Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2][Events] Use event classes for Actionlog plugins #43639

Merged
merged 8 commits into from
Jul 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
actionlogs
  • Loading branch information
Fedik committed Jun 9, 2024
commit 5e2c736555036d6621ac7359ba4f0c5618299d04
42 changes: 41 additions & 1 deletion plugins/actionlog/joomla/src/Extension/Joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Joomla\Database\DatabaseAwareTrait;
use Joomla\Database\Exception\ExecutionFailureException;
use Joomla\Event\DispatcherInterface;
use Joomla\Event\SubscriberInterface;
use Joomla\Utilities\ArrayHelper;

// phpcs:disable PSR1.Files.SideEffects
Expand All @@ -31,7 +32,7 @@
*
* @since 3.9.0
*/
final class Joomla extends ActionLogPlugin
final class Joomla extends ActionLogPlugin implements SubscriberInterface
{
use DatabaseAwareTrait;
use UserFactoryAwareTrait;
Expand Down Expand Up @@ -89,6 +90,45 @@ public function __construct(DispatcherInterface $dispatcher, array $config)
$this->loggableVerbs = $params->get('loggable_verbs', []);
}

/**
* Returns an array of events this subscriber will listen to.
*
* @return array
*
* @since __DEPLOY_VERSION__
*/
public static function getSubscribedEvents(): array
{
return [
'onContentAfterSave' => 'onContentAfterSave',
'onContentAfterDelete' => 'onContentAfterDelete',
'onContentChangeState' => 'onContentChangeState',
'onApplicationAfterSave' => 'onApplicationAfterSave',
'onExtensionAfterInstall' => 'onExtensionAfterInstall',
'onExtensionAfterUninstall' => 'onExtensionAfterUninstall',
'onExtensionAfterUpdate' => 'onExtensionAfterUpdate',
'onExtensionAfterSave' => 'onExtensionAfterSave',
'onExtensionAfterDelete' => 'onExtensionAfterDelete',
'onUserAfterSave' => 'onUserAfterSave',
'onUserAfterDelete' => 'onUserAfterDelete',
'onUserAfterSaveGroup' => 'onUserAfterSaveGroup',
'onUserAfterDeleteGroup' => 'onUserAfterDeleteGroup',
'onUserAfterLogin' => 'onUserAfterLogin',
'onUserLoginFailure' => 'onUserLoginFailure',
'onUserLogout' => 'onUserLogout',
'onUserAfterRemind' => 'onUserAfterRemind',
'onAfterCheckin' => 'onAfterCheckin',
'onAfterLogPurge' => 'onAfterLogPurge',
'onAfterLogExport' => 'onAfterLogExport',
'onAfterPurge' => 'onAfterPurge',
'onAfterDispatch' => 'onAfterDispatch',
'onJoomlaAfterUpdate' => 'onJoomlaAfterUpdate',
'onUserAfterResetRequest' => 'onUserAfterResetRequest',
'onUserAfterResetComplete' => 'onUserAfterResetComplete',
'onUserBeforeSave' => 'onUserBeforeSave',
];
}

/**
* After save content logging method
* This method adds a record to #__action_logs contains (message, date, context, user)
Expand Down