diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-09-16 06:55:13 -0700 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-09-16 06:55:13 -0700 |
commit | b5c364273d7b026c0deda2326018aabff8bec73c (patch) | |
tree | 08e5d883af7d56fbd7ff964b914c11da13ce5a07 | |
parent | 8deae975f0589fccb171b16d54c4b6d9eb569a1b (diff) | |
parent | fb4474aca9f5f56927290828c09407ddba637d8a (diff) |
Merge pull request #107 from JohnDoh/multi-logo
allow different logos for different functions (eg. normal and print)
-rw-r--r-- | config/defaults.inc.php | 2 | ||||
-rw-r--r-- | program/include/rcmail_output_html.php | 17 |
2 files changed, 17 insertions, 2 deletions
diff --git a/config/defaults.inc.php b/config/defaults.inc.php index bf7c4df2a..95e024ccc 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -245,6 +245,8 @@ $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 specific template files, '*' for default logo +// for example array("*" => "/images/roundcube_logo.png", "messageprint" => "/images/roundcube_logo_print.png") $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..6db559358 100644 --- a/program/include/rcmail_output_html.php +++ b/program/include/rcmail_output_html.php @@ -924,8 +924,21 @@ 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')) - $attrib['src'] = $logo; + + if ($logo = $this->config->get('skin_logo')) { + if (is_array($logo)) { + if ($template_logo = $logo[$this->template_name]) { + $attrib['src'] = $template_logo; + } + elseif ($template_logo = $logo['*']) { + $attrib['src'] = $template_logo; + } + } + else { + $attrib['src'] = $logo; + } + } + $content = html::img($attrib); } else if ($object == 'productname') { |