Create event for home_content hook

This commit is contained in:
Art4 2025-03-25 15:57:26 +00:00
parent a9f02bfef5
commit a9b36f55c9
6 changed files with 19 additions and 9 deletions

View file

@ -8,10 +8,10 @@
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Event\Event;
use Friendica\Event\HtmlFilterEvent;
use Friendica\Model\User;
use Friendica\Module\Security\Login;
use Friendica\Protocol\ActivityPub;
@ -66,7 +66,10 @@ class Home extends BaseModule
$login = Login::form(DI::args()->getQueryString(), Register::getPolicy() !== Register::CLOSED);
$content = '';
Hook::callAll('home_content', $content);
$content = $eventDispatcher->dispatch(
new HtmlFilterEvent(HtmlFilterEvent::MOD_HOME_CONTENT, $content),
)->getHtml();
$tpl = Renderer::getMarkupTemplate('home.tpl');
return Renderer::replaceMacros($tpl, [