From aeba783d30717b7fd6796d5e1252de622c174e1a Mon Sep 17 00:00:00 2001 From: Eltrac Koalar Date: Sun, 21 Aug 2022 14:29:54 +0800 Subject: =?UTF-8?q?:sunflower:=20Perf:=20=E8=B0=83=E6=95=B4=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E8=AE=BE=E7=BD=AE=E9=A1=B9=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=A1=B5=E8=84=9A=E7=89=88=E6=9D=83=E4=BF=A1=E6=81=AF=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=98=BE=E7=A4=BA=E5=8D=95=E4=B8=80=E5=B9=B4=E4=BB=BD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Options.php | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 libs/Options.php (limited to 'libs/Options.php') diff --git a/libs/Options.php b/libs/Options.php new file mode 100644 index 0000000..5a8b33a --- /dev/null +++ b/libs/Options.php @@ -0,0 +1,97 @@ + _t('Ringo'), + 'journal' => _t('Journal'), + ), + 'ringo', + _t('选择主题样式'), + _t('选择 Ringo 则使用 Ringo 主题的整体设计,更加简洁;
+ 选择 Journal 则使用 Journal 主题的整体设计,更加大气') + ); + $form->addInput($customStyle->addRule('required', _t('此处必须设置'))); + //首页摘要显示模式 + $IndexDisplayMode = new Typecho_Widget_Helper_Form_Element_Radio('IndexDisplayMode', array( + 'FullText' => _t('根据 more 标签截断'), + 'Excerpt200' => _t('截断前 200 字符'), + 'Title' => _t('不输出摘要') + ), + 'FullText', + _t('文章摘要显示模式'), + _t(' +

该设置相会影响首页的文章列表内的文章内容摘要如何显示。

+

若选择 根据 more 标签截断,主题会截取 标签之前的内容,这样能保留这一文段的样式,而不是单调的文字。

+

若选择 截断前200字符,主题总是会截取文章前 200 字纯文本,且不保留原本样式。

+

若选择 不输出摘要,文章列表中只会显示文章标题和元信息。

') + ); + $form->addInput($IndexDisplayMode->addRule('required', _t('此处必须设置'))); + //Favicon 设置 + $favicon = new Typecho_Widget_Helper_Form_Element_Text('favicon', NULL, 'favicon.png', _t('浏览器图标(Favicon)'), _t('在这里填入一个指向图片文件的 url 来自定义浏览器标签栏显示的图标,留空则默认为 favicon.ico
')); + $form->addInput($favicon); + + /** + * 基本信息 + */ + $icpNum = new Typecho_Widget_Helper_Form_Element_Text('icpNum', NULL, NULL, _t('网站备案号'), _t('在这里填入中国大陆的ICP网站备案号(无需带a标签,如 浙ICP备19006255号-1 ),留空则不显示')); + $form->addInput($icpNum); + $startDate = new Typecho_Widget_Helper_Form_Element_Text('startDate', NULL, date('Y-m-d'), _t('网站建立日期'), _t('用于显示在页脚的版权信息,以及计算网站建立时长,格式为 Y-m-d')); + $form->addInput($startDate); + $statCode = new Typecho_Widget_Helper_Form_Element_Textarea('statCode', NULL, NULL, _t('站点统计代码'), _t(' +

在这里填入 带 script 标签的 站点统计代码,留空则不显示。

+
+ ')); + $form->addInput($statCode); + $hideStatCode = new Typecho_Widget_Helper_Form_Element_Radio('hideStatCode', array( + 'able' => _t('隐藏'), + 'disable' => _t('显示'), + ), + 'able', + _t('是否隐藏统计标志'), + _t(' +

是否将统计标志用 CSS 的 display 函数隐藏起来(常用于隐藏 CNZZ 等统计站点显示的标志,防止影响美观),默认隐藏

+

现阶段暂没有对显示内容的统计标志做特别优化,因而会出现显示错乱的问题,建议隐藏。

+ ') + ); + $form->addInput($hideStatCode->addRule('required', _t('此处必须设置'))); + + /** + * 附加功能 + */ + $EnableBusuanzi = new Typecho_Widget_Helper_Form_Element_Radio('EnableBusuanzi', array( + 'able' => _t('启用'), + 'disable' => _t('停用'), + ), + 'able', + _t('是否启用 不蒜子 统计功能'), + _t(' + 不蒜子是一个即装即用的网页 js 计数脚本,目前可与主题进行对接显示访问数,默认启用 + ') + ); + $form->addInput($EnableBusuanzi->addRule('required', _t('此处必须设置'))); + + /** + * 自定义 + */ + //自定义 head + $customHead = new Typecho_Widget_Helper_Form_Element_Textarea('customHead', NULL, NULL, _t('自定义 head 头部信息'), _t(' +

将会输出在 head 标签结束之前,通常用于引入 css 文件。

')); + $form->addInput($customHead); + //自定义 footer + $customFooter = new Typecho_Widget_Helper_Form_Element_Textarea('customFooter', NULL, NULL, _t('自定义 footer 页脚信息'), _t(' +

将会输出在 body 标签结束之前,通常用于引入 js 文件。

')); + $form->addInput($customFooter); + //自定义 pjax 回调函数 + $pjaxCallback = new Typecho_Widget_Helper_Form_Element_Textarea('pjaxCallback', NULL, NULL, _t('Pjax 回调函数'), _t(' +

用于在 Pjax 切换页面后刷新某些元素,避免失效。如果你没有使用其他插件或者没有遇到问题,这里应当留空。

')); + $form->addInput($pjaxCallback); +} -- cgit v1.2.3