Esempio n. 1
0
 /**
  * Try to disable plugin. This method should be only invoked by any other core
  *
  * @throws RM_Exception
  * @param RM_Module_Row $module
  * @return bool
  */
 public function disable(RM_Module_Row $module)
 {
     $model = new RM_Modules();
     $moduleObject = $model->get($module->name);
     //Try/catch just for visualisation and better code understanding
     //we don't want to handle this exception here and just throw it to higher level
     try {
         $moduleObject->disable();
     } catch (RM_Exception $e) {
         throw $e;
     }
     $model->disable($module);
     return true;
 }
Esempio n. 2
0
 /**
  * Returns data for the info grid (grid with language files) on the language page.
  *
  * This method returns the list data in JSON format. This is implicated in
  * lists.js
  *
  * @param    request iso   
  * @return   json    the json data for the list.
  */
 public function infogridJsonAction()
 {
     $iso = $this->_getParam('iso');
     $files = RM_Language_Manager::$files;
     $jsonFiles = array();
     foreach ($files as $file) {
         $jsonFiles[] = array($file, RM_Language_Manager::TYPE_MAIN . ',' . RM_Language_Manager::TYPE_MAIN, $iso . ',' . $file . ',' . RM_Language_Manager::TYPE_MAIN . ',' . RM_Language_Manager::TYPE_MAIN);
     }
     $extensionFiles = RM_Language_Manager::$extensionFiles;
     $moduleModel = new RM_Modules();
     $modules = $moduleModel->fetchAll();
     foreach ($modules as $module) {
         foreach ($extensionFiles as $file) {
             $jsonFiles[] = array($file, RM_Language_Manager::TYPE_MODULE . ',' . $moduleModel->get($module->name)->getName(), $iso . ',' . $file . ',' . RM_Language_Manager::TYPE_MODULE . ',' . $module->name);
         }
     }
     $pluginModel = new RM_Plugins();
     $plugins = $pluginModel->fetchAll();
     foreach ($plugins as $plugin) {
         foreach ($extensionFiles as $file) {
             $jsonFiles[] = array($file, RM_Language_Manager::TYPE_PLUGIN . ',' . $pluginModel->get($plugin->name)->getName(), $iso . ',' . $file . ',' . RM_Language_Manager::TYPE_PLUGIN . ',' . $plugin->name);
         }
     }
     $json = new stdClass();
     $json->total = count($jsonFiles);
     $json->data = $jsonFiles;
     return array('data' => $jsonFiles);
 }