add get_pref and get_pref_override plugin hooks
[squirrelmail.git] / functions / file_prefs.php
index 0671b3ef582811ca465898704a94214c0f5dcb7b..073b366a30a3ddfb942ee8ac6e898db0971c168f 100644 (file)
@@ -79,12 +79,19 @@ function getPref($data_dir, $username, $string, $default = '') {
     global $prefs_cache;
     $result = '';
 
-    cachePrefValues($data_dir, $username);
+    $result = do_hook_function('get_pref_override', array($username, $string));
 
-    if (isset($prefs_cache[$string])) {
-        $result = $prefs_cache[$string];
-    } else {
-        $result = $default;
+    if ($result == '') {
+        cachePrefValues($data_dir, $username);
+
+        if (isset($prefs_cache[$string])) {
+            $result = $prefs_cache[$string];
+        } else {
+            $result = do_hook_function('get_pref', array($username, $string));
+            if ($result == '') {
+                $result = $default;
+            }
+        }
     }
 
     return ($result);