2022-09-13 13:51:00 +00:00
|
|
|
<?php
|
2022-09-14 10:43:45 +00:00
|
|
|
|
2022-09-13 13:51:00 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
// SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
|
|
|
namespace OCA\Social\Listeners;
|
|
|
|
|
|
|
|
use OCP\EventDispatcher\Event;
|
|
|
|
use OCP\EventDispatcher\IEventListener;
|
|
|
|
use OCP\Profile\BeforeTemplateRenderedEvent;
|
|
|
|
use OCP\Util;
|
|
|
|
|
2023-01-04 23:38:23 +00:00
|
|
|
/**
|
2023-01-05 09:10:41 +00:00
|
|
|
* @template-implements IEventListener<\OCP\Profile\BeforeTemplateRenderedEvent>
|
2023-01-04 23:38:23 +00:00
|
|
|
*/
|
2022-09-13 13:51:00 +00:00
|
|
|
class ProfileSectionListener implements IEventListener {
|
|
|
|
public function handle(Event $event): void {
|
|
|
|
if (!($event instanceof BeforeTemplateRenderedEvent)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Util::addScript('social', 'social-profilePage');
|
|
|
|
}
|
|
|
|
}
|