From 45d6f73dbadaae139b825a8dc13d4c532f312e1e Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 15 Feb 2013 15:53:18 +0000 Subject: [PATCH] Add stub drop actions to folder tree --- mail/inc/class.mail_ui.inc.php | 51 ++++++++++++++++++++-------------- mail/js/app.js | 10 +++++++ 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 8f92d96f35..5ee706a30b 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -136,6 +136,36 @@ class mail_ui if (!isset($content['nm']['cat_id'])) $content['nm']['cat_id'] = 'All'; $etpl = new etemplate('mail.index'); + + // Set tree actions + $etpl->set_cell_attribute('nm[foldertree]','actions', array( + + 'drop_move_mail' => array( + 'type' => 'drop', + 'acceptedTypes' => 'mail', + 'icon' => 'move', + 'caption' => 'Move to', + 'onExecute' => 'javaScript:mail_move' + ), + 'drop_copy_mail' => array( + 'type' => 'drop', + 'acceptedTypes' => 'mail', + 'icon' => 'copy', + 'caption' => 'Copy to', + 'onExecute' => 'javaScript:mail_copy' + ), + 'drop_cancel' => array( + 'caption' => 'Cancel', + 'acceptedTypes' => 'mail', + 'type' => 'drop', + ), + // Tree doesn't support this one - yet + 'rename' => array( + 'caption' => 'Rename', + 'type' => 'popup' + ) + )); + return $etpl->exec('mail.mail_ui.index',$content,$sel_options,$readonlys,$preserv); } @@ -708,32 +738,11 @@ class mail_ui 'group' => ++$group, 'onExecute' => 'javaScript:mail_delete', ), -/* 'drag_mail' => array( 'dragType' => 'mail', 'type' => 'drag', 'onExecute' => 'javaScript:mail_dragStart', ), - 'drop_move_mail' => array( - 'type' => 'drop', - 'acceptedTypes' => 'mail', - 'icon' => 'move', - 'caption' => 'Move to', - 'onExecute' => 'javaScript:mail_move' - ), - 'drop_copy_mail' => array( - 'type' => 'drop', - 'acceptedTypes' => 'mail', - 'icon' => 'copy', - 'caption' => 'Copy to', - 'onExecute' => 'javaScript:mail_copy' - ), - 'drop_cancel' => array( - 'caption' => 'Cancel', - 'acceptedTypes' => 'mail', - 'type' => 'drop', - ), -*/ ); // save as tracker, save as infolog, as this are actions that are either available for all, or not, we do that for all and not via css-class disabling if (!isset($GLOBALS['egw_info']['user']['apps']['infolog'])) diff --git a/mail/js/app.js b/mail/js/app.js index 763ecbf053..e504b2df96 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -158,3 +158,13 @@ function mail_changeFolder(folder,_widget) { } } +// Tree widget stubs +mail_dragStart = function(action,sender) { +console.log(action,sender); +} +mail_move = function(action,sender) { +console.log(action,sender); +} +mail_copy = function(action,sender) { +console.log(action,sender); +}