예제 #1
0
 function getConfigValues()
 {
     $c = new Am_Config();
     $c->read();
     $ret = $this->_getConfigValues('', $c->getArray());
     // strip keys encoded for form
     foreach ($ret as $k => $v) {
         if (preg_match('/___/', $k)) {
             unset($ret[$k]);
         }
     }
     return $ret;
 }
예제 #2
0
 public function saveConfig()
 {
     $c = new Am_Config();
     $c->read();
     $before = clone $c;
     foreach (array_merge($this->getDefaults(), $this->getValue()) as $k => $v) {
         if (preg_match('/(^|\\.)(save|_save_|p)$/', $k)) {
             continue;
         }
         if ($v === null) {
             continue;
         }
         $c->set($k, $v);
     }
     $this->beforeSaveConfig($before, $c);
     $c->save();
     $this->afterSaveConfig($before, $c);
     return true;
 }