Exemple #1
0
 /**
  * 获取插件配置面板
  * 
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $secretKey = new Typecho_Widget_Helper_Form_Element_Text('secretKey', NULL, NULL, _t('安全密钥'), _t('请在你的Google Code项目的管理员面板的source区的最下方找到此项'));
     $form->addInput($secretKey->addRule('required', _t('必须填写安全密钥')));
     $basePath = new Typecho_Widget_Helper_Form_Element_Text('basePath', NULL, '/trunk', _t('SVN目录'), _t('填写需要监控的SVN目录'));
     $form->addInput($basePath->addRule('required', _t('必须填写数据库用户名')));
 }
Exemple #2
0
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     /**
      * 节点
      */
     $endpointList = array("" => _t('请选择所属地域'), "oss-cn-beijing.aliyuncs.com" => _t('北京'), "oss-cn-qingdao.aliyuncs.com" => _t('青岛'), "oss-cn-shenzhen.aliyuncs.com" => _t('深圳'), "oss-cn-hangzhou.aliyuncs.com" => _t('杭州'), "oss-cn-shanghai.aliyuncs.com" => _t('上海'));
     $endpoint = new Typecho_Widget_Helper_Form_Element_Select('endpoint', $endpointList, 'oss-cn-beijing.aliyuncs.com', _t('所属地域'), _t('请选择<strong style="color:#C33;">bucket对应节点</strong>,否则无法使用,默认为北京!'));
     $form->addInput($endpoint->addRule('required', _t('所属地域 不能为空!')));
     $bucket = new Typecho_Widget_Helper_Form_Element_Text('bucket', null, null, _t('Bucket名称:'));
     $form->addInput($bucket->addRule('required', _t('“空间名称”不能为空!')));
     $accessid = new Typecho_Widget_Helper_Form_Element_Text('accessid', null, null, _t('Access Key ID'), _t('点击<a href="https://ak-console.aliyun.com/#/accesskey">这里</a>查看Access Key ID&Access Key Secret'));
     $form->addInput($accessid->addRule('required', _t('AccessID 不能为空!')));
     $accesskey = new Typecho_Widget_Helper_Form_Element_Text('accesskey', null, null, _t('Access Key Secret:'));
     $form->addInput($accesskey->addRule('required', _t('AccessKey 不能为空!')));
     $domain = new Typecho_Widget_Helper_Form_Element_Text('domain', null, null, _t('图片HTTP访问前缀:'), _t('OSS可供外网访问的域名前缀,比如https://cdn.mydomain.com'));
     $form->addInput($domain->addRule('required', _t('请填写OSS图片服务的域名前缀!')));
     $savepath = new Typecho_Widget_Helper_Form_Element_Text('savepath', null, 'img/{year}/{month}/', _t('图片保存路径格式:'), _t('图片附件保存路径的格式<br />可选参数:{year} 年份、{month} 月份、{day} 日期。<br /><strong style="color:#C33;">因为阿里云图片处理服务不支持故而GIF视为非图片</strong>'));
     $form->addInput($savepath->addRule('required', _t('请填写图片保存路径格式!')));
     $style = new Typecho_Widget_Helper_Form_Element_Text('style', null, null, _t('图片样式后缀:'), _t('阿里云图片处理服务的后缀,比如@600w.webp'));
     $form->addInput($style);
     $nonimg_domain = new Typecho_Widget_Helper_Form_Element_Text('nonimg_domain', null, null, _t('非图片HTTP访问前缀:'), _t('OSS可供外网访问的域名前缀,比如https://oss.mydomain.com'));
     $form->addInput($nonimg_domain->addRule('required', _t('请填写OSS的域名前缀!')));
     $nonimg_savepath = new Typecho_Widget_Helper_Form_Element_Text('nonimg_savepath', null, 'atta/{year}/{month}/', _t('非图片保存路径格式:'), _t('非图片附件保存路径的格式<br />可选参数:{year} 年份、{month} 月份、{day} 日期'));
     $form->addInput($nonimg_savepath->addRule('required', _t('请填写非图片保存路径格式!')));
 }
