summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TPage.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/TPage.php')
-rw-r--r--framework/Web/UI/TPage.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php
index 4681f876..4a2ea474 100644
--- a/framework/Web/UI/TPage.php
+++ b/framework/Web/UI/TPage.php
@@ -586,8 +586,17 @@ class TPage extends TTemplateControl
*/
public function getClientScript()
{
- if(!$this->_clientScript)
- $this->_clientScript=new TClientScriptManager($this);
+ if(!$this->_clientScript) {
+ $className = $classPath = $this->getService()->getClientScriptManagerClass();
+ Prado::using($className);
+ if(($pos=strrpos($className,'.'))!==false)
+ $className=substr($className,$pos+1);
+
+ if(!class_exists($className,false) || ($className!=='TClientScriptManager' && !is_subclass_of($className,'TClientScriptManager')))
+ throw new THttpException(404,'page_csmanagerclass_invalid',$classPath);
+
+ $this->_clientScript=new $className($this);
+ }
return $this->_clientScript;
}