/** * 主题卸载 * * @param $f3 */ public function UninstallTheme($f3) { // 权限检查 $this->requirePrivilege('manage_plugin_theme_uninstalltheme'); // 参数验证 $validator = new Validator($f3->get('GET')); $themeDirName = $validator->required()->validate('themeDirName'); if (!$this->validate($validator)) { goto out; } $themeInstance = ThemeHelper::loadPluginInstance($themeDirName); if (!$themeInstance) { $this->addFlashMessage('主题[' . $themeDirName . ']无效'); goto out_uninstall; } // 调用主题操作 $ret = $themeInstance->pluginUninstall(PluginHelper::SYSTEM_ALL); if (true !== $ret) { $this->addFlashMessage('主题[' . $themeDirName . ']卸载失败:' . $ret); goto out; } out_uninstall: ThemeHelper::removeInstallTheme($themeDirName); $this->addFlashMessage('主题卸载成功,您现在可以安全删除主题目录所有文件'); out: RouteHelper::reRoute($this, RouteHelper::getRefer(), false); }