Exemple #3
0
 /**
  * 获取插件配置面板
  * 
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $consumerKey = new Typecho_Widget_Helper_Form_Element_Text('consumerKey', NULL, '', _t('Consumer Key'), _t('Your application consumer key from Twitter.com. '));
     $form->addInput($consumerKey->addRule('required', _t('You must give the Consumer Key from Twitter.com')));
     $consumerSecret = new Typecho_Widget_Helper_Form_Element_Text('consumerSecret', NULL, '', _t('Consumer Secret'), _t('Your application consumer secret from Twitter.com. '));
     $form->addInput($consumerSecret->addRule('required', _t('You must give the Consumer Key from Twitter.com')));
 }
 /**
  * 获取插件配置面板
  *
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $mode = new Typecho_Widget_Helper_Form_Element_Radio('mode', array('smtp' => 'smtp', 'mail' => 'mail()', 'sendmail' => 'sendmail()'), 'smtp', '发信方式');
     $form->addInput($mode);
     $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);
     $mail = new Typecho_Widget_Helper_Form_Element_Text('mail', NULL, NULL, _t('接收邮箱'), _t('接收邮件用的信箱,如为空则使用文章作者个人设置中的邮箱!'));
     $form->addInput($mail->addRule('email', _t('请填写正确的邮箱!')));
     $status = new Typecho_Widget_Helper_Form_Element_Checkbox('status', array('approved' => '提醒已通过评论', 'waiting' => '提醒待审核评论', 'spam' => '提醒垃圾评论'), array('approved', 'waiting'), '提醒设置', _t('该选项仅针对博主,访客只发送已通过的评论。'));
     $form->addInput($status);
     $other = new Typecho_Widget_Helper_Form_Element_Checkbox('other', array('to_owner' => '有评论及回复时,发邮件通知博主。', 'to_guest' => '评论被回复时,发邮件通知评论者。', 'to_me' => '自己回复自己的评论时,发邮件通知。(同时针对博主和访客)', 'to_log' => '记录邮件发送日志。'), array('to_owner', 'to_guest', 'to_me'), '其他设置', _t('如果选上"记录邮件发送日志"选项,则会在./CommentToMail/log/mail_log.txt 文件中记录发送信息。<br />
                 关键性错误日志将自动记录到./CommentToMail/log/error_log.txt文件中。<br />
                 '));
     $form->addInput($other->multiMode());
     $titleForOwner = new Typecho_Widget_Helper_Form_Element_Text('titleForOwner', null, "[{site}]:《{title}》有新的评论", _t('博主接收邮件标题'));
     $form->addInput($titleForOwner);
     $titleForGuest = new Typecho_Widget_Helper_Form_Element_Text('titleForGuest', null, "[{site}]:您在《{title}》的评论有了回复", _t('访客接收邮件标题'));
     $form->addInput($titleForGuest);
 }
Exemple #5
0
 /**
  * 获取插件配置面板
  * 
  * @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('您使用的地址格式错误')));
 }
Exemple #6
0
function themeConfig($form)
{
    $navy_gravatar = new Typecho_Widget_Helper_Form_Element_Text('navy_gravatar', NULL, '*****@*****.**', _t('底部头像'), _t(''));
    $navy_gravatar->input->setAttribute('class', 'w-100 mono');
    $form->addInput($navy_gravatar->addRule('email', '请填写一个邮箱地址'));
    $navy_tips = new Typecho_Widget_Helper_Form_Element_Text('navy_tips', NULL, '一个高端大气上档次的网站', _t('头像提示'), _t(''));
    $form->addInput($navy_tips);
    $sidebarBlock = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebarBlock', array('ShowRecentPosts' => _t('显示最新文章'), 'ShowCategory' => _t('显示分类'), 'ShowArchive' => _t('显示归档'), 'ShowRecentComments' => _t('显示最新回复'), 'ShowOther' => _t('显示其它杂项')), array('ShowRecentPosts', 'ShowCategory'), _t('侧边栏显示'));
    $form->addInput($sidebarBlock->multiMode());
}
Exemple #7
0
function themeConfig($form)
{
    echo '<p style="font-size:16px;text-align:center;">感谢您使用TE响应式主题 :<font color="#4A89DC"> Themia</font><font color="#F40"> ' . Themia_Version . '</font> ![<a href="http://qqdie.com/archives/with-the-help-of-themia-subject-to-update-the-manual" target="_blank">更新与帮助</a>]</p>';
    $SmiliesSetting = new Typecho_Widget_Helper_Form_Element_Checkbox('SmiliesSetting', array('Showimg' => _t('缩略图固定')), array('Showimg'), _t('缩略图设置'), _t('文章没有图片时会随机调用缩略图,开启此项可将没有图片的文章缩略图固定为一张'));
    $form->addInput($SmiliesSetting->multiMode());
    //网站LOGO
    $logoUrl = new Typecho_Widget_Helper_Form_Element_Text('logoUrl', NULL, NULL, _t('博主头像地址'), _t('logo头像地址,不填写默认内置头像,这个建议用正方形的图片√'));
    $form->addInput($logoUrl);
    //背景
    $bgUrl = new Typecho_Widget_Helper_Form_Element_Text('bgUrl', NULL, NULL, _t('背景图地址'), _t('背景图地址,不填写默认为内置的图片,这个建议用高清大图√'));
    $form->addInput($bgUrl);
    $weibo = new Typecho_Widget_Helper_Form_Element_Text('weibo', NULL, 'http://weibo.com/jinzeboke', _t('新浪微博地址'), _t('填写你的新浪微博主页地址到菜单目录中'));
    $form->addInput($weibo);
    $Categories = new Typecho_Widget_Helper_Form_Element_Text('Categories', NULL, NULL, _t('Categories分类归档地址'), _t('新建独立页面,选择模板Categories,这里填入独立页面的完整地址'));
    $form->addInput($Categories);
    $Archive = new Typecho_Widget_Helper_Form_Element_Text('Archive', NULL, NULL, _t('Archive时间归档地址'), _t('新建独立页面,选择模板Archive,这里填入独立页面的完整地址'));
    $form->addInput($Archive);
    $links = new Typecho_Widget_Helper_Form_Element_Text('links', NULL, NULL, _t('links友情链接地址'), _t('新建独立页面,写上朋友的链接,作为友情链接页面,然后把页面地址填入这里'));
    $form->addInput($links);
    $about = new Typecho_Widget_Helper_Form_Element_Text('about', NULL, NULL, _t('about链接地址'), _t('新建独立页面,写上关于自己的属性,然后把页面地址填入这里'));
    $form->addInput($about);
    $css = new Typecho_Widget_Helper_Form_Element_Radio('css', array('1' => _t('1.在大屏幕显示宽的SideBar,在中屏幕显示窄的SideBar,在小屏幕显示抽屉SideBar(宽)'), '2' => _t('2.在大屏幕和中屏幕显示窄的SideBar,在小屏幕显示抽屉SideBar(窄)'), '3' => _t('3.在所有屏幕显示抽屉SideBar(宽)'), '4' => _t('4.在所有屏幕显示抽屉SideBar(窄)')), '1', _t('sidebar风格'), _t('这里的风格指的是网站整体风格,文章风格可通过自定义字段字段名ys和字段值来控制,实现对单独的一篇文章的风格重定义(字段值就是上边对应的数字,如风格3,就在文章字段名填入ys,字段值填入3即可),文章封面效果也是用自定义字段,字段名fm,字段值就是封面的图片地址,启动封面效果的文章风格会变更为3(优先级高)√'));
    $form->addInput($css->multiMode());
    $tf = new Typecho_Widget_Helper_Form_Element_Radio('tf', array('open' => _t('启用居中风格,使用默认方式截取缩略内容'), 'more' => _t('启用居中风格,并强制使用more语法截取缩略内容'), 'close' => _t('不启用')), 'close', _t('文章标题居中风格'), _t('默认不启用,启用后文章缩略图会关闭显示,并且文章标题,分类等信息居中'));
    $form->addInput($tf);
    //工具开关
    $sidebarBlock = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebarBlock', array('kp' => _t('文章中加入跨屏浏览二维码,支付宝打赏,及文章版权声明'), 'bjq' => _t('文章内容增强,加入最后编辑时间'), 'Showfull' => _t('手机浏览器强制全屏,仅限于uc和QQ浏览器'), 'Showcolor' => _t('手机谷歌浏览器状态栏颜色渲染为白色'), 'kiana' => _t('kiana封印解除'), 'simg' => _t('全局不显示文章缩略图')), array('Showcolor', 'bjq'), _t('工具开关'));
    $form->addInput($sidebarBlock->multiMode());
    $jsq = new Typecho_Widget_Helper_Form_Element_Radio('jsq', array('0' => _t('不显示文章浏览次数'), '1' => _t('非插件实现'), '2' => _t('绛木子TePostViews插件')), '0', _t('文章阅读次数显示方案(后一项需要自行安装对应插件)'), _t("在工具开关中,打开文章浏览次数,然后选择这里的方案,两款方案最终效果都一样<br>在不清除cookie或者cookie未过期的情况下不会重复计数<br>提示:非插件的方案和Hanny的Stat插件使用的是同一个数据,所以如果你曾经用的是Star插件,可以直接选择第一项,同时禁用Star插件,以免重复计数【不禁用的话,访问一次,计数器会加2】"));
    $form->addInput($jsq);
    $cdl = new Typecho_Widget_Helper_Form_Element_Radio('cdl', array('0' => _t('English'), '1' => _t('日本語【渣翻译】
'), '2' => _t('中文')), '0', _t('界面语言设置'), _t("尽管英文逼格比较高,但是中文有中文的好处。此处默认是英文,因为我比较屌,所以有日文选项"));
    $form->addInput($cdl);
    $bqg = new Typecho_Widget_Helper_Form_Element_Radio('bqg', array('1' => _t('不开启版权狗'), '2' => _t('开启版权声明')), '1', _t('版权声明'), _t("复制文章内容时,会出现版权声明提示,并且复制的内容自带版权声明。"));
    $form->addInput($bqg);
    //文章首行缩进
    $page_suo = new Typecho_Widget_Helper_Form_Element_Radio('page_suo', array('display' => _t('post和page页面启用'), 'display1' => _t('仅post页面启用'), 'display2' => _t('仅page页面启用'), 'close' => _t('禁用')), 'close', _t('文章首行缩进'), _t('开启后,所有文章内容将自动缩进2em(两个中文汉字宽度)'));
    $form->addInput($page_suo);
    //建站时间
    $time = new Typecho_Widget_Helper_Form_Element_Text('time', NULL, '2015/06/06', _t('博客成立时间'), _t('此功能是摆设,事件需要在模板kz.js中修改'));
    $form->addInput($time);
    //统计代码
    $tongji = new Typecho_Widget_Helper_Form_Element_Textarea('tongji', NULL, '', _t('底部声明什么的'), _t('填入备案链接或者统计代码或者版权什么的'));
    $form->addInput($tongji);
    $sticky_1 = new Typecho_Widget_Helper_Form_Element_Text('sticky_1', NULL, NULL, '置顶主题ID', '填写对应主题的 id 即可使某些分类的文章在置顶首页显示(例如 1)。');
    $sticky_1->input->setAttribute('class', 'mini');
    $form->addInput($sticky_1->addRule('isInteger', '请填入数字'));
    $sticky_2 = new Typecho_Widget_Helper_Form_Element_Text('sticky_2', NULL, NULL, '置顶主题ID', '填写对应主题的 id 即可使某些分类的文章在置顶首页显示(例如 1)。');
    $sticky_2->input->setAttribute('class', 'mini');
    $form->addInput($sticky_2->addRule('isInteger', '请填入数字'));
    $sticky_3 = new Typecho_Widget_Helper_Form_Element_Text('sticky_3', NULL, NULL, '置顶主题ID', '填写对应主题的 id 即可使某些分类的文章在置顶首页显示(例如 1)。');
    $sticky_3->input->setAttribute('class', 'mini');
    $form->addInput($sticky_3->addRule('isInteger', '请填入数字'));
}
Exemple #8
0
 /**
  * 获取插件配置面板
  *
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $keywords = new Typecho_Widget_Helper_Form_Element_Textarea('keywords', NULL, "", _t('关键词链接'), _t('以“关键词”|(英文半角分隔号)“链接”形式填写,每行一组。如:<br/>google|http://www.google.com'));
     $keywords->input->setAttribute('style', 'width:345px;height:150px;');
     $form->addInput($keywords);
     $tagslink = new Typecho_Widget_Helper_Form_Element_Checkbox('tagslink', array('true' => '自动替换'), NULL, _t('标签链接'), _t('文中若出现与本站标签相同的关键词则自动添加标签页链接'));
     $form->addInput($tagslink);
     $limits = new Typecho_Widget_Helper_Form_Element_Text('limits', NULL, "1", _t('链接频率'), _t('文中有多个重复关键词或标签时可限制链接替换次数'));
     $limits->input->setAttribute('style', 'width:60px');
     $form->addInput($limits->addRule('isInteger', _t('请填写整数数字')));
 }
Exemple #9
0
 /**
  * 插件配置面板
  *
  * @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('必须填写一个内容模板')));
 }
Exemple #10
0
 /**
  * 获取插件配置面板
  * 
  * @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('您使用的容器名错误')));
 }
Exemple #11
0
 /**
  * 获取插件配置面板
  * 
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $config_file = dirname(__FILE__) . '/config.xml';
     //config.xml的绝对地址
     $xml = simplexml_load_file($config_file);
     $tables = new Typecho_Widget_Helper_Form_Element_Text('tables', null, (string) $xml->tables, _t('需要备份的表'), _t('键入表名,用“,”隔开'));
     $form->addInput($tables);
     $circle = new Typecho_Widget_Helper_Form_Element_Text('circle', null, (string) $xml->circle, _t('更新周期(天)'));
     $form->addInput($circle->addRule('isInteger', _t('更新周期必须是纯数字')));
     $ToMail = new Typecho_Widget_Helper_Form_Element_Checkbox('tomail', array('tomail' => _t('发送备份文件至邮箱')), $xml->tomail ? explode(',', (string) $xml->tomail) : null, null, _t('<strong>重要:如果选择此项,请认真填写以下表单</strong>'));
     $form->addInput($ToMail);
     $subject = new Typecho_Widget_Helper_Form_Element_Text('subject', null, (string) $xml->subject, _t('自定义邮件标题'), _t('格式:20100902-XXX-数据库备份文件(不填则XXX默认为博客标题)'));
     $form->addInput($subject);
     $mode = new Typecho_Widget_Helper_Form_Element_Radio('mode', array('smtp' => 'smtp', 'mail' => 'mail()', 'sendmail' => 'sendmail()'), (string) $xml->mode, '发信方式');
     $form->addInput($mode);
     $host = new Typecho_Widget_Helper_Form_Element_Text('host', NULL, (string) $xml->host, _t('SMTP地址'), _t('请填写 SMTP 服务器地址'));
     $form->addInput($host);
     $port = new Typecho_Widget_Helper_Form_Element_Text('port', NULL, (string) $xml->port, _t('SMTP端口'), _t('SMTP服务端口,一般为25;gmail和qq的465。'));
     $port->input->setAttribute('class', 'mini');
     $form->addInput($port->addRule('isInteger', _t('端口号必须是纯数字')));
     $user = new Typecho_Widget_Helper_Form_Element_Text('user', NULL, (string) $xml->user, _t('SMTP用户'), _t('SMTP服务验证用户名,一般为邮箱名如:youname@domain.com'));
     $form->addInput($user);
     $pass = new Typecho_Widget_Helper_Form_Element_Password('pass', NULL, NULL, _t('SMTP密码'));
     $form->addInput($pass);
     $validate = new Typecho_Widget_Helper_Form_Element_Checkbox('validate', array('validate' => '服务器需要验证', 'ssl' => 'ssl加密'), $xml->validate ? explode(',', (string) $xml->validate) : null, 'SMTP验证');
     $form->addInput($validate);
     $mail = new Typecho_Widget_Helper_Form_Element_Text('mail', NULL, (string) $xml->mail, _t('接收邮箱'), _t('接收邮件用的信箱,如为空则使用博客创建者个人设置中的邮箱!'));
     $form->addInput($mail->addRule('email', _t('请填写正确的邮箱!')));
     $request = Typecho_Request::getInstance();
     if ($request->isPost()) {
         /**
          * 更新配置文件
          */
         $xml->tables = $request->get('tables');
         $xml->circle = $request->get('circle');
         if (is_array($request->get('tomail'))) {
             $xml->tomail = implode(',', $request->get('tomail'));
         }
         $xml->subject = $request->get('subject');
         $xml->mode = $request->get('mode');
         $xml->host = $request->get('host');
         $xml->port = $request->get('port');
         $xml->user = $request->get('user');
         if (is_array($request->get('validate'))) {
             $xml->validate = implode(',', $request->get('validate'));
         }
         $xml->mail = $request->get('mail');
         $xml = $xml->asXML();
         $fp = fopen($config_file, 'wb');
         fwrite($fp, $xml);
         fclose($fp);
     }
 }
