aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/NavigationManager.php
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-03-06 11:13:29 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2024-03-07 22:40:31 +0100
commit876e2d6198040553cdf0b184fb585b3b63048a7d (patch)
treebccdffb7f66222df0f5261c26a38c845a640abe7 /lib/private/NavigationManager.php
parent26728846b40bb1819ad4de507f397b944d15877b (diff)
downloadnextcloud-server-876e2d6198040553cdf0b184fb585b3b63048a7d.tar.gz
nextcloud-server-876e2d6198040553cdf0b184fb585b3b63048a7d.zip
feat(AppManager): Provide `getAppIcon` function
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib/private/NavigationManager.php')
-rw-r--r--lib/private/NavigationManager.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php
index 17573d9db86..cac52ab5c9f 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -372,16 +372,18 @@ class NavigationManager implements INavigationManager {
$order = $nav['order'] ?? 100;
$type = $nav['type'];
$route = !empty($nav['route']) ? $this->urlGenerator->linkToRoute($nav['route']) : '';
- $icon = $nav['icon'] ?? 'app.svg';
- foreach ([$icon, "$app.svg"] as $i) {
+ $icon = $nav['icon'] ?? null;
+ if ($icon !== null) {
try {
- $icon = $this->urlGenerator->imagePath($app, $i);
- break;
+ $icon = $this->urlGenerator->imagePath($app, $icon);
} catch (\RuntimeException $ex) {
- // no icon? - ignore it then
+ // ignore
}
}
if ($icon === null) {
+ $icon = $this->appManager->getAppIcon($app);
+ }
+ if ($icon === null) {
$icon = $this->urlGenerator->imagePath('core', 'default-app-icon');
}