/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $key = new Typecho_Widget_Helper_Form_Element_Textarea('key', NULL, NULL, _t('服务密钥'), _t('此密钥需要向服务提供商注册<br /> 它是一个用于表明您合法用户身份的字符串')); $form->addInput($key->addRule('required', _t('您必须填写一个服务密钥'))->addRule(array('Akismet_Plugin', 'validate'), _t('您使用的服务密钥错误'))); $url = new Typecho_Widget_Helper_Form_Element_Text('url', NULL, 'http://rest.akismet.com', _t('服务地址'), _t('这是反垃圾评论服务提供商的服务器地址<br /> 我们推荐您使用 <a href="http://akismet.com">Akismet</a> 或者 <a href="http://antispam.typepad.com">Typepad</a> 的反垃圾服务')); $form->addInput($url->addRule('url', _t('您使用的地址格式错误'))); }
/** * 插件配置面板 * * @param Typecho_Widget_Helper_Form $form * @static * @access public * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $qq = new Typecho_Widget_Helper_Form_Element_Text('qq', NULL, NULL, _t('qq号码'), _t('请填写您的qq号码')); $qq->addRule('isInteger', _t('qq号码必须是纯数字')); $form->addInput($qq->addRule('required', _t('必须填写一个qq号码'))); $psw = new Typecho_Widget_Helper_Form_Element_Password('psw', NULL, NULL, _t('qq邮箱密码'), _t('请填写您的qq邮箱密码')); $form->addInput($psw->addRule('required', _t('必须填写一个qq邮箱密码'))); $title = new Typecho_Widget_Helper_Form_Element_Text('title', NULL, '{post_title}', _t('标题模板'), _t('请填写您的标题模板')); $form->addInput($title->addRule('required', _t('必须填写一个标题模板'))); $content = new Typecho_Widget_Helper_Form_Element_Textarea('content', NULL, '{post_content}', _t('内容模板'), _t('请填写您的内容模板')); $form->addInput($content->addRule('required', _t('必须填写一个内容模板'))); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { /** 分类名称 */ $id = new Typecho_Widget_Helper_Form_Element_Textarea('appid', NULL, NULL, _t('认证ID'), _t('此密钥需要向服务提供商注册<br /> 它是一个用于表明您合法用户身份的字符串')); $form->addInput($id->addRule('required', _t('您必须填写一个认证ID'))); $key = new Typecho_Widget_Helper_Form_Element_Textarea('key', NULL, NULL, _t('服务密钥'), _t('此密钥需要向服务提供商注册<br /> 它是一个用于表明您合法用户身份的字符串')); $form->addInput($key->addRule('required', _t('您必须填写一个服务密钥'))); $bucket = new Typecho_Widget_Helper_Form_Element_Text('bucket', NULL, NULL, _t('容器名称'), _t('必要的保存区间')); $form->addInput($bucket->addRule('text', _t('您使用的容器名错误'))); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $vispost = new Typecho_Widget_Helper_Form_Element_Checkbox('vispost', self::visposts(), array(), _t('公开文章列表→'), _t('<span style="position:relative;left:330px;bottom:80px;">[勾选切换]</span>')); $form->addInput($vispost->multiMode()->setAttribute('style', 'float:left;width:300px;')); $subpost = new Typecho_Widget_Helper_Form_Element_Checkbox('subpost', self::subposts(), array(), _t('←会员文章列表'), _t('')); $form->addInput($subpost->multiMode()->setAttribute('style', 'float:right;width:300px;')); $submsgp = new Typecho_Widget_Helper_Form_Element_Textarea('submsgp', NULL, '<div class="sub2view"><i class="icon-lock"></i>本文仅对注册会员开放阅读。</div>', _t('会员文章隐藏提示'), _t('未登录访客看到的会员文章显示,可使用html鼓励注册')); $form->addInput($submsgp->setAttribute('style', 'clear:both;')); $submsga1 = new Typecho_Widget_Helper_Form_Element_Textarea('submsga1', NULL, '<div class="sub2view"><i class="icon-lock"></i>此处内容需要登录才能查看。</div>', _t('会员内容隐藏提示'), _t('公开文章中用[sub][/sub]隐藏的会员内容对访客的提示')); $form->addInput($submsga1); $submsga2 = new Typecho_Widget_Helper_Form_Element_Textarea('submsga2', NULL, '<p>您已登录,可以阅读以下内容:</p><div class="sub2view"><i class="icon-lock-open"></i>{content}</div>', _t('会员内容可见效果'), _t('已登录会员看到隐藏内容显示效果(勿删改{content}标签)')); $form->addInput($submsga2); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { /** * 可自定义的全局变量 * 标签 含义 说明 * {site} 博客站点名称 在博客后台设置中设定的 * {title} 评论文章标题 * {author} 作者名称 * {mail} 评论者的邮箱 * {permalink} 评论链接 * {text} 发评论的正文 * {time} 发布评论时间 * {author_m} 被提及的用户名称 * {text_m} 被提及的用户评论 * */ $text = "<p>{author}在<a href=\"{permalink}\">《{title}》</a>中发布的评论提到了你,以下是他的评论正文:</p>\n<blockquote>{text}</blockquote>\n<p>快去看看到底是怎么回事吧!</p>"; $jquery = new Typecho_Widget_Helper_Form_Element_Radio('jquery', array('0' => _t('不加载'), '1' => _t('加载')), '1', _t('是否加载外部jQuery库文件'), _t('插件需要jQuery库文件的支持,如果主题已经加载了可以选择不加载')); $form->addInput($jquery); $host = new Typecho_Widget_Helper_Form_Element_Text('host', NULL, 'smtp.', _t('SMTP地址'), _t('请填写 SMTP 服务器地址')); $form->addInput($host->addRule('required', _t('必须填写一个SMTP服务器地址'))); $port = new Typecho_Widget_Helper_Form_Element_Text('port', NULL, '25', _t('SMTP端口'), _t('SMTP服务端口,一般为25。')); $port->input->setAttribute('class', 'mini'); $form->addInput($port->addRule('required', _t('必须填写SMTP服务端口'))->addRule('isInteger', _t('端口号必须是纯数字'))); $user = new Typecho_Widget_Helper_Form_Element_Text('user', NULL, NULL, _t('SMTP用户'), _t('SMTP服务验证用户名,一般为邮箱名如:youname@domain.com')); $form->addInput($user->addRule('required', _t('SMTP服务验证用户名'))); $pass = new Typecho_Widget_Helper_Form_Element_Password('pass', NULL, NULL, _t('SMTP密码')); $form->addInput($pass->addRule('required', _t('SMTP服务验证密码'))); $validate = new Typecho_Widget_Helper_Form_Element_Checkbox('validate', array('validate' => '服务器需要验证', 'ssl' => 'ssl加密'), array('validate'), 'SMTP验证'); $form->addInput($validate); /* $limit = new Typecho_Widget_Helper_Form_Element_Text('limit', NULL, '5', _t('最大单次提及邮件提醒数'), _t('一次@最多能发送多少封邮件提醒,默认为5封')); $limit->input->setAttribute('class', 'mini'); $form->addInput($limit->addRule('required', _t('请设置一个上限数字'))->addRule('isInteger', _t('上限必须是纯数字'))); */ $subject = new Typecho_Widget_Helper_Form_Element_Text('subject', NULL, _t('有人在《{title}》中召唤你'), _t('提醒邮件标题')); $form->addInput($subject->addRule('required', _t('提醒邮件的标题是必须要设置的'))); $body = new Typecho_Widget_Helper_Form_Element_Textarea('body', NULL, $text, _t('提醒邮件正文'), _t('可使用变量:{site}, {title}, {author}, {mail}, {permalink}, {text}, {time}, {author_m}, {text_m}')); $form->addInput($body->addRule('required', _t('提醒邮件的正文是必须要设置的'))); }