/** * Save action */ function saveAction() { if ($this->getRequest()->isPost()) { try { $data = $this->getRequest()->getPost(); // Uni_Core_ModuleManager::runSqlUpgrade('News', 'Fox', 'core'); // exit; Uni_Core_ModuleManager::installModules(); Uni_Core_ModuleManager::updateModuleStatus($data); Uni_Core_Preferences::loadPreferences(TRUE); Uni_Core_CacheManager::clearLayoutCache(); Uni_Core_CacheManager::clearModuleCache(); Fox::getHelper('core/message')->setInfo('Modules successfully saved.'); } catch (Exception $e) { Fox::getHelper('core/message')->setError($e->getMessage()); } } $this->sendRedirect('*/*/'); }
/** * Bulk status update action */ public function groupStatusAction() { try { $model = Fox::getModel('core/cache'); $codes = $this->getGroupActionIds($model); $totalIds = count($codes); $updateType = ''; $dependentParams = $this->getRequest()->getParam('dependents', array()); if (isset($dependentParams['status'])) { if ($dependentParams['status'] == Fox_Core_Model_Cache::STATUS_CLEAR) { $updateType = 'cleared'; if (in_array(Fox_Core_Model_Cache::CACHE_CODE_PREFERENCE, $codes)) { Uni_Core_Preferences::loadPreferences(TRUE); Fox::initializePreferences(); } if (in_array(Fox_Core_Model_Cache::CACHE_CODE_LAYOUT, $codes)) { Uni_Core_CacheManager::clearLayoutCache(); } } else { if ($dependentParams['status'] == Fox_Core_Model_Cache::STATUS_ENABLED) { $updateType = 'enabled'; } else { if ($dependentParams['status'] == Fox_Core_Model_Cache::STATUS_DISABLED) { $updateType = 'disabled'; } } $cacheCodes = '\'' . implode('\',\'', $codes) . '\''; $model->update(array('status' => $dependentParams['status']), 'cache_code IN (' . $cacheCodes . ')'); } Uni_Core_CacheManager::createCacheSettings(); Fox::getHelper('core/message')->setInfo('Total ' . $totalIds . ' cache(s) successfully ' . $updateType . '.'); } } catch (Exception $e) { Fox::getHelper('core/message')->setError($e->getMessage()); } echo Zend_Json_Encoder::encode(array('redirect' => Fox::getUrl('*/*/'))); }
/** * Clear cache */ protected function clearCache() { Uni_Core_Preferences::loadPreferences(TRUE); Fox::initializePreferences(); Uni_Core_CacheManager::clearLayoutCache(); }