summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TClientScriptManager.php
diff options
context:
space:
mode:
authorxue <>2006-08-30 12:33:43 +0000
committerxue <>2006-08-30 12:33:43 +0000
commit1f560ccd8a9e21871dbedd548fc97f231131c771 (patch)
tree90d054108a0bce4668ca16d425655b22c99ed6d3 /framework/Web/UI/TClientScriptManager.php
parentf4482f9c17825b63242fee42252e097dd85f53c5 (diff)
merge from 3.0 branch till 1363.
Diffstat (limited to 'framework/Web/UI/TClientScriptManager.php')
-rw-r--r--framework/Web/UI/TClientScriptManager.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index 504cfb40..3d0ced60 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -133,7 +133,7 @@ class TClientScriptManager extends TApplicationComponent
$this->_registeredPradoScripts[$name]=true;
else
throw new TInvalidOperationException('csmanager_pradoscript_invalid',$name);
- $basePath=Prado::getFrameworkPath().'/'.self::SCRIPT_PATH;
+ $basePath=$this->getPradoBaseScriptPath();
foreach(self::$_pradoScripts[$name] as $script)
{
if(!isset($this->_publishedPradoFiles[$script]))
@@ -145,6 +145,15 @@ class TClientScriptManager extends TApplicationComponent
}
}
+ protected function getPradoBaseScriptPath()
+ {
+ $basePath = Prado::getFrameworkPath().'/'.self::SCRIPT_PATH;
+ if($this->getApplication()->getMode()===TApplication::STATE_DEBUG)
+ return $basePath.'/debug';
+ else
+ return $basePath.'/compressed';
+ }
+
/**
* Renders the <script> tag that will load the javascript library files.
* @param THtmlWriter writer that renders the <script> tag.
@@ -154,7 +163,7 @@ class TClientScriptManager extends TApplicationComponent
$files=implode(',',array_keys($this->_publishedPradoFiles));
if($files!=='')
{
- $basePath=Prado::getFrameworkPath().'/'.self::SCRIPT_PATH;
+ $basePath=$this->getPradoBaseScriptPath();
$scriptLoader=$basePath.'/'.self::SCRIPT_LOADER;
$url=$this->publishFilePath($scriptLoader).'?js='.trim($files,',');
if($this->getApplication()->getMode()===TApplication::STATE_DEBUG)
@@ -631,4 +640,4 @@ abstract class TClientSideOptions extends TComponent
}
}
-?> \ No newline at end of file
+?>