|
31 | 31 | use Kunena\Forum\Libraries\Controller\KunenaControllerDisplay; |
32 | 32 | use Kunena\Forum\Libraries\Date\KunenaDate; |
33 | 33 | use Kunena\Forum\Libraries\Event\KunenaDisplayEvent; |
| 34 | +use Kunena\Forum\Libraries\Event\KunenaGetButtons; |
34 | 35 | use Kunena\Forum\Libraries\Event\KunenaPrepareEvent; |
35 | 36 | use Kunena\Forum\Libraries\Factory\KunenaFactory; |
36 | 37 | use Kunena\Forum\Libraries\Forum\Category\KunenaCategoryHelper; |
@@ -785,9 +786,16 @@ public function getTopicActions() |
785 | 786 | } |
786 | 787 | } |
787 | 788 |
|
| 789 | + $dispatcher = Factory::getApplication()->getDispatcher(); |
788 | 790 | PluginHelper::importPlugin('kunena'); |
789 | 791 |
|
790 | | - Factory::getApplication()->triggerEvent('onKunenaGetButtons', ['topic.action', $this->topicButtons, $this]); |
| 792 | + $dispatcher->dispatch( |
| 793 | + 'onKunenaGetButtons', |
| 794 | + new KunenaGetButtons( |
| 795 | + 'onKunenaGetButtons', |
| 796 | + ['context' => 'topic.action', 'buttons' => $this->topicButtons, 'object' => $this] |
| 797 | + ) |
| 798 | + ); |
791 | 799 |
|
792 | 800 | return (string) $this->loadTemplateFile('actions'); |
793 | 801 | } |
@@ -861,9 +869,16 @@ public function getMessageActions() |
861 | 869 | $this->message->isAuthorised('delete') ? $this->messageButtons->set('delete', $this->getButton(sprintf($task, 'delete'), 'delete', 'message', 'moderation')) : null; |
862 | 870 | } |
863 | 871 |
|
| 872 | + $dispatcher = Factory::getApplication()->getDispatcher(); |
864 | 873 | PluginHelper::importPlugin('kunena'); |
865 | 874 |
|
866 | | - Factory::getApplication()->triggerEvent('onKunenaGetButtons', ['message.action', $this->messageButtons, $this]); |
| 875 | + $dispatcher->dispatch( |
| 876 | + 'onKunenaGetButtons', |
| 877 | + new KunenaGetButtons( |
| 878 | + 'onKunenaGetButtons', |
| 879 | + ['context' => 'message.action', 'buttons' => $this->messageButtons, 'object' => $this] |
| 880 | + ) |
| 881 | + ); |
867 | 882 |
|
868 | 883 | return (string) $this->loadTemplateFile("message_actions"); |
869 | 884 | } |
|
0 commit comments