Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
prefs.inc
1 <?php
29 class Prefs extends MySource_Object
30 {
31 
37  var $pref_vars = Array();
38 
43  var $pref_file = '';
44 
45 
50  function Prefs($pref_file='')
51  {
52  $this->MySource_Object();
53 
54  // include the correct preference file
55  if (empty($pref_file)) $this->pref_file = SQ_DATA_PATH.'/private/conf/preferences.inc';
56  else $this->pref_file = $pref_file;
57 
58  if (is_file($this->pref_file)) {
59  include $this->pref_file;
60 
61  $pref_type = substr((get_class_lower($this)), 0, -6);
62  if (isset($preferences[$pref_type])) {
63  foreach ($preferences[$pref_type] as $var_name => $var_data) {
64  if (!isset($this->pref_vars[$var_name])) continue;
65  $this->pref_vars[$var_name]['default'] = $var_data['default'];
66  $this->pref_vars[$var_name]['protected'] = $var_data['protected'];
67  }
68  }
69  }
70 
71  }//end constructor
72 
73 
84  function paintBackend(&$o, $have_lock, $pref=null)
85  {
86  return false;
87 
88  }//end paintBackend()
89 
90 
101  function processBackend($o, $have_lock, $pref=null)
102  {
103  return false;
104 
105  }//end processBackend()
106 
107 
121  function mergePrefs($prefs1, $prefs2)
122  {
123  // by default, just return the first preferences that have been set
124  // because we have no idea how to merge the two
125  return $prefs1;
126 
127  }//end mergePrefs()
128 
129 
130 }//end class
131 
132 ?>