function disableJsonAction() { $extensions = RM_Environment::getInstance()->getOutOfDateExtensions(); $pluginManager = new RM_Plugin_Manager($this->_translate); $pluginModel = new RM_Plugins(); foreach ($extensions['plugins'] as $pluginName) { $plugin = $pluginModel->fetchByName($pluginName); try { $pluginManager->disable($plugin); } catch (Exception $e) { //TODO: add message to log that we could not disable this plugin continue; } } $moduleManager = new RM_Module_Manager($this->_translate); $moduleModel = new RM_Modules(); foreach ($extensions['modules'] as $moduleName) { $module = $moduleModel->fetchByName($moduleName); try { $moduleManager->disable($module); } catch (Exception $e) { //TODO: add message to log that we could not disable this module continue; } } return array('data' => array('success' => true)); }
public function disableJsonAction() { $json = new stdClass(); $json->success = 1; $json->msg = array(); $ids = $this->_getParam('ids', array()); $manager = new RM_Module_Manager($this->_translate); $model = new RM_Modules(); foreach ($ids as $id) { $row = $model->find($id)->current(); try { $manager->disable($row); } catch (Exception $e) { $json->success = 0; $json->msg[] = $e->getMessage(); } } return array('data' => $json); }