Ejemplo n.º 1
0
 /** {@inheritdoc} */
 public function showBack()
 {
     $editor = $this->editor;
     if (!$editor) {
         $editor = strtolower($this->app['defaultEditor']);
     }
     $elementType = 'textarea';
     if ($editor == self::CODEMIRROR) {
         $elementType = 'codeMirror';
     } else {
         if ($editor == self::TINYMCE) {
             $elementType = 'tinyMCE';
         }
     }
     $form = new \Curry_Form_SubForm(array('elements' => array('content' => array($elementType, array('label' => 'Content', 'value' => $this->content)))));
     $subform = new \Curry_Form_SubForm(array('legend' => 'Advanced', 'class' => 'advanced', 'elements' => array('editor' => array('select', array('multiOptions' => array(self::DEFAULT_EDITOR => 'Default', self::CODEMIRROR => 'CodeMirror', self::TINYMCE => 'TinyMCE', self::PLAIN => 'Plain'), 'value' => $this->editor)), 'switch' => array('submit', array('label' => 'Switch')), 'allow_template_syntax' => array('checkbox', array('label' => 'Allow template syntax', 'value' => $this->allowTemplateSyntax, 'description' => 'Allows insertion of global variables, e.g. {{curry.page.Name}}.')))));
     $subform->addDisplayGroup(array('editor', 'switch'), 'editor_switch', array('class' => 'horizontal-group', 'legend' => 'Editor'));
     $form->addSubForm($subform, 'advanced', 0);
     if ($this->editor == self::PLAIN) {
         $form->content->setAttrib('wrap', 'off');
         $form->content->setAttrib('spellcheck', 'false');
     }
     return $form;
 }
Ejemplo n.º 2
0
 /** {@inheritdoc} */
 public function showBack()
 {
     $pages = array(null => "[ Active Page ]");
     $pages += \PagePeer::getSelect();
     $form = new \Curry_Form_SubForm(array('elements' => array('page_id' => array('select', array('label' => 'Page', 'multiOptions' => $pages, 'value' => $this->pageId)), 'sort_order' => array('select', array('label' => 'Sort order', 'multiOptions' => array(self::ORDER_SORTINDEX_ASC => 'Page order', self::ORDER_SORTINDEX_DESC => 'Page order reversed', self::ORDER_NAME_ASC => 'Page name', self::ORDER_NAME_DESC => 'Page name reversed'), 'value' => $this->sortOrder)), 'depth_offset' => array('text', array('label' => 'Depth Offset', 'description' => 'If positive, the selected page will move down the page tree towards the active page. If negative, the selected page will move up in the page tree towards the root.', 'value' => $this->depthOffset)), 'use_parent_page' => array('checkbox', array('label' => 'Use parent page if there are no subpages', 'value' => $this->useParentPage)), 'show_hidden' => array('checkbox', array('label' => 'Show hidden pages', 'value' => $this->showHidden)))));
     $form->addDisplayGroup(array('depth_offset', 'use_parent_page', 'show_hidden'), 'advanced', array('legend' => 'Advanced', 'class' => 'advanced'));
     return $form;
 }