Ejemplo n.º 1
0
 protected function lazy_get_children()
 {
     global $core;
     $vid_options = array(null => '') + $core->models['taxonomy.vocabulary']->select('vid, vocabulary')->pairs;
     /*
      * Beware of the 'weight' property, because vocabulary also define 'weight' and will
      * override the term's one.
      */
     return array_merge(parent::lazy_get_children(), array(Term::TERM => new TitleSlugCombo(array(Form::LABEL => 'Term', Element::REQUIRED => true)), Term::VID => new Element('select', array(Form::LABEL => 'Vocabulary', Element::OPTIONS => $vid_options, Element::REQUIRED => true))));
 }
Ejemplo n.º 2
0
 protected function lazy_get_children()
 {
     global $core;
     $values = $this->values;
     #
     # permissions
     #
     $user = $core->user;
     $permission = $this->permission;
     $uid = $values[User::UID];
     #
     # languages
     #
     $languages = $core->locale['languages'];
     uasort($languages, 'ICanBoogie\\unaccent_compare_ci');
     $administer = $user->has_permission(Module::PERMISSION_MANAGE, $this->module);
     return array_merge(parent::lazy_get_children(), [User::FIRSTNAME => new Text([Group::LABEL => 'firstname']), User::LASTNAME => new Text([Group::LABEL => 'lastname']), User::NICKNAME => new Text([Group::LABEL => 'Nickname']), User::USERNAME => $administer ? new Text([Group::LABEL => 'username', Element::REQUIRED => true]) : null, User::NAME_AS => $this->create_control_for_name_as(), User::EMAIL => new Text([Group::LABEL => 'email', Element::GROUP => 'connection', Element::REQUIRED => true, 'autocomplete' => 'off']), User::PASSWORD => new Text([Element::LABEL => 'password', Element::LABEL_POSITION => 'above', Element::DESCRIPTION => 'password_' . ($uid ? 'update' : 'new'), Element::GROUP => 'connection', 'autocomplete' => 'off', 'type' => 'password', 'value' => '']), User::PASSWORD . '-verify' => new Text([Element::LABEL => 'password_confirm', Element::LABEL_POSITION => 'above', Element::DESCRIPTION => 'password_confirm', Element::GROUP => 'connection', 'autocomplete' => 'off', 'type' => 'password', 'value' => '']), User::IS_ACTIVATED => $uid == 1 || !$administer ? null : new Element(Element::TYPE_CHECKBOX, [Element::LABEL => 'is_activated', Element::GROUP => 'connection', Element::DESCRIPTION => 'is_activated']), User::ROLES => $this->create_control_for_role(), User::LANGUAGE => new Element('select', [Group::LABEL => 'language', Element::GROUP => 'advanced', Element::DESCRIPTION => 'language', Element::OPTIONS => array(null => '') + $languages]), 'timezone' => new Widget\TimeZone([Group::LABEL => 'timezone', Element::GROUP => 'advanced', Element::DESCRIPTION => "Si la zone horaire n'est pas définie celle\n\t\t\t\tdu site sera utilisée à la place."]), User::RESTRICTED_SITES => $this->create_control_for_restricted_sites_ids()]);
 }
Ejemplo n.º 3
0
 /**
  * Adds the `title`, `is_online`, `uid` and `siteid` elements.
  *
  * The `uid` and `siteid` elements are added according to the context.
  */
 protected function lazy_get_children()
 {
     $values = $this->values;
     return array_merge(parent::lazy_get_children(), [Node::TITLE => new TitleSlugCombo([Form::LABEL => 'title', Element::REQUIRED => true, TitleSlugCombo::T_NODEID => $values[Node::NID], TitleSlugCombo::T_SLUG_NAME => 'slug']), Node::UID => $this->get_control__user(), Node::SITEID => $this->get_control__site(), Node::IS_ONLINE => new Element(Element::TYPE_CHECKBOX, [Element::LABEL => 'is_online', Element::DESCRIPTION => 'is_online', Element::GROUP => 'visibility'])]);
 }