diff options
Diffstat (limited to 'lib/public/INavigationManager.php')
-rw-r--r-- | lib/public/INavigationManager.php | 76 |
1 files changed, 45 insertions, 31 deletions
diff --git a/lib/public/INavigationManager.php b/lib/public/INavigationManager.php index 36f80c3293f..2bd70c04d65 100644 --- a/lib/public/INavigationManager.php +++ b/lib/public/INavigationManager.php @@ -1,44 +1,20 @@ <?php + /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Bart Visscher <bartv@thisnet.nl> - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Joas Schilling <coding@schilljs.com> - * @author John Molakvoæ <skjnldsv@protonmail.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Julius Härtl <jus@bitgrid.net> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ // use OCP namespace for all classes that are considered public. -// This means that they should be used by apps instead of the internal ownCloud classes +// This means that they should be used by apps instead of the internal Nextcloud classes namespace OCP; /** - * @psalm-type NavigationEntry = array{id: string, order: int, href: string, name: string, app?: string, icon?: string, classes?: string, type?: string} - */ - -/** * Manages the ownCloud navigation * @since 6.0.0 + * + * @psalm-type NavigationEntry = array{id: string, order: int, href: string, name: string, app?: string, icon?: string, classes?: string, type?: string} */ interface INavigationManager { /** @@ -104,4 +80,42 @@ interface INavigationManager { * @since 22.0.0 */ public function setUnreadCounter(string $id, int $unreadCounter): void; + + /** + * Get a navigation entry by id. + * + * @param string $id ID of the navigation entry + * @since 31.0.0 + */ + public function get(string $id): ?array; + + /** + * Returns the id of the user's default entry + * + * If `user` is not passed, the currently logged in user will be used + * + * @param ?IUser $user User to query default entry for + * @param bool $withFallbacks Include fallback values if no default entry was configured manually + * Before falling back to predefined default entries, + * the user defined entry order is considered and the first entry would be used as the fallback. + * @since 31.0.0 + */ + public function getDefaultEntryIdForUser(?IUser $user = null, bool $withFallbacks = true): string; + + /** + * Get the global default entries with fallbacks + * + * @return string[] The default entries + * @since 31.0.0 + */ + public function getDefaultEntryIds(): array; + + /** + * Set the global default entries with fallbacks + * + * @param string[] $ids + * @throws \InvalidArgumentException If any of the entries is not available + * @since 31.0.0 + */ + public function setDefaultEntryIds(array $ids): void; } |