summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-12-11 15:16:28 +0100
committerGitHub <noreply@github.com>2017-12-11 15:16:28 +0100
commit7c39711798354cd99dd9d8740e8c97f0d0f0fecc (patch)
treec43fb58d43dbfd3b087921ea52d627513b272f56 /lib/private
parent5b20600da9d4156251683da6532ef0ce4762481b (diff)
parentcce4c285dbfd6957f50112b234b3545ebcceac54 (diff)
downloadnextcloud-server-7c39711798354cd99dd9d8740e8c97f0d0f0fecc.tar.gz
nextcloud-server-7c39711798354cd99dd9d8740e8c97f0d0f0fecc.zip
Merge pull request #7427 from nextcloud/fix-white-color-in-emails
Fix email buttons for white theme
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Mail/EMailTemplate.php10
-rw-r--r--lib/private/legacy/defaults.php9
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php
index 1d905635d55..0535dabc13e 100644
--- a/lib/private/Mail/EMailTemplate.php
+++ b/lib/private/Mail/EMailTemplate.php
@@ -234,7 +234,7 @@ EOF;
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%">
<tr style="padding:0;text-align:left;vertical-align:top">
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;background:%s;border:0 solid %s;border-collapse:collapse!important;color:#fefefe;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
- <a href="%s" style="Margin:0;border:0 solid %s;border-radius:2px;color:#fefefe;display:inline-block;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;padding:10px 25px 10px 25px;text-align:left;text-decoration:none">%s</a>
+ <a href="%s" style="Margin:0;border:0 solid %s;border-radius:2px;color:%s;display:inline-block;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;padding:10px 25px 10px 25px;text-align:left;outline:1px solid %s;text-decoration:none">%s</a>
</td>
</tr>
</table>
@@ -287,7 +287,7 @@ EOF;
<table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%%">
<tr style="padding:0;text-align:left;vertical-align:top">
<td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;background:%s;border:0 solid %s;border-collapse:collapse!important;color:#fefefe;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
- <a href="%s" style="Margin:0;border:0 solid %s;border-radius:2px;color:#fefefe;display:inline-block;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;padding:10px 25px 10px 25px;text-align:left;text-decoration:none">%s</a>
+ <a href="%s" style="Margin:0;border:0 solid %s;border-radius:2px;color:%s;display:inline-block;font-family:Lucida Grande,Geneva,Verdana,sans-serif;font-size:16px;font-weight:regular;line-height:1.3;margin:0;padding:10px 25px 10px 25px;text-align:left;outline:1px solid %s;text-decoration:none">%s</a>
</td>
</tr>
</table>
@@ -531,8 +531,9 @@ EOF;
$this->ensureBodyListClosed();
$color = $this->themingDefaults->getColorPrimary();
+ $textColor = $this->themingDefaults->getTextColorPrimary();
- $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, htmlspecialchars($textLeft), $urlRight, htmlspecialchars($textRight)]);
+ $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, $textColor, $textColor, htmlspecialchars($textLeft), $urlRight, htmlspecialchars($textRight)]);
$this->plainBody .= $plainTextLeft . ': ' . $urlLeft . PHP_EOL;
$this->plainBody .= $plainTextRight . ': ' . $urlRight . PHP_EOL . PHP_EOL;
@@ -561,7 +562,8 @@ EOF;
}
$color = $this->themingDefaults->getColorPrimary();
- $this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, htmlspecialchars($text)]);
+ $textColor = $this->themingDefaults->getTextColorPrimary();
+ $this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, $textColor, $textColor, htmlspecialchars($text)]);
if ($plainText !== false) {
$this->plainBody .= $plainText . ': ';
diff --git a/lib/private/legacy/defaults.php b/lib/private/legacy/defaults.php
index 8b5cef3643e..494c65ef226 100644
--- a/lib/private/legacy/defaults.php
+++ b/lib/private/legacy/defaults.php
@@ -50,6 +50,7 @@ class OC_Defaults {
private $defaultDocVersion;
private $defaultSlogan;
private $defaultColorPrimary;
+ private $defaultTextColorPrimary;
public function __construct() {
$this->l = \OC::$server->getL10N('lib');
@@ -66,6 +67,7 @@ class OC_Defaults {
$this->defaultDocVersion = '12'; // used to generate doc links
$this->defaultSlogan = $this->l->t('a safe home for all your data');
$this->defaultColorPrimary = '#0082c9';
+ $this->defaultTextColorPrimary = '#ffffff';
$themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php';
if (file_exists($themePath)) {
@@ -318,4 +320,11 @@ class OC_Defaults {
}
return $logo . '?v=' . hash('sha1', implode('.', \OCP\Util::getVersion()));
}
+
+ public function getTextColorPrimary() {
+ if ($this->themeExist('getTextColorPrimary')) {
+ return $this->theme->getTextColorPrimary();
+ }
+ return $this->defaultTextColorPrimary;
+ }
}