/** * Uninstall * @return bool */ public function uninstall() { $Factory = new PluginFactory(); $Plugin = $Factory->newInstance($this->Key); DB::getInstance()->deleteByID('plugin', $Plugin->id()); PluginFactory::clearCache(); return true; }
/** * Uninstall * @return bool */ public function uninstall() { $Factory = new PluginFactory(); $Plugin = $Factory->newInstance($this->Key); DB::getInstance()->deleteByID('plugin', $Plugin->id()); DB::getInstance()->query('DELETE FROM `' . PREFIX . 'plugin_conf` WHERE `pluginid`=' . $Plugin->id() . ' AND accountid = ' . SessionAccountHandler::getId()); PluginFactory::clearCache(); return true; }
/** * Parse all post values */ public function parsePostData() { $Factory = new PluginFactory(); foreach ($Factory->completeData() as $Plugin) { $id = $Plugin['id']; if (isset($_POST['plugin_modus_' . $id]) && isset($_POST['plugin_order_' . $id])) { DB::getInstance()->update('plugin', $id, array('active', 'order'), array((int) $_POST['plugin_modus_' . $id], (int) $_POST['plugin_order_' . $id])); } } $Factory->clearCache(); Ajax::setReloadFlag(Ajax::$RELOAD_PLUGINS); }
/** * Function to (in)activate the plugin * @param int $active */ public final function setActive($active = 1) { DB::getInstance()->update('plugin', $this->id(), 'active', $active); $this->active = $active; PluginFactory::clearCache(); }
<?php /** * File for uninstalling plugins. * Call: call.Plugin.uninstall.php?key= */ require '../inc/class.Frontend.php'; $Pluginkey = filter_input(INPUT_GET, 'key'); $Frontend = new Frontend(); $Installer = new PluginInstaller($Pluginkey); echo '<h1>' . __('Uninstall') . ' ' . $Pluginkey . '</h1>'; if ($Installer->uninstall()) { echo HTML::okay(__('The plugin has been uninstalled.')); PluginFactory::clearCache(); Ajax::setReloadFlag(Ajax::$RELOAD_ALL); echo Ajax::getReloadCommand(); } else { echo HTML::error(__('There was a problem, the plugin could not be uninstalled.')); } echo '<ul class="blocklist">'; echo '<li>'; echo Ajax::window('<a href="' . ConfigTabPlugins::getExternalUrl() . '">' . Icon::$TABLE . ' ' . __('back to list') . '</a>'); echo '</li>'; echo '</ul>';