summaryrefslogtreecommitdiff
path: root/program/steps/settings/edit_identity.inc
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2006-09-14 03:49:28 +0000
committersvncommit <devs@roundcube.net>2006-09-14 03:49:28 +0000
commita0109c4933e0bfb5ed9dbcf94f932991ca689542 (patch)
tree955246969bf9da5d5335d1d7c483025fdbd50407 /program/steps/settings/edit_identity.inc
parentbb5ddfa0ade5fbd2ed9be16e51d4ce695252eece (diff)
Initial TinyMCE editor support (still need to work on spellcheck and skins)
Diffstat (limited to 'program/steps/settings/edit_identity.inc')
-rw-r--r--program/steps/settings/edit_identity.inc34
1 files changed, 32 insertions, 2 deletions
diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc
index 316eec785..af9cb26cc 100644
--- a/program/steps/settings/edit_identity.inc
+++ b/program/steps/settings/edit_identity.inc
@@ -42,7 +42,17 @@ else
function rcube_identity_form($attrib)
{
- global $IDENTITY_RECORD, $JS_OBJECT_NAME;
+ global $IDENTITY_RECORD, $JS_OBJECT_NAME, $OUTPUT;
+
+ $OUTPUT->include_script('tiny_mce/tiny_mce_src.js');
+ $OUTPUT->add_script("tinyMCE.init({ mode : 'specific_textareas'," .
+ "apply_source_formatting : true," .
+ "theme : 'advanced'," .
+ "theme_advanced_toolbar_location : 'top'," .
+ "theme_advanced_toolbar_align : 'left'," .
+ "theme_advanced_buttons1 : 'bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,separator,outdent,indent,charmap,hr'," .
+ "theme_advanced_buttons2 : 'link,unlink,forecolor,fontselect,fontsizeselect'," .
+ "theme_advanced_buttons3 : '' });");
if (!$IDENTITY_RECORD && $GLOBALS['_action']!='add-identity')
return rcube_label('notfound');
@@ -62,7 +72,8 @@ function rcube_identity_form($attrib)
'organization' => array('type' => 'text'),
'reply-to' => array('type' => 'text', 'label' => 'replyto'),
'bcc' => array('type' => 'text'),
- 'signature' => array('type' => 'textarea'),
+ 'signature' => array('type' => 'textarea', 'size' => "40", 'rows' => "6"),
+ 'html_signature'=>array('type' => 'checkbox', 'label' => 'htmlsignature', 'onclick' => 'return rcmail.toggle_editor(this, \'_signature\');'),
'standard' => array('type' => 'checkbox', 'label' => 'setdefault'));
@@ -87,6 +98,25 @@ function rcube_identity_form($attrib)
foreach ($a_show_cols as $col => $colprop)
{
$attrib['id'] = 'rcmfd_'.$col;
+
+ if (strlen($colprop['onclick']))
+ $attrib['onclick'] = $colprop['onclick'];
+ else
+ unset($attrib['onclick']);
+
+ if ($col == 'signature')
+ {
+ $attrib['size'] = $colprop['size'];
+ $attrib['rows'] = $colprop['rows'];
+ $attrib['mce_editable'] = $IDENTITY_RECORD['html_signature'] ? "true" : "false";
+ }
+ else
+ {
+ unset($attrib['size']);
+ unset($attrib['rows']);
+ unset($attrib['mce_editable']);
+ }
+
$label = strlen($colprop['label']) ? $colprop['label'] : $col;
$value = rcmail_get_edit_field($col, $IDENTITY_RECORD[$col], $attrib, $colprop['type']);