diff --git a/apps/encryption/templates/mail.php b/apps/encryption/templates/mail.php index 3754b4b3e582016ac6b764769f44e84d772c57f4..6e9f9885d33e339661d64d2dee07da6d143a7c87 100644 --- a/apps/encryption/templates/mail.php +++ b/apps/encryption/templates/mail.php @@ -6,7 +6,7 @@ <tr><td> <table cellspacing="0" cellpadding="0" border="0" width="600px"> <tr> - <td colspan="2" bgcolor="<?php p($theme->getMailHeaderColor());?>"> + <td colspan="2" bgcolor="<?php p($theme->getColorPrimary());?>"> <img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.png'))); ?>" alt="<?php p($theme->getName()); ?>"/> </td> </tr> diff --git a/apps/federatedfilesharing/settings-personal.php b/apps/federatedfilesharing/settings-personal.php index 522cb297898025a75e456babfb642a014430bbe1..71353cdef2e2e8d70d33192ce4870bb2fac387f3 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 ea3531809a9334321a2b4984ab9d2fede14406df..daf12fe034a7104fb456ee44565701c510ff6684 100644 --- a/apps/sharebymail/templates/mail.php +++ b/apps/sharebymail/templates/mail.php @@ -27,7 +27,7 @@ <tr><td> <table cellspacing="0" cellpadding="0" border="0" width="600px"> <tr> - <td colspan="2" bgcolor="<?php p($theme->getMailHeaderColor());?>"> + <td colspan="2" bgcolor="<?php p($theme->getColorPrimary());?>"> <img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.png'))); ?>" alt="<?php p($theme->getName()); ?>"/> </td> </tr> diff --git a/apps/theming/lib/Capabilities.php b/apps/theming/lib/Capabilities.php index b483cc80aedc1ef67c3acce5eb84fac51559db5e..2a9e9a3c6cf3ae0e8378d7befbfdadbd62f516a8 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 2aa79df2464c1763b681cd01907cd5854cb48abd..093134e6c5e5c87f0236b3fa11704585e0934144 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 39a7722f0a5446d0d0a7fe276f643bed4f08153e..7db24c4a2b0e385311345706501938bc75cc5dec 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 22ab5650e5bcad05018cd7177e3e8bbfaff58e8c..c8074f386affae115cbd2ded9de68e588ad503c2 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 20625116213e34667dc419a417b71c8869770990..5a863b1eb22dda8fc0b81cccb2fb3d098ef10f61 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 218fca505ed00f5b4c973500456e6c5620792fd3..1c379797736c603c8fa500271dd6b5d01b411d29 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 3afcdb847b66c430fa6827ddc825017e1f9b5cc7..cc7f73f742f3d55f7d740e7982df2c433b97c534 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 da27795ce2c64d67a8a3323e09ddc5c234820c75..423e3e86dbcc7c85faf0d8efea13d3b8d9a17859 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 d4f5490d352d9e2d59b1866e256f817f0530e7c8..709396775821c6fbafc8ef6d3d35fe62cdefe740 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 cd3a90e760aa7963d5531232805423f3994c5fc0..72ccaa57d7707d97f4a01a0787bb3ac41b7ea285 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('<a href="url" target="_blank" rel="noreferrer">Name</a>', $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 4ae33341e2f8318d4835563c8500893d944edbe6..e2e61e67e2c9afa1ab2fec2cf64bc143ef06d8fe 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -8,10 +8,10 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="referrer" content="never"> <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"> - <meta name="theme-color" content="<?php p($theme->getMailHeaderColor()); ?>"> + <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>"> <link rel="icon" href="<?php print_unescaped(image_path('', 'favicon.ico')); /* IE11+ supports png */ ?>"> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>"> - <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('', 'favicon-mask.svg')); ?>" color="<?php p($theme->getMailHeaderColor()); ?>"> + <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('', 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>"> <?php if (isset($_['inline_ocjs'])): ?> <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript"> <?php print_unescaped($_['inline_ocjs']); ?> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 9b89ed6300f81f203d3f9520bd90624317b91fe1..1e2559d69605bf1ca0f5d7997e33d59f6eb45c92 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -9,10 +9,10 @@ <meta name="referrer" content="never"> <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"> <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>"> - <meta name="theme-color" content="<?php p($theme->getMailHeaderColor()); ?>"> + <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>"> <link rel="icon" href="<?php print_unescaped(image_path('', 'favicon.ico')); /* IE11+ supports png */ ?>"> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path('', 'favicon-touch.png')); ?>"> - <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('', 'favicon-mask.svg')); ?>" color="<?php p($theme->getMailHeaderColor()); ?>"> + <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path('', 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>"> <?php if (isset($_['inline_ocjs'])): ?> <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript"> <?php print_unescaped($_['inline_ocjs']); ?> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 439567fe6a198aa09a30d065d362ecd94939a953..40e47c7e5822eb6ed2a23ea08b768ae02e61418b 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -16,10 +16,10 @@ <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid']!='files')? $_['application']:$theme->getTitle()); ?>"> <meta name="mobile-web-app-capable" content="yes"> - <meta name="theme-color" content="<?php p($theme->getMailHeaderColor()); ?>"> + <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>"> <link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>"> <link rel="apple-touch-icon-precomposed" href="<?php print_unescaped(image_path($_['appid'], 'favicon-touch.png')); ?>"> - <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getMailHeaderColor()); ?>"> + <link rel="mask-icon" sizes="any" href="<?php print_unescaped(image_path($_['appid'], 'favicon-mask.svg')); ?>" color="<?php p($theme->getColorPrimary()); ?>"> <link rel="manifest" href="<?php print_unescaped(image_path($_['appid'], 'manifest.json')); ?>"> <?php if (isset($_['inline_ocjs'])): ?> <script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" type="text/javascript"> diff --git a/core/templates/mail.php b/core/templates/mail.php index 3721d50e27b8fce657f08af2ff9895ebfb005676..cda33490e857fe29ebff58254763478c8a4fbb9c 100644 --- a/core/templates/mail.php +++ b/core/templates/mail.php @@ -2,7 +2,7 @@ <tr><td> <table cellspacing="0" cellpadding="0" border="0" width="600px"> <tr> -<td colspan="2" bgcolor="<?php p($theme->getMailHeaderColor());?>"> +<td colspan="2" bgcolor="<?php p($theme->getColorPrimary());?>"> <img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.png'))); ?>" alt="<?php p($theme->getName()); ?>"/> </td> </tr> diff --git a/lib/private/legacy/defaults.php b/lib/private/legacy/defaults.php index ea41d80076e03e79c9b4f1df01b6f18db0260d53..0248af54691a58ce65d764b0960374e98178fe7d 100644 --- a/lib/private/legacy/defaults.php +++ b/lib/private/legacy/defaults.php @@ -275,9 +275,9 @@ class OC_Defaults { * Returns mail header color * @return string */ - public function getMailHeaderColor() { - if ($this->themeExist('getMailHeaderColor')) { - return $this->theme->getMailHeaderColor(); + public function getColorPrimary() { + if ($this->themeExist('getColorPrimary')) { + return $this->theme->getColorPrimary(); } else { return $this->defaultMailHeaderColor; } diff --git a/settings/templates/email.new_user.php b/settings/templates/email.new_user.php index bd2d4249d9a7f5b10734a5b070dfde39f68d1072..9418c21c6cb0ceb96720f8b6e88569791449b37f 100644 --- a/settings/templates/email.new_user.php +++ b/settings/templates/email.new_user.php @@ -2,7 +2,7 @@ <tr><td> <table cellspacing="0" cellpadding="0" border="0" width="600px"> <tr> - <td colspan="2" bgcolor="<?php p($theme->getMailHeaderColor());?>" bordercolor="<?php p($theme->getMailHeaderColor());?>" border> + <td colspan="2" bgcolor="<?php p($theme->getColorPrimary());?>" bordercolor="<?php p($theme->getColorPrimary());?>" border> <img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.png'))); ?>" alt="<?php p($theme->getName()); ?>"/> </td> </tr> diff --git a/themes/example/defaults.php b/themes/example/defaults.php index 1a2389d0bc26e0af3e0f8fc5e4eff29cf42eaaff..3d0ae9c1c74c31f70b7958452a3b7e18e1b0cb9f 100644 --- a/themes/example/defaults.php +++ b/themes/example/defaults.php @@ -147,7 +147,7 @@ class OC_Theme { * Returns mail header color * @return string */ - public function getMailHeaderColor() { + public function getColorPrimary() { return '#745bca'; }