Add the icon for the default sections

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-01-19 10:37:17 +01:00
parent 8c8354399a
commit c3985aba70
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
10 changed files with 33 additions and 45 deletions

View File

@ -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>

After

Width:  |  Height:  |  Size: 915 B

View File

@ -792,7 +792,8 @@ class Server extends ServerContainer implements IServerContainer {
$c->getEncryptionManager(), $c->getEncryptionManager(),
$c->getUserManager(), $c->getUserManager(),
$c->getLockingProvider(), $c->getLockingProvider(),
new \OC\Settings\Mapper($c->getDatabaseConnection()) new \OC\Settings\Mapper($c->getDatabaseConnection()),
$c->getURLGenerator()
); );
return $manager; return $manager;
}); });

View File

@ -29,6 +29,7 @@ use OCP\IConfig;
use OCP\IDBConnection; use OCP\IDBConnection;
use OCP\IL10N; use OCP\IL10N;
use OCP\ILogger; use OCP\ILogger;
use OCP\IURLGenerator;
use OCP\IUserManager; use OCP\IUserManager;
use OCP\Lock\ILockingProvider; use OCP\Lock\ILockingProvider;
use OCP\Settings\ISettings; use OCP\Settings\ISettings;
@ -55,6 +56,8 @@ class Manager implements IManager {
private $userManager; private $userManager;
/** @var ILockingProvider */ /** @var ILockingProvider */
private $lockingProvider; private $lockingProvider;
/** @var IURLGenerator */
private $url;
/** /**
* @param ILogger $log * @param ILogger $log
@ -65,7 +68,7 @@ class Manager implements IManager {
* @param IUserManager $userManager * @param IUserManager $userManager
* @param ILockingProvider $lockingProvider * @param ILockingProvider $lockingProvider
* @param Mapper $mapper * @param Mapper $mapper
* @internal param IDBConnection $dbc * @param IURLGenerator $url
*/ */
public function __construct( public function __construct(
ILogger $log, ILogger $log,
@ -75,7 +78,8 @@ class Manager implements IManager {
EncryptionManager $encryptionManager, EncryptionManager $encryptionManager,
IUserManager $userManager, IUserManager $userManager,
ILockingProvider $lockingProvider, ILockingProvider $lockingProvider,
Mapper $mapper Mapper $mapper,
IURLGenerator $url
) { ) {
$this->log = $log; $this->log = $log;
$this->dbc = $dbc; $this->dbc = $dbc;
@ -85,6 +89,7 @@ class Manager implements IManager {
$this->encryptionManager = $encryptionManager; $this->encryptionManager = $encryptionManager;
$this->userManager = $userManager; $this->userManager = $userManager;
$this->lockingProvider = $lockingProvider; $this->lockingProvider = $lockingProvider;
$this->url = $url;
} }
/** /**
@ -260,11 +265,11 @@ class Manager implements IManager {
public function getAdminSections() { public function getAdminSections() {
// built-in sections // built-in sections
$sections = [ $sections = [
0 => [new Section('server', $this->l->t('Server settings'), 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)], 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)], 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)], 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)], 99 => [new Section('tips-tricks', $this->l->t('Tips & tricks'), 0, $this->url->imagePath('settings', 'help.svg'))],
]; ];
$rows = $this->mapper->getAdminSectionsFromDB(); $rows = $this->mapper->getAdminSectionsFromDB();

View File

@ -23,25 +23,29 @@
namespace OC\Settings; namespace OC\Settings;
use OCP\Settings\ISection; use OCP\Settings\IIconSection;
class Section implements ISection { class Section implements IIconSection {
/** @var string */ /** @var string */
private $id; private $id;
/** @var string */ /** @var string */
private $name; private $name;
/** @var int */ /** @var int */
private $priority; private $priority;
/** @var string */
private $icon;
/** /**
* @param string $id * @param string $id
* @param string $name * @param string $name
* @param int $priority * @param int $priority
* @param string $icon
*/ */
public function __construct($id, $name, $priority) { public function __construct($id, $name, $priority, $icon = '') {
$this->id = $id; $this->id = $id;
$this->name = $name; $this->name = $name;
$this->priority = $priority; $this->priority = $priority;
$this->icon = $icon;
} }
/** /**
@ -74,4 +78,15 @@ class Section implements ISection {
public function getPriority() { public function getPriority() {
return $this->priority; 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;
}
} }

View File

@ -737,35 +737,6 @@ table.grid td.date{
padding-left: 25px; 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 { #security-warning li {
list-style: initial; list-style: initial;
margin: 10px 0; margin: 10px 0;

View File

@ -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>

Before

Width:  |  Height:  |  Size: 424 B

View File

@ -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>

Before

Width:  |  Height:  |  Size: 935 B

View File

@ -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>

Before

Width:  |  Height:  |  Size: 462 B

View File

@ -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>

Before

Width:  |  Height:  |  Size: 611 B

View File

@ -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>

Before

Width:  |  Height:  |  Size: 310 B