aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-08-27 12:13:04 +0200
committerprovokateurin <kate@provokateurin.de>2024-09-09 11:04:36 +0200
commitb0baaaed9dfdce8c2630255d0d1921679579761d (patch)
tree552abcca392fd0e8b0241ff853c636f12fa6bf1c /lib/public
parent0f732199d22cf85d991f48389c33fb6e76b7eefc (diff)
downloadnextcloud-server-b0baaaed9dfdce8c2630255d0d1921679579761d.tar.gz
nextcloud-server-b0baaaed9dfdce8c2630255d0d1921679579761d.zip
feat(NavigationManager): Add default entries handling
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/INavigationManager.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/public/INavigationManager.php b/lib/public/INavigationManager.php
index eaef1cb35ec..d22e96aa9d3 100644
--- a/lib/public/INavigationManager.php
+++ b/lib/public/INavigationManager.php
@@ -80,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|null;
+
+ /**
+ * 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;
}