better autoload call

This commit is contained in:
Jean-Christian Paul Denis 2021-09-03 10:01:27 +02:00
parent 8b50811b0b
commit 610e8a2124
2 changed files with 203 additions and 196 deletions

View File

@ -15,7 +15,10 @@ if (!defined('DC_RC_PATH')) {
return null;
}
$__autoload['activityReport'] = dirname(__FILE__) . '/inc/class.activity.report.php';
$d = dirname(__FILE__) . '/inc/';
$__autoload['activityReport'] = $d . 'class.activity.report.php';
$__autoload['activityReportBehaviors'] = $d . 'class.activity.report.behaviors.php';
$__autoload['activityReportLib'] = $d . 'lib.activity.report.index.php';
try {
$core->activityReport = new activityReport($core);
@ -29,7 +32,7 @@ try {
define('ACTIVITY_REPORT', true);
require_once dirname(__FILE__) . '/inc/class.activity.report.behaviors.php';
activityReportBehaviors::registerBehaviors($core);
} catch (Exception $e) {
//throw new Exception('Failed to launch activityReport');
}

View File

@ -19,6 +19,11 @@ if (!defined('ACTIVITY_REPORT')) {
return null;
}
class activityReportBehaviors
{
public static function registerBehaviors($core)
{
// ActivityReport plugin
$core->activityReport->addGroup('activityReport', __('ActivityReport messages'));
@ -212,9 +217,8 @@ $core->activityReport->addAction(
'adminBeforeUserDelete',
['activityReportBehaviors', 'userDelete']
);
}
class activityReportBehaviors
{
public static function messageActivityReport($message)
{
global $core;