Example #1
0
function themeConfig($form)
{
    $index = Typecho_Widget::widget('Widget_Options')->index;
    echo '<p style="margin-bottom:14px;font-size:13px;text-align:center;">感谢您使用Minty主题 ' . Minty_Version . '!点击我进行<a href="#" onclick="location.href=\'' . Typecho_Common::url('cache', $index) . '\';return false;"> (清除缓存) </a>';
    echo '<a href="#" onclick="location.href=\'' . Typecho_Common::url('apc', $index) . '\';return false;"> (清除PHP代码缓存) </a>!</p>';
    MyTypechoTheme_Plugin::checkUpdate(Minty_Version);
    /*** Image ***/
    $edit = new Typecho_Widget_Helper_Form_Element_Text('themeImage', NULL, '', _t('云存储主题镜像URL'), _t('填写使用主题文件镜像,注意结尾不带/'));
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Text('thumbQuality', NULL, '80', _t('缩略图压缩质量'), _t('1-100之间'));
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Radio('thumbScaling', array('qiniu' => _t('七牛图片处理'), 'timthumb' => _t('本地timthumb')), 'timthumb', _t('缩略图获取方式'));
    $form->addInput($edit);
    /** Color **/
    $edit = new Typecho_Widget_Helper_Form_Element_Text('mainColor', NULL, '', _t('主色'), _t('CSS格式,自定义颜色时填写 (正常颜色)'));
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Text('subColor', NULL, '', _t('配色'), _t('CSS格式,自定义颜色时填写 (:hover 颜色)'));
    $form->addInput($edit);
    /** Plugin **/
    MyTypechoTheme_Plugin::themeConfig($form, "recentpost max=5\npopularpost max=5\ntagcloud max=30\nslider keyword=typecho\ncomment max=5");
    /** User **/
    $edit = new Typecho_Widget_Helper_Form_Element_Textarea('css', NULL, '', _t('自定义CSS'), NULL);
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Checkbox('header', array('rss' => _t('显示RSS'), 'weibo' => _t('显示微博'), 'mail' => _t('显示邮件订阅')), array('rss'), _t('头部导航栏显示'));
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Text('weibo', NULL, '#', _t('微博地址'), NULL);
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Text('mail', NULL, '#', _t('邮件订阅地址'), NULL);
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Textarea('links', NULL, '', _t('底部链接(一行一个,格式:名称:链接)'), NULL);
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Radio('stickysidebar', array('none' => _t('无'), 'top' => '顶部', 'bottom' => '底部'), 'top', _t('粘性侧边栏'), NULL);
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Radio('kbnav', array('false' => _t('否'), 'true' => '是'), 'true', _t('键盘导航'), NULL);
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Text('infsc', NULL, '0', _t('无限滚动层数'), _t('0为关闭'));
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Radio('ajaxc', array('false' => _t('否'), 'true' => '是'), 'true', _t('无刷新评论'), NULL);
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Text('sltmo', NULL, '4000', _t('幻灯片延时'), _t('单位: 毫秒'));
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Text('headertext', NULL, '', _t('首页介绍'), _t('留空为网站介绍'));
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Textarea('featured', NULL, '', _t('首页幻灯片'), _t('一行一个关键字或cid'));
    $form->addInput($edit);
    $edit = new Typecho_Widget_Helper_Form_Element_Text('respmenu', NULL, '620,700,700,800,900,1000,1100,1200,1300', _t('响应式菜单宽度'), _t('请自行调整,支持620,700,800,900,1000,1100,1200,1300px'));
    $form->addInput($edit);
}