summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Server.php3
-rw-r--r--lib/private/Settings/Manager.php19
-rw-r--r--lib/private/Settings/Section.php21
3 files changed, 32 insertions, 11 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index d88a687bbc4..8528d5e7b32 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -792,7 +792,8 @@ class Server extends ServerContainer implements IServerContainer {
$c->getEncryptionManager(),
$c->getUserManager(),
$c->getLockingProvider(),
- new \OC\Settings\Mapper($c->getDatabaseConnection())
+ new \OC\Settings\Mapper($c->getDatabaseConnection()),
+ $c->getURLGenerator()
);
return $manager;
});
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;
+ }
}