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_children() { global $core; $module_flat_id = $this->module->flat_id; $default_editor = $core->site->metas->get($module_flat_id . '.default_editor', 'rte'); $use_multi_editor = $core->site->metas->get($module_flat_id . '.use_multi_editor'); if ($use_multi_editor) { } else { } $values = $this->values; return array_merge(parent::lazy_get_children(), [Content::SUBTITLE => new Text([Form::LABEL => 'subtitle']), Content::BODY => new MultiEditorElement($values['editor'] ? $values['editor'] : $default_editor, [Element::LABEL_MISSING => 'Contents', Element::GROUP => 'contents', Element::REQUIRED => true, 'rows' => 16]), Content::EXCERPT => $core->editors['rte']->from([Form::LABEL => 'excerpt', Element::GROUP => 'contents', Element::DESCRIPTION => "excerpt", 'rows' => 3]), Content::DATE => new \Brickrouge\Date([Form::LABEL => 'Date', Element::REQUIRED => true, Element::DEFAULT_VALUE => date('Y-m-d')]), Content::IS_HOME_EXCLUDED => new Element(Element::TYPE_CHECKBOX, [Element::LABEL => "is_home_excluded", Element::GROUP => 'visibility', Element::DESCRIPTION => "is_home_excluded"])]); }
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.")))); }