From 9a75714c22b406ef13c985bec567b9d88ce7dc84 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 28 Mar 2017 01:37:47 +0200 Subject: [PATCH] rename confusing getMailHeaderColor to getColorPrimary, ref #3491 Signed-off-by: Jan-Christoph Borchardt --- apps/encryption/templates/mail.php | 2 +- apps/federatedfilesharing/settings-personal.php | 2 +- apps/sharebymail/templates/mail.php | 2 +- apps/theming/lib/Capabilities.php | 2 +- apps/theming/lib/Controller/ThemingController.php | 4 ++-- apps/theming/lib/IconBuilder.php | 4 ++-- apps/theming/lib/Settings/Admin.php | 2 +- apps/theming/lib/ThemingDefaults.php | 6 +++--- apps/theming/tests/CapabilitiesTest.php | 2 +- .../theming/tests/Controller/ThemingControllerTest.php | 4 ++-- apps/theming/tests/IconBuilderTest.php | 6 +++--- apps/theming/tests/Settings/AdminTest.php | 4 ++-- apps/theming/tests/ThemingDefaultsTest.php | 10 +++++----- core/templates/layout.base.php | 4 ++-- core/templates/layout.guest.php | 4 ++-- core/templates/layout.user.php | 4 ++-- core/templates/mail.php | 2 +- lib/private/legacy/defaults.php | 6 +++--- settings/templates/email.new_user.php | 2 +- themes/example/defaults.php | 2 +- 20 files changed, 37 insertions(+), 37 deletions(-) diff --git a/apps/encryption/templates/mail.php b/apps/encryption/templates/mail.php index 3754b4b3e5..6e9f9885d3 100644 --- a/apps/encryption/templates/mail.php +++ b/apps/encryption/templates/mail.php @@ -6,7 +6,7 @@ - diff --git a/apps/federatedfilesharing/settings-personal.php b/apps/federatedfilesharing/settings-personal.php index 522cb29789..71353cdef2 100644 --- a/apps/federatedfilesharing/settings-personal.php +++ b/apps/federatedfilesharing/settings-personal.php @@ -42,7 +42,7 @@ $cloudID = \OC::$server->getUserSession()->getUser()->getCloudId(); $url = 'https://nextcloud.com/federation#' . $cloudID; $logoPath = \OC::$server->getURLGenerator()->imagePath('core', 'logo-icon.svg'); $theme = \OC::$server->getThemingDefaults(); -$color = $theme->getMailHeaderColor(); +$color = $theme->getColorPrimary(); $textColor = "#ffffff"; if(\OC::$server->getAppManager()->isEnabledForUser("theming")) { $logoPath = $theme->getLogo(); diff --git a/apps/sharebymail/templates/mail.php b/apps/sharebymail/templates/mail.php index ea3531809a..daf12fe034 100644 --- a/apps/sharebymail/templates/mail.php +++ b/apps/sharebymail/templates/mail.php @@ -27,7 +27,7 @@
+ <?php p($theme->getName()); ?>
- diff --git a/apps/theming/lib/Capabilities.php b/apps/theming/lib/Capabilities.php index b483cc80ae..2a9e9a3c6c 100644 --- a/apps/theming/lib/Capabilities.php +++ b/apps/theming/lib/Capabilities.php @@ -60,7 +60,7 @@ class Capabilities implements ICapability { 'name' => $this->theming->getName(), 'url' => $this->theming->getBaseUrl(), 'slogan' => $this->theming->getSlogan(), - 'color' => $this->theming->getMailHeaderColor(), + 'color' => $this->theming->getColorPrimary(), 'logo' => $this->url->getAbsoluteURL($this->theming->getLogo()), 'background' => $this->url->getAbsoluteURL($this->theming->getBackground()), ], diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 2aa79df246..093134e6c5 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -451,8 +451,8 @@ class ThemingController extends Controller { name: ' . json_encode($this->template->getName()) . ', url: ' . json_encode($this->template->getBaseUrl()) . ', slogan: ' . json_encode($this->template->getSlogan()) . ', - color: ' . json_encode($this->template->getMailHeaderColor()) . ', - inverted: ' . json_encode($this->util->invertTextColor($this->template->getMailHeaderColor())) . ', + color: ' . json_encode($this->template->getColorPrimary()) . ', + inverted: ' . json_encode($this->util->invertTextColor($this->template->getColorPrimary())) . ', cacheBuster: ' . json_encode($cacheBusterValue). ' }; })();'; diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php index 39a7722f0a..7db24c4a2b 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -97,7 +97,7 @@ class IconBuilder { return false; } - $color = $this->themingDefaults->getMailHeaderColor(); + $color = $this->themingDefaults->getColorPrimary(); $mime = mime_content_type($appIcon); // generate background image with rounded corners @@ -178,7 +178,7 @@ class IconBuilder { } $svg = file_get_contents($imageFile); if ($svg !== false && $svg !== "") { - $color = $this->util->elementColor($this->themingDefaults->getMailHeaderColor()); + $color = $this->util->elementColor($this->themingDefaults->getColorPrimary()); $svg = $this->util->colorizeSvg($svg, $color); return $svg; } else { diff --git a/apps/theming/lib/Settings/Admin.php b/apps/theming/lib/Settings/Admin.php index 22ab5650e5..c8074f386a 100644 --- a/apps/theming/lib/Settings/Admin.php +++ b/apps/theming/lib/Settings/Admin.php @@ -70,7 +70,7 @@ class Admin implements ISettings { 'name' => $this->themingDefaults->getEntity(), 'url' => $this->themingDefaults->getBaseUrl(), 'slogan' => $this->themingDefaults->getSlogan(), - 'color' => $this->themingDefaults->getMailHeaderColor(), + 'color' => $this->themingDefaults->getColorPrimary(), 'logo' => $this->themingDefaults->getLogo(), 'logoMime' => $this->config->getAppValue('theming', 'logoMime', ''), 'background' => $this->themingDefaults->getBackground(), diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 2062511621..5a863b1eb2 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -78,7 +78,7 @@ class ThemingDefaults extends \OC_Defaults { $this->name = $defaults->getName(); $this->url = $defaults->getBaseUrl(); $this->slogan = $defaults->getSlogan(); - $this->color = $defaults->getMailHeaderColor(); + $this->color = $defaults->getColorPrimary(); } public function getName() { @@ -119,7 +119,7 @@ class ThemingDefaults extends \OC_Defaults { * * @return string */ - public function getMailHeaderColor() { + public function getColorPrimary() { return $this->config->getAppValue('theming', 'color', $this->color); } @@ -214,7 +214,7 @@ class ThemingDefaults extends \OC_Defaults { $returnValue = $this->getSlogan(); break; case 'color': - $returnValue = $this->getMailHeaderColor(); + $returnValue = $this->getColorPrimary(); break; default: $returnValue = ''; diff --git a/apps/theming/tests/CapabilitiesTest.php b/apps/theming/tests/CapabilitiesTest.php index 218fca505e..1c37979773 100644 --- a/apps/theming/tests/CapabilitiesTest.php +++ b/apps/theming/tests/CapabilitiesTest.php @@ -106,7 +106,7 @@ class CapabilitiesTest extends TestCase { ->method('getSlogan') ->willReturn($slogan); $this->theming->expects($this->once()) - ->method('getMailHeaderColor') + ->method('getColorPrimary') ->willReturn($color); $this->theming->expects($this->once()) ->method('getLogo') diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php index 3afcdb847b..cc7f73f742 100644 --- a/apps/theming/tests/Controller/ThemingControllerTest.php +++ b/apps/theming/tests/Controller/ThemingControllerTest.php @@ -983,7 +983,7 @@ class ThemingControllerTest extends TestCase { ->willReturn(""); $this->template ->expects($this->at(3)) - ->method('getMailHeaderColor') + ->method('getColorPrimary') ->willReturn("#000"); @@ -1018,7 +1018,7 @@ class ThemingControllerTest extends TestCase { ->willReturn("awesome"); $this->template ->expects($this->any()) - ->method('getMailHeaderColor') + ->method('getColorPrimary') ->willReturn("#ffffff"); $expectedResponse = '(function() { diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php index da27795ce2..423e3e86db 100644 --- a/apps/theming/tests/IconBuilderTest.php +++ b/apps/theming/tests/IconBuilderTest.php @@ -87,7 +87,7 @@ class IconBuilderTest extends TestCase { public function testRenderAppIcon($app, $color, $file) { $this->checkImagick(); $this->themingDefaults->expects($this->once()) - ->method('getMailHeaderColor') + ->method('getColorPrimary') ->willReturn($color); $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file); @@ -112,7 +112,7 @@ class IconBuilderTest extends TestCase { public function testGetTouchIcon($app, $color, $file) { $this->checkImagick(); $this->themingDefaults->expects($this->once()) - ->method('getMailHeaderColor') + ->method('getColorPrimary') ->willReturn($color); $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file); @@ -138,7 +138,7 @@ class IconBuilderTest extends TestCase { public function testGetFavicon($app, $color, $file) { $this->checkImagick(); $this->themingDefaults->expects($this->once()) - ->method('getMailHeaderColor') + ->method('getColorPrimary') ->willReturn($color); $expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file); diff --git a/apps/theming/tests/Settings/AdminTest.php b/apps/theming/tests/Settings/AdminTest.php index d4f5490d35..7093967758 100644 --- a/apps/theming/tests/Settings/AdminTest.php +++ b/apps/theming/tests/Settings/AdminTest.php @@ -78,7 +78,7 @@ class AdminTest extends TestCase { ->willReturn('MySlogan'); $this->themingDefaults ->expects($this->once()) - ->method('getMailHeaderColor') + ->method('getColorPrimary') ->willReturn('#fff'); $this->urlGenerator ->expects($this->once()) @@ -128,7 +128,7 @@ class AdminTest extends TestCase { ->willReturn('MySlogan'); $this->themingDefaults ->expects($this->once()) - ->method('getMailHeaderColor') + ->method('getColorPrimary') ->willReturn('#fff'); $this->urlGenerator ->expects($this->once()) diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php index cd3a90e760..72ccaa57d7 100644 --- a/apps/theming/tests/ThemingDefaultsTest.php +++ b/apps/theming/tests/ThemingDefaultsTest.php @@ -73,7 +73,7 @@ class ThemingDefaultsTest extends TestCase { ->willReturn('Safe Data'); $this->defaults ->expects($this->at(3)) - ->method('getMailHeaderColor') + ->method('getColorPrimary') ->willReturn('#000'); $this->template = new ThemingDefaults( $this->config, @@ -232,24 +232,24 @@ class ThemingDefaultsTest extends TestCase { $this->assertEquals('Name', $this->template->getShortFooter()); } - public function testGetMailHeaderColorWithDefault() { + public function testgetColorPrimaryWithDefault() { $this->config ->expects($this->once()) ->method('getAppValue') ->with('theming', 'color', '#000') ->willReturn('#000'); - $this->assertEquals('#000', $this->template->getMailHeaderColor()); + $this->assertEquals('#000', $this->template->getColorPrimary()); } - public function testGetMailHeaderColorWithCustom() { + public function testgetColorPrimaryWithCustom() { $this->config ->expects($this->once()) ->method('getAppValue') ->with('theming', 'color', '#000') ->willReturn('#fff'); - $this->assertEquals('#fff', $this->template->getMailHeaderColor()); + $this->assertEquals('#fff', $this->template->getColorPrimary()); } public function testSet() { diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index 4ae33341e2..e2e61e67e2 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -8,10 +8,10 @@ - + - +
+ <?php p($theme->getName()); ?>