summaryrefslogtreecommitdiffstats
path: root/lib/private/Settings
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-19 10:37:17 +0100
committerJoas Schilling <coding@schilljs.com>2017-01-19 10:42:21 +0100
commitc3985aba70c7a89eeb47cef58b28442055bec4c2 (patch)
treec446ab6ae62eee51a3d8552bbf185605156ad50d /lib/private/Settings
parent8c8354399a1923b3580bf887f1f0ab1ef50bc14e (diff)
downloadnextcloud-server-c3985aba70c7a89eeb47cef58b28442055bec4c2.tar.gz
nextcloud-server-c3985aba70c7a89eeb47cef58b28442055bec4c2.zip
Add the icon for the default sections
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Settings')
-rw-r--r--lib/private/Settings/Manager.php19
-rw-r--r--lib/private/Settings/Section.php21
2 files changed, 30 insertions, 10 deletions
diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php
index 949826aa246..7a339b94199 100644
--- a/lib/private/Settings/Manager.php
+++ b/lib/private/Settings/Manager.php
@@ -29,6 +29,7 @@ use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IL10N;
use OCP\ILogger;
+use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\Lock\ILockingProvider;
use OCP\Settings\ISettings;
@@ -55,6 +56,8 @@ class Manager implements IManager {
private $userManager;
/** @var ILockingProvider */
private $lockingProvider;
+ /** @var IURLGenerator */
+ private $url;
/**
* @param ILogger $log
@@ -65,7 +68,7 @@ class Manager implements IManager {
* @param IUserManager $userManager
* @param ILockingProvider $lockingProvider
* @param Mapper $mapper
- * @internal param IDBConnection $dbc
+ * @param IURLGenerator $url
*/
public function __construct(
ILogger $log,
@@ -75,7 +78,8 @@ class Manager implements IManager {
EncryptionManager $encryptionManager,
IUserManager $userManager,
ILockingProvider $lockingProvider,
- Mapper $mapper
+ Mapper $mapper,
+ IURLGenerator $url
) {
$this->log = $log;
$this->dbc = $dbc;
@@ -85,6 +89,7 @@ class Manager implements IManager {
$this->encryptionManager = $encryptionManager;
$this->userManager = $userManager;
$this->lockingProvider = $lockingProvider;
+ $this->url = $url;
}
/**
@@ -260,11 +265,11 @@ class Manager implements IManager {
public function getAdminSections() {
// built-in sections
$sections = [
- 0 => [new Section('server', $this->l->t('Server settings'), 0)],
- 5 => [new Section('sharing', $this->l->t('Sharing'), 0)],
- 45 => [new Section('encryption', $this->l->t('Encryption'), 0)],
- 98 => [new Section('additional', $this->l->t('Additional settings'), 0)],
- 99 => [new Section('tips-tricks', $this->l->t('Tips & tricks'), 0)],
+ 0 => [new Section('server', $this->l->t('Server settings'), 0, $this->url->imagePath('settings', 'admin.svg'))],
+ 5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))],
+ 45 => [new Section('encryption', $this->l->t('Encryption'), 0, $this->url->imagePath('core', 'actions/password.svg'))],
+ 98 => [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))],
+ 99 => [new Section('tips-tricks', $this->l->t('Tips & tricks'), 0, $this->url->imagePath('settings', 'help.svg'))],
];
$rows = $this->mapper->getAdminSectionsFromDB();
diff --git a/lib/private/Settings/Section.php b/lib/private/Settings/Section.php
index b3cf242279f..c89a3999c4e 100644
--- a/lib/private/Settings/Section.php
+++ b/lib/private/Settings/Section.php
@@ -23,25 +23,29 @@
namespace OC\Settings;
-use OCP\Settings\ISection;
+use OCP\Settings\IIconSection;
-class Section implements ISection {
+class Section implements IIconSection {
/** @var string */
private $id;
/** @var string */
private $name;
/** @var int */
private $priority;
+ /** @var string */
+ private $icon;
/**
* @param string $id
* @param string $name
* @param int $priority
+ * @param string $icon
*/
- public function __construct($id, $name, $priority) {
+ public function __construct($id, $name, $priority, $icon = '') {
$this->id = $id;
$this->name = $name;
$this->priority = $priority;
+ $this->icon = $icon;
}
/**
@@ -74,4 +78,15 @@ class Section implements ISection {
public function getPriority() {
return $this->priority;
}
+
+ /**
+ * 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->icon;
+ }
}