2021-09-01 23:35:23 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @brief improve, a plugin for Dotclear 2
|
2021-11-01 21:08:56 +00:00
|
|
|
*
|
2021-09-01 23:35:23 +00:00
|
|
|
* @package Dotclear
|
2021-09-06 21:36:50 +00:00
|
|
|
* @subpackage Plugin
|
2021-11-01 21:08:56 +00:00
|
|
|
*
|
2021-09-01 23:35:23 +00:00
|
|
|
* @author Jean-Christian Denis and contributors
|
2021-11-01 21:08:56 +00:00
|
|
|
*
|
2021-09-01 23:35:23 +00:00
|
|
|
* @copyright Jean-Christian Denis
|
|
|
|
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
*/
|
2021-11-13 21:57:51 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace plugins\improve;
|
|
|
|
|
2022-11-12 21:58:44 +00:00
|
|
|
use Clearbricks;
|
|
|
|
|
2021-11-13 21:57:51 +00:00
|
|
|
if (!defined('DC_RC_PATH') || !defined('DC_CONTEXT_ADMIN')) {
|
2021-09-01 23:35:23 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-11-13 21:57:51 +00:00
|
|
|
/**
|
|
|
|
* Improve prepend class
|
|
|
|
*
|
|
|
|
* Manage autoload and some action module helpers.
|
|
|
|
*/
|
|
|
|
class prepend
|
|
|
|
{
|
2022-11-12 21:58:44 +00:00
|
|
|
public static function process(): void
|
2021-11-13 21:57:51 +00:00
|
|
|
{
|
|
|
|
foreach (['improve', 'action', 'module'] as $class) {
|
2022-11-12 21:58:44 +00:00
|
|
|
Clearbricks::lib()->autoload(['plugins\\improve\\' . $class => __DIR__ . '/inc/core/' . $class . '.php']);
|
2021-11-13 21:57:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getActionsDir(): string
|
|
|
|
{
|
2022-11-12 21:58:44 +00:00
|
|
|
return __DIR__ . '/inc/module/';
|
2021-11-13 21:57:51 +00:00
|
|
|
}
|
2021-09-01 23:35:23 +00:00
|
|
|
|
2021-11-13 21:57:51 +00:00
|
|
|
public static function getActionsNS(): string
|
|
|
|
{
|
|
|
|
return 'plugins\\improve\\module\\';
|
|
|
|
}
|
2021-11-01 21:08:56 +00:00
|
|
|
}
|
2021-11-13 21:57:51 +00:00
|
|
|
|
|
|
|
/* process */
|
2022-11-12 21:58:44 +00:00
|
|
|
prepend::process();
|