]> source.dussan.org Git - nextcloud-server.git/commitdiff
make mail notification header color themable
authorJan-Christoph Borchardt <hey@jancborchardt.net>
Mon, 3 Mar 2014 11:43:22 +0000 (12:43 +0100)
committerJan-Christoph Borchardt <hey@jancborchardt.net>
Mon, 3 Mar 2014 11:43:22 +0000 (12:43 +0100)
core/templates/mail.php
lib/private/defaults.php

index c46fd6ab8054918065ba459a91bd53b143087863..854240a976fa8f15a6857902c49432daf6e5b613 100644 (file)
@@ -2,8 +2,8 @@
 <tr><td>
 <table cellspacing="0" cellpadding="0" border="0" width="600px">
 <tr>
-<td bgcolor="#1d2d44" width="20px">&nbsp;</td>
-<td bgcolor="#1d2d44">
+<td bgcolor="<?php print_unescaped($theme->getMailHeaderColor());?>" width="20px">&nbsp;</td>
+<td bgcolor="<?php print_unescaped($theme->getMailHeaderColor());?>">
 <img src="<?php print_unescaped(OC_Helper::makeURLAbsolute(image_path('', 'logo-mail.gif'))); ?>" alt="<?php p($theme->getName()); ?>"/>
 </td>
 </tr>
index 59630cda5c09e3b66a1153c27da197220d98e396..79be211b82f0e7afb7d5a571c1aa342a684856f6 100644 (file)
@@ -21,6 +21,7 @@ class OC_Defaults {
        private $defaultDocBaseUrl;
        private $defaultSlogan;
        private $defaultLogoClaim;
+       private $defaultMailHeaderColor;
 
        function __construct() {
                $this->l = OC_L10N::get('core');
@@ -33,6 +34,7 @@ class OC_Defaults {
                $this->defaultDocBaseUrl = "http://doc.owncloud.org";
                $this->defaultSlogan = $this->l->t("web services under your control");
                $this->defaultLogoClaim = "";
+               $this->defaultMailHeaderColor = "#1d2d44"; /* header color of mail notifications */
 
                if (class_exists("OC_Theme")) {
                        $this->theme = new OC_Theme();
@@ -181,4 +183,16 @@ class OC_Defaults {
                return $this->getDocBaseUrl() . '/server/6.0/go.php?to=' . $key;
        }
 
+       /**
+        * Returns mail header color
+        * @return mail header color
+        */
+       public function getMailHeaderColor() {
+               if ($this->themeExist('getMailHeaderColor')) {
+                       return $this->theme->getMailHeaderColor();
+               } else {
+                       return $this->defaultMailHeaderColor;
+               }
+       }
+
 }