Exemple #12
0
 /**
  * 获取插件配置面板
  * 
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     //应用服务器地址
     $server = new Typecho_Widget_Helper_Form_Element_Text('server', NULL, self::$defaultServer, _t('应用服务器地址'));
     $server->addRule('required', _t('应用服务器地址不能为空'));
     $form->addInput($server);
     //缓存设置
     $cache = new Typecho_Widget_Helper_Form_Element_Select('cache_time', array('0' => _t('不缓存'), '0.5' => _t('半小时'), '1' => _t('1小时'), '12' => _t('12小时'), '24' => _t('24小时')), '1', _t('缓存时间'), '应用数据的缓存时间');
     $form->addInput($cache);
     $showNavMenu = new Typecho_Widget_Helper_Form_Element_Radio('showNavMenu', array('true' => '是', 'false' => '否'), 'true', _t('是否显示菜单栏按钮'));
     $form->addInput($showNavMenu);
 }
Exemple #13
0
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $bucket = new Typecho_Widget_Helper_Form_Element_Text('bucket', null, null, _t('空间名称:'));
     $form->addInput($bucket->addRule('required', _t('“空间名称”不能为空!')));
     $accesskey = new Typecho_Widget_Helper_Form_Element_Text('accesskey', null, null, _t('AccessKey:'));
     $form->addInput($accesskey->addRule('required', _t('AccessKey 不能为空!')));
     $sercetkey = new Typecho_Widget_Helper_Form_Element_Text('sercetkey', null, null, _t('SecretKey:'));
     $form->addInput($sercetkey->addRule('required', _t('SecretKey 不能为空!')));
     $domain = new Typecho_Widget_Helper_Form_Element_Text('domain', null, 'http://', _t('绑定域名:'), _t('以 http:// 开头,结尾不要加 / !'));
     $form->addInput($domain->addRule('required', _t('请填写空间绑定的域名!'))->addRule('url', _t('您输入的域名格式错误!')));
     $savepath = new Typecho_Widget_Helper_Form_Element_Text('savepath', null, '{year}/{month}/', _t('保存路径格式:'), _t('附件保存路径的格式,默认为 Typecho 的 {year}/{month}/ 格式,注意<strong style="color:#C33;">前面不要加 / </strong>!<br />可选参数:{year} 年份、{month} 月份、{day} 日期'));
     $form->addInput($savepath->addRule('required', _t('请填写保存路径格式!')));
 }
function themeConfig($form)
{
    $next_name = new Typecho_Widget_Helper_Form_Element_Text('next_name', NULL, '', _t('侧边栏显示的昵称'), _t('显示在头像下方'));
    $next_name->input->setAttribute('class', 'w-100 mono');
    $form->addInput($next_name);
    $next_gravatar = new Typecho_Widget_Helper_Form_Element_Text('next_gravatar', NULL, '', _t('侧边栏头像'), _t(''));
    $next_gravatar->input->setAttribute('class', 'w-100 mono');
    $form->addInput($next_gravatar->addRule('email', '请填写一个邮箱地址'));
    $next_tips = new Typecho_Widget_Helper_Form_Element_Text('next_tips', NULL, '一个高端大气上档次的网站', _t('站点描述'), _t('显示在昵称下方'));
    $form->addInput($next_tips);
    $search_form = new Typecho_Widget_Helper_Form_Element_Checkbox('search_form', array('ShowSearch' => _t('显示搜索框'), 'ShowFeed' => _t('显示RSS订阅')), array('ShowSearch', 'ShowFeed'), _t('其他设置'));
    $form->addInput($search_form->multiMode());
}
Exemple #15
0
 /**
  * 获取插件配置面板
  *
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $bucket = new Typecho_Widget_Helper_Form_Element_Text('bucket', null, null, _t('Bucket 名称(*):'));
     $form->addInput($bucket->addRule('required', _t('Bucket名称不能为空!')));
     $accesskey = new Typecho_Widget_Helper_Form_Element_Text('accesskey', null, null, _t('AccessKey(*):'));
     $form->addInput($accesskey->addRule('required', _t('AccessKey不能为空!')));
     $secretkey = new Typecho_Widget_Helper_Form_Element_Text('secretkey', null, null, _t('SecretKey(*):'));
     $form->addInput($secretkey->addRule('required', _t('SecretKey不能为空!')));
     $scsbind = new Typecho_Widget_Helper_Form_Element_Text('scsbind', null, null, _t('SCS绑定的域名: '), _t('非必填,有则填写SCS上绑定的域名。'));
     $form->addInput($scsbind->addRule('xssCheck', _t('SCS域名格式不正确!')));
     $format = new Typecho_Widget_Helper_Form_Element_Text('format', null, null, _t('自定义SCS路径: '), _t('非必填,SCS存储路径。可用参数: {year}年份,{month}月份,{day}天数。默认为 "年份/月份/" 即 {year}/{month} 格式,也可自行输入类似 "{year}/a目录/b目录/{month}/" 等样式风格。'));
     $form->addInput($format->addRule('xssCheck', _t('SCS路径格式不正确!')));
     //必填则$form->addInput($format->addRule('required', _t('SCS路径不能为空!'))->addRule('xssCheck', _t('SCS路径格式不正确!')));
 }
Exemple #16
0
 public function form()
 {
     /** 构建表格 */
     $form = new Typecho_Widget_Helper_Form($this->security->getIndex('/action/options-forum'), Typecho_Widget_Helper_Form::POST_METHOD);
     $siteIcp = new Typecho_Widget_Helper_Form_Element_Text('siteIcp', NULL, $this->options->siteIcp, _t('网站备案号'), _t('在这里填入网站备案号'));
     $siteIcp->input->setAttribute('class', 'w-60');
     $form->addInput($siteIcp);
     $siteStat = new Typecho_Widget_Helper_Form_Element_Textarea('siteStat', NULL, $this->options->siteStat, _t('统计代码'), _t('在这里填入网站统计代码'));
     $form->addInput($siteStat);
     $smtp_host = new Typecho_Widget_Helper_Form_Element_Text('smtpHost', NULL, $this->options->smtpHost, _t('SMTP地址'), _t('请填写 SMTP 服务器地址'));
     $smtp_host->input->setAttribute('class', 'w-60');
     $form->addInput($smtp_host);
     $smtp_port = new Typecho_Widget_Helper_Form_Element_Text('smtpPort', NULL, $this->options->smtpPort, _t('SMTP端口'), _t('SMTP服务端口,一般为25。'));
     $smtp_port->input->setAttribute('class', 'w-60');
     $form->addInput($smtp_port);
     $smtp_user = new Typecho_Widget_Helper_Form_Element_Text('smtpUser', NULL, $this->options->smtpUser, _t('SMTP用户'), _t('SMTP服务验证用户名,一般为邮箱名如:youname@domain.com'));
     $smtp_user->input->setAttribute('class', 'w-60');
     $form->addInput($smtp_user);
     $smtp_pass = new Typecho_Widget_Helper_Form_Element_Password('smtpPass', NULL, $this->options->smtpPass, _t('SMTP密码'));
     $smtp_pass->input->setAttribute('class', 'w-60');
     $form->addInput($smtp_pass);
     $from_mail = new Typecho_Widget_Helper_Form_Element_Text('smtpMail', NULL, $this->options->smtpMail, _t('发件人EMAIL'));
     $from_mail->input->setAttribute('class', 'w-60');
     $form->addInput($from_mail->addRule('email', _t('电子邮箱格式错误')));
     $from_name = new Typecho_Widget_Helper_Form_Element_Text('smtpName', NULL, $this->options->smtpName, _t('发件人名称'));
     $from_name->input->setAttribute('class', 'w-60');
     $form->addInput($from_name);
     //用户积分
     $credits_register = new Typecho_Widget_Helper_Form_Element_Text('creditsRegister', NULL, $this->options->creditsRegister, _t('注册积分'), _t('用户注册后默认的积分'));
     $credits_register->input->setAttribute('class', 'w-60');
     $form->addInput($credits_register);
     $credits_login = new Typecho_Widget_Helper_Form_Element_Text('creditsLogin', NULL, $this->options->creditsLogin, _t('登录积分'), _t('每日登录获取的积分'));
     $credits_login->input->setAttribute('class', 'w-60');
     $form->addInput($credits_login);
     $credits_publish = new Typecho_Widget_Helper_Form_Element_Text('creditsPublish', NULL, $this->options->creditsPublish, _t('发布主题'), _t('用户发布主题加上或减少的积分'));
     $credits_publish->input->setAttribute('class', 'w-60');
     $form->addInput($credits_publish);
     $credits_reply = new Typecho_Widget_Helper_Form_Element_Text('creditsReply', NULL, $this->options->creditsReply, _t('发表回复'), _t('用户发表回复加上或减少的积分'));
     $credits_reply->input->setAttribute('class', 'w-60');
     $form->addInput($credits_reply);
     $credits_invite = new Typecho_Widget_Helper_Form_Element_Text('creditsInvite', NULL, $this->options->creditsInvite, _t('邀请注册'), _t('邀请者和被邀请者所奖励的积分'));
     $credits_invite->input->setAttribute('class', 'w-60');
     $form->addInput($credits_invite);
     /** 提交按钮 */
     $submit = new Typecho_Widget_Helper_Form_Element_Submit('submit', NULL, _t('保存设置'));
     $submit->input->setAttribute('class', 'btn primary');
     $form->addItem($submit);
     return $form;
 }
