From 956cfdb6df90521cfd4fa1899f14faaa8140ba45 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 25 Jan 2017 15:23:26 +0100 Subject: [PATCH] add icon for admin settings Signed-off-by: Bjoern Schiessle --- img/app-dark.svg | 5 +++++ lib/Settings/AdminSection.php | 28 +++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 img/app-dark.svg diff --git a/img/app-dark.svg b/img/app-dark.svg new file mode 100644 index 00000000..e7a39e61 --- /dev/null +++ b/img/app-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/lib/Settings/AdminSection.php b/lib/Settings/AdminSection.php index 26e793bf..f34b837c 100644 --- a/lib/Settings/AdminSection.php +++ b/lib/Settings/AdminSection.php @@ -24,15 +24,26 @@ use OCP\IL10N; -use OCP\Settings\ISection; +use OCP\IURLGenerator; +use OCP\Settings\IIconSection; -class AdminSection implements ISection { +class AdminSection implements IIconSection { /** @var IL10N */ private $l; - public function __construct(IL10N $l) { + /** @var IURLGenerator */ + private $urlGenerator; + + /** + * AdminSection constructor. + * + * @param IL10N $l + * @param IURLGenerator $urlGenerator + */ + public function __construct(IL10N $l, IURLGenerator $urlGenerator) { $this->l = $l; + $this->urlGenerator = $urlGenerator; } /** @@ -65,4 +76,15 @@ public function getPriority() { return 0; } + /** + * returns the relative path to an 16*16 icon describing the section. + * e.g. '/core/img/places/files.svg' + * + * @returns string + * @since 12 + */ + public function getIcon() { + return $this->urlGenerator->imagePath('serverinfo', 'app-dark.svg'); + } + }