protected function lazy_get_children() { global $core; $values = $this->values; $nid = $values[Node::NID]; $is_alone = !$this->module->model->select('nid')->where(array('siteid' => $core->site_id))->rc; list($contents_tags) = $this->module->get_contents_section($values[Node::NID], $values[Page::TEMPLATE]); # # parentid # $parentid_el = null; if (!$is_alone) { $parentid_el = new PopPage('select', array(Form::LABEL => 'parentid', Element::OPTIONS_DISABLED => $nid ? array($nid => true) : null, Element::DESCRIPTION => 'parentid')); } # # location element # $location_el = null; if (!$is_alone) { $location_el = new PopPage('select', array(Form::LABEL => 'location', Element::GROUP => 'advanced', Element::WEIGHT => 10, Element::OPTIONS_DISABLED => $nid ? array($nid => true) : null, Element::DESCRIPTION => 'location')); } $contents_children = array(); if (isset($contents_tags[Element::CHILDREN])) { $contents_children = $contents_tags[Element::CHILDREN]; unset($contents_tags[Element::CHILDREN]); $this->attributes = \ICanBoogie\array_merge_recursive($this->attributes, $contents_tags); } return array_merge(parent::lazy_get_children(), array(Page::LABEL => new Text(array(Form::LABEL => 'label', Element::DESCRIPTION => 'label')), Page::PARENTID => $parentid_el, Page::SITEID => null, Page::IS_NAVIGATION_EXCLUDED => new Element(Element::TYPE_CHECKBOX, array(Element::LABEL => 'is_navigation_excluded', Element::GROUP => 'visibility', Element::DESCRIPTION => 'is_navigation_excluded')), Page::PATTERN => new Text(array(Form::LABEL => 'pattern', Element::GROUP => 'advanced', Element::DESCRIPTION => 'pattern')), Page::LOCATIONID => $location_el), $contents_children); }
protected function lazy_get_values() { global $core; $values = parent::lazy_get_values(); if (isset($values['editor']) && isset($values['body'])) { $editor = $core->editors[$values['editor']]; $values['body'] = $editor->unserialize($values['body']); } return $values; }
protected function get_children() { global $core; $models = $core->configs->synthesize('formmodels', 'merge'); $models_options = array(); if ($models) { foreach ($models as $modelid => $model) { $models_options[$modelid] = $model['title']; } asort($models_options); } $label_default_values = I18n\t('Default values'); $description_notify = I18n\t('description_notify', array(':link' => '<a href="http://github.com/Weirdog/WdPatron" target="_blank">WdPatron</a>')); return array_merge(parent::get_children(), array('modelid' => new Element('select', array(Form::LABEL => 'modelid', Element::REQUIRED => true, Element::OPTIONS => array(null => '') + $models_options, Element::LABEL_POSITION => 'before')), 'before' => $core->editors['rte']->from(array(Form::LABEL => 'before', Element::GROUP => 'messages', 'rows' => 5)), 'after' => $core->editors['rte']->from(array(Form::LABEL => 'after', Element::GROUP => 'messages', 'rows' => 5)), 'complete' => $core->editors['rte']->from(array(Form::LABEL => 'complete', Element::GROUP => 'messages', Element::REQUIRED => true, Element::DESCRIPTION => 'complete', Element::DEFAULT_VALUE => '<p>' . I18n\t('default.complete') . '</p>', 'rows' => 5)), 'is_notify' => new Element(Element::TYPE_CHECKBOX, array(Element::LABEL => 'is_notify', Element::GROUP => 'options', Element::DESCRIPTION => 'is_notify')), 'notify_' => new EmailComposer(array(Element::GROUP => 'options', Element::DEFAULT_VALUE => array('from' => $core->site->email, 'destination' => $core->site->email), 'class' => 'form-horizontal')))); }
protected function lazy_get_children() { return array_merge(parent::lazy_get_children(), array('slides' => new AlbumEditor($this->record, array(Element::GROUP => 'album')), 'image_id' => new PopOrUploadImage(array(Group::LABEL => 'Poster', Element::DESCRIPTION => "Poster de l'album. La première photo de l'album est utilisée par défaut.")))); }