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

Open
wants to merge 6 commits into
base: 5.2-dev
Choose a base branch
from
Open
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
Prev Previous commit
Next Next commit
actionlog
  • Loading branch information
Fedik committed Jun 9, 2024
commit 1ad5c03693e7870669a36c4a8d024769b80268cb
29 changes: 15 additions & 14 deletions plugins/actionlog/joomla/src/Extension/Joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Joomla\CMS\Event\Application;
use Joomla\CMS\Event\Extension;
use Joomla\CMS\Event\Model;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Event\User;
use Joomla\CMS\MVC\Factory\MVCFactoryServiceInterface;
use Joomla\CMS\Table\Table;
use Joomla\CMS\User\UserFactoryAwareTrait;
Expand Down Expand Up @@ -572,18 +572,20 @@ public function onExtensionAfterSave(Model\AfterSaveEvent $event): void
}

/**
* On Deleting extensions logging method
* On Deleting extensions logging method.
* Method is called when an extension is being deleted
*
* @param string $context The extension
* @param Table $table DataBase Table object
* @param Model\AfterDeleteEvent $event The event instance.
*
* @return void
*
* @since 3.9.0
*/
public function onExtensionAfterDelete($context, $table): void
public function onExtensionAfterDelete(Model\AfterDeleteEvent $event): void
{
$context = $event->getContext();
$table = $event->getItem();

if (!$this->checkLoggable($this->getApplication()->getInput()->get('option'))) {
return;
}
Expand Down Expand Up @@ -612,17 +614,17 @@ public function onExtensionAfterDelete($context, $table): void
* Method is called after user data is stored in the database.
* This method logs who created/edited any user's data
*
* @param array $user Holds the new user data.
* @param boolean $isnew True if a new user is stored.
* @param boolean $success True if user was successfully stored in the database.
* @param string $msg Message.
* @param User\AfterSaveEvent $event The event instance.
*
* @return void
*
* @since 3.9.0
*/
public function onUserAfterSave($user, $isnew, $success, $msg): void
public function onUserAfterSave(User\AfterSaveEvent $event): void
{
$user = $event->getUser();
$isnew = $event->getIsNew();

$context = $this->getApplication()->getInput()->get('option');
$task = $this->getApplication()->getInput()->get('task');

Expand Down Expand Up @@ -703,16 +705,15 @@ public function onUserAfterSave($user, $isnew, $success, $msg): void
*
* Method is called after user data is deleted from the database
*
* @param array $user Holds the user data
* @param boolean $success True if user was successfully stored in the database
* @param string $msg Message
* @param User\AfterDeleteEvent $event The event instance.
*
* @return void
*
* @since 3.9.0
*/
public function onUserAfterDelete($user, $success, $msg): void
public function onUserAfterDelete(User\AfterDeleteEvent $event): void
{
$user = $event->getUser();
$context = $this->getApplication()->getInput()->get('option');

if (!$this->checkLoggable($context)) {
Expand Down