From 4c23b3766e3467c478af1233fe5f47ac03fb3605 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 28 Aug 2011 08:28:53 +0000 Subject: [PATCH] egw API update missed in r36331: - sending EGroupware configuration (non-sensible stuff) to browser and make it available via egw.config(_name, _app="phpgwapi") - sending link-registry in the same file - used javascript file uses etag to ensure there's no need to load it on each request --- phpgwapi/js/jsapi/egw.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/phpgwapi/js/jsapi/egw.js b/phpgwapi/js/jsapi/egw.js index cdd7c8f13c..9993863aaf 100644 --- a/phpgwapi/js/jsapi/egw.js +++ b/phpgwapi/js/jsapi/egw.js @@ -275,6 +275,39 @@ else { this.link_registry[_app] = _registry; } + }, + + /** + * Clientside config + * + * @access: private, use egw.config(_name, _app="phpgwapi") + */ + configs: null, + + /** + * Query clientside config + * + * @param string _name name of config variable + * @param string _app default "phpgwapi" + * @return mixed + */ + config: function (_name, _app) + { + if (typeof _app == 'undefined') _app = 'phpgwapi'; + + if (typeof this.configs[_app] == 'undefined') return null; + + return this.configs[_app][_name]; + }, + + /** + * Set clientside configuration for all apps + * + * @param array/object + */ + set_configs: function(_configs) + { + this.configs = _configs; } }; }