Exemplo n.º 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;
 }
Exemplo n.º 2
0
 public function beforeSaveConfig(Am_Config $before, Am_Config $after)
 {
     $arr = $after->getArray();
     if (empty($arr['aff_comm'])) {
         return;
     }
     $this->rule = Am_Di::getInstance()->affCommissionRuleTable->findFirstByType(AffCommissionRule::TYPE_GLOBAL_1);
     if (empty($this->rule)) {
         $this->rule = Am_Di::getInstance()->affCommissionRuleTable->createRecord();
         $this->rule->type = AffCommissionRule::TYPE_GLOBAL_1;
         $this->rule->title = "Default Commmission";
     }
     foreach ($arr['aff_comm'] as $aa) {
         foreach ($aa as $k => $v) {
             $this->rule->set($k, $v);
         }
     }
     unset($arr['aff_comm']);
     $after->setArray($arr);
 }