class TinyMCEPlugin extends Plugin
{
+ var $html;
+
function onEndShowScripts($action)
{
if (common_logged_in()) {
return true;
}
+ function onArgsInitialize(&$args)
+ {
+ if (!array_key_exists('action', $args) ||
+ $args['action'] != 'newnotice') {
+ return true;
+ }
+
+ $raw = $args['status_textarea'];
+
+ require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
+
+ $config = array('safe' => 1,
+ 'deny_attribute' => 'id,style,on*');
+
+ $this->html = htmLawed($raw, $config);
+
+ $text = html_entity_decode(strip_tags($this->html));
+
+ $args['status_textarea'] = $text;
+
+ return true;
+ }
+
+ function onStartNoticeSave($notice)
+ {
+ if (!empty($this->html)) {
+ // Stomp on any rendering
+ $notice->rendered = $this->html;
+ }
+
+ return true;
+ }
+
function _inlineScript()
{
$path = common_path('plugins/TinyMCE/js/tiny_mce.js');