addInput($host->addRule('required', _t('必须填写一个数据库地址'))); $port = new Typecho_Widget_Helper_Form_Element_Text('port', NULL, '3306', _t('数据库端口'), _t('Emlog 所在的数据库服务器端口')); $port->input->setAttribute('class', 'w-20'); $form->addInput($port->addRule('required', _t('必须填写数据库端口')) ->addRule('isInteger', _t('端口号必须是纯数字'))); $user = new Typecho_Widget_Helper_Form_Element_Text('user', NULL, 'root', _t('数据库用户名')); $form->addInput($user->addRule('required', _t('必须填写数据库用户名'))); $password = new Typecho_Widget_Helper_Form_Element_Password('password', NULL, NULL, _t('数据库密码')); $password->input->setAttribute('class', 'w-40'); $form->addInput($password); $database = new Typecho_Widget_Helper_Form_Element_Text('database', NULL, 'emlog', _t('数据库名称'), _t('Emlog 所在的数据库名称')); $form->addInput($database->addRule('required', _t('您必须填写数据库名称'))); $prefix = new Typecho_Widget_Helper_Form_Element_Text('prefix', NULL, 'emlog_', _t('表前缀'), _t('所有 Emlog 数据表的前缀')); $form->addInput($prefix->addRule('required', _t('您必须填写表前缀'))); } /** * 个人用户的配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form * @return void */ public static function personalConfig(Typecho_Widget_Helper_Form $form){} }