If we include a full url, output prototype with a full url as well.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 16 Dec 2010 23:44:08 +0000 (18:44 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 16 Dec 2010 23:45:43 +0000 (18:45 -0500)
explicitly including prototype withOUT a full url breaks all kinds of stuff
with API rendering and external site embedding.

framework/Core/lib/Horde/Script/Files.php

index e9c3268..197e675 100644 (file)
@@ -22,6 +22,8 @@ class Horde_Script_Files
      */
     public $prototypejs = true;
 
+    protected $_full = false;
+
     /**
      * The list of script files to add.
      *
@@ -49,6 +51,9 @@ class Horde_Script_Files
      */
     public function add($file, $app = null, $full = false)
     {
+        if ($full && !$this->_full) {
+            $this->_full = true;
+        }
         if (($this->_add($file, $app, $full) === false) ||
             !Horde::contentSent()) {
             return;
@@ -170,7 +175,7 @@ class Horde_Script_Files
             if (!isset($this->_included['horde']['prototype.js'])) {
                 $old = $this->_files['horde'];
                 $this->_files['horde'] = array();
-                $this->_add('prototype.js', 'horde', false);
+                $this->_add('prototype.js', 'horde', $this->_full);
                 $this->_files['horde'] = array_merge($this->_files['horde'], $old);
             }