From a77504aeacd4516156267fe10eeca1bfffcacf87 Mon Sep 17 00:00:00 2001 From: PhilW Date: Mon, 26 Aug 2013 12:22:34 +0100 Subject: allow different logos for different functions (eg. normal and print) --- config/defaults.inc.php | 3 +++ program/include/rcmail_output_html.php | 13 ++++++++++++- skins/classic/includes/header.html | 2 +- skins/classic/templates/login.html | 2 +- skins/classic/templates/messageprint.html | 2 +- skins/larry/includes/header.html | 2 +- skins/larry/templates/login.html | 2 +- skins/larry/templates/messageprint.html | 2 +- 8 files changed, 21 insertions(+), 7 deletions(-) diff --git a/config/defaults.inc.php b/config/defaults.inc.php index 54d0b1d27..feed82f1b 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -240,6 +240,9 @@ $config['support_url'] = ''; // replace Roundcube logo with this image // specify an URL relative to the document root of this Roundcube installation +// an array can be used to specify different logos for different screens +// for example array("default" => "/images/roundcube_logo.png", "print" => "/images/roundcube_logo_print.png") +// available options: default, login, print $config['skin_logo'] = null; // automatically create a new Roundcube user when log-in the first time. diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php index a2ec29ca3..39f79d119 100644 --- a/program/include/rcmail_output_html.php +++ b/program/include/rcmail_output_html.php @@ -924,8 +924,19 @@ class rcmail_output_html extends rcmail_output } else if ($object == 'logo') { $attrib += array('alt' => $this->xml_command(array('', 'object', 'name="productname"'))); - if ($logo = $this->config->get('skin_logo')) + + if (is_array($this->config->get('skin_logo'))) { + if (isset($attrib['type']) && array_key_exists($attrib['type'], $this->config->get('skin_logo'))) { + $attrib['src'] = $this->config->get('skin_logo')[$attrib['type']]; + } + elseif (array_key_exists('default', $this->config->get('skin_logo'))) { + $attrib['src'] = $this->config->get('skin_logo')['default']; + } + } + elseif ($logo = $this->config->get('skin_logo')) { $attrib['src'] = $logo; + } + $content = html::img($attrib); } else if ($object == 'productname') { diff --git a/skins/classic/includes/header.html b/skins/classic/includes/header.html index 08d777af0..962e4dd7b 100644 --- a/skins/classic/includes/header.html +++ b/skins/classic/includes/header.html @@ -1,2 +1,2 @@ -