protected function _initApplication() { $bootstrap = $this->getInvokeArg('bootstrap'); $config = $bootstrap->getOptions(); if (isset($config['default']['applicationId'])) { $this->_applicationId = $config['default']['applicationId']; } else { $this->_applicationId = 1; } $this->_application = new Application_Model_Application(); if (!Application_Model_ApplicationMapper::getInstance()->find($this->_applicationId, $this->_application)) { throw new Zend_Exception("Application not found [{$this->_applicationId}]"); } $this->_publicDirectory = isset($config['default']['publicDirectory']) ? $config['default']['publicDirectory'] : APPLICATION_PATH . '/../public'; $fileConfig = HCMS_Utils::loadThemeConfig('application.php'); if ($fileConfig && isset($fileConfig['settings'])) { $this->_application->set_settings($fileConfig['settings']); } $this->view->application = $this->_application; $this->view->headTitle($this->_application->get_name())->setSeparator(' - '); if ($this->getRequest()->getModuleName() != '') { $this->_module = $this->getRequest()->getModuleName(); } $this->view->module = $this->_module; //fb og properies $this->view->doctype('XHTML1_RDFA'); $this->view->headMeta()->setProperty('og:type', 'website'); $this->view->headMeta()->setProperty('og:url', $this->view->fullUrl()); if ($this->_application->get_name() != '') { $this->view->headMeta()->setProperty('og:title', $this->_application->get_name()); } if ($this->_application->get_og_settings('image') != '') { $this->view->headMeta()->setProperty('og:image', $this->view->fullUrl('/content/1/' . $this->_application->get_og_settings('image'))); } if ($this->_application->get_og_settings('description') != '') { $this->view->headMeta()->setProperty('og:description', $this->_application->get_og_settings('description')); } }
public function activateAction() { //Get theme name $theme = $this->_getParam('theme'); // Update database $mapper = Application_Model_ApplicationMapper::getInstance(); $appSettings = $mapper->fetchAll(); $settings = $appSettings[0]->get_settings(); $settings['theme'] = $theme; $app = new Application_Model_Application(); $app->set_settings($settings); $app->set_id(1); $mapper->save($app); //Create symlinks //$this->_createSymlinks($theme); //Delete cache HCMS_Cache::getInstance()->getObjectCache(Application_Model_TranslateMapper::getInstance())->clean(); HCMS_Cache::getInstance()->getCoreCache()->clean(); //Return json $this->_helper->json(array('message' => $this->translate("Theme is activated"), 'success' => true)); }