From 6832bc778e68a8604aa081b45ad06b3749943ec4 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 30 May 2017 16:19:37 +0200 Subject: [PATCH] WIP SpamTitan integration: - Add actions into mail contextmenu --- mail/inc/class.mail_ui.inc.php | 10 ++++++++++ mail/js/app.js | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index f031e33b6d..0d768d1f89 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -1305,6 +1305,16 @@ class mail_ui { unset($actions['save']['children']['save2filemanager']); } + if ($GLOBALS['egw_info']['apps']['stylite']) + { + $spamtitan_actions = stylite_mail_spamtitan::getActions(); + $group++; + foreach ($spamtitan_actions as &$action) + { + $action['group'] = $group; + } + $actions = array_merge($actions, $spamtitan_actions); + } return $actions; } diff --git a/mail/js/app.js b/mail/js/app.js index 5b365932dc..bde97a5a49 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -5478,6 +5478,19 @@ app.classes.mail = AppJS.extend( et2_dialog.BUTTON_YES_NO, et2_dialog.WARNING_MESSAGE, undefined, egw); }, + /** + * Actions handler + * + * @param {object} _action egw action + * @param {object} _sender nm row + */ + spamtitan_actions: function (_action, _sender) + { + var id = _sender[0].id; + var data = egw.dataGetUIDdata(id); + this.egw.json('stylite.stylite_mail_spamtitan.ajax_action', [_action.id, {}]).sendRequest(true); + }, + /** * Implement mobile view *