mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 02:05:19 +02:00
create event for smilie hook
This commit is contained in:
parent
0b3915322b
commit
a6ab7dd6f1
5 changed files with 14 additions and 2 deletions
|
@ -8,8 +8,8 @@
|
|||
namespace Friendica\Content;
|
||||
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\DI;
|
||||
use Friendica\Event\ArrayFilterEvent;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
/**
|
||||
|
@ -133,8 +133,13 @@ class Smilies
|
|||
'<a href="http://redmatrix.me/">red<img class="smiley" src="' . $baseUrl . '/images/rm-16.png" alt="red#matrix" title="red#matrix" />matrix</a>'
|
||||
];
|
||||
|
||||
$eventDispatcher = DI::eventDispatcher();
|
||||
|
||||
$params = ['texts' => $texts, 'icons' => $icons];
|
||||
Hook::callAll('smilie', $params);
|
||||
|
||||
$params = $eventDispatcher->dispatch(
|
||||
new ArrayFilterEvent(ArrayFilterEvent::SMILEY_LIST, $params),
|
||||
)->getArray();
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ final class HookEventBridge
|
|||
ArrayFilterEvent::ITEM_PHOTO_MENU => 'item_photo_menu',
|
||||
ArrayFilterEvent::OEMBED_FETCH_END => 'oembed_fetch_url',
|
||||
ArrayFilterEvent::PAGE_INFO => 'page_info_data',
|
||||
ArrayFilterEvent::SMILEY_LIST => 'smilie',
|
||||
HtmlFilterEvent::HEAD => 'head',
|
||||
HtmlFilterEvent::FOOTER => 'footer',
|
||||
HtmlFilterEvent::PAGE_HEADER => 'page_header',
|
||||
|
@ -87,6 +88,7 @@ final class HookEventBridge
|
|||
ArrayFilterEvent::ITEM_PHOTO_MENU => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::OEMBED_FETCH_END => 'onOembedFetchEndEvent',
|
||||
ArrayFilterEvent::PAGE_INFO => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::SMILEY_LIST => 'onArrayFilterEvent',
|
||||
HtmlFilterEvent::HEAD => 'onHtmlFilterEvent',
|
||||
HtmlFilterEvent::FOOTER => 'onHtmlFilterEvent',
|
||||
HtmlFilterEvent::PAGE_HEADER => 'onHtmlFilterEvent',
|
||||
|
|
|
@ -46,6 +46,8 @@ final class ArrayFilterEvent extends Event
|
|||
|
||||
public const PAGE_INFO = 'friendica.data.page_info';
|
||||
|
||||
public const SMILEY_LIST = 'friendica.data.smiley_list';
|
||||
|
||||
private array $array;
|
||||
|
||||
public function __construct(string $name, array $array)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue