From 7dbe2fa6bf629e1089c61a7bb89885e9936de8a9 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 25 May 2009 05:22:59 -0400
Subject: [PATCH] - get rid of 'plugins_dir' option, plugins directory must be in Roundcube root (like skins)

---
 program/include/rcube_html_page.php |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/program/include/rcube_html_page.php b/program/include/rcube_html_page.php
index ab8eba5..b8db7b3 100644
--- a/program/include/rcube_html_page.php
+++ b/program/include/rcube_html_page.php
@@ -5,7 +5,7 @@
  | program/include/rcube_html_page.php                                   |
  |                                                                       |
  | This file is part of the RoundCube PHP suite                          |
- | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland                 |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | CONTENTS:                                                             |
@@ -31,8 +31,8 @@
     protected $scripts = array();
     protected $charset = 'UTF-8';
 
-    protected $script_tag_file = "<script type=\"text/javascript\" src=\"%s%s\"></script>\n";
-    protected $script_tag      = "<script type=\"text/javascript\">\n<!--\n%s\n\n//-->\n</script>\n";
+    protected $script_tag_file = "<script type=\"text/javascript\" src=\"%s\"></script>\n";
+    protected $script_tag  =  "<script type=\"text/javascript\">\n/* <![CDATA[ */\n%s\n/* ]]> */\n</script>";
     protected $default_template = "<html>\n<head><title></title></head>\n<body></body>\n</html>";
 
     protected $title = '';
@@ -53,6 +53,9 @@
     public function include_script($file, $position='head')
     {
         static $sa_files = array();
+        
+        if (!preg_match('|^https?://|i', $file) && $file[0] != '/')
+          $file = $this->scripts_path . $file;
 
         if (in_array($file, $sa_files)) {
             return;
@@ -165,7 +168,7 @@
         // definition of the code to be placed in the document header and footer
         if (is_array($this->script_files['head'])) {
             foreach ($this->script_files['head'] as $file) {
-                $__page_header .= sprintf($this->script_tag_file, $this->scripts_path, $file);
+                $__page_header .= sprintf($this->script_tag_file, $file);
             }
         }
 
@@ -180,7 +183,7 @@
 
         if (is_array($this->script_files['foot'])) {
             foreach ($this->script_files['foot'] as $file) {
-                $__page_footer .= sprintf($this->script_tag_file, $this->scripts_path, $file);
+                $__page_footer .= sprintf($this->script_tag_file, $file);
             }
         }
 

--
Gitblit v1.9.1