예제 #1
0
파일: Flash.php 프로젝트: varvanin/currycms
 /** {@inheritdoc} */
 public function showBack()
 {
     $form = new Curry_Form_SubForm();
     $form->addSubForm(new Curry_Form_SubForm(array('legend' => 'Embed properties', 'class' => $this->module ? 'advanced' : '', 'elements' => array('flash' => array('filebrowser', array('label' => 'Flash', 'required' => true, 'value' => $this->flash)), 'method' => array('select', array('label' => 'Method', 'multiOptions' => array(Curry_Flash::SWFOBJECT_DYNAMIC => "swfobject (dynamic)", Curry_Flash::SWFOBJECT_STATIC => "swfobject (static)"), 'required' => true, 'value' => $this->method)), 'width' => array('text', array('label' => 'Width', 'required' => true, 'value' => $this->width)), 'height' => array('text', array('label' => 'Height', 'required' => true, 'value' => $this->height)), 'target' => array('text', array('label' => 'Target Id', 'required' => true, 'value' => $this->target)), 'version' => array('text', array('label' => 'Version', 'required' => true, 'value' => $this->version)), 'express_install' => array('text', array('label' => 'Express Install SWF', 'value' => (string) $this->expressInstall)), 'add_to_flashvars' => array('multiCheckbox', array('label' => 'Add to flashvars', 'multiOptions' => array('get' => 'GET', 'post' => 'POST', 'cookie' => 'Cookies'), 'value' => $this->addToFlashvars)), 'alternative_content' => array('textarea', array('label' => 'Alternative content', 'value' => $this->alternativeContent, 'rows' => 5, 'cols' => 40, 'wrap' => 'off'))))), 'embed');
     $form->addSubForm(new Curry_Form_SubForm(array('legend' => 'Attributes', 'class' => 'advanced', 'elements' => array('name' => array('text', array('label' => 'Name', 'value' => $this->attributes['name'])), 'class' => array('text', array('label' => 'Class', 'value' => $this->attributes['class']))))), 'attributes');
     $form->addSubForm(new Curry_Form_SubForm(array('legend' => 'Parameters', 'class' => 'advanced', 'elements' => array('play' => array('select', array('label' => 'Play', 'multiOptions' => array('' => '[Default]', 'true' => 'true', 'false' => 'false'), 'value' => $this->params['play'])), 'loop' => array('select', array('label' => 'Loop', 'multiOptions' => array('' => '[Default]', 'true' => 'true', 'false' => 'false'), 'value' => $this->params['loop'])), 'menu' => array('select', array('label' => 'Menu', 'multiOptions' => array('' => '[Default]', 'true' => 'true', 'false' => 'false'), 'value' => $this->params['menu'])), 'quality' => array('select', array('label' => 'Quality', 'multiOptions' => array('' => '[Default]', 'best' => 'best', 'high' => 'high', 'medium' => 'medium', 'autohigh' => 'autohigh', 'autolow' => 'autolow', 'low' => 'low'), 'value' => $this->params['quality'])), 'scale' => array('select', array('label' => 'Scale', 'multiOptions' => array('' => '[Default]', 'showall' => 'showall', 'noborder' => 'noborder', 'exactfit' => 'exactfit', 'noscale' => 'noscale'), 'value' => $this->params['scale'])), 'salign' => array('select', array('label' => 'salign', 'multiOptions' => array('' => '[Default]', 'tl' => 'tl', 'tr' => 'tr', 'bl' => 'bl', 'br' => 'br', 'l' => 'l', 't' => 't', 'r' => 'r', 'b' => 'b'), 'value' => $this->params['salign'])), 'wmode' => array('select', array('label' => 'wmode', 'multiOptions' => array('' => '[Default]', 'window' => 'window', 'opaque' => 'opaque', 'transparent' => 'transparent', 'direct' => 'direct', 'gpu' => 'gpu'), 'value' => $this->params['wmode'])), 'bgcolor' => array('text', array('label' => 'bgcolor', 'value' => $this->params['bgcolor'])), 'devicefont' => array('select', array('label' => 'devicefont', 'multiOptions' => array('' => '[Default]', 'true' => 'true', 'false' => 'false'), 'value' => $this->params['devicefont'])), 'seamlesstabbing' => array('select', array('label' => 'seamlesstabbing', 'multiOptions' => array('' => '[Default]', 'true' => 'true', 'false' => 'false'), 'value' => $this->params['seamlesstabbing'])), 'swliveconnect' => array('select', array('label' => 'swliveconnect', 'multiOptions' => array('' => '[Default]', 'true' => 'true', 'false' => 'false'), 'value' => $this->params['swliveconnect'])), 'allowfullscreen' => array('select', array('label' => 'allowfullscreen', 'multiOptions' => array('' => '[Default]', 'true' => 'true', 'false' => 'false'), 'value' => $this->params['allowfullscreen'])), 'allowscriptaccess' => array('select', array('label' => 'allowscriptaccess', 'multiOptions' => array('' => '[Default]', 'always' => 'always', 'sameDomain' => 'sameDomain', 'never' => 'never'), 'value' => $this->params['allowscriptaccess'])), 'allownetworking' => array('select', array('label' => 'allownetworking', 'multiOptions' => array('' => '[Default]', 'all' => 'all', 'internal' => 'internal', 'none' => 'none'), 'value' => $this->params['allownetworking'])), 'base' => array('text', array('label' => 'base', 'value' => $this->params['base']))))), 'params');
     $variableForm = new Curry_Form_Dynamic(array('legend' => 'Variable', 'elements' => array('name' => array('text', array('label' => 'Name', 'required' => true)), 'value' => array('text', array('label' => 'Value')))));
     $form->addSubForm(new Curry_Form_MultiForm(array('legend' => 'Flashvars', 'class' => 'advanced', 'cloneTarget' => $variableForm, 'defaults' => $this->flashvars)), 'flashvars');
     $templatesSelect = array(null => "[ None ]") + Curry_Backend_Template::getTemplateSelect();
     $classNames = array(null => "[ None ]") + Curry_Module::getModuleList();
     $form->addSubForm(new Curry_Form_SubForm(array('legend' => 'Embedded module', 'class' => 'advanced', 'elements' => array('class_name' => array('select', array('label' => 'Module', 'multiOptions' => $classNames, 'value' => $this->className, 'disable' => array(__CLASS__))), 'template' => array('select', array('label' => 'Template', 'multiOptions' => $templatesSelect, 'value' => $this->template)), 'flashvar' => array('text', array('label' => 'Flashvar-name', 'value' => $this->moduleFlashvar))))), 'emodule');
     if ($this->module) {
         $form->addSubForm($this->module->showBack(), 'submodule');
     }
     return $form;
 }
