From 58498f0d70d8396ef0dc1c9e8bc4f28151771bee Mon Sep 17 00:00:00 2001 From: "godzilla80@gmx.net" <> Date: Sun, 8 Nov 2009 07:33:48 +0000 Subject: Add property ClientScriptManagerClass to TPageService and releated changes in TPage.getClientScript() to allow subclassing of TClientScriptManager --- framework/Web/UI/TPage.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'framework/Web/UI') 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; } -- cgit v1.2.3