Exemplo n.º 1
0
 /**
  * Edit action
  *
  * Update the site settings file
  *
  * @return void
  */
 public function editAction()
 {
     $settings = Digitalus_Filter_Post::raw('setting');
     $s = new Model_SiteSettings();
     foreach ($settings as $k => $v) {
         $s->set($k, $v);
     }
     $s->save();
     $this->_message->add("Global parameters have been updated !!");
     $this->_redirect($this->_currentControllerUrl);
 }
Exemplo n.º 2
0
 /**
  * Edit action
  *
  * Update the site settings file
  *
  * @return void
  */
 public function editAction()
 {
     $form = new Admin_Form_Site();
     $form->setAction($this->baseUrl . '/admin/site/edit');
     if ($this->_request->isPost() && $form->isValid($_POST)) {
         $settings = Digitalus_Filter_Post::raw('setting');
         $s = new Model_SiteSettings();
         foreach ($settings as $k => $v) {
             $s->set($k, $v);
             /* *****************************************************************************
              * TODO: remove redirector and validate form
              * ****************************************************************************/
             /* *****************************************************************************
              * TODO: check allowed charsets for MySQL => VALIDATOR ??
                         if ('default_charset' == $k) {
                             $v = str_replace('-', '', $v);
                             $mdlConfig = new Digitalus_Installer_Config();
                             $mdlConfig->loadFile();
                             $config = $mdlConfig->get();
                             $config->production->database->charset = $v;
                             $mdlConfig->save();
                         }
              * *****************************************************************************
              * TODO: add Validators for all site meta data => consider using Zend_Form
                         if ('default_timezone' == $k) {
                             $validator = new Digitalus_Validate_Timezone();
                             $_SESSION['timezone0'] = Zend_Debug::dump($v);
                             $_SESSION['timezone1'] = Zend_Debug::dump($validator->isValid($v));
                         }
              * *****************************************************************************
              */
         }
         $s->save();
         $this->_redirect('admin/site');
     }
     $this->view->form = $form;
 }
Exemplo n.º 3
0
 private function _updateTemplateReferences()
 {
     $this->_db->query("ALTER TABLE `" . Digitalus_Db_Table::getTableName('users') . "` ADD `openid` VARCHAR(100) NOT NULL AFTER `email`");
     $this->_db->query("UPDATE `" . Digitalus_Db_Table::getTableName('pages') . "` SET `publish_level` = '1' WHERE `publish_level` = 0");
     $siteSettings = new Model_SiteSettings();
     $siteSettings->set('xml_declaration', 'never');
     $siteSettings->set('publish_pages', 0);
     $siteSettings->save();
     return true;
 }