Exemple #17
0
 /**
  * 获取插件配置面板
  * 
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $upyundomain = new Typecho_Widget_Helper_Form_Element_Text('upyundomain', NULL, 'http://', _t('绑定域名:'), _t('该绑定域名为绑定Upyun服务的域名,由Upyun提供,注意以http://开头,最后不要加/'));
     $form->addInput($upyundomain->addRule('required', _t('您必须填写绑定域名,它是由Upyun提供'))->addRule('url', _t('您输入的域名格式错误')));
     $upyunpathmode = new Typecho_Widget_Helper_Form_Element_Radio('mode', array('typecho' => _t('Typecho结构(' . self::getUploadDir() . '/年/月/文件名)'), 'simple' => _t('精简结构(/年/月/文件名)')), 'typecho', _t('目录结构模式'), _t('默认为Typecho结构模式'));
     $form->addInput($upyunpathmode);
     $upyunhost = new Typecho_Widget_Helper_Form_Element_Text('upyunhost', NULL, NULL, _t('服务名称:'));
     $upyunhost->input->setAttribute('class', 'mini');
     $form->addInput($upyunhost->addRule('required', _t('您必须填写服务名称,它是由Upyun提供')));
     $upyunuser = new Typecho_Widget_Helper_Form_Element_Text('upyunuser', NULL, NULL, _t('操作员:'));
     $upyunuser->input->setAttribute('class', 'mini');
     $form->addInput($upyunuser->addRule('required', _t('您必须填写操作员,它是由Upyun提供')));
     $upyunpwd = new Typecho_Widget_Helper_Form_Element_Password('upyunpwd', NULL, NULL, _t('密码:'));
     $form->addInput($upyunpwd->addRule('required', _t('您必须填写密码,它是由Upyun提供'))->addRule(array('UpyunFile_Plugin', 'validate'), _t('验证不通过,请核对Upyun操作员和密码是否输入正确')));
 }
Exemple #18
0
 /**
  * 获取插件配置面板
  * 
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $host = new Typecho_Widget_Helper_Form_Element_Text('host', NULL, 'localhost', _t('数据库地址'), _t('请填写 WordPress 所在的数据库地址'));
     $form->addInput($host->addRule('required', _t('必须填写一个数据库地址')));
     $port = new Typecho_Widget_Helper_Form_Element_Text('port', NULL, '3306', _t('数据库端口'), _t('WordPress 所在的数据库服务器端口'));
     $port->input->setAttribute('class', 'mini');
     $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('数据库密码'));
     $form->addInput($password);
     $database = new Typecho_Widget_Helper_Form_Element_Text('database', NULL, 'wordpress', _t('数据库名称'), _t('WordPress 所在的数据库名称'));
     $form->addInput($database->addRule('required', _t('您必须填写数据库名称')));
     $prefix = new Typecho_Widget_Helper_Form_Element_Text('prefix', NULL, 'wp_', _t('表前缀'), _t('所有 WordPress 数据表的前缀'));
     $form->addInput($prefix->addRule('required', _t('您必须填写表前缀')));
 }
Exemple #19
0
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     /* 缓存前缀 */
     $prefix = new Typecho_Widget_Helper_Form_Element_Text('prefix', null, self::$defaultPrefix, _t('缓存前缀'), '请不要随意更改!修改该值会导致缓存丢失!');
     // 增加一条规则,不可为空
     $prefix->addRule('required', _t('缓存前缀不能为空!'));
     $form->addInput($prefix);
     /* 缓存时间 */
     $cacheTTL = new Typecho_Widget_Helper_Form_Element_Text('cacheTTL', null, '暂时没什么卵用', _t('缓存时间'), '单位为秒');
     // 增加一条规则,不可为空
     // $prefix->addRule('required', _t('缓存时间不能为空!'));
     $form->addInput($cacheTTL);
     /* 禁用插件时是否清空缓存 */
     $clearCacheAfterDisable = new Typecho_Widget_Helper_Form_Element_Radio('clearCacheAfterDisable', array('true' => '是', 'false' => '否'), 'false', _t('禁用插件时是否清空缓存'));
     $form->addInput($clearCacheAfterDisable);
 }
