Hi devs,
I'm working on a plugin which allows the Admin to configure the TinyMCE toolbar without hacking in editor.js. It also allows to enable/disable features domain/user based.
The reasons why I need this plugin are:
#1 Editor width is too large when RoundCube is embedded in frameset. #2 I'd like to restrict some features (media, spellchecker) domein/user based
I don't get it working without patching two files:
#1 ,/program/include/main.inc
... see function rcube_html_editor
#2 ./porgram/js/editor.js
... see function rcmail_editor_init
Attached files are based on trunk r2852. Hope you will commit them to trunk.
Regards, Roland
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/4C/jhUOCkvG/program.zip Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/
Sorry, there was a small bug in main.inc#line 1396 ...
----- Original Message ----- From: Roland Liebl To: dev@lists.roundcube.net Sent: Tuesday, August 11, 2009 10:51 AM Subject: [RCD] Configurable TinyMCE Toolbar
Hi devs,
I'm working on a plugin which allows the Admin to configure the TinyMCE toolbar without hacking in editor.js. It also allows to enable/disable features domain/user based.
The reasons why I need this plugin are:
#1 Editor width is too large when RoundCube is embedded in frameset. #2 I'd like to restrict some features (media, spellchecker) domein/user based
I don't get it working without patching two files:
#1 ,/program/include/main.inc
... see function rcube_html_editor
#2 ./porgram/js/editor.js
... see function rcmail_editor_init
Attached files are based on trunk r2852. Hope you will commit them to trunk.
Regards, Roland
List info: http://lists.roundcube.net/dev/
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/5V/XeS8STpa/program.zip Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/
Maybe it is much more flexible just to add a hook to ./program/include/main.inc?
function rcube_html_editor($mode='') { global $RCMAIL, $OUTPUT, $CONFIG;
$hook = $RCMAIL->plugins->exec_hook('hmtl_editor', array('abort' => false));
if($hook['abort']) return;
Would be also a starting point to give the flexibility to use another html editor, such as FCK ...
I think that's the best approach.
Regards, Roland
----- Original Message ----- From: Roland Liebl To: Roland Liebl ; dev@lists.roundcube.net Sent: Tuesday, August 11, 2009 11:26 AM Subject: Re: [RCD] Configurable TinyMCE Toolbar
Sorry, there was a small bug in main.inc#line 1396 ...
----- Original Message -----
From: Roland Liebl
To: dev@lists.roundcube.net
Sent: Tuesday, August 11, 2009 10:51 AM
Subject: [RCD] Configurable TinyMCE Toolbar
Hi devs,
I'm working on a plugin which allows the Admin to configure the TinyMCE toolbar
without hacking in editor.js. It also allows to enable/disable features domain/user based.
The reasons why I need this plugin are:
#1 Editor width is too large when RoundCube is embedded in frameset.
#2 I'd like to restrict some features (media, spellchecker) domein/user based
I don't get it working without patching two files:
#1 ,/program/include/main.inc
... see function rcube_html_editor
#2 ./porgram/js/editor.js
... see function rcmail_editor_init
Attached files are based on trunk r2852. Hope you will commit them to trunk.
Regards,
Roland
_______________________________________________
List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/
OK, best approach for me is a hook:
Could please someone commit to trunk:
./program/include/main.inc.php#line1374
/**
*/ function rcube_html_editor($mode='') { global $RCMAIL, $OUTPUT, $CONFIG;
$lang = $tinylang = strtolower(substr($_SESSION['language'], 0, 2)); if (!file_exists(INSTALL_PATH . 'program/js/tiny_mce/langs/'.$tinylang.'.js')) $tinylang = 'en';
$hook = $RCMAIL->plugins->exec_hook('hmtl_editor', array('abort' => false, 'mode' => $mode, 'tinylang' => $tinylang));
if($hook['abort']) return;
$OUTPUT->include_script('tiny_mce/tiny_mce.js'); $OUTPUT->include_script('editor.js'); $OUTPUT->add_script('rcmail_editor_init("$__skin_path", "'.JQ($tinylang).'", '.intval($CONFIG['enable_spellcheck']).', "'.$mode.'");'); }
Regards, Roland
List info: http://lists.roundcube.net/dev/