Example #1
0
 public function __construct($tag = '', rex_form $table = null, array $attributes = [])
 {
     parent::__construct('', $table, $attributes);
     $this->labelField = '';
     $this->whereCondition = '';
     $this->primaryKey = 'id';
     $this->firstOptionMsg = 'form_field_first_priority';
     $this->optionMsg = 'form_field_after_priority';
     $this->select->setSize(1);
     rex_extension::register('REX_FORM_SAVED', [$this, 'organizePriorities']);
 }
Example #2
0
 public function __construct($tag = '', rex_metainfo_table_expander $table = null, array $attributes = [])
 {
     parent::__construct('', $table, $attributes);
     $this->chkbox_element = new rex_form_checkbox_element('');
     $this->chkbox_element->setAttribute('name', 'enable_restrictions');
     $this->chkbox_element->setAttribute('id', 'enable-restrictions-checkbox');
     $this->chkbox_element->addOption(rex_i18n::msg('minfo_field_label_no_restrictions'), '');
     if ($table->getPrefix() == rex_metainfo_article_handler::PREFIX || $table->getPrefix() == rex_metainfo_category_handler::PREFIX) {
         $restrictionsSelect = new rex_category_select(false, false, true, false);
     } elseif ($table->getPrefix() == rex_metainfo_media_handler::PREFIX) {
         $restrictionsSelect = new rex_media_category_select();
     } else {
         throw new rex_exception('Unexpected TablePrefix "' . $table->getPrefix() . '"!');
     }
     $restrictionsSelect->setMultiple(true);
     $this->setSelect($restrictionsSelect);
     $this->setNotice(rex_i18n::msg('ctrl'));
 }