From 36e13b7c8f31af59b55f679cc0e348e7f489195a Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 16 Jan 2014 16:37:01 +0000 Subject: [PATCH] move empty trash/compress folder to actionsmenu on tree --- mail/inc/class.mail_hooks.inc.php | 25 ------------------------- mail/inc/class.mail_ui.inc.php | 19 +++++++++++++++++++ mail/js/app.js | 11 ----------- 3 files changed, 19 insertions(+), 36 deletions(-) diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index 31a514ff5e..d407fc3803 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -677,31 +677,6 @@ class mail_hooks 'icon' => false ); $showMainScreenStuff = false; -/* - if (!$showMainScreenStuff) - { - // action links that are mostly static and dont need any connection and additional classes ... - $file += array( - 'mail' => egw::link('/index.php','menuaction=mail.mail_ui.index&ajax=true'), - ); - - } -*/ - // empty trash (if available -> move to trash ) - if($preferences['deleteOptions'] == 'move_to_trash') - { - $file += array( - '_NewLine_' => '', // give a newline - 'empty trash' => "javascript:mail_callEmptyTrash();", - ); - } - if($preferences['deleteOptions'] == 'mark_as_deleted') - { - $file += array( - '_NewLine_' => '', // give a newline - 'compress folder' => "javascript:mail_callCompressFolder();", - ); - } // import Message link - only when the required library is available if ((@include_once 'Mail/mimeDecode.php') !== false) { diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 1c84000d53..9a7541271d 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -389,6 +389,25 @@ class mail_ui 'onExecute' => 'javaScript:app.mail.edit_acl', ), ); + $deleteOptions = $GLOBALS['egw_info']['user']['preferences']['mail']['deleteOptions']; + if($deleteOptions == 'move_to_trash') + { + $tree_actions['empty_trash'] = array( + 'caption' => 'empty trash', + 'icon' => 'dhtmlxtree/MailFolderTrash', + 'onExecute' => 'javaScript:app.mail.mail_emptyTrash', + //'enableId' => '^\\d+$', // only show action on account itself + ); + } + if($preferences['deleteOptions'] == 'mark_as_deleted') + { + $tree_actions['compress_folder'] = array( + 'caption' => 'compress folder', + 'icon' => 'dhtmlxtree/MailFolderTrash', + 'onExecute' => 'javaScript:app.mail.mail_compressFolder', + //'enableId' => '^\\d+$', // only show action on account itself + ); + } if (!$this->mail_bo->icServer->queryCapability('ACL')) unset($tree_actions['edit_acl']); if (!$this->mail_bo->icServer->acc_sieve_enabled) diff --git a/mail/js/app.js b/mail/js/app.js index e58df8a6f0..4565c93d8b 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -2375,14 +2375,3 @@ app.classes.mail = AppJS.extend( this.egw.open_link('mail.mail_wizard.edit&acc_id='+acc_id, '_blank', '720x500'); } }); -// wrapper functions to call functions within app -function mail_callEmptyTrash() -{ - this.mail_emptyTrash(); - -} -function mail_callCompressFolder() -{ - this.mail_compressFolder(); -} -