Esempio n. 1
0
 public function getAllSettings()
 {
     $db = Zend_Registry::get('db');
     $select = $db->select()->from(array('e' => 'EventSettings'), array('*'))->where('e.language = ?', $_SESSION['System']['lng']);
     $results = $db->fetchAll($select);
     $settings = array();
     foreach ($results as $result) {
         $setting = new SxCms_Event_Setting();
         $setting->setVariable($result['variable'])->setValue($result['value'])->setLanguage($result['language']);
         $settings[$result['variable']] = $setting;
     }
     return $settings;
 }
 public function indexAction()
 {
     $settings = SxCms_Event_Setting_DataMapper::getAllSettings();
     if ($this->getRequest()->isPost()) {
         foreach ($this->_getAllParams() as $key => $value) {
             if (array_key_exists($key, $settings)) {
                 $setting = new SxCms_Event_Setting();
                 $setting->setVariable($key)->setValue($value)->setLanguage($_SESSION['System']['lng']);
                 $setting->save();
             }
         }
         $flashMessenger = $this->_helper->getHelper('FlashMessenger');
         $flashMessenger->addMessage($this->admin_tmx->_('settingsedited'));
         $this->_helper->redirector->gotoSimple('index', 'event_settings');
     }
     $this->view->settings = $settings;
 }