/** * (non-PHPdoc) * @see \library\BaseModel::getElementsRender() */ public function getElementsRender() { $output = array('module_id' => array('__tid__' => 'main', 'type' => 'hidden', 'label' => Text::_('MOD_POSTS_POST_MODULES_MODULE_ID_LABEL'), 'hint' => Text::_('MOD_POSTS_POST_MODULES_MODULE_ID_HINT')), 'module_name' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_POSTS_POST_MODULES_MODULE_NAME_LABEL'), 'hint' => Text::_('MOD_POSTS_POST_MODULES_MODULE_NAME_HINT'), 'required' => true), 'fields' => array('__tid__' => 'main', 'type' => 'textarea', 'label' => Text::_('MOD_POSTS_POST_MODULES_FIELDS_LABEL'), 'hint' => Text::_('MOD_POSTS_POST_MODULES_FIELDS_HINT'), 'rows' => 15), 'forbidden' => array('__tid__' => 'main', 'type' => 'switch', 'label' => Text::_('MOD_POSTS_POST_MODULES_FORBIDDEN_LABEL'), 'hint' => Text::_('MOD_POSTS_POST_MODULES_FORBIDDEN_HINT'), 'options' => DataModules::getForbiddenEnum(), 'value' => DataModules::FORBIDDEN_N), 'description' => array('__tid__' => 'main', 'type' => 'textarea', 'label' => Text::_('MOD_POSTS_POST_MODULES_DESCRIPTION_LABEL'), 'hint' => Text::_('MOD_POSTS_POST_MODULES_DESCRIPTION_HINT'))); return $output; }
/** * 获取“是否禁用”验证规则 * @param mixed $value * @return array */ public function getForbiddenRule($value) { $enum = DataModules::getForbiddenEnum(); return array('InArray' => new validator\InArrayValidator($value, array_keys($enum), sprintf(Lang::_('SRV_FILTER_POST_MODULES_FORBIDDEN_INARRAY'), implode(', ', $enum)))); }