diff options
author | ctrlaltca@gmail.com <> | 2011-09-06 17:43:27 +0000 |
---|---|---|
committer | ctrlaltca@gmail.com <> | 2011-09-06 17:43:27 +0000 |
commit | 8783266ac456bb47d92c256524968d562a8d6e60 (patch) | |
tree | 78b803c8edc612205d5cd9ed84b8e5dda7ce006c | |
parent | 826209441942e71e9efc658b44b2077ddfd5b379 (diff) |
workaround for #363
-rw-r--r-- | framework/Web/UI/TClientScriptManager.php | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 677daa9b..19a8090c 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -209,29 +209,36 @@ class TClientScriptManager extends TApplicationComponent */ public function getScriptUrls() { - $scripts = array(); - - $packages=array_keys($this->_registeredPradoScripts); - $base = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH; - list($path,$baseUrl)=$this->getPackagePathUrl($base); - foreach ($packages as $p) + if (Prado::getApplication()->getMode()!==TApplicationMode::Debug) { - foreach (self::$_pradoScripts[$p] as $dep) + $packages=array_keys($this->_registeredPradoScripts); + $base = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH; + return array($this->registerJavascriptPackages($base, $packages)); + } else { + $scripts = array(); + + $packages=array_keys($this->_registeredPradoScripts); + $base = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH; + list($path,$baseUrl)=$this->getPackagePathUrl($base); + foreach ($packages as $p) { - foreach (self::$_pradoPackages[$dep] as $script) + foreach (self::$_pradoScripts[$p] as $dep) { - if (!in_array($url=$baseUrl.'/'.$script,$scripts)) - $scripts[]=$url; + foreach (self::$_pradoPackages[$dep] as $script) + { + if (!in_array($url=$baseUrl.'/'.$script,$scripts)) + $scripts[]=$url; + } } } - } - $scripts = array_merge($scripts, array_values($this->_headScriptFiles)); - $scripts = array_merge($scripts, array_values($this->_scriptFiles)); + $scripts = array_merge($scripts, array_values($this->_headScriptFiles)); + $scripts = array_merge($scripts, array_values($this->_scriptFiles)); - $scripts = array_unique($scripts); + $scripts = array_unique($scripts); - return $scripts; + return $scripts; + } } /** |