diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index fd7d865f92..1b816dcaab 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -182,25 +182,25 @@ class mail_hooks $folderList['none'] = lang('no folders'); // Build toogled on actions sel options - $allActions = array_merge(mail_compose::getToolbarActions(array( + $allActions = mail_compose::getToolbarActions(array( 'priority' => true, 'mailaccount' => $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] - ))); + )); $toggledOnActions = array ( - 'mail_compose.cc_expander' => array ( - 'id' => 'mail_compose.cc_expander', + 'cc_expander' => array ( + 'id' => 'cc_expander', 'label' => lang('Cc'), ), - 'mail_compose.bcc_expander' => array ( - 'id' => 'mail_compose.bcc_expander', + 'bcc_expander' => array ( + 'id' => 'bcc_expander', 'label' => lang('Bcc') ), - 'mail_compose.folder_expander' => array( - 'id' => 'mail_compose.folder_expander', + 'folder_expander' => array( + 'id' => 'folder_expander', 'label' => lang('Folder') ), - 'mail_compose.replyto_expander' => array( - 'id' => 'mail_compose.replyto_expander', + 'replyto_expander' => array( + 'id' => 'replyto_expander', 'label' => lang('Reply to') ) ); @@ -209,8 +209,8 @@ class mail_hooks { if ($action['checkbox']) { - $toggledOnActions['mail_compose.'.$name] = array( - 'id' => 'mail_compose.'.$name, + $toggledOnActions[$name] = array( + 'id' => $name, 'label' => lang($action['caption']), 'title' => lang($action['hint']), 'app' => 'mail' diff --git a/mail/js/app.js b/mail/js/app.js index bfd77fa91c..25f0471aca 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -350,6 +350,7 @@ app.classes.mail = AppJS.extend( this.mail_currentlyFocussed = this.et2.mail_currentlyFocussed; } + this.preSetToggledOnActions (); }, /** @@ -6048,5 +6049,39 @@ app.classes.mail = AppJS.extend( nm.header.right_div.addClass('vertical_splitter'); } return state; + }, + + /** + * Pre set toggled actions + */ + preSetToggledOnActions: function () + { + var actions = egw.preference('toggledOnActions', 'mail'); + var toolbar = this.et2.getWidgetById('composeToolbar'); + if (actions) + { + actions = actions.split(','); + for (var i=0; i < actions.length; i++) + { + if (toolbar.options.actions[actions[i]]) + { + var $d = jQuery('#composeToolbar-'+actions[i]); + if ($d.length > 0 + && toolbar._actionManager.getActionById(actions[i]).checkbox + && !toolbar._actionManager.getActionById(actions[i]).checked) + { + $d.trigger('click'); + } + } + else + { + var widget = this.et2.getWidgetById(actions[i]); + if (widget) + { + jQuery(widget.getDOMNode()).trigger('click'); + } + } + } + } } });