Esempio n. 1
0
 public function __construct(array $attributes = [])
 {
     global $core;
     $site = $core->site;
     $native = $site->native->language;
     parent::__construct('select', $attributes + [Form::LABEL => 'nativeid', Element::GROUP => 'i18n', Element::DESCRIPTION => I18n\t('nativeid', ['native' => $native, 'language' => $site->language], ['scope' => 'element.description'])]);
 }
Esempio n. 2
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('ul', $attributes + array('class' => 'widgets-selector combo'));
     if ($this[Element::DESCRIPTION] === null) {
         $this[Element::DESCRIPTION] = "Sélectionner les widgets à afficher. Vous pouvez les ordonner par glissé-déposé.";
     }
 }
Esempio n. 3
0
 public function __construct(array $attributes = array())
 {
     global $core;
     $options = array();
     foreach ($core->editors as $id => $editor) {
         $options[$id] = I18n\t($id, array(), array('scope' => 'editor_title'));
     }
     parent::__construct('select', $attributes + array(Element::OPTIONS => $options));
 }
Esempio n. 4
0
 public function __construct(array $attributes = [])
 {
     $login = new LoginForm();
     $password = new NonceRequestForm();
     $password->children['email'][Element::DESCRIPTION] = new A(I18n\t('Cancel', [], ['scope' => 'button']));
     $this->elements['login'] = $login;
     $this->elements['password'] = $password;
     parent::__construct('div', $attributes + [Element::WIDGET_CONSTRUCTOR => 'LoginCombo', 'id' => 'login', 'class' => 'widget-login-combo']);
 }
Esempio n. 5
0
 public function __construct(array $attributes = array())
 {
     global $core;
     $constructors = array();
     $modules = $core->modules;
     foreach ($modules->descriptors as $module_id => $descriptor) {
         if ($module_id == 'contents' || !$modules->is_extending($module_id, 'contents')) {
             continue;
         }
         $constructors[$module_id] = $descriptor[Module::T_TITLE];
     }
     uasort($constructors, 'ICanBoogie\\unaccent_compare_ci');
     parent::__construct('div', $attributes + array(self::CHILDREN => array($this->elements['constructor'] = new Element('select', array(Element::LABEL => 'Module', Element::LABEL_POSITION => 'above', Element::REQUIRED => true, Element::OPTIONS => array(null => '<sélectionner un module>') + $constructors)), $this->elements['limit'] = new Text(array(Element::LABEL => "Nombre d'entrées dans le flux", Element::LABEL_POSITION => 'above', Element::REQUIRED => true, Element::DEFAULT_VALUE => 10, 'size' => 4)), $this->elements['settings'] = new Element(Element::TYPE_CHECKBOX_GROUP, array(Element::LABEL => 'Options', Element::LABEL_POSITION => 'above', Element::OPTIONS => array('is_with_author' => "Mentionner l'auteur", 'is_with_category' => "Mentionner les catégories", 'is_with_attached' => "Ajouter les pièces jointes"), 'class' => 'list'))), 'class' => 'editor feed combo'));
 }
Esempio n. 6
0
 /**
  * Default attributes are added to those provided using a union:
  *
  * - `action`: If the `id` attribute is provided, `action` is set to "#<id>".
  * - `method`: "POST"
  * - `enctype`: "multipart/form-data"
  * - `name`: The value of the `id` attribute or a name generated with the {@link get_auto_name()} method
  *
  * If `method` is different than "POST" then the `enctype` attribute is unset.
  *
  * @param array $attributes
  */
 public function __construct(array $attributes = [])
 {
     $attributes += ['action' => isset($attributes['id']) ? '#' . $attributes['id'] : '', 'method' => 'POST', 'enctype' => 'multipart/form-data', 'name' => isset($attributes['id']) ? $attributes['id'] : self::get_auto_name()];
     if (strtoupper($attributes['method']) != 'POST') {
         unset($attributes['enctype']);
     }
     $this->name = $attributes['name'] ?: self::get_auto_name();
     parent::__construct('form', $attributes);
 }
Esempio n. 7
0
 public function __construct(array $attributes)
 {
     parent::__construct('div', $attributes + ['class' => 'view-editor']);
 }
Esempio n. 8
0
 public function __construct(Module $module)
 {
     $this->module = $module;
     parent::__construct('div', ['id' => 'dashboard']);
 }
Esempio n. 9
0
 public function __construct()
 {
     $action = new Button("Install", array('class' => 'btn btn-primary', 'type' => 'submit'));
     parent::__construct('div', array(PanelDecorator::TITLE => t('panel.install.title'), Element::CHILDREN => array(t('panel.install.content', array('action' => $action))), 'name' => 'install'));
 }
