-
nyloth authored
(Preliminary note : This is a deep modification in tikiwiki's prefs code. Please test first and send feedback if you can) * Now use the $prefs array everywhere (in php files also) instead of global vars. This will : - allow to use prefs the same way in smarty and php ($prefs array), - simplify all code parts that modifiy a preference, because when a pref is modified in php's $prefs array, it is also up-to-date in smarty $prefs array (everything is passed by reference now). So, no more need to reassign values in smarty each time, - avoid duplication of values in memory, - reduce risks of errors (e.g. collision in variables names, forget to add one of the "global $prefname", ...) * All user prefs are now retrieved in one query at tiki-setup stage (as site prefs) and also in session vars (when sessions are used). This will : - reduce overhead and database queries after the first page * User prefs are now overriding $prefs. This will : - simplify the whole usage of $prefs, because only one array is used (no more need, in general, to use tikilib's functions to get user prefs), - set some $prefs['site_*'] (listed in the $user_overrider_prefs array of lib/setup/user_prefs.php) for some specific site prefs that needs to be accessed in php (for example when sending mails) and that could have been overrided with the corresponding user pref
86185302