public function uninstall() { // delete editor plugins $classes = PluginUtil::loadAllModulePlugins(); foreach ($classes as $class) { if (strpos($class, 'Scribite') !== false) { try { PluginUtil::uninstall($class); } catch (Exception $e) { LogUtil::registerError($e->getMessage()); } } } // delete module variables $this->delVars(); // remove hook HookUtil::unregisterProviderBundles($this->version->getHookProviderBundles()); // deletion successful return true; }
/** * Remove a plugin * @return bool true */ public function removePlugin() { $csrftoken = FormUtil::getPassedValue('csrftoken'); $this->checkCsrfToken($csrftoken); // Security and sanity checks if (!SecurityUtil::checkPermission('Extensions::', '::', ACCESS_ADMIN)) { return LogUtil::registerPermissionError(); } // Get parameters from whatever input we need $plugin = FormUtil::getPassedValue('plugin', null); $state = FormUtil::getPassedValue('state', -1); $sort = FormUtil::getPassedValue('sort', null); $module = FormUtil::getPassedValue('bymodule', null); $systemplugins = FormUtil::getPassedValue('systemplugins', false)? true : null; if (empty($plugin)) { return LogUtil::registerError($this->__('Error! No plugin class provided.'), 404, ModUtil::url('Extensions', 'admin', 'viewPlugins')); } PluginUtil::loadAllPlugins(); if (PluginUtil::uninstall($plugin)) { LogUtil::registerStatus($this->__('Done! De-installed plugin.')); } $this->redirect(ModUtil::url('Extensions', 'admin', 'viewPlugins', array('state' => $state, 'sort' => $sort, 'bymodule' => $module, 'systemplugins' => $systemplugins))); }