public static function getConfigOptions(Context $ctx) { $list = TypeNode::getDictionaries(); if (empty($list)) { throw new ForbiddenException(t('Не определён ни один справочник.')); } return array('type' => array('type' => 'EnumControl', 'label' => t('Справочник'), 'required' => true, 'options' => $list)); }
public function getExtraSettings() { $fields = array('dictionary' => array('type' => 'EnumControl', 'label' => t('Справочник'), 'options' => TypeNode::getDictionaries(), 'weight' => 4, 'default_label' => t('(не использовать)'))); return $fields; }
/** * Дополнительные настройки поля. */ public function getExtraSettings() { $fields = array('dictionary' => array('type' => 'EnumControl', 'label' => t('Справочник'), 'required' => true, 'options' => TypeNode::getDictionaries(), 'weight' => 4), 'mode' => array('type' => 'EnumControl', 'label' => t('Режим работы'), 'options' => array('select' => t('один — выпадающий список'), 'radio' => t('один — радио'), 'enter' => t('один — текстовое поле'), 'set' => t('много — галки')), 'required' => true), 'details' => array('type' => 'EnumControl', 'label' => t('Объём данных'), 'options' => array('less' => t('id + название'), 'more' => t('полный XML')), 'required' => true)); return $fields; }