move empty trash/compress folder to actionsmenu on tree

This commit is contained in:
Klaus Leithoff 2014-01-16 16:37:01 +00:00
parent fd7aab0996
commit 36e13b7c8f
3 changed files with 19 additions and 36 deletions

View File

@ -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)
{

View File

@ -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)

View File

@ -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();
}