mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-17 04:15:15 +02:00
Add ArrayFilterEvent, replace app_menu hook
This commit is contained in:
parent
5b28b3d28f
commit
715248d6a2
5 changed files with 158 additions and 8 deletions
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||
namespace Friendica\EventSubscriber;
|
||||
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Event\ArrayFilterEvent;
|
||||
use Friendica\Event\ConfigLoadedEvent;
|
||||
use Friendica\Event\Event;
|
||||
use Friendica\Event\HtmlFilterEvent;
|
||||
|
@ -35,6 +36,7 @@ final class HookEventBridge
|
|||
private static array $eventMapper = [
|
||||
Event::INIT => 'init_1',
|
||||
ConfigLoadedEvent::CONFIG_LOADED => 'load_config',
|
||||
ArrayFilterEvent::APP_MENU => 'app_menu',
|
||||
HtmlFilterEvent::HEAD => 'head',
|
||||
HtmlFilterEvent::FOOTER => 'footer',
|
||||
HtmlFilterEvent::PAGE_CONTENT_TOP => 'page_content_top',
|
||||
|
@ -49,6 +51,7 @@ final class HookEventBridge
|
|||
return [
|
||||
Event::INIT => 'onNamedEvent',
|
||||
ConfigLoadedEvent::CONFIG_LOADED => 'onConfigLoadedEvent',
|
||||
ArrayFilterEvent::APP_MENU => 'onArrayFilterEvent',
|
||||
HtmlFilterEvent::HEAD => 'onHtmlFilterEvent',
|
||||
HtmlFilterEvent::FOOTER => 'onHtmlFilterEvent',
|
||||
HtmlFilterEvent::PAGE_CONTENT_TOP => 'onHtmlFilterEvent',
|
||||
|
@ -66,6 +69,13 @@ final class HookEventBridge
|
|||
static::callHook($event->getName(), $event->getConfig());
|
||||
}
|
||||
|
||||
public static function onArrayFilterEvent(ArrayFilterEvent $event): void
|
||||
{
|
||||
$event->setArray(
|
||||
static::callHook($event->getName(), $event->getArray())
|
||||
);
|
||||
}
|
||||
|
||||
public static function onHtmlFilterEvent(HtmlFilterEvent $event): void
|
||||
{
|
||||
$event->setHtml(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue