Esempio n. 1
0
 /**
  * 获取“所属分类”所有选项
  * @return array
  */
 public static function getCategoryEnum()
 {
     static $enum = null;
     if ($enum === null) {
         $enum = array(self::CATEGORY_TEXT => Lang::_('SRV_ENUM_BUILDER_TYPES_CATEGORY_TEXT'), self::CATEGORY_OPTION => Lang::_('SRV_ENUM_BUILDER_TYPES_CATEGORY_OPTION'), self::CATEGORY_BUTTON => Lang::_('SRV_ENUM_BUILDER_TYPES_CATEGORY_BUTTON'));
     }
     return $enum;
 }
Esempio n. 2
0
 /**
  * 获取“排序”验证规则
  * @param mixed $value
  * @return array
  */
 public function getSortRule($value)
 {
     return array('Numeric' => new validator\NumericValidator($value, true, Lang::_('SRV_FILTER_BUILDER_FIELD_GROUPS_SORT_NUMERIC')));
 }
Esempio n. 3
0
 /**
  * 获取“验证环境”验证规则
  * @param mixed $value
  * @return array
  */
 public function getWhenRule($value)
 {
     $enum = DataValidators::getWhenEnum();
     return array('InArray' => new validator\InArrayValidator($value, array_keys($enum), sprintf(Lang::_('SRV_FILTER_BUILDER_FIELD_VALIDATORS_WHEN_INARRAY'), implode(', ', $enum))));
 }
Esempio n. 4
0
 /**
  * 获取“移至回收站”验证规则
  * @param mixed $value
  * @return array
  */
 public function getTrashRule($value)
 {
     if ($value === '') {
         return array();
     }
     $enum = DataBuilders::getTrashEnum();
     return array('InArray' => new validator\InArrayValidator($value, array_keys($enum), sprintf(Lang::_('SRV_FILTER_BUILDERS_TRASH_INARRAY'), implode(', ', $enum))));
 }
Esempio n. 5
0
 /**
  * 获取“数据列表每行操作Btn”所有选项
  * @return array
  */
 public static function getIndexRowBtnsEnum()
 {
     static $enum = null;
     if ($enum === null) {
         $enum = array(self::INDEX_ROW_BTNS_PENCIL => Lang::_('SRV_ENUM_BUILDERS_INDEX_ROW_BTNS_PENCIL'), self::INDEX_ROW_BTNS_TRASH => Lang::_('SRV_ENUM_BUILDERS_INDEX_ROW_BTNS_TRASH'), self::INDEX_ROW_BTNS_REMOVE => Lang::_('SRV_ENUM_BUILDERS_INDEX_ROW_BTNS_REMOVE'));
     }
     return $enum;
 }
Esempio n. 6
0
 /**
  * 获取“表单提示示例”所有选项
  * @return array
  */
 public static function getFormPromptExamplesEnum()
 {
     static $enum = null;
     if ($enum === null) {
         $enum = array('example0' => Lang::_('SRV_ENUM_BUILDER_FIELDS_FORM_PROMPT_EXAMPLE0'), 'example1' => Lang::_('SRV_ENUM_BUILDER_FIELDS_FORM_PROMPT_EXAMPLE1'), 'example2' => Lang::_('SRV_ENUM_BUILDER_FIELDS_FORM_PROMPT_EXAMPLE2'), 'example3' => Lang::_('SRV_ENUM_BUILDER_FIELDS_FORM_PROMPT_EXAMPLE3'), 'example4' => Lang::_('SRV_ENUM_BUILDER_FIELDS_FORM_PROMPT_EXAMPLE4'), 'example5' => Lang::_('SRV_ENUM_BUILDER_FIELDS_FORM_PROMPT_EXAMPLE5'), 'example6' => Lang::_('SRV_ENUM_BUILDER_FIELDS_FORM_PROMPT_EXAMPLE6'));
     }
     return $enum;
 }
Esempio n. 7
0
 /**
  * 获取“出错提示消息”所有选项
  * @return array
  */
 public static function getMessageEnum()
 {
     static $enum = null;
     if ($enum === null) {
         $enum = array('AlphaNum' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_ALPHANUM')), 'Alpha' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_ALPHA')), 'EqualTo' => array('option_category' => 'string', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_EQUALTO')), 'Equal' => array('option_category' => 'string', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_EQUAL')), 'Float' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_FLOAT')), 'InArray' => array('option_category' => 'array', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_INARRAY')), 'Integer' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_INTEGER')), 'Ip' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_IP')), 'Mail' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_MAIL')), 'MaxLength' => array('option_category' => 'integer', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_MAXLENGTH')), 'Max' => array('option_category' => 'integer', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_MAX')), 'MinLength' => array('option_category' => 'integer', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_MINLENGTH')), 'Min' => array('option_category' => 'integer', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_MIN')), 'NotEmpty' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_NOTEMPTY')), 'Numeric' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_NUMERIC')), 'Require' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_REQUIRE')), 'Url' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_URL')), 'DateTime' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_DATETIME')), 'NonNegativeInteger' => array('option_category' => 'boolean', 'message' => Lang::_('SRV_ENUM_BUILDER_FIELD_VALIDATORS_MESSAGE_NONNEGATIVEINTEGER')));
     }
     return $enum;
 }
Esempio n. 8
0
 /**
  * 获取“在查询表单中排序”验证规则
  * @param mixed $value
  * @return array
  */
 public function getFormSearchSortRule($value)
 {
     return array('Numeric' => new validator\NumericValidator($value, true, Lang::_('SRV_FILTER_BUILDER_FIELDS_FORM_SEARCH_SORT_NUMERIC')));
 }