72 lines
1.5 KiB
PHP
72 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* @brief noodles, a plugin for Dotclear 2
|
|
*
|
|
* @package Dotclear
|
|
* @subpackage Plugin
|
|
*
|
|
* @author Jean-Christian Denis and contributors
|
|
*
|
|
* @copyright Jean-Christian Denis
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace Dotclear\Plugin\noodles;
|
|
|
|
use dcCore;
|
|
use dcNsProcess;
|
|
use Dotclear\Plugin\Uninstaller\Uninstaller;
|
|
|
|
class Uninstall extends dcNsProcess
|
|
{
|
|
public static function init(): bool
|
|
{
|
|
static::$init = defined('DC_CONTEXT_ADMIN');
|
|
|
|
return static::$init;
|
|
}
|
|
|
|
public static function process(): bool
|
|
{
|
|
if (!static::$init || !dcCore::app()->plugins->moduleExists('Uninstaller')) {
|
|
return false;
|
|
}
|
|
|
|
Uninstaller::instance()
|
|
->addUserAction(
|
|
'settings',
|
|
'delete_all',
|
|
My::id()
|
|
)
|
|
->addUserAction(
|
|
'plugins',
|
|
'delete',
|
|
My::id()
|
|
)
|
|
->addUserAction(
|
|
'versions',
|
|
'delete',
|
|
My::id()
|
|
)
|
|
->addDirectAction(
|
|
'settings',
|
|
'delete_all',
|
|
My::id()
|
|
)
|
|
->addDirectAction(
|
|
'plugins',
|
|
'delete',
|
|
My::id()
|
|
)
|
|
->addDirectAction(
|
|
'versions',
|
|
'delete',
|
|
My::id()
|
|
)
|
|
;
|
|
|
|
// no custom action
|
|
return false;
|
|
}
|
|
}
|