koblog/bl-kernel/admin/controllers/uninstall-plugin.php

43 lines
No EOL
1.4 KiB
PHP

<?php defined('KOBLOG') or die('Koblog CMS.');
// ============================================================================
// Check role
// ============================================================================
checkRole(array('admin'));
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================
$pluginClassName = $layout['parameters'];
$returnPage = "plugins";
if (isset($plugins['all'][$pluginClassName])) {
$plugin = $plugins['all'][$pluginClassName];
switch ($plugin->type()) {
case 'theme':
$returnPage = "themes";
break;
case 'widget':
$returnPage = "sidebar";
break;
default:
break;
}
}
deactivatePlugin($pluginClassName);
Redirect::page($returnPage);