From ae0c82b0e4883268d977c377b9d023c658887a5d Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 23 Apr 2008 15:33:59 -0400
Subject: [PATCH] - Append skin_path to images location only when it starts with '/' sign (#1484859)

---
 CHANGELOG                          |    5 +++++
 program/include/rcube_template.php |   16 +++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 2752fe7..e942e87 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,11 @@
 CHANGELOG RoundCube Webmail
 ---------------------------
 
+2008/04/23 (alec)
+----------
+- Append skin_path to images location only when it starts 
+  with '/' sign (#1484859)
+
 2008/04/20 (estadtherr)
 ----------
 - fix parse_attrib_string to handle unquoted values, which fixes
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index 20b55ca..a76e378 100755
--- a/program/include/rcube_template.php
+++ b/program/include/rcube_template.php
@@ -599,7 +599,6 @@
         return $out;
     }
 
-
     /**
      * Create and register a button
      *
@@ -617,12 +616,12 @@
         // these commands can be called directly via url
         $a_static_commands = array('compose', 'list');
 
-        $browser   = new rcube_browser();
-        $skin_path = $this->config['skin_path'];
-
         if (!($attrib['command'] || $attrib['name'])) {
             return '';
         }
+
+        $browser   = new rcube_browser();
+
         // try to find out the button type
         if ($attrib['type']) {
             $attrib['type'] = strtolower($attrib['type']);
@@ -687,9 +686,9 @@
                 $command,
                 $attrib['id'],
                 $attrib['type'],
-                $attrib['imageact'] ? $skin_path.$attrib['imageact'] : $attrib['classact'],
-                $attrib['imagesel'] ? $skin_path.$attrib['imagesel'] : $attrib['classsel'],
-                $attrib['imageover'] ? $skin_path.$attrib['imageover'] : ''
+                $attrib['imageact'] ? $this->abs_url($attrib['imageact']) : $attrib['classact'],
+                $attrib['imagesel'] ? $this->abs_url($attrib['imagesel']) : $attrib['classsel'],
+                $attrib['imageover'] ? $this->abs_url($attrib['imageover']) : ''
             ));
 
             // make valid href to specific buttons
@@ -755,8 +754,7 @@
                     'vspace', 'align', 'alt',
                 )
             );
-            $img_tag = sprintf('<img src="%%s"%s />', $attrib_str);
-            $btn_content = sprintf($img_tag, $skin_path.$attrib['image']);
+            $btn_content = sprintf('<img src="%s"%s />', $this->abs_url($attrib['image']), $attrib_str);
             if ($attrib['label']) {
                 $btn_content .= ' '.$attrib['label'];
             }

--
Gitblit v1.9.1