public function deactivate() { if (!($match = Uri::match('\\/deactivate\\/(\\w+)'))) { Redirect::to(ADMINCP_URL); } $foldername = $match[1]; Database::query("update plugins set status='0' where foldername='{$foldername}'"); Database::query("update plugins_meta set status='0' where foldername='{$foldername}'"); PluginsZone::saveCache(); Redirect::to(ADMINCP_URL . 'plugins'); }
public static function add($scName, $funcName) { $data = debug_backtrace(); $path = dirname($data[0]['file']) . '/'; $post = array(); $post['content'] = $scName; $post['func'] = $funcName; $pluginPath = $path; $folderName = basename($path); $post['foldername'] = $folderName; $post['zonename'] = 'shortcode'; $post['type'] = 'shortcode'; // Plugins::add('shortcode',$post); if (!PluginsMeta::insert($post)) { return false; } PluginsZone::addPlugin($post['zonename'], $post); }
public static function makeUninstall($foldername) { // Route::$canAdd='no'; // Route::$canRemove='yes'; self::$canUninstall = 'yes'; self::$uninstallFolderName = $foldername; Database::query("delete from plugins where foldername='{$foldername}'"); Database::query("delete from plugins_meta where foldername='{$foldername}'"); PluginsZone::removeCache($foldername); }