diff --git a/admin/inc/class.admin_cmd_config.inc.php b/admin/inc/class.admin_cmd_config.inc.php index ec714c3daa..f671ba052f 100644 --- a/admin/inc/class.admin_cmd_config.inc.php +++ b/admin/inc/class.admin_cmd_config.inc.php @@ -14,7 +14,8 @@ use EGroupware\Api; /** * setup command: change EGw configuration * - * @property-read string $app app whos config to change + * @property-read string $app app whos config to change (egw_config.config_app) + * @property-read string $appname app name whos config is changed (some apps store their config under app="phpgwapi") * @property-read array $set config data to set, value of null or "" to remove * @property-read array $old old values to record */ @@ -72,6 +73,17 @@ class admin_cmd_config extends admin_cmd } $config->save_repository(); - return lang('Configuration changed.'); + return lang('Configuration saved.'); + } + + /** + * Return a title / string representation for a given command, eg. to display it + * + * @return string + */ + function __tostring() + { + return lang('%1 site configuration', + lang($this->appname ? $this->appname : $this->app)); } } diff --git a/admin/inc/class.admin_config.inc.php b/admin/inc/class.admin_config.inc.php index 244ccc03b1..f7924da815 100644 --- a/admin/inc/class.admin_config.inc.php +++ b/admin/inc/class.admin_config.inc.php @@ -180,8 +180,14 @@ class admin_config } // compute real changes and their old values (null for removals) - $modifications = array_diff_assoc($c->config_data, $old); - $removals = array_diff_assoc($old, $c->config_data); + $modifications = array_udiff_assoc($c->config_data, $old, function($a, $b) + { + return (int)($a != $b); // necessary to kope with arrays + }); + $removals = array_udiff_assoc($old, $c->config_data, function($a, $b) + { + return (int)($a != $b); + }); $set = array_merge(array_fill_keys(array_keys($removals), null), $modifications); $old = array_filter($old, function($key) use ($set) { @@ -189,7 +195,8 @@ class admin_config }, ARRAY_FILTER_USE_KEY); if ($set) { - $cmd = new admin_cmd_config($config_appname, $set, $old, $_content['admin_cmd']); + $cmd = new admin_cmd_config($config_appname, $set, $old, + $_content['admin_cmd']+array('appname' => $_appname)); $msg = $cmd->run(); } else