mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 11:25:14 +02:00
Create event for lockview_content hook
This commit is contained in:
parent
f08aef86f1
commit
ff3c4046e0
5 changed files with 76 additions and 7 deletions
|
@ -43,6 +43,7 @@ final class HookEventBridge
|
|||
ArrayFilterEvent::NAV_INFO => 'nav_info',
|
||||
ArrayFilterEvent::FEATURE_ENABLED => 'isEnabled',
|
||||
ArrayFilterEvent::FEATURE_GET => 'get',
|
||||
ArrayFilterEvent::PERMISSION_TOOLTIP_CONTENT => 'lockview_content',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL_START => 'post_local_start',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL => 'post_local',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL_END => 'post_local_end',
|
||||
|
@ -127,6 +128,7 @@ final class HookEventBridge
|
|||
ArrayFilterEvent::NAV_INFO => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::FEATURE_ENABLED => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::FEATURE_GET => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::PERMISSION_TOOLTIP_CONTENT => 'onPermissionTooltipContentEvent',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL_START => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL => 'onInsertPostLocalEvent',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL_END => 'onInsertPostLocalEndEvent',
|
||||
|
@ -215,6 +217,20 @@ final class HookEventBridge
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map the PERMISSION_TOOLTIP_CONTENT event to `lockview_content` hook
|
||||
*/
|
||||
public static function onPermissionTooltipContentEvent(ArrayFilterEvent $event): void
|
||||
{
|
||||
$data = $event->getArray();
|
||||
|
||||
$model = (array) $data['model'] ?? [];
|
||||
|
||||
$data['model'] = static::callHook($event->getName(), $model);
|
||||
|
||||
$event->setArray($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map the INSERT_POST_LOCAL event to `post_local` hook
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue