diff options
author | xue <> | 2007-09-23 02:10:01 +0000 |
---|---|---|
committer | xue <> | 2007-09-23 02:10:01 +0000 |
commit | e1e00df22e6e9a589c3273822ec8ce90c21da84e (patch) | |
tree | ee3d0084c207dc0ae744f953f54ea35ccf6f6eb8 /framework/Web/UI/TClientScriptManager.php | |
parent | 956389844be8d9674cbe79e045f9a9cc44866c41 (diff) |
removed redundant code.
Diffstat (limited to 'framework/Web/UI/TClientScriptManager.php')
-rw-r--r-- | framework/Web/UI/TClientScriptManager.php | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index e28f108f..b7cc7e55 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -145,11 +145,10 @@ class TClientScriptManager extends TApplicationComponent */ protected function renderPradoScripts($writer) { - $files=array_keys($this->_registeredPradoScripts); - if(count($files) > 0) + if(($packages=array_keys($this->_registeredPradoScripts))!==array()) { $base = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH; - $url = $this->registerJavascriptPackages($base, $files); + $url = $this->registerJavascriptPackages($base, $packages); $writer->write(TJavaScript::renderScriptFile($url)); } } @@ -206,16 +205,7 @@ class TClientScriptManager extends TApplicationComponent protected function getPackagePathUrl($base) { $assets = Prado::getApplication()->getAssetManager(); - if(strpos($base, $assets->getBaseUrl())===false) - { - if(!is_null($dir = Prado::getPathOfNameSpace($base))) - $base = $dir; - return array($assets->getPublishedPath($base), $assets->publishFilePath($base)); - } - else - { - return array($assets->getBasePath().str_replace($assets->getBaseUrl(),'',$base), $base); - } + return array($assets->getPublishedPath($base), $assets->publishFilePath($base)); } /** |