Skip to content

Commit c3985ab

Browse files
committed
Add the icon for the default sections
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 8c83543 commit c3985ab

10 files changed

Lines changed: 33 additions & 45 deletions

File tree

core/img/actions/settings-dark.svg

Lines changed: 1 addition & 0 deletions
Loading

lib/private/Server.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,8 @@ public function __construct($webRoot, \OC\Config $config) {
792792
$c->getEncryptionManager(),
793793
$c->getUserManager(),
794794
$c->getLockingProvider(),
795-
new \OC\Settings\Mapper($c->getDatabaseConnection())
795+
new \OC\Settings\Mapper($c->getDatabaseConnection()),
796+
$c->getURLGenerator()
796797
);
797798
return $manager;
798799
});

lib/private/Settings/Manager.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use OCP\IDBConnection;
3030
use OCP\IL10N;
3131
use OCP\ILogger;
32+
use OCP\IURLGenerator;
3233
use OCP\IUserManager;
3334
use OCP\Lock\ILockingProvider;
3435
use OCP\Settings\ISettings;
@@ -55,6 +56,8 @@ class Manager implements IManager {
5556
private $userManager;
5657
/** @var ILockingProvider */
5758
private $lockingProvider;
59+
/** @var IURLGenerator */
60+
private $url;
5861

5962
/**
6063
* @param ILogger $log
@@ -65,7 +68,7 @@ class Manager implements IManager {
6568
* @param IUserManager $userManager
6669
* @param ILockingProvider $lockingProvider
6770
* @param Mapper $mapper
68-
* @internal param IDBConnection $dbc
71+
* @param IURLGenerator $url
6972
*/
7073
public function __construct(
7174
ILogger $log,
@@ -75,7 +78,8 @@ public function __construct(
7578
EncryptionManager $encryptionManager,
7679
IUserManager $userManager,
7780
ILockingProvider $lockingProvider,
78-
Mapper $mapper
81+
Mapper $mapper,
82+
IURLGenerator $url
7983
) {
8084
$this->log = $log;
8185
$this->dbc = $dbc;
@@ -85,6 +89,7 @@ public function __construct(
8589
$this->encryptionManager = $encryptionManager;
8690
$this->userManager = $userManager;
8791
$this->lockingProvider = $lockingProvider;
92+
$this->url = $url;
8893
}
8994

9095
/**
@@ -260,11 +265,11 @@ private function query($className) {
260265
public function getAdminSections() {
261266
// built-in sections
262267
$sections = [
263-
0 => [new Section('server', $this->l->t('Server settings'), 0)],
264-
5 => [new Section('sharing', $this->l->t('Sharing'), 0)],
265-
45 => [new Section('encryption', $this->l->t('Encryption'), 0)],
266-
98 => [new Section('additional', $this->l->t('Additional settings'), 0)],
267-
99 => [new Section('tips-tricks', $this->l->t('Tips & tricks'), 0)],
268+
0 => [new Section('server', $this->l->t('Server settings'), 0, $this->url->imagePath('settings', 'admin.svg'))],
269+
5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))],
270+
45 => [new Section('encryption', $this->l->t('Encryption'), 0, $this->url->imagePath('core', 'actions/password.svg'))],
271+
98 => [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))],
272+
99 => [new Section('tips-tricks', $this->l->t('Tips & tricks'), 0, $this->url->imagePath('settings', 'help.svg'))],
268273
];
269274

270275
$rows = $this->mapper->getAdminSectionsFromDB();

lib/private/Settings/Section.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,29 @@
2323

2424
namespace OC\Settings;
2525

26-
use OCP\Settings\ISection;
26+
use OCP\Settings\IIconSection;
2727

28-
class Section implements ISection {
28+
class Section implements IIconSection {
2929
/** @var string */
3030
private $id;
3131
/** @var string */
3232
private $name;
3333
/** @var int */
3434
private $priority;
35+
/** @var string */
36+
private $icon;
3537

3638
/**
3739
* @param string $id
3840
* @param string $name
3941
* @param int $priority
42+
* @param string $icon
4043
*/
41-
public function __construct($id, $name, $priority) {
44+
public function __construct($id, $name, $priority, $icon = '') {
4245
$this->id = $id;
4346
$this->name = $name;
4447
$this->priority = $priority;
48+
$this->icon = $icon;
4549
}
4650

4751
/**
@@ -74,4 +78,15 @@ public function getName() {
7478
public function getPriority() {
7579
return $this->priority;
7680
}
81+
82+
/**
83+
* returns the relative path to an 16*16 icon describing the section.
84+
* e.g. '/core/img/places/files.svg'
85+
*
86+
* @returns string
87+
* @since 12
88+
*/
89+
public function getIcon() {
90+
return $this->icon;
91+
}
7792
}

settings/css/settings.css

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -737,35 +737,6 @@ table.grid td.date{
737737
padding-left: 25px;
738738
}
739739

740-
/* icons for sidebar */
741-
.nav-icon-server {
742-
background-image: url('../img/admin.svg?v=1');
743-
}
744-
.nav-icon-sharing {
745-
background-image: url('../img/share.svg?v=1');
746-
}
747-
.nav-icon-theming {
748-
background-image: url('../img/theming.svg?v=1');
749-
}
750-
.nav-icon-encryption {
751-
background-image: url('../img/password.svg?v=1');
752-
}
753-
.nav-icon-workflow {
754-
background-image: url('../img/tag.svg?v=1');
755-
}
756-
.nav-icon-survey_client {
757-
background-image: url('../img/toggle.svg?v=1');
758-
}
759-
.nav-icon-logging {
760-
background-image: url('../img/edit.svg?v=1');
761-
}
762-
.nav-icon-additional {
763-
background-image: url('../img/settings.svg?v=1');
764-
}
765-
.nav-icon-tips-tricks {
766-
background-image: url('../img/help.svg?v=1');
767-
}
768-
769740
#security-warning li {
770741
list-style: initial;
771742
margin: 10px 0;

settings/img/edit.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

settings/img/settings.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

settings/img/tag.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

settings/img/theming.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

settings/img/toggle.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)