function com_uninstall() { // Include install helper $helper = dirname(__FILE__) . DS . 'install.linkr.php'; if (file_exists($helper)) { require_once $helper; if (!class_exists('LinkrInstaller')) { return true; } } else { return true; } // Uninstall plugins return LinkrInstaller::uninstall(); }
function uPlugin(&$installer, $plugin, $group, $name) { $msg = 'Uninstalling ' . $name . '... '; $fail = 'You\'ll have to uninstall "' . $name . '" manually.'; // Get plugin $db =& JFactory::getDBO(); $db->setQuery(' SELECT id FROM #__plugins ' . ' WHERE folder = ' . $db->Quote($group) . ' AND element = ' . $db->Quote($plugin)); $id = (int) $db->loadResult(); if ($id < 1) { LinkrInstaller::msg($msg . 'Fail: could not find plugin.', 'blue'); LinkrInstaller::msg($fail, 'blue'); return false; } // Uninstall plugin if (!$installer->uninstall('plugin', $id, 0)) { LinkrInstaller::msg($msg . 'Fail: could not uninstall plugin.', 'blue'); LinkrInstaller::msg($fail, 'blue'); return false; } LinkrInstaller::msg($msg . 'Done!', 'green'); return true; }