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'])]); }
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é."; } }
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)); }
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']); }
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')); }
/** * 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); }
public function __construct(array $attributes) { parent::__construct('div', $attributes + ['class' => 'view-editor']); }
public function __construct(Module $module) { $this->module = $module; parent::__construct('div', ['id' => 'dashboard']); }
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')); }
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'); }
public function __construct(array $attributes = array()) { parent::__construct('select', $attributes); }
public function __construct(array $attributes = []) { parent::__construct('div', $attributes + [self::T_CONSTRUCTOR => 'nodes', self::WIDGET_CONSTRUCTOR => 'AdjustNode', 'data-adjust' => 'adjust-node']); }
public function __construct(array $attributes = array()) { parent::__construct('div', $attributes + array(self::FROM => self::DEFAULT_FROM, self::TO => self::DEFAULT_TO, 'class' => 'scale')); }
public function __construct(Page $page, array $attributes = array()) { $this->page = $page; parent::__construct('div', $attributes + array('class' => 'nav-branch')); }
public function __construct($tags) { parent::__construct('ol', $tags + array(self::DIVIDER => self::DEFAULT_DIVIDER, 'class' => 'breadcrumb')); }
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'))); }
public function __construct(array $attributes = array()) { parent::__construct('div', array('class' => 'btn-group i18n-languages')); }
public function __construct($editor, array $attributes) { $this->editor_id = $editor ? $editor : 'rte'; parent::__construct('div', $attributes + array(self::SELECTOR_NAME => 'editor', 'class' => 'editor-wrapper')); }
public function __construct(array $attributes = array()) { parent::__construct('div', $attributes + array(Element::WIDGET_CONSTRUCTOR => 'TabbableEditor', 'class' => 'editor editor--tabbable')); }
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[]')); }
public function __construct(array $attributes = array()) { parent::__construct('textarea', $attributes + array('class' => 'editor moo', 'rows' => 16)); }
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')); }
/** * 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']); }
/** * Circumvent Element constructor. */ public function __construct(array $attributes = []) { parent::__construct('div', $attributes); }
public function __construct(array $attributes = array()) { parent::__construct('textarea', $attributes + array('class' => 'editor code php')); }
public function __construct(array $attributes = []) { parent::__construct('select', $attributes + [Form::LABEL => 'language', Element::DESCRIPTION => 'language', Element::OPTIONS => [null => '.neutral'] + $this->collect_options()]); }