function __construct($tag = '', &$table, $attributes = array()) { global $I18N; global $REX; parent::rex_form_select_element('', $table, $attributes); $dummy = null; $this->chkbox_element = new rex_form_checkbox_element('', $dummy); $this->chkbox_element->setAttribute('name', 'enable_restrictions'); $this->chkbox_element->setAttribute('id', 'enable_restrictions_chkbx'); $this->chkbox_element->addOption($I18N->msg('minfo_field_label_no_restrictions'), ''); if ($table->getPrefix() == 'art_' || $table->getPrefix() == 'cat_') { $restrictionsSelect = new rex_category_select(false, false, true, false); } elseif ($table->getPrefix() == 'med_') { $restrictionsSelect = new rex_mediacategory_select(); } elseif ($table->getPrefix() == 'asd_') { $restrictionsSelect = new rex_select(); $restrictionsSelect->addSqlOptions('SELECT `name`, `id` FROM ' . $REX['TABLE_PREFIX'] . 'asd_news_category'); $restrictionsSelect->setSize(6); } else { trigger_error('Unexpected TablePrefix "' . $table->getPrefix() . '"!', E_USER_ERROR); exit; } $restrictionsSelect->setMultiple(true); $this->setSelect($restrictionsSelect); $this->setNotice($I18N->msg('ctrl')); }
function rex_form_restrictons_element($tag = '', &$table, $attributes = array()) { global $I18N; parent::rex_form_select_element('', $table, $attributes); $this->chkbox_element = new rex_form_checkbox_element('', $dummy = null); $this->chkbox_element->setAttribute('name', 'enable_restrictions'); $this->chkbox_element->setAttribute('id', 'enable_restrictions_chkbx'); $this->chkbox_element->addOption($I18N->msg('minfo_field_label_no_restrictions'), ''); if ($table->getPrefix() == 'art_' || $table->getPrefix() == 'cat_') { $restrictionsSelect = new rex_category_select(false, false, true, false); } else { if ($table->getPrefix() == 'med_') { $restrictionsSelect = new rex_mediacategory_select(); } else { trigger_error('Unexpected TablePrefix "' . $table->getPrefix() . '"!', E_USER_ERROR); exit; } } $restrictionsSelect->setMultiple(true); $this->setSelect($restrictionsSelect); $this->setNotice($I18N->msg('ctrl')); }
function rex_form_prio_element($tag = '', &$table, $attributes = array()) { parent::rex_form_select_element('', $table, $attributes); $this->labelField = ''; $this->whereCondition = ''; $this->primaryKey = 'id'; $this->firstOptionMsg = 'form_field_first_prior'; $this->optionMsg = 'form_field_after_prior'; $this->select->setSize(1); rex_register_extension('REX_FORM_SAVED', array($this, 'organizePriorities')); }