APlayer_Plugin::config PHP Метод

config() публичный статический Метод

获取插件配置面板
public static config ( Typecho_Widget_Helper_Form $form ) : void
$form Typecho_Widget_Helper_Form 配置面板
Результат void
    public static function config(Typecho_Widget_Helper_Form $form)
    {
        if (isset($_GET['action']) && $_GET['action'] == 'deletefile') {
            self::deletefile();
        }
        $listexpire = new Typecho_Widget_Helper_Form_Element_Text('listexpire', null, '43200', _t('歌单更新周期'), _t('设置歌单的缓存时间(单位:秒),超过设定时间后歌单将自动更新'));
        $form->addInput($listexpire);
        $maintheme = new Typecho_Widget_Helper_Form_Element_Text('maintheme', null, '#e6d0b2', _t('默认主题颜色'), _t('播放器默认的主题颜色,如 #372e21、#75c、red、blue,该设定会被[player]标签中的theme属性覆盖,默认为 #e6d0b2'));
        $form->addInput($maintheme);
        $nolyric = new Typecho_Widget_Helper_Form_Element_Text('nolyric', null, '找不到歌词', _t('找不到歌词时显示的文字'), _t('找不到歌词时显示的文字'));
        $form->addInput($nolyric);
        $mutex = new Typecho_Widget_Helper_Form_Element_Radio('mutex', array('false' => _t('是'), 'true' => _t('否')), 'true', _t('是否允许在一个页面中多个播放器同时播放'), _t('若选择否,当页面中存在多个播放器时,点击其中一个播放器的播放按钮,其它播放器将自动暂停'));
        $form->addInput($mutex);
        $preload = new Typecho_Widget_Helper_Form_Element_Radio('preload', array('false' => _t('自动'), 'none' => _t('none'), 'metadata' => _t('metadata'), 'auto' => _t('auto')), 'false', _t('音频预加载(preload)属性'), '自动:移动端为none,桌面端为metadata; none:页面加载后不预加载音频; metadata:当页面加载后仅加载音频的元数据; auto:一旦页面加载,则开始加载音频。');
        $form->addInput($preload);
        $cache = new Typecho_Widget_Helper_Form_Element_Radio('cache', array('false' => _t('否')), 'false', _t('清空缓存'), _t('清空插件生成的缓存文件,必要时可以使用'));
        $form->addInput($cache);
        $submit = new Typecho_Widget_Helper_Form_Element_Submit();
        $submit->value(_t('清空歌词,专辑图片链接,在线歌曲缓存'));
        $submit->setAttribute('style', 'position:relative;');
        $submit->input->setAttribute('style', 'position:absolute;bottom:37px;');
        $submit->input->setAttribute('class', 'btn btn-s btn-warn btn-operate');
        $submit->input->setAttribute('formaction', Typecho_Common::url('/options-plugin.php?config=APlayer&action=deletefile', Helper::options()->adminUrl));
        $form->addItem($submit);
    }