summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TClientScriptManager.php
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-09-06 17:43:27 +0000
committerctrlaltca@gmail.com <>2011-09-06 17:43:27 +0000
commit8783266ac456bb47d92c256524968d562a8d6e60 (patch)
tree78b803c8edc612205d5cd9ed84b8e5dda7ce006c /framework/Web/UI/TClientScriptManager.php
parent826209441942e71e9efc658b44b2077ddfd5b379 (diff)
workaround for #363
Diffstat (limited to 'framework/Web/UI/TClientScriptManager.php')
-rw-r--r--framework/Web/UI/TClientScriptManager.php37
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;
+ }
}
/**