diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-09-12 22:58:53 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-09-14 12:55:40 +0200 |
commit | 66a7a89898678f30118151733be42ce041f55816 (patch) | |
tree | 4aff2a46fe0b1ef3971f6c0055cebbdf6fac17cb /core/Controller | |
parent | 52d962bd5346f8879290c332a2e35ad6d12c84df (diff) | |
download | nextcloud-server-66a7a89898678f30118151733be42ce041f55816.tar.gz nextcloud-server-66a7a89898678f30118151733be42ce041f55816.zip |
Add api to load additional section in profile page
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/ProfilePageController.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/Controller/ProfilePageController.php b/core/Controller/ProfilePageController.php index 61573f43753..4b710911482 100644 --- a/core/Controller/ProfilePageController.php +++ b/core/Controller/ProfilePageController.php @@ -27,6 +27,7 @@ declare(strict_types=1); namespace OC\Core\Controller; use OC\Profile\ProfileManager; +use OCP\Profile\BeforeTemplateRenderedEvent; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Services\IInitialState; @@ -36,6 +37,7 @@ use OCP\IUserManager; use OCP\IUserSession; use OCP\Share\IManager as IShareManager; use OCP\UserStatus\IManager as IUserStatusManager; +use OCP\EventDispatcher\IEventDispatcher; class ProfilePageController extends Controller { private IInitialState $initialStateService; @@ -44,6 +46,7 @@ class ProfilePageController extends Controller { private IUserManager $userManager; private IUserSession $userSession; private IUserStatusManager $userStatusManager; + private IEventDispatcher $eventDispatcher; public function __construct( $appName, @@ -53,7 +56,8 @@ class ProfilePageController extends Controller { IShareManager $shareManager, IUserManager $userManager, IUserSession $userSession, - IUserStatusManager $userStatusManager + IUserStatusManager $userStatusManager, + IEventDispatcher $eventDispatcher ) { parent::__construct($appName, $request); $this->initialStateService = $initialStateService; @@ -62,6 +66,7 @@ class ProfilePageController extends Controller { $this->userManager = $userManager; $this->userSession = $userSession; $this->userStatusManager = $userStatusManager; + $this->eventDispatcher = $eventDispatcher; } /** @@ -111,6 +116,8 @@ class ProfilePageController extends Controller { $this->profileManager->getProfileParams($targetUser, $visitingUser), ); + $this->eventDispatcher->dispatchTyped(new BeforeTemplateRenderedEvent($targetUserId)); + \OCP\Util::addScript('core', 'profile'); return new TemplateResponse( |