Hook data:
- **name** (input): the name of the used storage backend
-- **data['storage']** (output): the storage instance to use (**must** implement `\Friendica\Core\Storage\IWritableStorage`)
+- **data['storage']** (output): the storage instance to use (**must** implement `\Friendica\Core\Storage\IWritableStorage`)
### storage_config
### src/Content/ContactBlock.php
- Hook::callAll('contact_block_end', $arr);
+ Hook::callAll('contact_block_end', $text);
### src/Content/Text/BBCode.php
Hook::callAll('register_account', $uid);
Hook::callAll('remove_user', $user);
-
+
### src/Content/ContactBlock.php
- Hook::callAll('contact_block_end', $arr);
+ Hook::callAll('contact_block_end', $text);
### src/Content/Text/BBCode.php
namespace Friendica\Content\Widget;
use Friendica\Content\Text\HTML;
-use Friendica\Core\Hook;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
+use Friendica\Event\HtmlFilterEvent;
use Friendica\Model\Contact;
use Friendica\Model\User;
/**
* Get HTML for contact block
*
- * @hook contact_block_end (contacts=>array, output=>string)
* @return string Formatted HTML code or empty string
*/
public static function getHTML(array $profile, int $visitor_uid = null): string
'$micropro' => $micropro,
]);
- $arr = ['contacts' => $contacts, 'output' => $o];
+ $eventDispatcher = DI::eventDispatcher();
- Hook::callAll('contact_block_end', $arr);
+ $o = $eventDispatcher->dispatch(
+ new HtmlFilterEvent(HtmlFilterEvent::CONTACT_BLOCK_END, $o),
+ )->getHtml();
return $o;
}
HtmlFilterEvent::PAGE_CONTENT_TOP => 'page_content_top',
HtmlFilterEvent::PAGE_END => 'page_end',
HtmlFilterEvent::JOT_TOOL => 'jot_tool',
+ HtmlFilterEvent::CONTACT_BLOCK_END => 'contact_block_end',
];
/**
HtmlFilterEvent::PAGE_CONTENT_TOP => 'onHtmlFilterEvent',
HtmlFilterEvent::PAGE_END => 'onHtmlFilterEvent',
HtmlFilterEvent::JOT_TOOL => 'onHtmlFilterEvent',
+ HtmlFilterEvent::CONTACT_BLOCK_END => 'onHtmlFilterEvent',
];
}
public const JOT_TOOL = 'friendica.html.jot_tool';
+ public const CONTACT_BLOCK_END = 'friendica.html.contact_block_end';
+
private string $html;
public function __construct(string $name, string $html)
HtmlFilterEvent::PAGE_CONTENT_TOP => 'onHtmlFilterEvent',
HtmlFilterEvent::PAGE_END => 'onHtmlFilterEvent',
HtmlFilterEvent::JOT_TOOL => 'onHtmlFilterEvent',
+ HtmlFilterEvent::CONTACT_BLOCK_END => 'onHtmlFilterEvent',
];
$this->assertSame(
[HtmlFilterEvent::PAGE_CONTENT_TOP, 'page_content_top'],
[HtmlFilterEvent::PAGE_END, 'page_end'],
[HtmlFilterEvent::JOT_TOOL, 'jot_tool'],
+ [HtmlFilterEvent::CONTACT_BLOCK_END, 'contact_block_end'],
];
}