示例#1
0
    /**
     * 获取插件配置面板
     *
     * @access public
     * @param Typecho_Widget_Helper_Form $form 配置面板
     * @return void
     */
    public static function config(Typecho_Widget_Helper_Form $form)
    {
        ?>
<script type="text/javascript" src="<?php 
        Helper::options()->adminUrl('js/jquery.js');
        ?>
"></script>
<script type="text/javascript">
$(function() {
	var full = $('#mode-highslide-full-packed-js'),
		basic = $('#mode-highslide-packed-js'),
		adv = $('.advanced'),
		option = $('#typecho-option-item-align-9,#typecho-option-item-opac-10,#typecho-option-item-slide-11,#typecho-option-item-nextimg-12,#typecho-option-item-cpos-13,#typecho-option-item-wrap-14'),
		input = option.find('input,select');
	if(!full.is(':checked')) {
		adv.attr('style','color:#999;font-weight:bold');
		option.attr('style','color:#999');
	}
	full.click(function() {
		adv.attr('style','color:#467B96;font-weight:bold');
		option.removeAttr('style');
	});
	basic.click(function() {
		adv.attr('style','color:#999;font-weight:bold');
		option.attr('style','color:#999');
	});
});
</script>
<?php 
        $mode = new Typecho_Widget_Helper_Form_Element_Radio('mode', array('highslide.packed.js' => _t('基础版 <span style="color:#999;font-size:0.92857em;">(25.2K)支持插图弹窗</span>'), 'highslide-full.packed.js' => _t('全功能版 <span style="color:#999;font-size:0.92857em;">(46.8K)支持插图幻灯/html弹窗/页面相册等</span>')), 'highslide.packed.js', _t('核心选择'));
        $form->addInput($mode);
        $rpmode = new Typecho_Widget_Helper_Form_Element_Radio('rpmode', array('ahref' => _t('链接图片'), 'imgsrc' => _t('所有图片')), 'ahref', _t('应用模式'), NULL);
        $form->addInput($rpmode);
        $rplist = new Typecho_Widget_Helper_Form_Element_Checkbox('rplist', array('index' => _t('首页'), 'post' => _t('文章页'), 'page' => _t('独立页'), 'archive' => _t('索引页')), array('index', 'post', 'page', 'archive'), _t('应用范围'), NULL);
        $form->addInput($rplist);
        $lang = new Typecho_Widget_Helper_Form_Element_Radio('lang', array('chs' => _t('中文'), 'eng' => _t('英文')), 'chs', _t('提示语言'));
        $form->addInput($lang);
        $outline = new Typecho_Widget_Helper_Form_Element_Radio('outline', array('' => _t('无边框'), 'rounded-white' => _t('圆角白'), 'rounded-black' => _t('圆角黑'), 'glossy-dark' => _t('亮泽黑'), 'outer-glow' => _t('外发光'), 'beveled' => _t('半透明')), '', _t('边框风格'));
        $form->addInput($outline);
        $butn = new Typecho_Widget_Helper_Form_Element_Radio('butn', array('false' => _t('不显示'), 'true' => _t('显示')), 'false', _t('关闭按钮'));
        $form->addInput($butn);
        $ltext = new Typecho_Widget_Helper_Form_Element_Text('ltext', NULL, '&copy; ' . $_SERVER['HTTP_HOST'] . '', _t('角标文字'), _t('弹窗logo文字与显示位置,留空则不显示'));
        $ltext->input->setAttribute('class', 'mini');
        $form->addInput($ltext);
        $lpos = new Typecho_Widget_Helper_Form_Element_Select('lpos', array('top left' => _t('左上'), 'top center' => _t('中上'), 'top right' => _t('右上'), 'bottom left' => _t('左下'), 'bottom center' => _t('中下'), 'bottom right' => _t('右下')), 'top left', '');
        $lpos->removeAttribute('class', 'typecho-label');
        $lpos->input->setAttribute('style', 'position:absolute;bottom:42px;left:165px;');
        $lpos->setAttribute('style', 'list-style:none;position:relative;');
        $form->addInput($lpos);
        $capt = new Typecho_Widget_Helper_Form_Element_Radio('capt', array('' => _t('不显示'), 'this.a.title' => _t('显示链接title'), 'this.thumb.alt' => _t('显示图片alt')), '', _t('图片说明'), _t('例: &#60;a href="http://xx.jpg" title="图片说明写这"&#62;&#60;img src="http://xxx.jpg" alt="或者写这显示"/&#62;&#60;/a&#62;<p class="advanced" style="color:#467B96;font-weight:bold;">全功能版设置 ———————————————————————————————————————</p>'));
        $form->addInput($capt);
        $align = new Typecho_Widget_Helper_Form_Element_Radio('align', array('default' => _t('默认'), 'center' => _t('居中')), 'default', _t('弹窗位置'));
        $form->addInput($align);
        $opac = new Typecho_Widget_Helper_Form_Element_Text('opac', NULL, '0.65', _t('背景遮罩'), _t('可填入0~1之间小数, 代表透明至纯黑'));
        $opac->input->setAttribute('class', 'mini');
        $form->addInput($opac->addRule('isFloat', _t('请填写数字')));
        $slide = new Typecho_Widget_Helper_Form_Element_Radio('slide', array('false' => _t('关闭'), 'true' => _t('开启')), 'true', _t('幻灯按钮'));
        $form->addInput($slide);
        $nextimg = new Typecho_Widget_Helper_Form_Element_Radio('nextimg', array('false' => _t('否'), 'true' => _t('是')), 'false', _t('自动翻页'), _t('开启后点击图片为显示下一张'));
        $form->addInput($nextimg);
        $cpos = new Typecho_Widget_Helper_Form_Element_Radio('cpos', array('' => _t('不显示'), 'caption' => _t('底部显示'), 'heading' => _t('顶部显示')), '', _t('图片序数'));
        $form->addInput($cpos);
        $wrap = new Typecho_Widget_Helper_Form_Element_Checkbox('wrap', array('draggable-header' => _t('标题栏 <span style="color:#999;font-size:0.92857em;">支持&#60;hs title="标题"&#62;显示</span>'), 'no-footer' => _t('无拉伸')), NULL, _t('html弹窗效果'));
        $form->addInput($wrap);
        //相册设置隐藏域
        $storage = new Typecho_Widget_Helper_Form_Element_Hidden('storage', array('local', 'qiniu', 'upyun', 'bcs'), 'local');
        $form->addInput($storage);
        $local = new Typecho_Widget_Helper_Form_Element_Hidden('local', NULL, '/usr/uploads/HSgallery/');
        $form->addInput($local);
        $qiniubucket = new Typecho_Widget_Helper_Form_Element_Hidden('qiniubucket', NULL, '');
        $form->addInput($qiniubucket);
        $qiniudomain = new Typecho_Widget_Helper_Form_Element_Hidden('qiniudomain', NULL, 'http://');
        $form->addInput($qiniudomain);
        $qiniuaccesskey = new Typecho_Widget_Helper_Form_Element_Hidden('qiniuaccesskey', NULL, '');
        $form->addInput($qiniuaccesskey);
        $qiniusecretkey = new Typecho_Widget_Helper_Form_Element_Hidden('qiniusecretkey', NULL, '');
        $form->addInput($qiniusecretkey);
        $qiniuprefix = new Typecho_Widget_Helper_Form_Element_Hidden('qiniuprefix', NULL, 'usr/uploads/HSgallery/');
        $form->addInput($qiniuprefix);
        $upyunbucket = new Typecho_Widget_Helper_Form_Element_Hidden('upyunbucket', NULL, '');
        $form->addInput($upyunbucket);
        $upyundomain = new Typecho_Widget_Helper_Form_Element_Hidden('upyundomain', NULL, 'http://');
        $form->addInput($upyundomain);
        $upyunuser = new Typecho_Widget_Helper_Form_Element_Hidden('upyunuser', NULL, '');
        $form->addInput($upyunuser);
        $upyunpwd = new Typecho_Widget_Helper_Form_Element_Hidden('upyunpwd', NULL, '');
        $form->addInput($upyunpwd);
        $upyunkey = new Typecho_Widget_Helper_Form_Element_Hidden('upyunkey', NULL, '');
        $form->addInput($upyunkey);
        $upyunprefix = new Typecho_Widget_Helper_Form_Element_Hidden('upyunprefix', NULL, '/usr/uploads/HSgallery/');
        $form->addInput($upyunprefix);
        $bcsbucket = new Typecho_Widget_Helper_Form_Element_Hidden('bcsbucket', NULL, '');
        $form->addInput($bcsbucket);
        $bcsapikey = new Typecho_Widget_Helper_Form_Element_Hidden('bcsapikey', NULL, '');
        $form->addInput($bcsapikey);
        $bcssecretkey = new Typecho_Widget_Helper_Form_Element_Hidden('bcssecretkey', NULL, '');
        $form->addInput($bcssecretkey);
        $bcsprefix = new Typecho_Widget_Helper_Form_Element_Hidden('bcsprefix', NULL, '/usr/uploads/HSgallery/');
        $form->addInput($bcsprefix);
        $thumbfix = new Typecho_Widget_Helper_Form_Element_Hidden('thumbfix', array('fixedwidth', 'fixedheight', 'fixedratio'), 'fixedwidth');
        $form->addInput($thumbfix);
        $fixedwidth = new Typecho_Widget_Helper_Form_Element_Hidden('fixedwidth', NULL, '100');
        $form->addInput($fixedwidth);
        $fixedheight = new Typecho_Widget_Helper_Form_Element_Hidden('fixedheight', NULL, '200');
        $form->addInput($fixedheight);
        $fixedratio = new Typecho_Widget_Helper_Form_Element_Hidden('fixedratio', NULL, '4:3');
        $form->addInput($fixedratio);
        $gallery = new Typecho_Widget_Helper_Form_Element_Hidden('gallery', array('gallery-horizontal-strip', 'gallery-thumbstrip-above', 'gallery-vertical-strip', 'gallery-in-box', 'gallery-floating-thumbs', 'gallery-floating-caption', 'gallery-controls-in-heading', 'gallery-in-page'), 'gallery-horizontal-strip');
        $form->addInput($gallery);
    }