ArticleTypeField::setShowInEditor PHP Method

setShowInEditor() public method

Sets the int for where to show the field
public setShowInEditor ( $p_showInEditor ) : integer
$p_showInEditor
return integer
    public function setShowInEditor($p_showInEditor)
    {
        return $this->setProperty('show_in_editor', (int) $p_showInEditor);
    }

Usage Example

Ejemplo n.º 1
0
<?php

require_once $GLOBALS['g_campsiteDir'] . '/classes/Log.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Input.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/Article.php';
require_once $GLOBALS['g_campsiteDir'] . '/classes/ArticleType.php';
$translator = \Zend_Registry::get('container')->getService('translator');
if (!Saas::singleton()->hasPermission('ManageArticleTypes')) {
    camp_html_display_error($translator->trans("You do not have the right to delete article types.", array(), 'article_types'));
    exit;
}
if (!SecurityToken::isValid()) {
    camp_html_display_error($translator->trans('Invalid security token!'));
    exit;
}
$articleTypeName = Input::Get('f_article_type');
$articleTypeFieldName = Input::Get('f_field_name');
$showInEditor = Input::Get('f_show_in_editor');
$errorMsgs = array();
$articleTypeField = new ArticleTypeField($articleTypeName, $articleTypeFieldName);
$articleTypeField->setShowInEditor($showInEditor == 'true');
$cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
$cacheService->clearNamespace('article_type');
camp_html_goto_page("/{$ADMIN}/article_types/fields/?f_article_type=" . urlencode($articleTypeName));