function themeConfig($form)
{
    $siteUrl = Helper::options()->siteUrl;
    $next_name = new Typecho_Widget_Helper_Form_Element_Text('next_name', NULL, '', _t('侧边栏显示的昵称'), _t('显示在头像下方'));
    $next_name->input->setAttribute('class', 'w-100 mono');
    $form->addInput($next_name);
    $next_gravatar = new Typecho_Widget_Helper_Form_Element_Text('next_gravatar', NULL, '', _t('侧边栏头像'), _t('填写Gravatar头像的邮箱地址'));
    $next_gravatar->input->setAttribute('class', 'w-100 mono');
    $form->addInput($next_gravatar->addRule('email', '请填写一个邮箱地址'));
    $next_tips = new Typecho_Widget_Helper_Form_Element_Text('next_tips', NULL, '一个高端大气上档次的网站', _t('站点描述'), _t('将显示在侧边栏的昵称下方'));
    $form->addInput($next_tips);
    $next_cdn = new Typecho_Widget_Helper_Form_Element_Text('next_cdn', NULL, $siteUrl, _t('cdn镜像地址'), _t('静态文件cdn镜像加速地址,加速js和css,如七牛,又拍云等<br>格式参考:' . $siteUrl . '<br>不用请留空或者保持默认'));
    $form->addInput($next_cdn);
    $sidebar = new Typecho_Widget_Helper_Form_Element_Radio('sidebar', array(_t('始终自动弹出'), _t('文章中有目录时弹出'), _t('不自动弹出')), 1, _t('侧边栏自动弹出设置'));
    $form->addInput($sidebar);
    $search_form = new Typecho_Widget_Helper_Form_Element_Checkbox('search_form', array('ShowSearch' => _t('显示搜索框'), 'ShowFeed' => _t('显示RSS订阅')), array('ShowSearch', 'ShowFeed'), _t('其他设置'));
    $form->addInput($search_form->multiMode());
}
Exemple #21
0
 /**
  * 获取插件配置面板
  *
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     echo "<div style='color:#999;font-size:0.92857em;font-weight:bold;'><p>编辑文章或页面写入如<span style='color:#467B96;'>&lt;gb&gt;</span><span style='color:#E47E00;'>用户名<span style='color:#467B96;'>/</span>项目名</span><span style='color:#467B96;'>&lt;/gb&gt;</span>发布即可. 支持标签参数, 详见各选项说明.<br/>示例: <span style='color:#467B96;'>&lt;gb user=\"<span style='color:#E47E00;'>typecho-fans</span>\"  type=\"<span style='color:#E47E00;'>star</span>\" count=\"<span style='color:#E47E00;'>1</span>\" size=\"<span style='color:#E47E00;'>1</span>\" width=\"<span style='color:#E47E00;'>200</span>\"&gt;</span><span style='color:#E47E00;'>plugins</span><span style='color:#467B96;'>&lt;/gb&gt;</span></p></div>";
     $btn_user = new Typecho_Widget_Helper_Form_Element_Text('btn_user', NULL, '', _t('GitHub用户名'), _t('默认调用的username, 可在标签中用参数user="******"覆盖'));
     $btn_user->input->setAttribute('class', 'w-20');
     $form->addInput($btn_user);
     $btn_type = new Typecho_Widget_Helper_Form_Element_Select('btn_type', array('watch' => _t('Watch(跟进项目)'), 'star' => _t('Star(收藏项目)'), 'fork' => _t('Fork(拷贝项目)'), 'follow' => _t('Follow(关注作者)'), 'download' => _t('Download(版本发布)')), 'fork', _t('GitHub按钮种类'), _t('默认调用的按钮种类, 可在标签中用参数type="watch/star/fork/follow/download"覆盖'));
     $form->addInput($btn_type);
     $btn_count = new Typecho_Widget_Helper_Form_Element_Checkbox('btn_count', array('1' => _t('显示')), NULL, _t('GitHub按钮数字'), _t('默认是否显示按钮数字, 可在标签中用参数count="0/1"覆盖'));
     $form->addInput($btn_count);
     $btn_size = new Typecho_Widget_Helper_Form_Element_Checkbox('btn_size', array('1' => _t('大尺寸')), NULL, _t('GitHub按钮大小'), _t('默认是否使用大尺寸按钮, 可在标签中用参数size="0/1"覆盖'));
     $form->addInput($btn_size);
     $btn_lang = new Typecho_Widget_Helper_Form_Element_Radio('btn_lang', array('en' => _t('英文'), 'cn' => _t('中文')), 'en', _t('GitHub按钮语言'), _t('选择按钮文字语言, 可在标签中用参数lang="en/zh"覆盖'));
     $form->addInput($btn_lang);
     $btn_width = new Typecho_Widget_Helper_Form_Element_Text('btn_width', NULL, '170', _t('iframe框架宽度'), _t('默认iframe调用宽度, 单位px(不用写), 可在标签中用参数width="*"覆盖'));
     $btn_width->input->setAttribute('class', 'w-10');
     $form->addInput($btn_width->addRule('isInteger', '请输入整数数字'));
 }
function themeConfig($form)
{
    $siteUrl = Helper::options()->siteUrl;
    $next_name = new Typecho_Widget_Helper_Form_Element_Text('next_name', NULL, '', _t('侧边栏显示的昵称'));
    $next_name->input->setAttribute('class', 'w-100 mono');
    $form->addInput($next_name);
    $next_gravatar = new Typecho_Widget_Helper_Form_Element_Text('next_gravatar', NULL, '', _t('侧边栏头像'), _t('填写Gravatar头像的邮箱地址'));
    $next_gravatar->input->setAttribute('class', 'w-100 mono');
    $form->addInput($next_gravatar->addRule('email', '请填写一个邮箱地址'));
    $next_tips = new Typecho_Widget_Helper_Form_Element_Text('next_tips', NULL, '一个高端大气上档次的网站', _t('站点描述'), _t('将显示在侧边栏的昵称下方'));
    $form->addInput($next_tips);
    $next_cdn = new Typecho_Widget_Helper_Form_Element_Text('next_cdn', NULL, $siteUrl, _t('cdn镜像地址'), _t('静态文件cdn镜像加速地址,加速js和css,如七牛,又拍云等<br>格式参考:' . $siteUrl . '<br>不用请留空或者保持默认'));
    $form->addInput($next_cdn);
    $sidebarFlinks = new Typecho_Widget_Helper_Form_Element_Radio('sidebarFlinks', array('show' => _t('显示'), 'hide' => _t('不显示')), 'hide', _t('侧边栏友链设置'), _t('安装了 Hanny 的Links插件才可显示'));
    $form->addInput($sidebarFlinks);
    $sidebarNav = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebarNav', array('main' => _t('首页'), 'archive' => _t('归档'), 'categories' => _t('分类'), 'tags' => _t('标签'), 'search' => _t('搜索')), array('main', 'archive', 'tags', 'search'), _t('侧边导航栏设置'));
    $form->addInput($sidebarNav->multiMode());
    $sidebarOthers = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebarOthers', array('ShowFeed' => _t('显示RSS订阅')), array('ShowFeed'), _t('其他设置'));
    $form->addInput($sidebarOthers->multiMode());
}
Exemple #23
0
 /**
  * 获取插件配置面板
  * 
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     Typecho_Widget::widget('Widget_Contents_Page_List')->to($pages);
     $page_arr = array();
     while ($pages->next()) {
         $page_arr[$pages->slug] = $pages->title;
     }
     $user_id = new Typecho_Widget_Helper_Form_Element_Text('user_id', NULL, '', _t('虾米用户ID'), _t('虾米用户ID:http://www.xiami.com/u/<strong>33663442</strong> (填入数字)'));
     $user_id->addRule('isInteger', _t('填写的虾米用户ID必须为数字'));
     $user_id->addRule('required', _t('必须填写一个虾米用户ID'));
     $form->addInput($user_id);
     $user_page = new Typecho_Widget_Helper_Form_Element_Select('user_page', $page_arr, '', _t('选择页面'), _t('此页面用来展示虾米专辑或精选集。'));
     $form->addInput($user_page);
     $user_type = new Typecho_Widget_Helper_Form_Element_Select('user_type', array('all' => '所有', 'collects' => '精选集', 'albums' => '专辑'), 'all', _t('同步选择'), _t('默认选择“全部”,同步精选集和专辑。'));
     $form->addInput($user_type);
     $user_width = new Typecho_Widget_Helper_Form_Element_Text('user_width', NULL, '', _t('页面宽度'), _t('如果与主题宽度不一致可以试着调节此项。默认使用主题上层结构宽度。'));
     $user_width->addRule('isInteger', _t('填写的宽度ID必须为数字'));
     $form->addInput($user_width);
     $user_fullwidth = new Typecho_Widget_Helper_Form_Element_Radio('user_fullwidth', array('0' => '页面宽度', '1' => '浏览器宽度'), '0', _t('专辑预览宽度'), _t('如果与主题宽度不一致可以试着调节此项。默认选择页面宽度。'));
     $form->addInput($user_fullwidth);
 }
Exemple #24
0
 /**
  * 获取插件配置面板
  * 
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     Avatars_Plugin::form()->setAttribute('style', 'position:relative;bottom:-627px;left:217px;')->render();
     echo "<div style='color:#999;font-size:0.92857em;font-weight:bold;'><p>在模版适当位置插入代码<span style='color:#467B96;font-weight:bold'>&lt;?php Avatars_Plugin::output('<span style='color:#E47E00;'>li</span>','<span style='color:#E47E00;'>mostactive</span>'); ?&gt;</span>, 或在页面内容<br/>写入标签<span style='color:#467B96;font-weight:bold'>[AVATARS|<span style='color:#E47E00;'>li</span>|<span style='color:#E47E00;'>mostactive</span>]</span>均可. 橙色部分为自定义tag名(如span, div, p等)和class名. </p></div>";
     $listnumber = new Typecho_Widget_Helper_Form_Element_Text('listnumber', NULL, '10', '读者墙头像数目', '设置最多显示多少个评论者头像');
     $listnumber->input->setAttribute('class', 'mini');
     $form->addInput($listnumber->addRule('isInteger', '请填入一个数字'));
     $since = new Typecho_Widget_Helper_Form_Element_Text('since', NULL, '30', '读者墙收录时间', '设置显示多少*天*以内的评论者头像');
     $since->input->setAttribute('class', 'mini');
     $form->addInput($since->addRule('isInteger', '请填入一个数字'));
     $altword = new Typecho_Widget_Helper_Form_Element_Text('altword', NULL, '条评论', '读者墙提示文字', '设置评论者头像上的评论数提示后缀');
     $altword->input->setAttribute('class', 'mini');
     $form->addInput($altword);
     $avsize = new Typecho_Widget_Helper_Form_Element_Text('avsize', NULL, '32', '读者墙头像尺寸', '设置读者墙显示的gravatar头像大小(*px*)');
     $avsize->input->setAttribute('class', 'mini');
     $form->addInput($avsize->addRule('isInteger', '请填入一个数字'));
     $avdefault = new Typecho_Widget_Helper_Form_Element_Text('avdefault', NULL, '', '读者墙缺省头像', '设置没有gravatar头像的读者显示图片url(注意与上一项尺寸一致)');
     $avdefault->input->setAttribute('style', 'width:550px;');
     $form->addInput($avdefault->addRule('url', '请填入一个url地址'));
     $avcache = new Typecho_Widget_Helper_Form_Element_Radio('avcache', array('false' => '否', 'true' => '是'), 'false', '读者墙开启缓存', '开启后若修改了以上两项设置请点击清空缓存重新生成');
     $form->addInput($avcache);
 }
Exemple #25
0
 /**
  * 获取插件配置面板
  *
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $mail = new Typecho_Widget_Helper_Form_Element_Text('mail', NULL, NULL, _t('接收邮箱'), _t('接收邮件用的信箱,如为空则使用文章作者个人设置中的邮箱!'));
     $form->addInput($mail->addRule('email', _t('请填写正确的邮箱!')));
     $status = new Typecho_Widget_Helper_Form_Element_Checkbox('status', array('approved' => '提醒已通过评论', 'waiting' => '提醒待审核评论', 'spam' => '提醒垃圾评论'), array('approved', 'waiting'), '提醒设置', _t('该选项仅针对博主,访客只发送已通过的评论。'));
     $form->addInput($status);
     $other = new Typecho_Widget_Helper_Form_Element_Checkbox('other', array('to_owner' => '有评论及回复时,发邮件通知博主。', 'to_guest' => '评论被回复时,发邮件通知评论者。', 'to_me' => '自己回复自己的评论时,发邮件通知。(同时针对博主和访客)', 'to_log' => '记录邮件发送日志。'), array('to_owner', 'to_guest'), '其他设置', _t('如果选上"记录邮件发送日志"选项,则会在./CommentMailPlus/mail_log.php 文件中记录发送信息。<br />
                 关键性错误日志将自动记录到./CommentMailPlus/error_log.php文件中。<br />
                 '));
     $form->addInput($other->multiMode());
     $key = new Typecho_Widget_Helper_Form_Element_Text('key', NULL, 'key-', _t('Mailgun API 密钥'), _t('请填写在<a href="https://mailgun.com/">Mailgun</a>申请的密钥'));
     $form->addInput($key->addRule('required', _t('密钥不能为空')));
     $domain = new Typecho_Widget_Helper_Form_Element_Text('domain', NULL, 'samples.mailgun.org', _t('Mailgun域名'), _t('请填写您的邮件域名'));
     $form->addInput($domain->addRule('required', _t('邮件域名不能为空')));
     $mailAddress = new Typecho_Widget_Helper_Form_Element_Text('mailAddress', NULL, '*****@*****.**', _t('发件人邮箱'));
     $form->addInput($mailAddress->addRule('required', _t('发件人邮箱不能为空')));
     $senderName = new Typecho_Widget_Helper_Form_Element_Text('senderName', NULL, '评论提醒', _t('发件人显示名'));
     $form->addInput($senderName);
     $titleForOwner = new Typecho_Widget_Helper_Form_Element_Text('titleForOwner', null, "[{site}]:《{title}》有新的评论", _t('博主接收邮件标题'));
     $form->addInput($titleForOwner);
     $titleForGuest = new Typecho_Widget_Helper_Form_Element_Text('titleForGuest', null, "[{site}]:您在《{title}》的评论有了回复", _t('访客接收邮件标题'));
     $form->addInput($titleForGuest);
 }
Exemple #26
0
 /**
  * 输出表单结构
  *
  * @access public
  * @return Typecho_Widget_Helper_Form
  */
 public function form()
 {
     /** 构建表格 */
     $form = new Typecho_Widget_Helper_Form($this->security->getRootUrl('index.php/action/options-permalink'), Typecho_Widget_Helper_Form::POST_METHOD);
     if (!defined('__TYPECHO_REWRITE__')) {
         /** 是否使用地址重写功能 */
         $rewrite = new Typecho_Widget_Helper_Form_Element_Radio('rewrite', array('0' => _t('不启用'), '1' => _t('启用')), $this->options->rewrite, _t('是否使用地址重写功能'), _t('地址重写即 rewrite 功能是某些服务器软件提供的优化内部连接的功能.') . '<br />' . _t('打开此功能可以让你的链接看上去完全是静态地址.'));
         // disable rewrite check when rewrite opened
         if (!$this->options->rewrite && !$this->request->is('enableRewriteAnyway=1')) {
             $errorStr = _t('重写功能检测失败, 请检查你的服务器设置');
             /** 如果是apache服务器, 可能存在无法写入.htaccess文件的现象 */
             if ((isset($_SERVER['SERVER_SOFTWARE']) && false !== strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'apache') || function_exists('apache_get_version')) && !file_exists(__TYPECHO_ROOT_DIR__ . '/.htaccess') && !is_writeable(__TYPECHO_ROOT_DIR__)) {
                 $errorStr .= '<br /><strong>' . _t('我们检测到你使用了apache服务器, 但是程序无法在根目录创建.htaccess文件, 这可能是产生这个错误的原因.') . _t('请调整你的目录权限, 或者手动创建一个.htaccess文件.') . '</strong>';
             }
             $errorStr .= '<br /><input type="checkbox" name="enableRewriteAnyway" id="enableRewriteAnyway" value="1" />' . ' <label for="enableRewriteAnyway">' . _t('如果你仍然想启用此功能, 请勾选这里') . '</label>';
             $rewrite->addRule(array($this, 'checkRewrite'), $errorStr);
         }
         $form->addInput($rewrite);
     }
     $patterns = array('/archives/[cid:digital]/' => _t('默认风格') . ' <code>/archives/{cid}/</code>', '/archives/[slug].html' => _t('wordpress风格') . ' <code>/archives/{slug}.html</code>', '/[year:digital:4]/[month:digital:2]/[day:digital:2]/[slug].html' => _t('按日期归档') . ' <code>/archives/{year}/{month}/{day}/{slug}.html</code>', '/[category]/[slug].html' => _t('按分类归档') . ' <code>/{category}/{slug}.html</code>');
     /** 自定义文章路径 */
     $postPatternValue = $this->options->routingTable['post']['url'];
     /** 增加个性化路径 */
     $customPatternValue = NULL;
     if (isset($this->request->__typecho_form_item_postPattern)) {
         $customPatternValue = $this->request->__typecho_form_item_postPattern;
         Typecho_Cookie::delete('__typecho_form_item_postPattern');
     } else {
         if (!isset($patterns[$postPatternValue])) {
             $customPatternValue = $this->decodeRule($postPatternValue);
         }
     }
     $patterns['custom'] = _t('个性化定义') . ' <input type="text" class="w-50 text-s mono" name="customPattern" value="' . $customPatternValue . '" />';
     $postPattern = new Typecho_Widget_Helper_Form_Element_Radio('postPattern', $patterns, $postPatternValue, _t('自定义文章路径'), _t('可用参数: <code>{cid}</code> 日志 ID, <code>{slug}</code> 日志缩略名, <code>{category}</code> 分类, <code>{directory}</code> 多级分类, <code>{year}</code> 年, <code>{month}</code> 月, <code>{day}</code> 日') . '<br />' . _t('选择一种合适的文章静态路径风格, 使得你的网站链接更加友好.') . '<br />' . _t('一旦你选择了某种链接风格请不要轻易修改它.'));
     if ($customPatternValue) {
         $postPattern->value('custom');
     }
     $form->addInput($postPattern->multiMode());
     /** 独立页面后缀名 */
     $pagePattern = new Typecho_Widget_Helper_Form_Element_Text('pagePattern', NULL, $this->decodeRule($this->options->routingTable['page']['url']), _t('独立页面路径'), _t('可用参数: <code>{cid}</code> 页面 ID, <code>{slug}</code> 页面缩略名') . '<br />' . _t('请在路径中至少包含上述的一项参数.'));
     $pagePattern->input->setAttribute('class', 'mono w-60');
     $form->addInput($pagePattern->addRule(array($this, 'checkPagePattern'), _t('独立页面路径中没有包含 {cid} 或者 {slug} ')));
     /** 分类页面 */
     $categoryPattern = new Typecho_Widget_Helper_Form_Element_Text('categoryPattern', NULL, $this->decodeRule($this->options->routingTable['category']['url']), _t('分类路径'), _t('可用参数: <code>{mid}</code> 分类 ID, <code>{slug}</code> 分类缩略名, <code>{directory}</code> 多级分类') . '<br />' . _t('请在路径中至少包含上述的一项参数.'));
     $categoryPattern->input->setAttribute('class', 'mono w-60');
     $form->addInput($categoryPattern->addRule(array($this, 'checkCategoryPattern'), _t('分类路径中没有包含 {mid} 或者 {slug} ')));
     /** 提交按钮 */
     $submit = new Typecho_Widget_Helper_Form_Element_Submit('submit', NULL, _t('保存设置'));
     $submit->input->setAttribute('class', 'btn primary');
     $form->addItem($submit);
     return $form;
 }
