From c03ec0679e17ce02acca2b61f1ae72e4e55fb0f8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 28 Nov 2014 12:43:27 +0000 Subject: [PATCH] sort apps alphabetic and open external links with a target _blank --- admin/inc/class.admin_ui.inc.php | 10 +++++++++- admin/js/app.js | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/admin/inc/class.admin_ui.inc.php b/admin/inc/class.admin_ui.inc.php index 52a1cbc0ec..81536a9ff6 100644 --- a/admin/inc/class.admin_ui.inc.php +++ b/admin/inc/class.admin_ui.inc.php @@ -488,7 +488,15 @@ class admin_ui admin_ui::$hook_data[$appname] = $file2 ? $file2 : $file; //error_log(__METHOD__."(".array2string(func_get_args()).")"); } - return array_merge($GLOBALS['egw']->hooks->process('admin', array('admin')), self::$hook_data); + self::$hook_data = array_merge($GLOBALS['egw']->hooks->process('admin', array('admin')), self::$hook_data); + + // sort apps alphabetic by their title / translation of app-name + uksort(self::$hook_data, function($a, $b) + { + return strcasecmp(lang($a), lang($b)); + }); + + return self::$hook_data; } /** diff --git a/admin/js/app.js b/admin/js/app.js index 0d6f17f268..8b300e099d 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -118,6 +118,12 @@ app.classes.admin = AppJS.extend( this.egw.message(this.egw.lang('Please submit (or postpone) statistic first'), 'info'); return; // do not allow to leave statistics submit } + // url outside EGroupware eg. eSyncPro linking to wikipedia + if (_url && _url.indexOf(this.egw.webserverUrl) == -1) + { + window.open(_url, '_blank'); + return; + } if (_url) { this.iframe.set_src(_url);