activityReport/src/Uninstall.php

88 lines
1.9 KiB
PHP
Raw Normal View History

<?php
2021-09-02 22:18:08 +00:00
/**
* @brief activityReport, a plugin for Dotclear 2
2022-11-18 20:24:30 +00:00
*
2021-09-02 22:18:08 +00:00
* @package Dotclear
* @subpackage Plugin
2022-11-18 20:24:30 +00:00
*
2021-09-02 22:18:08 +00:00
* @author Jean-Christian Denis and contributors
2022-11-18 20:24:30 +00:00
*
2021-09-02 22:18:08 +00:00
* @copyright Jean-Christian Denis
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
declare(strict_types=1);
namespace Dotclear\Plugin\activityReport;
use dcCore;
use dcNsProcess;
use Dotclear\Plugin\Uninstaller\Uninstaller;
/**
* Uninstall process.
*
* Using plugin 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(
'tables',
'delete',
My::ACTIVITY_TABLE_NAME
)
->addUserAction(
'settings',
'delete_all',
My::id()
)
->addUserAction(
'versions',
'delete',
My::id()
)
->addUserAction(
'plugins',
'delete',
My::id()
)
->addDirectAction(
'tables',
'delete',
My::ACTIVITY_TABLE_NAME
)
->addDirectAction(
'settings',
'delete_all',
My::id()
)
->addDirectAction(
'versions',
'delete',
My::id()
)
->addDirectAction(
'plugins',
'delete',
My::id()
)
;
// no custom action
return false;
}
}