Esempio n. 10
0
 public function __construct()
 {
     $action = new Button("Let's go!", array('class' => 'btn btn-large', 'type' => 'submit'));
     parent::__construct('div', array(PanelDecorator::TITLE => t('panel.welcome.title'), PanelDecorator::DESCRIPTION => t('panel.welcome.description', array('action' => $action)), Element::CHILDREN => array(WelcomeRequirements::get()->render()), 'name' => 'welcome', 'data-message' => t('panel.welcome.success')));
 }
 public function __construct(array $attributes = array())
 {
     parent::__construct('div', $attributes + array(Element::WIDGET_CONSTRUCTOR => 'NodeAttachments'));
     $this->add_class('widget-node-attachments');
     $this->add_class('resources-files-attached');
 }
Esempio n. 12
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('select', $attributes);
 }
Esempio n. 13
0
 public function __construct(array $attributes = [])
 {
     parent::__construct('div', $attributes + [self::T_CONSTRUCTOR => 'nodes', self::WIDGET_CONSTRUCTOR => 'AdjustNode', 'data-adjust' => 'adjust-node']);
 }
Esempio n. 14
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('div', $attributes + array(self::FROM => self::DEFAULT_FROM, self::TO => self::DEFAULT_TO, 'class' => 'scale'));
 }
Esempio n. 15
0
 public function __construct(Page $page, array $attributes = array())
 {
     $this->page = $page;
     parent::__construct('div', $attributes + array('class' => 'nav-branch'));
 }
Esempio n. 16
0
 public function __construct($tags)
 {
     parent::__construct('ol', $tags + array(self::DIVIDER => self::DEFAULT_DIVIDER, 'class' => 'breadcrumb'));
 }
Esempio n. 17
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('select', $attributes + array(Element::OPTIONS => array(null => '', 'en' => 'English', 'fr' => 'French'), Element::INLINE_HELP => t('language.description')));
 }
Esempio n. 18
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('div', array('class' => 'btn-group i18n-languages'));
 }
Esempio n. 19
0
 public function __construct($editor, array $attributes)
 {
     $this->editor_id = $editor ? $editor : 'rte';
     parent::__construct('div', $attributes + array(self::SELECTOR_NAME => 'editor', 'class' => 'editor-wrapper'));
 }
Esempio n. 20
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('div', $attributes + array(Element::WIDGET_CONSTRUCTOR => 'TabbableEditor', 'class' => 'editor editor--tabbable'));
 }
Esempio n. 21
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('div', $attributes + array(Element::WIDGET_CONSTRUCTOR => 'PopPhoto', 'data-adjust' => 'adjust-photo', 'class' => 'spinner', 'tabindex' => 0, 'name' => 'photos[]'));
 }
Esempio n. 22
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('textarea', $attributes + array('class' => 'editor moo', 'rows' => 16));
 }
Esempio n. 23
0
 public function __construct(array $attributes = array())
 {
     $attributes += [self::POP_OPTIONS => [], self::UPLOAD_OPTIONS => []];
     parent::__construct('div', $attributes + array(Element::CHILDREN => array($this->pop_image = new PopImage($attributes[self::POP_OPTIONS]), $this->upload_image = new UploadImage($attributes[self::UPLOAD_OPTIONS] + [UploadImage::FILE_WITH_LIMIT => true, 'data-name' => Image::PATH, 'data-upload-url' => Operation::encode('images/save')])), Element::WIDGET_CONSTRUCTOR => 'PopOrUploadImage'));
 }
Esempio n. 24
0
 /**
  * Creates a `<DIV.alert>` element.
  *
  * @param string|array|Errors $message The alert message is provided as a string,
  * an array of strings or a {@link Errors} object.
  *
  * If the message is provided as a string it is used as is. If the message is provided as an
  * array each value of the array is considered as a message. If the message is provided as
  * an {@link Errors} object each entry of the object is considered as a message.
  *
  * Each message is wrapped in a `<P>` element and they are concatenated to create the final
  * message.
  *
  * If the message is an instance of {@link Errors} the {@link CONTEXT} attribute is
  * set to "error" in the initial attributes.
  *
  * @param array $attributes Additional attributes.
  */
 public function __construct($message, array $attributes = [])
 {
     $this->message = $message;
     parent::__construct('div', $attributes + [self::CONTEXT => $message instanceof Errors ? 'error' : null, 'class' => 'alert']);
 }
Esempio n. 25
0
 /**
  * Circumvent Element constructor.
  */
 public function __construct(array $attributes = [])
 {
     parent::__construct('div', $attributes);
 }
Esempio n. 26
0
 public function __construct(array $attributes = array())
 {
     parent::__construct('textarea', $attributes + array('class' => 'editor code php'));
 }
Esempio n. 27
0
 public function __construct(array $attributes = [])
 {
     parent::__construct('select', $attributes + [Form::LABEL => 'language', Element::DESCRIPTION => 'language', Element::OPTIONS => [null => '.neutral'] + $this->collect_options()]);
 }