/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $type = new Typecho_Widget_Helper_Form_Element_Radio('type', array('1' => '使用自带样式', '2' => '使用自填样式'), '1', _t('角色样式选择'), _t('如选择自填样式,则在角色名称那边带入样式')); $form->addInput($type); //角色1 $name_1 = new Typecho_Widget_Helper_Form_Element_Text('name_1', NULL, '博主', _t('角色1'), _t('填入角色1的名称')); $form->addInput($name_1); $color_1 = new Typecho_Widget_Helper_Form_Element_Text('color_1', NULL, '#1ba1e2', _t('角色1样式颜色'), _t('填入颜色代码,只有使用自带样式时才生效')); $form->addInput($color_1); $email_1 = new Typecho_Widget_Helper_Form_Element_Textarea('email_1', NULL, '', _t('邮箱地址列表1'), _t('每个邮箱地址之间以英文半角逗号隔开')); $form->addInput($email_1); //角色2 $name_2 = new Typecho_Widget_Helper_Form_Element_Text('name_2', NULL, '好友', _t('角色2'), _t('填入角色2的名称')); $form->addInput($name_2); $color_2 = new Typecho_Widget_Helper_Form_Element_Text('color_2', NULL, '#1ba1e2', _t('角色2样式颜色'), _t('填入颜色代码,只有使用自带样式时才生效')); $form->addInput($color_2); $email_2 = new Typecho_Widget_Helper_Form_Element_Textarea('email_2', NULL, '', _t('邮箱地址列表2'), _t('每个邮箱地址之间以英文半角逗号隔开')); $form->addInput($email_2); //角色3 $name_3 = new Typecho_Widget_Helper_Form_Element_Text('name_3', NULL, '', _t('角色3'), _t('填入角色3的名称')); $form->addInput($name_3); $color_3 = new Typecho_Widget_Helper_Form_Element_Text('color_3', NULL, '#1ba1e2', _t('角色3样式颜色'), _t('填入颜色代码,只有使用自带样式时才生效')); $form->addInput($color_3); $email_3 = new Typecho_Widget_Helper_Form_Element_Textarea('email_3', NULL, '', _t('邮箱地址列表3'), _t('每个邮箱地址之间以英文半角逗号隔开')); $form->addInput($email_3); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $editorThemeOptions = array('default' => '默认风格', 'simple' => '简洁风格', 'qq' => 'QQ风格'); $editorTheme = new Typecho_Widget_Helper_Form_Element_Select('editorTheme', $editorThemeOptions, 'default', _t('皮肤')); $editorLangOptions = array('zh_CN' => '中文简体', 'en' => 'English'); $editorLang = new Typecho_Widget_Helper_Form_Element_Select('editorLang', $editorLangOptions, 'zh_CN', '语言'); $line = new Typecho_Widget_Helper_Layout('hr'); $editorNewlineTagOptions = array('br' => '新开始行', 'p' => '新开始段落'); $editorNewlineTag = new Typecho_Widget_Helper_Form_Element_Radio('editorNewlineTag', $editorNewlineTagOptions, 'p', _t('回车处理')); $editorPasteTypeOptions = array('0' => '禁止', '1' => '纯文本', '2' => 'HTML'); $editorPasteType = new Typecho_Widget_Helper_Form_Element_Radio('editorPasteType', $editorPasteTypeOptions, '2', _t('粘贴类型')); $editorToolsOptions = array('source' => 'HTML代码', '|' => '分隔', 'undo' => '后退', 'redo' => '前进', '|1' => '分隔', 'preview' => '预览', 'wordpaste' => '从Word粘贴', 'print' => '打印', 'template' => '插入模板', 'code' => '插入程序代码', 'cut' => '剪切', 'copy' => ' 复制', 'paste' => '粘贴', 'plainpaste' => '粘贴为无格式文本', '|2' => '分隔', 'selectall' => '全选', 'justifyleft' => '左对齐', 'justifycenter' => '居中', 'justifyright' => '右对齐', 'justifyfull' => '两端对齐', 'insertorderedlist' => '编号', 'insertunorderedlist' => '项目符号', 'indent' => '增加缩进', 'outdent' => '减少缩进', 'subscript' => '下标', 'superscript' => '上标', 'removeformat' => '删除格式', 'quickformat' => '一键排版', '|3' => '分隔', 'formatblock' => '段落', 'fontname' => '字体', 'fontsize' => '文字大小', '|3' => '分隔', 'forecolor' => '文字颜色', 'hilitecolor' => '文字背景', 'bold' => '粗体', 'italic' => '斜体', 'underline' => '下划线', 'strikethrough' => '删除线', '|5' => '分隔', 'image' => '图片', 'flash' => 'Flash', 'media' => '视音频', 'table' => '表格', 'hr' => '插入横线', 'emoticons' => '插入表情', 'link' => '超级链接', 'unlink' => '取消超级链接', 'fullscreen' => '全屏显示', 'map' => 'Google地图', 'baidumap' => '百度地图', 'lineheight' => '行距', 'clearhtml' => '清理HTML代码', 'pagebreak' => ' 插入分页符', 'anchor' => '插入锚点', 'insertfile' => '插入文件', '|6' => '分隔', 'about' => '关于'); $editorToolsDescription = _t('仅在默认风格有效!'); $editorTools = new Typecho_Widget_Helper_Form_Element_Checkbox('editorTools', $editorToolsOptions, array('fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link'), _t('工具栏'), $editorToolsDescription); $form->addInput($editorTheme); $form->addInput($editorLang); $form->addItem($line); $form->addInput($editorNewlineTag); $form->addInput($editorPasteType); $form->addItem($line); $form->addInput($editorTools); $form->addItem($line); echo <<<EOF <style> #typecho-option-item-editorTools-4 span{width:24%;display:inline-block;margin-right:0;} </style> EOF; }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { // 文本输入框 $text = new Typecho_Widget_Helper_Form_Element_Text('text', NULL, '默认值', _t('标题'), _t('提示文字')); // 多行文本输入框 $textarea = new Typecho_Widget_Helper_Form_Element_Textarea('textarea', NULL, '默认值', _t('标题'), _t('提示文字')); // 密码输入框 $password = new Typecho_Widget_Helper_Form_Element_Password('password', NULL, NULL, _t('标题'), _t('提示文字')); // 单选框 $radio = new Typecho_Widget_Helper_Form_Element_Radio('radio', array('选项值1' => _t('选项1说明'), '选项值2' => _t('选项2说明')), '默认值', _t('标题'), _t('提示文字')); // 多选框 $checkbox = new Typecho_Widget_Helper_Form_Element_Checkbox('checkbox', array('选项值1' => _t('选项1说明'), '选项值2' => _t('选项2说明')), '默认值', _t('标题'), _t('提示文字')); // 下拉选择框 $select = new Typecho_Widget_Helper_Form_Element_Select('select', array('选项值1' => _t('选项1说明'), '选项值2' => _t('选项2说明')), '默认值', _t('标题'), _t('提示文字')); /* 添加表单验证规则 */ // $text->addRule('isInteger', _t('text必须是纯数字')); // $form->addInput($text->addRule('isInteger', _t('text必须是纯数字'))); // $element->addRule('xssCheck', _t('请不要使用特殊字符')); // $password->addRule('required', _t('密码不可为空')); // $password->addRule('minLength', _t('为了保证账户安全, 请输入至少六位的密码'), 6); // $confirm->addRule('confirm', _t('两次输入的密码不一致'), 'password'); // $url->addRule('url', _t('个人主页地址格式错误')); // $mail->addRule('required', _t('必须填写电子邮箱')); // $mail->addRule(array($this, 'mailExists'), _t('电子邮箱地址已经存在')); // $mail->addRule('email', _t('电子邮箱格式错误')); $form->addInput($text); $form->addInput($textarea); $form->addInput($password); $form->addInput($radio); $form->addInput($checkbox); $form->addInput($select); }
public static function config(Typecho_Widget_Helper_Form $form) { $pageSize = new Typecho_Widget_Helper_Form_Element_Text('pageSize', null, '', '分页数量', '每页显示的日志数量'); $isDrop = new Typecho_Widget_Helper_Form_Element_Radio('isDrop', array('0' => '删除', '1' => '不删除'), '', '删除数据表:', '请选择是否在禁用插件时,删除日志数据表'); $form->addInput($pageSize); $form->addInput($isDrop); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $gravatar = new Typecho_Widget_Helper_Form_Element_Radio('gravatar', array('1' => _t('开启'), '0' => _t('关闭')), '1', _t('Gravatar 头像加速'), _t('会帮您把默认的 Gravatar 源替换到 MoeCDN Gravatar 源。此版本的 MoeCDN 将自动选择最适协议。')); $form->addInput($gravatar); $gapi = new Typecho_Widget_Helper_Form_Element_Radio('gapi', array('1' => _t('开启'), '0' => _t('关闭')), '1', _t('Google API 加速'), _t('使用谷歌公共库可以加快网页加载速度,但是,众所周知的原因,在中国您不能享受这一点。然而现在,一切都不一样了。')); $form->addInput($gapi); }
/** * 获取插件配置面板 * * @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); $token = new Typecho_Widget_Helper_Form_Element_Password('token', NULL, Typecho_Common::randString(7), _t('Token'), _t('请勿泄露')); $form->addInput($token); $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 * @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) { $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('必须填写数据库用户名'))); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { echo '一个简单的、基于jQuery的图片灯箱插件。<br/>原作者:<a href="https://github.com/kirainmoe/Image-Box" target="_blank">吟梦</a>'; $jquery = new Typecho_Widget_Helper_Form_Element_Radio('jquery', array('0' => '手动加载', '1' => '自动加载'), 0, 'jQuery', '“手动加载”需要你手动加载jQuery,若选择“自动加载”,插件会自动加载jQuery,版本为1.9.1。'); $form->addInput($jquery); $Selector = new Typecho_Widget_Helper_Form_Element_Text('Selector', NULL, 'div img', _t('选择器'), _t('(默认div img)请根据你的主题输入适合的值,默认值已经适合大部分情况。<a href="http://www.w3school.com.cn/jquery/jquery_ref_selectors.asp" target="_blank">jQuery选择器说明</a>')); $form->addInput($Selector); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { /** 换行符设置 */ $newlineTag = new Typecho_Widget_Helper_Form_Element_Text('newlineTag', NULL, 'br', _t('设置回车换行符'), _t('可选参数:p, br')); $form->addInput($newlineTag); $themesTab = new Typecho_Widget_Helper_Form_Element_Text('themesTab', NULL, 'default', _t('设置编辑器风格'), _t('默认风格:default')); $form->addInput($themesTab); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { /** 互联配置 */ $connect = new Typecho_Widget_Helper_Form_Element_Textarea('connect', NULL, NULL, _t('互联配置'), _t('一行一个配置,格式为:‘type:appid,appkey,title’,如:‘qq:12345678,asdiladaldns,腾讯QQ’')); $form->addInput($connect); $custom = new Typecho_Widget_Helper_Form_Element_Radio('custom', array(1 => _t('是'), 0 => '否'), 1, _t('是否需要完善资料'), _t('用户使用社会化登录后,是否需要完善昵称、邮箱等信息;选择不需要完善资料则直接使用获取到的昵称')); $form->addInput($custom); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $smiliesset = new Typecho_Widget_Helper_Form_Element_Select('smiliesset', self::parseFolders(), 'qq-smilies', _t('表情风格'), _t('插件目录下若新增表情风格文件夹可刷新本页在下拉菜单中选择. <br/>注意图片名须参考其他文件夹保持一致, 如icon_cry.gif对应哭泣表情等')); $form->addInput($smiliesset); // jquery地址 $jquery = new Typecho_Widget_Helper_Form_Element_Text('jquery', NULL, 'http://apps.bdimg.com/libs/jquery/1.11.1/jquery.min.js', _t('Jquery地址'), _t('引用的Jquery地址,当页面未加载jquery时自动加载,默认为( http://apps.bdimg.com/libs/jquery/1.11.1/jquery.min.js )')); $form->addInput($jquery); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $color = array('desert' => _t('Desert'), 'doxy' => _t('Doxy'), 'sons-of-obsidian' => _t('Sons of obsidian'), 'sunburst' => _t('Sunburst'), 'github' => _t('Github')); $type = new Typecho_Widget_Helper_Form_Element_Select('type', $color, 'true', _t('请选择代码配色样式')); $form->addInput($type); $textarea = new Typecho_Widget_Helper_Form_Element_Textarea('custom', NULL, NULL, _t('自定义CSS代码')); $form->addInput($textarea); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $pageSize = new Typecho_Widget_Helper_Form_Element_Text('pageSize', null, 20, '分页数量', '每页显示的便签数量'); $isDrop = new Typecho_Widget_Helper_Form_Element_Radio('isDrop', array('0' => '删除', '1' => '不删除'), 1, '删除数据表:', '请选择是否在禁用插件时,删除日志数据表'); $form->addInput($pageSize); $form->addInput($isDrop); // Typecho_Widget::widget('Widget_Options')->plugin('Notes')->pageSize }
/** * 获取插件配置面板 * * @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('您使用的地址格式错误'))); }
/** * 获取duoshuo配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $end_point = new Typecho_Widget_Helper_Form_Element_Radio('end_point', array('0' => _t('api.duoshuo.com [国内]') . "\r\n", '1' => _t('api.duoshuo.org [国外]'), '2' => _t('118.144.80.201 [特殊]')), '1', _t('多说同步API节点'), _t('如果你的博客服务器DNS坏掉了,才会用到第3个,其它情况慎用')); $form->addInput($end_point); $seo_enabled = new Typecho_Widget_Helper_Form_Element_Radio('seo_enabled', array('1' => _t('开启'), '0' => _t('关闭')), '1', _t('是否动态改变文章评论数'), _t('若开启,则在评论操作时,同时改变本地文章评论数,不必修改模板中文章评论数量')); $form->addInput($seo_enabled); $sync_to_local = new Typecho_Widget_Helper_Form_Element_Radio('sync_to_local', array('1' => _t('开启'), '0' => _t('关闭')), '1', _t('是否开启主动同步功能'), _t('若开启,则不进行主动同步,手动同步不受影响')); $form->addInput($sync_to_local); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $jq_import = new Typecho_Widget_Helper_Form_Element_Radio('jq_import', array(0 => _t('不引入'), 1 => _t('引入')), 1, _t('是否引入jQuery'), _t('此插件需要jQuery,如已有选择不引入避免引入多余jQuery')); $form->addInput($jq_import->addRule('enum', _t('必须选择一个模式'), array(0, 1))); $default_pay = new Typecho_Widget_Helper_Form_Element_Text('default_pay', NULL, 'https://www.hongweipeng.com/usr/uploads/2016/09/555702225.jpg', _t('默认的二维码'), _t('该项用于用户自定义数据扩展')); $form->addInput($default_pay); $user = new Typecho_Widget_Helper_Form_Element_Textarea('authors', NULL, NULL, _t('打赏二维码信息'), _t('输入合法的json数据')); $form->addInput($user); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $compatibilityMode = new Typecho_Widget_Helper_Form_Element_Radio('compatibilityMode', array(0 => _t('不启用'), 1 => _t('启用')), 0, _t('兼容模式'), _t('兼容模式一般用于对以前没有使用Markdown语法解析的文章')); $form->addInput($compatibilityMode->addRule('enum', _t('必须选择一个模式'), array(0, 1))); $styles = array_map('basename', glob(dirname(__FILE__) . '/res/styles/*.css')); $styles = array_combine($styles, $styles); $style = new Typecho_Widget_Helper_Form_Element_Select('style', $styles, 'default.css', _t('代码配色样式')); $form->addInput($style->addRule('enum', _t('必须选择配色样式'), $styles)); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $delFields = new Typecho_Widget_Helper_Form_Element_Radio('delFields', array(0 => _t('保留数据'), 1 => _t('删除数据')), '0', _t('卸载设置'), _t('卸载插件后数据是否保留')); $form->addInput($delFields); $allow_stat = new Typecho_Widget_Helper_Form_Element_Radio('allow_stat', array(0 => _t('关闭'), 1 => _t('开启')), '1', _t('统计运行信息'), _t('是否开启运行信息统计')); $form->addInput($allow_stat); $allow_stat_mem = new Typecho_Widget_Helper_Form_Element_Radio('allow_stat_mem', array(0 => _t('关闭'), 1 => _t('开启')), '1', _t('统计内存开销'), _t('是否开启内存开销统计')); $form->addInput($allow_stat_mem); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { /** 文章页A标签点赞的class */ $likeClass = new Typecho_Widget_Helper_Form_Element_Text('likeClass', NULL, 'post-like', _t('点赞A标签的class'), _t('点赞的自定义样式,默认为.post-like。可自定义CSS样式,无需加.<br><a href="www.phoneshuo.com/PHP/typecho-like-plugin.html">使用帮助与更新</a>')); /** 是否加载jquery */ $jquery = new Typecho_Widget_Helper_Form_Element_Radio('jquery', array('0' => '手动加载', '1' => '自动加载'), 0, '选择jQuery来源', '若选择"手动加载",则需要你手动加载jQuery到你的主题里,若选择"自动加载",本插件会自动加载jQuery到你的主题里。'); $form->addInput($jquery); $form->addInput($likeClass); }
public static function config(Typecho_Widget_Helper_Form $form) { $element = new Typecho_Widget_Helper_Form_Element_Text('api', null, null, _t('接口调用地址'), '请登录百度站长平台获取'); $form->addInput($element); $element = new Typecho_Widget_Helper_Form_Element_Text('group', null, 15, _t('分组URL数'), '每天最多只能发送50条,请酌情设置'); $form->addInput($element); $element = new Typecho_Widget_Helper_Form_Element_Radio('delete', array(0 => '不删除', 1 => '删除'), 0, _t('卸载是否删除数据表')); $form->addInput($element); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $ak = new Typecho_Widget_Helper_Form_Element_Text('ak', NULL, '', _t('API Key'), _t('<a href="http://developer.baidu.com/console" target="_blank">获取API Key</a>')); $form->addInput($ak); $sk = new Typecho_Widget_Helper_Form_Element_Text('sk', NULL, '', _t('Secret Key'), _t('<a href="http://developer.baidu.com/console" target="_blank">获取Secret Key</a>')); $form->addInput($sk); $bucketName = new Typecho_Widget_Helper_Form_Element_Text('bucket', NULL, '', _t('Bucket名称'), _t('')); $form->addInput($bucketName); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { /** user agent icons **/ $icons = new Typecho_Widget_Helper_Form_Element_Radio('icons', array('16' => '16px 大小', '24' => '24px 大小'), '16', _t('选择图标尺寸大小'), _t('')); $form->addInput($icons->multiMode()); /** user agent show **/ $show = new Typecho_Widget_Helper_Form_Element_Radio('show', array('1' => '只显示图标', '2' => '只显示文字', '3' => '显示图片和文字'), '1', _t('选择显示的内容'), _t('')); $form->addInput($show->multiMode()); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { /** 百度应用 API Key */ $apiKey = new Typecho_Widget_Helper_Form_Element_Text('apiKey', NULL, '', _t('百度应用 API Key'), _t('<a href="http://developer.baidu.com/dev">获取 API Key</a>')); $form->addInput($apiKey); /** 生成模式 */ $mode = new Typecho_Widget_Helper_Form_Element_Radio('mode', array('en' => _t('英文'), 'zh' => _t('拼音')), 'en', _t('生成模式'), _t('默认为英文模式')); $form->addInput($mode); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $options = Typecho_Widget::widget('Widget_Options'); //配置信息 $baddress = new Typecho_Widget_Helper_Form_Element_Text('bad', NULL, NULL, _t('替换前地址'), _t('即你的附件存放地址,如http://www.yourblog.com/usr/uploads/')); $form->addInput($baddress); $aaddress = new Typecho_Widget_Helper_Form_Element_Text('aad', NULL, NULL, _t('替换后'), _t('即你的七牛云存储域名,如http://*.qiniudn.com/usr/uploads/')); $form->addInput($aaddress); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $query_parent = new Typecho_Widget_Helper_Form_Element_Text('query_parent', NULL, '', _t('应用插件的范围'), _t('请使用css选择器来指定插件应用的范围。如果是默认主题,可以使用“.post”;如果是P酱的主题,可以使用“.entry-content”;实在弄不清就留空。')); $query_parent->input->setAttribute('class', 'mini'); $form->addInput($query_parent); $mode = new Typecho_Widget_Helper_Form_Element_Radio('mode', array('all' => _t('转换所有可用播放器'), 'click' => _t('等待点击'), 'first' => _t('转换首个可用播放器,其它等待点击')), 'first', _t('是否自动转换链接')); $form->addInput($mode); $audio_player_theme = new Typecho_Widget_Helper_Form_Element_Text('audio_player_theme', NULL, '#FFFFFF|#FF9933|#FF6633', _t('音频播放器的配色'), _t('')); $form->addInput($audio_player_theme); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $captchakeyDescription = _t("To use GeeTest you must get an API key from <a href='http://www.geetest.com/'>http://www.geetest.com/</a>"); $captchakey = new Typecho_Widget_Helper_Form_Element_Text('captchakey', NULL, '', _t('Captcha key:'), $captchakeyDescription); $privatekey = new Typecho_Widget_Helper_Form_Element_Text('privatekey', NULL, '', _t('Private key:'), _t('')); $dispmode = new Typecho_Widget_Helper_Form_Element_Select('dispmode', array('float' => '浮动式', 'embed' => '嵌入式', 'popup' => '弹出式'), 'float', _t('Display mode(<a href="http://geetest.com/experience">experience online</a>):'), _t('')); $form->addInput($captchakey); $form->addInput($privatekey); $form->addInput($dispmode); }
/** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form) { $list = array('index' => '首页', 'archive' => '归档', 'post' => '文章', 'attachment' => '附件', 'category' => '分类', 'tag' => '标签', 'author' => '作者', 'search' => '搜索', 'feed' => 'feed', 'page' => '页面'); $element = new Typecho_Widget_Helper_Form_Element_Checkbox('cache_page', $list, array('index', 'post', 'search', 'page', 'author', 'tag'), '需要缓存的页面'); $form->addInput($element); $list = array('关闭', '开启'); $element = new Typecho_Widget_Helper_Form_Element_Radio('login', $list, 1, '是否对已登录用户失效', '已经录用户不会触发缓存策略'); $form->addInput($element); $list = array('关闭', '开启'); $element = new Typecho_Widget_Helper_Form_Element_Radio('enable_ssl', $list, '0', '是否支持SSL'); $form->addInput($element); $list = array('0' => '不使用缓存', 'memcached' => 'Memcached', 'memcache' => 'Memcache', 'redis' => 'Redis', 'mysql' => 'Mysql'); $element = new Typecho_Widget_Helper_Form_Element_Radio('cache_driver', $list, '0', '缓存驱动'); $form->addInput($element); $element = new Typecho_Widget_Helper_Form_Element_Text('expire', null, '86400', '缓存过期时间', '86400 = 60s * 60m *24h,即一天的秒数'); $form->addInput($element); $element = new Typecho_Widget_Helper_Form_Element_Text('host', null, '127.0.0.1', '主机地址', '主机地址,一般为127.0.0.1'); $form->addInput($element); $element = new Typecho_Widget_Helper_Form_Element_Text('port', null, '11211', '端口号', '端口号,memcache对应11211,Redis对应6379,其他类型随意填写'); $form->addInput($element); $list = array('关闭', '开启'); $element = new Typecho_Widget_Helper_Form_Element_Radio('is_debug', $list, 0, '是否开启debug'); $form->addInput($element); $list = array('关闭', '清除所有数据'); $element = new Typecho_Widget_Helper_Form_Element_Radio('is_clean', $list, 0, '清除所有数据'); $form->addInput($element); }
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('请填写非图片保存路径格式!'))); }
/** * 获取插件配置面板 * * @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('请填写整数数字'))); }