From 0493ca041c8d71a0ece0aaf4c386907a96e04b20 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 9 Mar 2016 09:29:13 +0000 Subject: [PATCH] nicer UI to select apps for mobile device and not storing default, to allow chaning it, when more apps become available --- admin/inc/class.uiconfig.inc.php | 2 +- admin/inc/hook_config_validate.inc.php | 21 ++++++++++++++++++++- admin/lang/egw_de.lang | 2 +- admin/lang/egw_en.lang | 2 +- admin/templates/default/config.tpl | 2 +- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/admin/inc/class.uiconfig.inc.php b/admin/inc/class.uiconfig.inc.php index 237e2424f4..4060f05115 100644 --- a/admin/inc/class.uiconfig.inc.php +++ b/admin/inc/class.uiconfig.inc.php @@ -124,7 +124,7 @@ class uiconfig $c->config_data[$key] = $config; if (in_array($key, (array)$GLOBALS['egw_info']['server']['found_validation_hook'], true) && function_exists($key)) { - call_user_func($key,$config); + call_user_func($key, $config, $c); if($GLOBALS['config_error']) { $errors .= lang($GLOBALS['config_error']) . "\n"; diff --git a/admin/inc/hook_config_validate.inc.php b/admin/inc/hook_config_validate.inc.php index 3df687425d..b11ebb5540 100644 --- a/admin/inc/hook_config_validate.inc.php +++ b/admin/inc/hook_config_validate.inc.php @@ -14,7 +14,7 @@ use EGroupware\Api; /* Set global flag to indicate for which config settings we have equally named validation methods */ -$GLOBALS['egw_info']['server']['found_validation_hook'] = array('vfs_image_dir'); +$GLOBALS['egw_info']['server']['found_validation_hook'] = array('vfs_image_dir','fw_mobile_app_list'); /** * Check VFS dir exists and delete image map to recreate it, if vfs-image-dir changes @@ -39,4 +39,23 @@ function vfs_image_dir($vfs_image_dir) // Set the global now, or the old value will get re-loaded $GLOBALS['egw_info']['server']['vfs_image_dir'] = $vfs_image_dir; } +} + +/** + * Do NOT store the default to allow changing it if more apps become available + * + * @param type $app_list + * @param \EGroupware\Api\Config $c + */ +function fw_mobile_app_list($app_list, Api\Config $c) +{ + // normalize lists + sort($app_list); + $default_list = explode(',', jdots_framework::DEFAULT_MOBILE_APPS); + sort($default_list); + + if ($app_list == $default_list) + { + $c->config_data['fw_mobile_app_list'] = null; + } } \ No newline at end of file diff --git a/admin/lang/egw_de.lang b/admin/lang/egw_de.lang index ef5df126dd..6894637bed 100644 --- a/admin/lang/egw_de.lang +++ b/admin/lang/egw_de.lang @@ -96,6 +96,7 @@ application '%1' not found (maybe not installed or misspelled)! admin de Anwendu application name admin de Name der Anwendung application title admin de Titel der Anwendung applications admin de Anwendungen +applications available on mobile devices admin de Anwendungen die auf Mobilgeräten zur Verfügung stehen applications list admin de Liste der Anwendungen applications run rights updated. admin de Anwendungsrechte aktualisiert. applies the changes admin de übernimmt Änderungen @@ -416,7 +417,6 @@ limit to members of admin de beschränken auf Mitglieder von list config settings admin de Konfigurationseinstellungen auflisten list current sessions admin de aktive Sitzungen anzeigen list of current users admin de Liste der gegenwärtigen Benutzer -list of enabled applications on mobile template (apps must be comma separated) admin de Liste freigeschalteter Anwendung für Mobilgeräte (komma separiert) log user-agent and action of changes in history-log of entries admin de Protokolliere Browser-Typ und Aktion von Änderungen in der History der Einträge logged out admin de abgemeldet login history admin de Login-Kontrolle diff --git a/admin/lang/egw_en.lang b/admin/lang/egw_en.lang index 10f4036b96..89c3b5330a 100644 --- a/admin/lang/egw_en.lang +++ b/admin/lang/egw_en.lang @@ -96,6 +96,7 @@ application '%1' not found (maybe not installed or misspelled)! admin en Applica application name admin en Application name application title admin en Application title applications admin en Applications +applications available on mobile devices admin en Applications available on mobile devices applications list admin en Applications list applications run rights updated. admin en Applications run rights updated. applies the changes admin en Applies the changes @@ -416,7 +417,6 @@ limit to members of admin en Limit to members of list config settings admin en List config settings list current sessions admin en List current sessions list of current users admin en List of current users -list of enabled applications on mobile template (apps must be comma separated) admin en List of enabled applications on mobile template (apps must be comma separated) log user-agent and action of changes in history-log of entries admin en Log user-agent and action of changes in history-log of entries logged out admin en Logged out login history admin en Login history diff --git a/admin/templates/default/config.tpl b/admin/templates/default/config.tpl index c877f55bd6..8b343bbb80 100644 --- a/admin/templates/default/config.tpl +++ b/admin/templates/default/config.tpl @@ -114,7 +114,7 @@ - {lang_List_of_enabled_applications_on_mobile_template_(apps_must_be_comma_separated)}: + {lang_Applications_available_on_mobile_devices}: {call_jdots_framework::mobile_app_list}