Exemple #27
0
 /**
  * 获取插件配置面板
  *
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $mode = new Typecho_Widget_Helper_Form_Element_Radio('mode', array('smtp' => 'smtp', 'mail' => 'mail()', 'sendmail' => 'sendmail()'), 'smtp', '发信方式');
     $form->addInput($mode);
     $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);
     $fromName = new Typecho_Widget_Helper_Form_Element_Text('fromName', NULL, NULL, _t('发件人名称'), _t('发件人名称,留空则使用博客标题'));
     $form->addInput($fromName);
     $mail = new Typecho_Widget_Helper_Form_Element_Text('mail', NULL, NULL, _t('接收邮件的地址'), _t('接收邮件的地址,如为空则使用文章作者个人设置中的邮件地址!'));
     $form->addInput($mail->addRule('email', _t('请填写正确的邮件地址!')));
     $contactme = new Typecho_Widget_Helper_Form_Element_Text('contactme', NULL, NULL, _t('模板中“联系我”的邮件地址'), _t('联系我用的邮件地址,如为空则使用文章作者个人设置中的邮件地址!'));
     $form->addInput($contactme->addRule('email', _t('请填写正确的邮件地址!')));
     $status = new Typecho_Widget_Helper_Form_Element_Checkbox('status', array('approved' => '提醒已通过评论', 'waiting' => '提醒待审核评论', 'spam' => '提醒垃圾评论'), array('approved', 'waiting'), '提醒设置', _t('该选项仅针对博主,访客只发送已通过的评论。'));
     $form->addInput($status);
     $other = new Typecho_Widget_Helper_Form_Element_Checkbox('other', array('to_owner' => '有评论及回复时,发邮件通知博主。', 'to_guest' => '评论被回复时,发邮件通知评论者。', 'to_me' => '自己回复自己的评论时,发邮件通知。(同时针对博主和访客)', 'to_log' => '记录邮件发送日志。'), array('to_owner', 'to_guest'), '其他设置', _t('选中该选项插件会在log/mailer_log.txt 文件中记录发送日志。'));
     $form->addInput($other->multiMode());
     $titleForOwner = new Typecho_Widget_Helper_Form_Element_Text('titleForOwner', null, "[{title}] 一文有新的评论", _t('博主接收邮件标题'));
     $form->addInput($titleForOwner->addRule('required', _t('博主接收邮件标题 不能为空')));
     $titleForGuest = new Typecho_Widget_Helper_Form_Element_Text('titleForGuest', null, "您在 [{title}] 的评论有了回复", _t('访客接收邮件标题'));
     $form->addInput($titleForGuest->addRule('required', _t('访客接收邮件标题 不能为空')));
 }
    /**
     * 输出表单结构
     *
     * @access public
     * @return Typecho_Widget_Helper_Form
     */
    public function form()
    {
        /** 构建表格 */
        $form = new Typecho_Widget_Helper_Form($this->security->getIndex('/action/options-reading'), Typecho_Widget_Helper_Form::POST_METHOD);
        /** 文章日期格式 */
        $postDateFormat = new Typecho_Widget_Helper_Form_Element_Text('postDateFormat', NULL, $this->options->postDateFormat, _t('文章日期格式'), _t('此格式用于指定显示在文章归档中的日期默认显示格式.') . '<br />' . _t('在某些主题中这个格式可能不会生效, 因为主题作者可以自定义日期格式.') . '<br />' . _t('请参考 <a href="http://www.php.net/manual/zh/function.date.php">PHP 日期格式写法</a>.'));
        $postDateFormat->input->setAttribute('class', 'w-40 mono');
        $form->addInput($postDateFormat->addRule('xssCheck', _t('请不要在日期格式中使用特殊字符')));
        //首页显示
        $frontPageParts = explode(':', $this->options->frontPage);
        $frontPageType = $frontPageParts[0];
        $frontPageValue = count($frontPageParts) > 1 ? $frontPageParts[1] : '';
        $frontPageOptions = array('recent' => _t('显示最新发布的文章'));
        $frontPattern = '</label></span><span class="multiline front-archive%class%">' . '<input type="checkbox" id="frontArchive" name="frontArchive" value="1"' . ($this->options->frontArchive && 'recent' != $frontPageType ? ' checked' : '') . ' />
<label for="frontArchive">' . _t('同时将文章列表页路径更改为 %s', '<input type="text" name="archivePattern" class="w-20 mono" value="' . htmlspecialchars($this->decodeRule($this->options->routingTable['archive']['url'])) . '" />') . '</label>';
        // 页面列表
        $pages = $this->db->fetchAll($this->db->select('cid', 'title')->from('table.contents')->where('type = ?', 'page')->where('status = ?', 'publish')->where('created < ?', $this->options->gmtTime));
        if (!empty($pages)) {
            $pagesSelect = '<select name="frontPagePage" id="frontPage-frontPagePage">';
            foreach ($pages as $page) {
                $selected = '';
                if ('page' == $frontPageType && $page['cid'] == $frontPageValue) {
                    $selected = ' selected="true"';
                }
                $pagesSelect .= '<option value="' . $page['cid'] . '"' . $selected . '>' . $page['title'] . '</option>';
            }
            $pagesSelect .= '</select>';
            $frontPageOptions['page'] = _t('使用 %s 页面作为首页', '</label>' . $pagesSelect . '<label for="frontPage-frontPagePage">');
            $selectedFrontPageType = 'page';
        }
        // 自定义文件列表
        $files = glob($this->options->themeFile($this->options->theme, '*.php'));
        $filesSelect = '';
        foreach ($files as $file) {
            $info = Typecho_Plugin::parseInfo($file);
            $file = basename($file);
            if ('index.php' != $file && 'index' == $info['title']) {
                $selected = '';
                if ('file' == $frontPageType && $file == $frontPageValue) {
                    $selected = ' selected="true"';
                }
                $filesSelect .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>';
            }
        }
        if (!empty($filesSelect)) {
            $frontPageOptions['file'] = _t('直接调用 %s 模板文件', '</label><select name="frontPageFile" id="frontPage-frontPageFile">' . $filesSelect . '</select><label for="frontPage-frontPageFile">');
            $selectedFrontPageType = 'file';
        }
        if (isset($frontPageOptions[$frontPageType]) && 'recent' != $frontPageType && isset($selectedFrontPageType)) {
            $selectedFrontPageType = $frontPageType;
            $frontPattern = str_replace('%class%', '', $frontPattern);
        }
        if (isset($selectedFrontPageType)) {
            $frontPattern = str_replace('%class%', ' hidden', $frontPattern);
            $frontPageOptions[$selectedFrontPageType] .= $frontPattern;
        }
        $frontPage = new Typecho_Widget_Helper_Form_Element_Radio('frontPage', $frontPageOptions, $frontPageType, _t('站点首页'));
        $form->addInput($frontPage->multiMode());
        /** 文章列表数目 */
        $postsListSize = new Typecho_Widget_Helper_Form_Element_Text('postsListSize', NULL, $this->options->postsListSize, _t('文章列表数目'), _t('此数目用于指定显示在侧边栏中的文章列表数目.'));
        $postsListSize->input->setAttribute('class', 'w-20');
        $form->addInput($postsListSize->addRule('isInteger', _t('请填入一个数字')));
        /** 每页文章数目 */
        $pageSize = new Typecho_Widget_Helper_Form_Element_Text('pageSize', NULL, $this->options->pageSize, _t('每页文章数目'), _t('此数目用于指定文章归档输出时每页显示的文章数目.'));
        $pageSize->input->setAttribute('class', 'w-20');
        $form->addInput($pageSize->addRule('isInteger', _t('请填入一个数字')));
        /** FEED全文输出 */
        $feedFullText = new Typecho_Widget_Helper_Form_Element_Radio('feedFullText', array('0' => _t('仅输出摘要'), '1' => _t('全文输出')), $this->options->feedFullText, _t('聚合全文输出'), _t('如果你不希望在聚合中输出文章全文,请使用仅输出摘要选项.') . '<br />' . _t('摘要的文字取决于你在文章中使用分隔符的位置.'));
        $form->addInput($feedFullText);
        /** 提交按钮 */
        $submit = new Typecho_Widget_Helper_Form_Element_Submit('submit', NULL, _t('保存设置'));
        $submit->input->setAttribute('class', 'btn primary');
        $form->addItem($submit);
        return $form;
    }
