richEditor = array('TinyMCE_Plugin', 'render');
Typecho_Plugin::factory('admin/write-page.php')->richEditor = array('TinyMCE_Plugin', 'render');
//去除段落
Typecho_Plugin::factory('Widget_Contents_Post_Edit')->write = array('TinyMCE_Plugin', 'filter');
Typecho_Plugin::factory('Widget_Contents_Page_Edit')->write = array('TinyMCE_Plugin', 'filter');
Helper::addPanel(0, 'TinyMCE/tiny_mce/langs.php','', '', 'contributor');
}
/**
* 禁用插件方法,如果禁用失败,直接抛出异常
*
* @static
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function deactivate()
{
Helper::removePanel(0, 'TinyMCE/tiny_mce/langs.php');
}
/**
* 获取插件配置面板
*
* @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
* @param array $post 数据结构体
* @return array
*/
public static function filter($post)
{
$post['text'] = Typecho_Common::removeParagraph($post['text']);
return $post;
}
/**
* 插件实现方法
*
* @access public
* @return void
*/
public static function render($post)
{
$options = Helper::options();
$js = Typecho_Common::url('TinyMCE/tiny_mce/tiny_mce.js', $options->pluginUrl);
$langs = Typecho_Common::url('extending.php?panel=TinyMCE/tiny_mce/langs.php', $options->adminUrl);
echo "
";
}
}