From e1e00df22e6e9a589c3273822ec8ce90c21da84e Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 23 Sep 2007 02:10:01 +0000 Subject: removed redundant code. --- framework/Web/UI/TClientScriptManager.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'framework') 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)); } /** -- cgit v1.2.3