Example #1
0
/**
 * remove one plugin
 *
 * @return array status
 */
function Core_adminPluginsRemoveOne()
{
    $to_remove = $_REQUEST['name'];
    // { is it already removed?
    $installed = Core_adminPluginsGetInstalled();
    $found = 0;
    foreach ($installed as $key => $p) {
        if ($key == $to_remove) {
            $found = 1;
        }
    }
    if ($found == 0) {
        return array('ok' => 1, 'message' => __('Plugin already removed'));
    }
    // }
    // { remove it
    $plugins = array();
    foreach ($installed as $key => $p) {
        if ($key == $to_remove) {
            continue;
        }
        $plugins[$key] = 1;
    }
    $_REQUEST['plugins'] = $plugins;
    return Core_adminPluginsSetInstalled();
    // }
}
Example #2
0
 * shows the plugins available on the cms and allows
 * them to be installed
 *
 * PHP version 5.2
 *
 * @category None
 * @package  None
 * @author   Conor Mac Aoidh <*****@*****.**>
 * @author   Kae Verens <*****@*****.**>
 * @license  GPL 2.0
 * @link     http://kvsites.ie/
 */
require_once SCRIPTBASE . 'ww.incs/api-admin.php';
echo '<h2>Plugins</h2>';
if ($action == 'Save') {
    $status = Core_adminPluginsSetInstalled();
    $msg = $status['ok'] ? 'updated' : 'failed';
    $removed = $status['removed'];
    if (count($removed)) {
        // adjust menus
        foreach ($removed as $plugin) {
            if (!isset($PLUGINS[$plugin]['admin']['menu'])) {
                continue;
            }
            $links = $PLUGINS[$plugin]['admin']['menu'];
            foreach ($links as $path => $link) {
                Core_adminMenusRemove($path);
            }
        }
        Core_cacheClear('admin');
    }