Ejemplo n.º 1
0
 private static function _init_vars($only_load_key = false)
 {
     if (self::$config_vars) {
         return false;
     }
     self::$config_vars = array();
     $sql = "SELECT `key`,`val` FROM `" . _DB_PREFIX . "config` ";
     foreach (qa($sql) as $c) {
         self::$config_vars[$c['key']] = $c['val'];
     }
     if (_DEMO_MODE && isset($_SESSION['_demo_config'])) {
         foreach ($_SESSION['_demo_config'] as $key => $val) {
             self::$config_vars[$key] = $val;
         }
     }
     if (function_exists('hook_handle_callback')) {
         // hook into the company module (or any other modules in the future) to modify this if needed
         $new_configs = hook_handle_callback('config_init_vars', self::$config_vars);
         // returns a list of new configs from other modules
         if (is_array($new_configs)) {
             foreach ($new_configs as $new_config) {
                 if (is_array($new_config)) {
                     self::$config_vars = array_merge(self::$config_vars, $new_config);
                 }
             }
         }
     }
 }