aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-01-24 10:56:31 -0600
committerGitHub <noreply@github.com>2017-01-24 10:56:31 -0600
commite09bba5e366d14223c1326ac4a08cf3e5904612a (patch)
tree824ddc7166e002b46bea6f1cff916785603c2494 /apps
parentf55260bc83feeb76ae662c7b97d092da83d8b6bb (diff)
parent38f684aadfb10d491fabfeb0af9a22c109c9cfff (diff)
downloadnextcloud-server-e09bba5e366d14223c1326ac4a08cf3e5904612a.tar.gz
nextcloud-server-e09bba5e366d14223c1326ac4a08cf3e5904612a.zip
Merge pull request #3151 from nextcloud/navigation-icons
add icons to navigation of personal & admin settings
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/img/app-dark.svg1
-rw-r--r--apps/files_external/lib/Settings/Section.php21
-rw-r--r--apps/files_external/tests/Settings/SectionTest.php5
-rw-r--r--apps/theming/img/app-dark.svg1
-rw-r--r--apps/theming/lib/Settings/Section.php21
-rw-r--r--apps/theming/tests/Settings/SectionTest.php18
-rw-r--r--apps/user_ldap/lib/Settings/Section.php21
-rw-r--r--apps/user_ldap/tests/Settings/SectionTest.php18
-rw-r--r--apps/workflowengine/lib/Settings/Section.php21
9 files changed, 111 insertions, 16 deletions
diff --git a/apps/files_external/img/app-dark.svg b/apps/files_external/img/app-dark.svg
new file mode 100644
index 00000000000..157af238eeb
--- /dev/null
+++ b/apps/files_external/img/app-dark.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="32" width="32" viewBox="0 0 32 32"><path d="M14.903 3.237l4.76 4.515-7.14 6.772 4.76 4.514 7.142-6.772 4.762 4.515V3.237H14.904zM5.38 5.495C4.063 5.495 3 6.5 3 7.752V25.81c0 1.25 1.062 2.257 2.38 2.257h19.045c1.318 0 2.38-1.007 2.38-2.257v-6.772l-2.38-2.257v9.03H5.38V7.752h9.523l-2.38-2.258H5.38z" fill="#000"/></svg>
diff --git a/apps/files_external/lib/Settings/Section.php b/apps/files_external/lib/Settings/Section.php
index 4b4bac93d29..4829bb60d39 100644
--- a/apps/files_external/lib/Settings/Section.php
+++ b/apps/files_external/lib/Settings/Section.php
@@ -24,13 +24,21 @@
namespace OCA\Files_External\Settings;
use OCP\IL10N;
-use OCP\Settings\ISection;
+use OCP\IURLGenerator;
+use OCP\Settings\IIconSection;
-class Section implements ISection {
+class Section implements IIconSection {
/** @var IL10N */
private $l;
+ /** @var IURLGenerator */
+ private $url;
- public function __construct(IL10N $l) {
+ /**
+ * @param IURLGenerator $url
+ * @param IL10N $l
+ */
+ public function __construct(IURLGenerator $url, IL10N $l) {
+ $this->url = $url;
$this->l = $l;
}
@@ -64,4 +72,11 @@ class Section implements ISection {
public function getPriority() {
return 10;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getIcon() {
+ return $this->url->imagePath('files_external', 'app-dark.svg');
+ }
}
diff --git a/apps/files_external/tests/Settings/SectionTest.php b/apps/files_external/tests/Settings/SectionTest.php
index b5dfb28b382..ee501b1270b 100644
--- a/apps/files_external/tests/Settings/SectionTest.php
+++ b/apps/files_external/tests/Settings/SectionTest.php
@@ -25,19 +25,24 @@ namespace OCA\Files_External\Tests\Settings;
use OCA\Files_External\Settings\Section;
use OCP\IL10N;
+use OCP\IURLGenerator;
use Test\TestCase;
class SectionTest extends TestCase {
/** @var IL10N */
private $l;
+ /** @var IURLGenerator */
+ private $urlGenerator;
/** @var Section */
private $section;
public function setUp() {
parent::setUp();
+ $this->urlGenerator = $this->getMockBuilder('\OCP\IURLGenerator')->disableOriginalConstructor()->getMock();
$this->l = $this->getMockBuilder('\OCP\IL10N')->disableOriginalConstructor()->getMock();
$this->section = new Section(
+ $this->urlGenerator,
$this->l
);
}
diff --git a/apps/theming/img/app-dark.svg b/apps/theming/img/app-dark.svg
new file mode 100644
index 00000000000..adf97966c41
--- /dev/null
+++ b/apps/theming/img/app-dark.svg
@@ -0,0 +1 @@
+<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/apps/theming/lib/Settings/Section.php b/apps/theming/lib/Settings/Section.php
index cffbb8901c8..6078743dead 100644
--- a/apps/theming/lib/Settings/Section.php
+++ b/apps/theming/lib/Settings/Section.php
@@ -24,13 +24,21 @@
namespace OCA\Theming\Settings;
use OCP\IL10N;
-use OCP\Settings\ISection;
+use OCP\IURLGenerator;
+use OCP\Settings\IIconSection;
-class Section implements ISection {
+class Section implements IIconSection {
/** @var IL10N */
private $l;
+ /** @var IURLGenerator */
+ private $url;
- public function __construct(IL10N $l) {
+ /**
+ * @param IURLGenerator $url
+ * @param IL10N $l
+ */
+ public function __construct(IURLGenerator $url, IL10N $l) {
+ $this->url = $url;
$this->l = $l;
}
@@ -64,4 +72,11 @@ class Section implements ISection {
public function getPriority() {
return 30;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getIcon() {
+ return $this->url->imagePath('theming', 'app-dark.svg');
+ }
}
diff --git a/apps/theming/tests/Settings/SectionTest.php b/apps/theming/tests/Settings/SectionTest.php
index 3a3a4375236..90d1854aebf 100644
--- a/apps/theming/tests/Settings/SectionTest.php
+++ b/apps/theming/tests/Settings/SectionTest.php
@@ -25,19 +25,24 @@ namespace OCA\Theming\Tests\Settings;
use OCA\Theming\Settings\Section;
use OCP\IL10N;
+use OCP\IURLGenerator;
use Test\TestCase;
class SectionTest extends TestCase {
- /** @var IL10N */
+ /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
+ private $url;
+ /** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
private $l;
/** @var Section */
private $section;
public function setUp() {
parent::setUp();
- $this->l = $this->getMockBuilder('\OCP\IL10N')->getMock();
+ $this->url = $this->createMock(IURLGenerator::class);
+ $this->l = $this->createMock(IL10N::class);
$this->section = new Section(
+ $this->url,
$this->l
);
}
@@ -59,4 +64,13 @@ class SectionTest extends TestCase {
public function testGetPriority() {
$this->assertSame(30, $this->section->getPriority());
}
+
+ public function testGetIcon() {
+ $this->url->expects($this->once())
+ ->method('imagePath')
+ ->with('theming', 'app-dark.svg')
+ ->willReturn('icon');
+
+ $this->assertSame('icon', $this->section->getIcon());
+ }
}
diff --git a/apps/user_ldap/lib/Settings/Section.php b/apps/user_ldap/lib/Settings/Section.php
index 82d8d0c84fa..a4106bacb9e 100644
--- a/apps/user_ldap/lib/Settings/Section.php
+++ b/apps/user_ldap/lib/Settings/Section.php
@@ -24,13 +24,21 @@
namespace OCA\User_LDAP\Settings;
use OCP\IL10N;
-use OCP\Settings\ISection;
+use OCP\IURLGenerator;
+use OCP\Settings\IIconSection;
-class Section implements ISection {
+class Section implements IIconSection {
/** @var IL10N */
private $l;
+ /** @var IURLGenerator */
+ private $url;
- public function __construct(IL10N $l) {
+ /**
+ * @param IURLGenerator $url
+ * @param IL10N $l
+ */
+ public function __construct(IURLGenerator $url, IL10N $l) {
+ $this->url = $url;
$this->l = $l;
}
@@ -64,4 +72,11 @@ class Section implements ISection {
public function getPriority() {
return 25;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getIcon() {
+ return $this->url->imagePath('user_ldap', 'app.svg');
+ }
}
diff --git a/apps/user_ldap/tests/Settings/SectionTest.php b/apps/user_ldap/tests/Settings/SectionTest.php
index 2d2165b8e56..ae780dd7665 100644
--- a/apps/user_ldap/tests/Settings/SectionTest.php
+++ b/apps/user_ldap/tests/Settings/SectionTest.php
@@ -25,19 +25,24 @@ namespace OCA\User_LDAP\Tests\Settings;
use OCA\User_LDAP\Settings\Section;
use OCP\IL10N;
+use OCP\IURLGenerator;
use Test\TestCase;
class SectionTest extends TestCase {
- /** @var IL10N */
+ /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
+ private $url;
+ /** @var IL10N|\PHPUnit_Framework_MockObject_MockObject */
private $l;
/** @var Section */
private $section;
public function setUp() {
parent::setUp();
- $this->l = $this->getMockBuilder('\OCP\IL10N')->getMock();
+ $this->url = $this->createMock(IURLGenerator::class);
+ $this->l = $this->createMock(IL10N::class);
$this->section = new Section(
+ $this->url,
$this->l
);
}
@@ -59,4 +64,13 @@ class SectionTest extends TestCase {
public function testGetPriority() {
$this->assertSame(25, $this->section->getPriority());
}
+
+ public function testGetIcon() {
+ $this->url->expects($this->once())
+ ->method('imagePath')
+ ->with('user_ldap', 'app.svg')
+ ->willReturn('icon');
+
+ $this->assertSame('icon', $this->section->getIcon());
+ }
}
diff --git a/apps/workflowengine/lib/Settings/Section.php b/apps/workflowengine/lib/Settings/Section.php
index df8bb807134..b46f9a4a35f 100644
--- a/apps/workflowengine/lib/Settings/Section.php
+++ b/apps/workflowengine/lib/Settings/Section.php
@@ -24,13 +24,21 @@
namespace OCA\WorkflowEngine\Settings;
use OCP\IL10N;
-use OCP\Settings\ISection;
+use OCP\IURLGenerator;
+use OCP\Settings\IIconSection;
-class Section implements ISection {
+class Section implements IIconSection {
/** @var IL10N */
private $l;
+ /** @var IURLGenerator */
+ private $url;
- public function __construct(IL10N $l) {
+ /**
+ * @param IURLGenerator $url
+ * @param IL10N $l
+ */
+ public function __construct(IURLGenerator $url, IL10N $l) {
+ $this->url = $url;
$this->l = $l;
}
@@ -54,4 +62,11 @@ class Section implements ISection {
public function getPriority() {
return 55;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getIcon() {
+ return $this->url->imagePath('core', 'actions/tag.svg');
+ }
}