Skip to content

Commit

Permalink
feat(Navigation): emit dedicated event for loading additional entries
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz committed Dec 17, 2024
1 parent fe90aa3 commit 71a1fbb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/NavigationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
use OC\App\AppManager;
use OC\Group\Manager;
use OCP\App\IAppManager;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\INavigationManager;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserSession;
use OCP\L10N\IFactory;
use OCP\Navigation\Events\LoadAdditionalEntriesEvent;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -56,6 +58,7 @@ public function __construct(
IGroupManager $groupManager,
IConfig $config,
LoggerInterface $logger,
protected IEventDispatcher $eventDispatcher,
) {
$this->appManager = $appManager;
$this->urlGenerator = $urlGenerator;
Expand Down Expand Up @@ -318,6 +321,7 @@ private function init() {
]);
}
}
$this->eventDispatcher->dispatchTyped(new LoadAdditionalEntriesEvent());

if ($this->userSession->isLoggedIn()) {
$user = $this->userSession->getUser();
Expand Down
17 changes: 17 additions & 0 deletions lib/public/Navigation/Events/LoadAdditionalEntriesEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\Navigation\Events;

use OCP\EventDispatcher\Event;

/**
* @since 31.0.0
*/
class LoadAdditionalEntriesEvent extends Event {
}

0 comments on commit 71a1fbb

Please sign in to comment.