diff options
-rw-r--r-- | core/img/actions/settings-dark.svg | 1 | ||||
-rw-r--r-- | lib/private/Server.php | 3 | ||||
-rw-r--r-- | lib/private/Settings/Manager.php | 19 | ||||
-rw-r--r-- | lib/private/Settings/Section.php | 21 | ||||
-rw-r--r-- | settings/css/settings.css | 29 | ||||
-rw-r--r-- | settings/img/edit.svg | 1 | ||||
-rw-r--r-- | settings/img/settings.svg | 1 | ||||
-rw-r--r-- | settings/img/tag.svg | 1 | ||||
-rw-r--r-- | settings/img/theming.svg | 1 | ||||
-rw-r--r-- | settings/img/toggle.svg | 1 |
10 files changed, 33 insertions, 45 deletions
diff --git a/core/img/actions/settings-dark.svg b/core/img/actions/settings-dark.svg new file mode 100644 index 00000000000..2160b673e30 --- /dev/null +++ b/core/img/actions/settings-dark.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1"><path d="M6.938 0A.43.43 0 0 0 6.5.438v1.25a5.818 5.818 0 0 0-1.53.656l-.907-.906a.436.436 0 0 0-.625 0l-1.5 1.5a.436.436 0 0 0 0 .624l.906.907c-.285.48-.514.976-.656 1.53H.938a.43.43 0 0 0-.438.438v2.125C.5 8.81.69 9 .938 9h1.25a5.82 5.82 0 0 0 .656 1.53l-.907.908a.436.436 0 0 0 0 .625l1.5 1.5c.176.176.45.176.625 0l.907-.907c.48.285.976.514 1.53.656v1.25c0 .25.19.438.437.438h2.125a.43.43 0 0 0 .438-.438v-1.25a5.82 5.82 0 0 0 1.53-.657l.907.907c.176.175.45.175.625 0l1.5-1.5a.436.436 0 0 0 0-.625l-.906-.906A5.79 5.79 0 0 0 13.812 9h1.25a.43.43 0 0 0 .438-.438V6.437A.43.43 0 0 0 15.062 6h-1.25a5.79 5.79 0 0 0-.656-1.532l.906-.906a.436.436 0 0 0 0-.625l-1.5-1.5a.436.436 0 0 0-.625 0l-.906.906a5.816 5.816 0 0 0-1.53-.656V.437A.43.43 0 0 0 9.063 0zM8 4.157a3.344 3.344 0 0 1 0 6.686 3.344 3.344 0 0 1 0-6.686z" display="block"/></svg> 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; + } } diff --git a/settings/css/settings.css b/settings/css/settings.css index b9b5570bc7e..5c6e30b9bf2 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -737,35 +737,6 @@ table.grid td.date{ padding-left: 25px; } -/* icons for sidebar */ -.nav-icon-server { - background-image: url('../img/admin.svg?v=1'); -} -.nav-icon-sharing { - background-image: url('../img/share.svg?v=1'); -} -.nav-icon-theming { - background-image: url('../img/theming.svg?v=1'); -} -.nav-icon-encryption { - background-image: url('../img/password.svg?v=1'); -} -.nav-icon-workflow { - background-image: url('../img/tag.svg?v=1'); -} -.nav-icon-survey_client { - background-image: url('../img/toggle.svg?v=1'); -} -.nav-icon-logging { - background-image: url('../img/edit.svg?v=1'); -} -.nav-icon-additional { - background-image: url('../img/settings.svg?v=1'); -} -.nav-icon-tips-tricks { - background-image: url('../img/help.svg?v=1'); -} - #security-warning li { list-style: initial; margin: 10px 0; diff --git a/settings/img/edit.svg b/settings/img/edit.svg deleted file mode 100644 index 5b798f3f4e4..00000000000 --- a/settings/img/edit.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 16 16" version="1"><path style="block-progression:tb;text-transform:none;text-indent:0" d="M2.35 1.002A.45.45 0 0 0 2 1.44V14.56c0 .232.206.44.432.44H13.57a.452.452 0 0 0 .432-.438V4.42a.458.458 0 0 0-.055-.192l-3.312-3.2a.427.427 0 0 0-.135-.026H2.43a.424.424 0 0 0-.08 0zM4 3h6v1H4V3zm0 3h5v1H4V6zm0 3h8v1H4V9zm0 3h4v1H4v-1z" color="#000"/></svg>
\ No newline at end of file diff --git a/settings/img/settings.svg b/settings/img/settings.svg deleted file mode 100644 index f132dfa94bd..00000000000 --- a/settings/img/settings.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 16 16" version="1"><path d="M6.938 0A.43.43 0 0 0 6.5.438v1.25a5.818 5.818 0 0 0-1.53.656l-.907-.906a.436.436 0 0 0-.625 0l-1.5 1.5a.436.436 0 0 0 0 .624l.906.907c-.285.48-.514.976-.656 1.53H.938a.43.43 0 0 0-.438.438v2.125C.5 8.81.69 9 .938 9h1.25a5.82 5.82 0 0 0 .656 1.53l-.907.908a.436.436 0 0 0 0 .625l1.5 1.5c.176.176.45.176.625 0l.907-.907c.48.285.976.514 1.53.656v1.25c0 .25.19.438.437.438h2.125a.43.43 0 0 0 .438-.438v-1.25a5.82 5.82 0 0 0 1.53-.657l.907.907c.176.175.45.175.625 0l1.5-1.5a.436.436 0 0 0 0-.625l-.906-.906A5.79 5.79 0 0 0 13.812 9h1.25a.43.43 0 0 0 .438-.438V6.437A.43.43 0 0 0 15.062 6h-1.25a5.79 5.79 0 0 0-.656-1.532l.906-.906a.436.436 0 0 0 0-.625l-1.5-1.5a.436.436 0 0 0-.625 0l-.906.906a5.816 5.816 0 0 0-1.53-.656V.437A.43.43 0 0 0 9.063 0zM8 4.157a3.344 3.344 0 0 1 0 6.686 3.344 3.344 0 0 1 0-6.686z" display="block"/></svg> diff --git a/settings/img/tag.svg b/settings/img/tag.svg deleted file mode 100644 index 464ab936a74..00000000000 --- a/settings/img/tag.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1" viewBox="0 0 16 16"><path color="#000" fill="none" d="M-62.897-32.993h163.31v97.986h-163.31z"/><path d="M6.186.96L1.38.975c-.273 0-.347.21-.348.346l-.015 4.802 8.723 8.722a.498.498 0 0 0 .71 0l4.456-4.457a.5.5 0 0 0 .002-.71v.01L6.54 1.318 6.186.964zM4.02 2.814a1.144 1.144 0 0 1 1.143 1.144A1.144 1.144 0 0 1 4.02 5.1a1.144 1.144 0 0 1-1.145-1.143A1.144 1.144 0 0 1 4.02 2.813z"/></svg>
\ No newline at end of file diff --git a/settings/img/theming.svg b/settings/img/theming.svg deleted file mode 100644 index adf97966c41..00000000000 --- a/settings/img/theming.svg +++ /dev/null @@ -1 +0,0 @@ -<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M10.707 11.412l-.587-.587-.03-.03a.513.513 0 0 1-.074-.526L13.07 3.4l-1.5-1.498-.15.15-.708-.706.505-.505a.538.538 0 0 1 .224-.128c.04-.01.05-.01.087-.016h.087c.04.006.05.006.086.016.072.02.134.055.192.1.74.676 1.42 1.415 2.127 2.124a.503.503 0 0 1 .103.556l-3.053 6.87.344.343.49-.49 3.01 3.01a1.192 1.192 0 0 1-1.685 1.686l-3.012-3.01.49-.488zm-.533-10.217a.986.986 0 0 0-1.396 0l-7.582 7.58a.99.99 0 0 0 0 1.398l1.397 1.396a.986.986 0 0 0 1.396 0l7.58-7.583a.988.988 0 0 0 0-1.396l-1.396-1.395z" fill="#000"/></svg> diff --git a/settings/img/toggle.svg b/settings/img/toggle.svg deleted file mode 100644 index 1f3de01ff34..00000000000 --- a/settings/img/toggle.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="16" viewBox="0 0 16 16" width="16" overflow="visible"><path d="M8 3C4.89 3 2.073 4.72 0 7.5 2.073 10.28 4.89 12 8 12c3.11 0 5.927-1.72 8-4.5C13.927 4.72 11.11 3 8 3zm0 1.5a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM8 6a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z" fill="#222"/></svg>
\ No newline at end of file |