summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-19 10:34:17 +0100
committerJoas Schilling <coding@schilljs.com>2017-01-19 10:42:21 +0100
commit8c8354399a1923b3580bf887f1f0ab1ef50bc14e (patch)
tree1134a1732816e7d54ce6909472e366af7bf93b19 /settings/Controller
parent381e58d7d4c5b04f32cdbec813ec2a2d150e09bc (diff)
downloadnextcloud-server-8c8354399a1923b3580bf887f1f0ab1ef50bc14e.tar.gz
nextcloud-server-8c8354399a1923b3580bf887f1f0ab1ef50bc14e.zip
Allow apps to specify an icon with the sections via the API
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings/Controller')
-rw-r--r--settings/Controller/AdminSettingsController.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/settings/Controller/AdminSettingsController.php b/settings/Controller/AdminSettingsController.php
index ef70caf5690..4bc986e708e 100644
--- a/settings/Controller/AdminSettingsController.php
+++ b/settings/Controller/AdminSettingsController.php
@@ -28,7 +28,9 @@ use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\INavigationManager;
use OCP\IRequest;
+use OCP\Settings\IIconSection;
use OCP\Settings\IManager as ISettingsManager;
+use OCP\Settings\ISection;
use OCP\Template;
/**
@@ -133,10 +135,16 @@ class AdminSettingsController extends Controller {
/** @var \OC\Settings\Section[] $prioritizedSections */
foreach($sections as $prioritizedSections) {
foreach ($prioritizedSections as $section) {
+ $icon = '';
+ if ($section instanceof IIconSection) {
+ $icon = $section->getIcon();
+ }
+
$templateParameters[] = [
'anchor' => $section->getID(),
'section-name' => $section->getName(),
'active' => $section->getID() === $currentSection,
+ 'icon' => $icon,
];
}
}