end = array(__CLASS__, 'render'); } /** * 禁用插件方法,如果禁用失败,直接抛出异常 * * @static * @access public * @return void * @throws Typecho_Plugin_Exception */ public static function deactivate() { Helper::removeAction('imanage-posts'); } /** * 获取插件配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form 配置面板 * @return void */ public static function config(Typecho_Widget_Helper_Form $form){} /** * 个人用户的配置面板 * * @access public * @param Typecho_Widget_Helper_Form $form * @return void */ public static function personalConfig(Typecho_Widget_Helper_Form $form){} /** * 插件实现方法 * * @access public * @return void */ public static function render() { $url = $_SERVER['REQUEST_URI']; $filename = substr( $url , strrpos($url , '/')+1); if (empty($filename) || strpos($filename,'manage-posts.php') === false) { return; } $db = Typecho_Db::get(); $prefix = $db->getPrefix(); $options = Typecho_Widget::widget('Widget_Options'); $category_list = $db->fetchAll($db->select()->from($prefix.'metas')->where('type = ?', 'category')); //批量更改文章分类接收的action地址 $makeChange_url = Typecho_Common::url('/index.php/action/imanage-posts?do=change-category', $options->siteUrl); //批量更改文章分类接收的action地址 $changeStatus_url = Typecho_Common::url('/index.php/action/imanage-posts?do=change-status', $options->siteUrl); $category_html = ''; $status_html = ''; $script = << SCRIPT; echo $script; } }