Exemple #29
0
 /**
  * 获取插件配置面板
  * 
  * @access public
  * @param Typecho_Widget_Helper_Form $form 配置面板
  * @return void
  */
 public static function config(Typecho_Widget_Helper_Form $form)
 {
     $domainName = new Typecho_Widget_Helper_Form_Element_Text('saestoragedomain', NULL, 'typechoupload', _t('Domain名称'), _t('请您在 <a href="http://sae.sina.com.cn/?m=storage&app_id=' . $_SERVER['HTTP_APPNAME'] . '" target="_blank">Sina App Engine控制面板</a> 中创建Storage的Domain: 名称固定为 <strong>typechoupload</strong>'));
     $form->addInput($domainName->addRule(array('SaeUpload_Plugin', 'validateDomainName'), _t('Domain名称错误,或者未上传文件!')));
 }
Exemple #30
0
 /**
  * 输出表单结构
  *
  * @access public
  * @return Typecho_Widget_Helper_Form
  */
 public function form()
 {
     /** 构建表格 */
     $form = new Typecho_Widget_Helper_Form($this->security->getIndex('/action/options-discussion'), Typecho_Widget_Helper_Form::POST_METHOD);
     /** 评论日期格式 */
     $commentDateFormat = new Typecho_Widget_Helper_Form_Element_Text('commentDateFormat', NULL, $this->options->commentDateFormat, _t('评论日期格式'), _t('这是一个默认的格式,当你在模板中调用显示评论日期方法时, 如果没有指定日期格式, 将按照此格式输出.') . '<br />' . _t('具体写法请参考 <a href="http://www.php.net/manual/zh/function.date.php">PHP 日期格式写法</a>.'));
     $commentDateFormat->input->setAttribute('class', 'w-40 mono');
     $form->addInput($commentDateFormat);
     /** 评论列表数目 */
     $commentsListSize = new Typecho_Widget_Helper_Form_Element_Text('commentsListSize', NULL, $this->options->commentsListSize, _t('评论列表数目'), _t('此数目用于指定显示在侧边栏中的评论列表数目.'));
     $commentsListSize->input->setAttribute('class', 'w-20');
     $form->addInput($commentsListSize->addRule('isInteger', _t('请填入一个数字')));
     $commentsShowOptions = array('commentsShowCommentOnly' => _t('仅显示评论, 不显示 Pingback 和 Trackback'), 'commentsMarkdown' => _t('在评论中使用Markdown语法'), 'commentsShowUrl' => _t('评论者名称显示时自动加上其个人主页链接'), 'commentsUrlNofollow' => _t('对评论者个人主页链接使用 <a href="http://en.wikipedia.org/wiki/Nofollow">nofollow 属性</a>'), 'commentsAvatar' => _t('启用 <a href="http://gravatar.com">Gravatar</a> 头像服务, 最高显示评级为 %s 的头像', '</label><select id="commentsShow-commentsAvatarRating" name="commentsAvatarRating">
         <option value="G"' . ('G' == $this->options->commentsAvatarRating ? ' selected="true"' : '') . '>G - 普通</option>
         <option value="PG"' . ('PG' == $this->options->commentsAvatarRating ? ' selected="true"' : '') . '>PG - 13岁以上</option>
         <option value="R"' . ('R' == $this->options->commentsAvatarRating ? ' selected="true"' : '') . '>R - 17岁以上成人</option>
         <option value="X"' . ('X' == $this->options->commentsAvatarRating ? ' selected="true"' : '') . '>X - 限制级</option></select>
         <label for="commentsShow-commentsAvatarRating">'), 'commentsPageBreak' => _t('启用分页, 并且每页显示 %s 篇评论, 在列出时将 %s 作为默认显示', '</label><input type="text" value="' . $this->options->commentsPageSize . '" class="text num text-s" id="commentsShow-commentsPageSize" name="commentsPageSize" /><label for="commentsShow-commentsPageSize">', '</label><select id="commentsShow-commentsPageDisplay" name="commentsPageDisplay">
         <option value="first"' . ('first' == $this->options->commentsPageDisplay ? ' selected="true"' : '') . '>' . _t('第一页') . '</option>
         <option value="last"' . ('last' == $this->options->commentsPageDisplay ? ' selected="true"' : '') . '>' . _t('最后一页') . '</option></select>' . '<label for="commentsShow-commentsPageDisplay">'), 'commentsThreaded' => _t('启用评论回复, 以 %s 层作为每个评论最多的回复层数', '</label><input name="commentsMaxNestingLevels" type="text" class="text num text-s" value="' . $this->options->commentsMaxNestingLevels . '" id="commentsShow-commentsMaxNestingLevels" />
         <label for="commentsShow-commentsMaxNestingLevels">') . '</label></span><span class="multiline">' . _t('将 %s 的评论显示在前面', '<select id="commentsShow-commentsOrder" name="commentsOrder">
         <option value="DESC"' . ('DESC' == $this->options->commentsOrder ? ' selected="true"' : '') . '>' . _t('较新的') . '</option>
         <option value="ASC"' . ('ASC' == $this->options->commentsOrder ? ' selected="true"' : '') . '>' . _t('较旧的') . '</option></select><label for="commentsShow-commentsOrder">'));
     $commentsShowOptionsValue = array();
     if ($this->options->commentsShowCommentOnly) {
         $commentsShowOptionsValue[] = 'commentsShowCommentOnly';
     }
     if ($this->options->commentsMarkdown) {
         $commentsShowOptionsValue[] = 'commentsMarkdown';
     }
     if ($this->options->commentsShowUrl) {
         $commentsShowOptionsValue[] = 'commentsShowUrl';
     }
     if ($this->options->commentsUrlNofollow) {
         $commentsShowOptionsValue[] = 'commentsUrlNofollow';
     }
     if ($this->options->commentsAvatar) {
         $commentsShowOptionsValue[] = 'commentsAvatar';
     }
     if ($this->options->commentsPageBreak) {
         $commentsShowOptionsValue[] = 'commentsPageBreak';
     }
     if ($this->options->commentsThreaded) {
         $commentsShowOptionsValue[] = 'commentsThreaded';
     }
     $commentsShow = new Typecho_Widget_Helper_Form_Element_Checkbox('commentsShow', $commentsShowOptions, $commentsShowOptionsValue, _t('评论显示'));
     $form->addInput($commentsShow->multiMode());
     /** 评论提交 */
     $commentsPostOptions = array('commentsRequireModeration' => _t('所有评论必须经过审核'), 'commentsWhitelist' => _t('评论者之前须有评论通过了审核'), 'commentsRequireMail' => _t('必须填写邮箱'), 'commentsRequireURL' => _t('必须填写网址'), 'commentsCheckReferer' => _t('检查评论来源页 URL 是否与文章链接一致'), 'commentsAntiSpam' => _t('开启反垃圾保护'), 'commentsAutoClose' => _t('在文章发布 %s 天以后自动关闭评论', '</label><input name="commentsPostTimeout" type="text" class="text num text-s" value="' . intval($this->options->commentsPostTimeout / (24 * 3600)) . '" id="commentsPost-commentsPostTimeout" />
         <label for="commentsPost-commentsPostTimeout">'), 'commentsPostIntervalEnable' => _t('同一 IP 发布评论的时间间隔限制为 %s 分钟', '</label><input name="commentsPostInterval" type="text" class="text num text-s" value="' . round($this->options->commentsPostInterval / 60, 1) . '" id="commentsPost-commentsPostInterval" />
         <label for="commentsPost-commentsPostInterval">'));
     $commentsPostOptionsValue = array();
     if ($this->options->commentsRequireModeration) {
         $commentsPostOptionsValue[] = 'commentsRequireModeration';
     }
     if ($this->options->commentsWhitelist) {
         $commentsPostOptionsValue[] = 'commentsWhitelist';
     }
     if ($this->options->commentsRequireMail) {
         $commentsPostOptionsValue[] = 'commentsRequireMail';
     }
     if ($this->options->commentsRequireURL) {
         $commentsPostOptionsValue[] = 'commentsRequireURL';
     }
     if ($this->options->commentsCheckReferer) {
         $commentsPostOptionsValue[] = 'commentsCheckReferer';
     }
     if ($this->options->commentsAntiSpam) {
         $commentsPostOptionsValue[] = 'commentsAntiSpam';
     }
     if ($this->options->commentsAutoClose) {
         $commentsPostOptionsValue[] = 'commentsAutoClose';
     }
     if ($this->options->commentsPostIntervalEnable) {
         $commentsPostOptionsValue[] = 'commentsPostIntervalEnable';
     }
     $commentsPost = new Typecho_Widget_Helper_Form_Element_Checkbox('commentsPost', $commentsPostOptions, $commentsPostOptionsValue, _t('评论提交'));
     $form->addInput($commentsPost->multiMode());
     /** 允许使用的HTML标签和属性 */
     $commentsHTMLTagAllowed = new Typecho_Widget_Helper_Form_Element_Textarea('commentsHTMLTagAllowed', NULL, $this->options->commentsHTMLTagAllowed, _t('允许使用的HTML标签和属性'), _t('默认的用户评论不允许填写任何的HTML标签, 你可以在这里填写允许使用的HTML标签.') . '<br />' . _t('比如: %s', ': <code>&lt;a href=&quot;&quot;&gt; &lt;img src=&quot;&quot;&gt; &lt;blockquote&gt;</code>'));
     $commentsHTMLTagAllowed->input->setAttribute('class', 'mono');
     $form->addInput($commentsHTMLTagAllowed);
     /** 提交按钮 */
     $submit = new Typecho_Widget_Helper_Form_Element_Submit('submit', NULL, _t('保存设置'));
     $submit->input->setAttribute('class', 'btn primary');
     $form->addItem($submit);
     return $form;
 }