Exemplo n.º 1
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))));
 }
Exemplo n.º 2
0
 /**
  * (non-PHPdoc)
  * @see \library\BaseModel::getElementsRender()
  */
 public function getElementsRender()
 {
     $output = array('builder_id' => array('__tid__' => 'main', 'type' => 'hidden', 'label' => Text::_('MOD_BUILDER_BUILDERS_BUILDER_ID_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_BUILDER_ID_HINT')), 'builder_name' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_BUILDER_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_BUILDER_NAME_HINT'), 'required' => true), 'tbl_name' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_TBL_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_TBL_NAME_HINT'), 'required' => true), 'tbl_profile' => array('__tid__' => 'main', 'type' => 'switch', 'label' => Text::_('MOD_BUILDER_BUILDERS_TBL_PROFILE_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_TBL_PROFILE_HINT'), 'options' => DataBuilders::getTblProfileEnum(), 'value' => DataBuilders::TBL_PROFILE_N), 'tbl_engine' => array('__tid__' => 'main', 'type' => 'radio', 'label' => Text::_('MOD_BUILDER_BUILDERS_TBL_ENGINE_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_TBL_ENGINE_HINT'), 'options' => DataBuilders::getTblEngineEnum(), 'value' => DataBuilders::TBL_ENGINE_INNODB), 'tbl_charset' => array('__tid__' => 'main', 'type' => 'radio', 'label' => Text::_('MOD_BUILDER_BUILDERS_TBL_CHARSET_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_TBL_CHARSET_HINT'), 'options' => DataBuilders::getTblCharsetEnum(), 'value' => DataBuilders::TBL_CHARSET_UTF8), 'tbl_comment' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_TBL_COMMENT_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_TBL_COMMENT_HINT'), 'required' => true), 'srv_type' => array('__tid__' => 'main', 'type' => 'radio', 'label' => Text::_('MOD_BUILDER_BUILDERS_SRV_TYPE_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_SRV_TYPE_HINT'), 'options' => DataBuilders::getSrvTypeEnum(), 'value' => DataBuilders::SRV_TYPE_NORMAL), 'srv_name' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_SRV_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_SRV_NAME_HINT'), 'required' => true), 'app_name' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_APP_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_APP_NAME_HINT'), 'required' => true), 'mod_name' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_MOD_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_MOD_NAME_HINT'), 'required' => true), 'cls_name' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_CLS_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_CLS_NAME_HINT'), 'required' => true), 'ctrl_name' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_CTRL_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_CTRL_NAME_HINT'), 'required' => true), 'fk_column' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_FK_COLUMN_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_FK_COLUMN_HINT')), 'act_index_name' => array('__tid__' => 'act', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_ACT_INDEX_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_ACT_INDEX_NAME_HINT'), 'value' => 'index', 'required' => true), 'act_view_name' => array('__tid__' => 'act', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_ACT_VIEW_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_ACT_VIEW_NAME_HINT'), 'value' => 'view', 'required' => true), 'act_create_name' => array('__tid__' => 'act', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_ACT_CREATE_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_ACT_CREATE_NAME_HINT'), 'value' => 'create', 'required' => true), 'act_modify_name' => array('__tid__' => 'act', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_ACT_MODIFY_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_ACT_MODIFY_NAME_HINT'), 'value' => 'modify', 'required' => true), 'act_remove_name' => array('__tid__' => 'act', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_ACT_REMOVE_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_ACT_REMOVE_NAME_HINT'), 'value' => 'remove', 'required' => true), 'index_row_btns' => array('__tid__' => 'main', 'type' => 'checkbox', 'label' => Text::_('MOD_BUILDER_BUILDERS_INDEX_ROW_BTNS_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_INDEX_ROW_BTNS_HINT'), 'options' => DataBuilders::getIndexRowBtnsEnum()), 'description' => array('__tid__' => 'main', 'type' => 'textarea', 'label' => Text::_('MOD_BUILDER_BUILDERS_DESCRIPTION_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_DESCRIPTION_HINT')), 'author_name' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_AUTHOR_NAME_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_AUTHOR_NAME_HINT'), 'required' => true), 'author_mail' => array('__tid__' => 'main', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_AUTHOR_MAIL_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_AUTHOR_MAIL_HINT'), 'required' => true), 'dt_created' => array('__tid__' => 'system', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_DT_CREATED_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_DT_CREATED_HINT'), 'disabled' => true), 'dt_modified' => array('__tid__' => 'system', 'type' => 'text', 'label' => Text::_('MOD_BUILDER_BUILDERS_DT_MODIFIED_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_DT_MODIFIED_HINT'), 'disabled' => true), 'trash' => array('__tid__' => 'main', 'type' => 'switch', 'label' => Text::_('MOD_BUILDER_BUILDERS_TRASH_LABEL'), 'hint' => Text::_('MOD_BUILDER_BUILDERS_TRASH_HINT'), 'options' => DataBuilders::getTrashEnum(), 'value' => DataBuilders::TRASH_Y));
     return $output;
 }