<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>
$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();
<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>
'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()),
],
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). '
};
})();';
return false;
}
- $color = $this->themingDefaults->getMailHeaderColor();
+ $color = $this->themingDefaults->getColorPrimary();
$mime = mime_content_type($appIcon);
// generate background image with rounded corners
}
$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 {
'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(),
$this->name = $defaults->getName();
$this->url = $defaults->getBaseUrl();
$this->slogan = $defaults->getSlogan();
- $this->color = $defaults->getMailHeaderColor();
+ $this->color = $defaults->getColorPrimary();
}
public function getName() {
*
* @return string
*/
- public function getMailHeaderColor() {
+ public function getColorPrimary() {
return $this->config->getAppValue('theming', 'color', $this->color);
}
$returnValue = $this->getSlogan();
break;
case 'color':
- $returnValue = $this->getMailHeaderColor();
+ $returnValue = $this->getColorPrimary();
break;
default:
$returnValue = '';
->method('getSlogan')
->willReturn($slogan);
$this->theming->expects($this->once())
- ->method('getMailHeaderColor')
+ ->method('getColorPrimary')
->willReturn($color);
$this->theming->expects($this->once())
->method('getLogo')
->willReturn("");
$this->template
->expects($this->at(3))
- ->method('getMailHeaderColor')
+ ->method('getColorPrimary')
->willReturn("#000");
->willReturn("awesome");
$this->template
->expects($this->any())
- ->method('getMailHeaderColor')
+ ->method('getColorPrimary')
->willReturn("#ffffff");
$expectedResponse = '(function() {
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);
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);
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);
->willReturn('MySlogan');
$this->themingDefaults
->expects($this->once())
- ->method('getMailHeaderColor')
+ ->method('getColorPrimary')
->willReturn('#fff');
$this->urlGenerator
->expects($this->once())
->willReturn('MySlogan');
$this->themingDefaults
->expects($this->once())
- ->method('getMailHeaderColor')
+ ->method('getColorPrimary')
->willReturn('#fff');
$this->urlGenerator
->expects($this->once())
->willReturn('Safe Data');
$this->defaults
->expects($this->at(3))
- ->method('getMailHeaderColor')
+ ->method('getColorPrimary')
->willReturn('#000');
$this->template = new ThemingDefaults(
$this->config,
$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() {
<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']); ?>
<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']); ?>
<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">
<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>
* 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;
}
<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>
* Returns mail header color
* @return string
*/
- public function getMailHeaderColor() {
+ public function getColorPrimary() {
return '#745bca';
}