_data_file = $datafile; $this->_local_files = $local; $this->_default_files = $default; $this->_protected_files = $protected; if (!@file_exists($datafile)) { msg('No configuration metadata found at - '.htmlspecialchars($datafile),-1); return; } include($datafile); if (isset($config['varname'])) $this->_name = $config['varname']; if (isset($config['format'])) $this->_format = $config['format']; if (isset($config['heading'])) $this->_heading = $config['heading']; $this->locked = $this->_is_locked(); #$this->_metadata = array_merge($meta, $this->get_plugintpl_metadata($conf['template'])); $this->_metadata = $meta; // retrieve $no_default_check = array('setting_fieldset', 'setting_undefined', 'setting_no_class'); #$default = array_merge($this->get_plugintpl_default($conf['template']), $this->_read_config_group($this->_default_files)); $default = array_merge($this->_read_config_group($this->_default_files)); $local = $this->_read_config_group($this->_local_files); $protected = $this->_read_config_group($this->_protected_files); $keys = array_merge(array_keys($this->_metadata),array_keys($default), array_keys($local), array_keys($protected)); $keys = array_unique($keys); foreach ($keys as $key) { if (isset($this->_metadata[$key])) { $class = $this->_metadata[$key][0]; $class = ($class && class_exists('setting_'.$class)) ? 'setting_'.$class : 'setting'; if ($class=='setting') { $this->setting[] = new setting_no_class($key,$param); } $param = $this->_metadata[$key]; array_shift($param); } else { $class = 'setting_undefined'; $param = NULL; } #if (!in_array($class, $no_default_check) && !isset($default[$key])) { # $this->setting[] = new setting_no_default($key,$param); #} $this->setting[$key] = new $class($key,$param); $this->setting[$key]->initialize($default[$key],$local[$key],$protected[$key]); } $this->_loaded = true; } function isSingleton() { return false; } }