예제 #2
0
 /** {@inheritdoc} */
 public function showBack()
 {
     $form = new \Curry_Form_SubForm(array('elements' => array()));
     $scriptForm = new \Curry_Form_Dynamic(array('legend' => 'Script', 'elements' => array('source' => array('filebrowser', array('label' => 'Source', 'required' => true, 'description' => 'May be a local or external file.')), 'type' => array('text', array('label' => 'Type', 'required' => true, 'value' => 'text/javascript', 'description' => 'The type attribute of the script tag.')), 'condition' => array('text', array('label' => 'Condition', 'value' => '', 'description' => 'Wrap the tag in a conditional comment, example: lt IE 8. Leave blank to disable.')), 'async' => array('multiCheckbox', array('label' => 'Async', 'multiOptions' => array('1' => 'Async'), 'value' => false, 'description' => "Load the script asyncronously using the HTML5 async attribute.")), 'defer' => array('multiCheckbox', array('label' => 'Defer', 'multiOptions' => array('1' => 'Defer'), 'value' => false, 'description' => "Defer execution of script until after the HTML has been loaded.")))));
     $scriptForm->addDisplayGroup(array('type', 'condition', 'async', 'defer'), 'options', array('Legend' => 'Options', 'class' => 'horizontal-group'));
     $form->addSubForm(new \Curry_Form_MultiForm(array('legend' => 'Script includes', 'cloneTarget' => $scriptForm, 'defaults' => $this->script)), 'script');
     $stylesheetForm = new \Curry_Form_Dynamic(array('legend' => 'Stylesheet', 'elements' => array('source' => array('filebrowser', array('label' => 'Source', 'required' => true)), 'media' => array('text', array('label' => 'Media', 'required' => true, 'value' => 'all')), 'condition' => array('text', array('label' => 'Condition', 'value' => '')))));
     $form->addSubForm(new \Curry_Form_MultiForm(array('legend' => 'Stylesheet includes', 'cloneTarget' => $stylesheetForm, 'defaults' => $this->stylesheet)), 'stylesheet');
     $form->addSubForm(new \Curry_Form_SubForm(array('legend' => 'Custom inline javascript', 'class' => $this->inlineScript ? '' : 'advanced', 'elements' => array('source' => array('codeMirror', array('codeMirrorOptions' => array('mode' => array('name' => 'javascript')), 'label' => 'Source', 'value' => $this->inlineScript, 'wrap' => 'off', 'rows' => 15, 'cols' => 35))))), 'inline_script');
     return $form;
 }
예제 #3
0
 /** {@inheritdoc} */
 public function isValid($data)
 {
     if ($this->isArray()) {
         $data2 = $this->_dissolveArrayValue($data, $this->getElementsBelongTo());
         foreach ($data2 as $k => $v) {
             if (!is_int($k)) {
                 unset($data2[$k]);
             }
         }
         $this->_add($data2, false);
     }
     return parent::isValid($data);
 }
예제 #4
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;
 }
예제 #5
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;
 }