diff options
Diffstat (limited to 'framework/Web')
| -rw-r--r-- | framework/Web/Javascripts/TJavaScript.php | 48 | ||||
| -rw-r--r-- | framework/Web/UI/TClientScriptManager.php | 582 | ||||
| -rw-r--r-- | framework/Web/UI/WebControls/TTextHighlighter.php | 3 | 
3 files changed, 245 insertions, 388 deletions
| diff --git a/framework/Web/Javascripts/TJavaScript.php b/framework/Web/Javascripts/TJavaScript.php index f1efb5b3..02dfdd6a 100644 --- a/framework/Web/Javascripts/TJavaScript.php +++ b/framework/Web/Javascripts/TJavaScript.php @@ -24,6 +24,54 @@   */
  class TJavaScript
  {
 +	public static function renderScriptFiles($files)
 +	{
 +		$str='';
 +		foreach($files as $file)
 +			$str.='<script type="text/javascript" src="'.THttpUtility::htmlEncode($file)."\"></script>\n";
 +		return $str;
 +	}
 +
 +	public static function renderScriptFile($file)
 +	{
 +		return '<script type="text/javascript" src="'.THttpUtility::htmlEncode($file)."\"></script>\n";
 +	}
 +
 +	public static function renderScriptBlocks($scripts)
 +	{
 +		if(count($scripts))
 +			return "<script type=\"text/javascript\">\n/*<![CDATA[*/\n".implode("\n",$scripts)."\n/*]]>*/\n</script>\n";
 +		else
 +			return '';
 +	}
 +
 +	public static function renderScriptBlock($script)
 +	{
 +		return "<script type=\"text/javascript\">\n/*<![CDATA[*/\n{$script}\n/*]]>*/\n</script>\n";
 +	}
 +
 +	public static function renderArrayDeclarations($arrays)
 +	{
 +		if(count($arrays))
 +		{
 +			$str="<script type=\"text/javascript\">\n/*<![CDATA[*/\n";
 +			foreach($arrays as $name=>$array)
 +				$str.="var $name=new Array(".implode(',',$array).");\n";
 +			$str.="\n/*]]>*/\n</script>\n";
 +			return $str;
 +		}
 +		else
 +			return '';
 +	}
 +
 +	public static function renderArrayDeclaration($array)
 +	{
 +		$str="<script type=\"text/javascript\">\n/*<![CDATA[*/\n";
 +		$str.="var $name=new Array(".implode(',',$array).");\n";
 +		$str.="\n/*]]>*/\n</script>\n";
 +		return $str;
 +	}
 +
  	public static function quoteJavaScriptString($js,$forUrl=false)
  	{
  		if($forUrl)
 diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index c4ac316a..381ee82b 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -10,10 +10,10 @@   * @package System.Web.UI   */ -Prado::using('System.Web.Javascripts.*'); -  /** - * TClientScriptManager class + * TClientScriptManager class. + * + * TClientScriptManager manages javascript and CSS stylesheets for a page.   *   * @author Qiang Xue <qiang.xue@gmail.com>   * @version $Revision: $  $Date: $ @@ -39,20 +39,41 @@ class TClientScriptManager extends TApplicationComponent  	 * @var array registered hidden fields, indexed by hidden field names  	 */  	private $_hiddenFields=array(); +	/** +	 * @var array javascript blocks to be rendered at the beginning of the form +	 */  	private $_beginScripts=array(); +	/** +	 * @var array javascript blocks to be rendered at the end of the form +	 */  	private $_endScripts=array(); +	/** +	 * @var array javascript files to be rendered in the form +	 */  	private $_scriptFiles=array(); -	private $_onSubmitStatements=array(); -	private $_arrayDeclares=array(); -	private $_expandoAttributes=array(); - +	/** +	 * @var array javascript files to be renderd in page head section +	 */  	private $_headScriptFiles=array(); +	/** +	 * @var array javascript blocks to be renderd in page head section +	 */  	private $_headScripts=array(); - +	/** +	 * @var array CSS files +	 */  	private $_styleSheetFiles=array(); +	/** +	 * @var array CSS declarations +	 */  	private $_styleSheets=array(); - +	/** +	 * @var array registered PRADO script libraries +	 */  	private $_registeredPradoScripts=array(); +	/** +	 * @var array registered PRADO script files +	 */  	private $_registeredPradoFiles=array();  	/** @@ -81,10 +102,18 @@ class TClientScriptManager extends TApplicationComponent  	/**  	 * Registers Prado scripts by library name. -	 * The script files will be published. -	 * @param string script library name. Valid names include -	 * 'prado', 'effects', 'ajax', 'validator', 'logger', -	 * 'datepicker', 'rico', 'colorpicker'. +	 * Each library may include one or several script files. +	 * Currently, the following libraries are available: +	 * - prado : basic prado js framework +	 * - effects : +	 * - ajax : ajax related js +	 * - validator : validator js +	 * - logger : js logger +	 * - datepicker : datepicker js +	 * - rico : +	 * - colorpicker : colorpicker js +	 * The script files registered will be published. +	 * @param string script library name.  	 */  	public function registerPradoScript($name)  	{ @@ -155,195 +184,223 @@ class TClientScriptManager extends TApplicationComponent  		return $options;  	} -/*	protected function registerPostBackScript() -	{ -		if(!$this->_postBackScriptRegistered) -		{ -			$this->_postBackScriptRegistered=true; -			$this->registerHiddenField(TPage::FIELD_POSTBACK_TARGET,''); -			$this->registerHiddenField(TPage::FIELD_POSTBACK_PARAMETER,''); -			$this->registerPradoScript('prado'); -		} -	} - -	public function registerFocusScript($target) -	{ -		if(!$this->_focusScriptRegistered) -		{ -			$this->_focusScriptRegistered=true; -			$this->registerPradoScript('prado'); -			$this->registerEndScript('prado:focus','Prado.Focus.setFocus("'.THttpUtility::quoteJavaScriptString($target).'");'); -		} -	} - -	public function registerScrollScript($x,$y) -	{ -		if(!$this->_scrollScriptRegistered) -		{ -			$this->_scrollScriptRegistered=true; -			$this->registerHiddenField(TPage::FIELD_SCROLL_X,$x); -			$this->registerHiddenField(TPage::FIELD_SCROLL_Y,$y); -			// TBD, need scroll.js -		} -	} - -	public function registerDefaultButtonScript($source, $target) +	/** +	 * Registers a CSS file to be rendered in the page head +	 * @param string a unique key identifying the file +	 * @param string URL to the CSS file +	 */ +	public function registerStyleSheetFile($key,$url)  	{ -		$this->registerPradoScript('prado'); -		$button = $target->getClientID(); -		$panel = $source->getClientID(); -		return "Event.observe('{$panel}', 'keyup', Prado.Button.fireButton.bindEvent($('{$panel}'), '$button'));"; +		$this->_styleSheetFiles[$key]=$url;  	} -	public function registerValidationScript() -	{ -	}*/ - -	public function isHiddenFieldRegistered($key) +	/** +	 * Registers a CSS block to be rendered in the page head +	 * @param string a unique key identifying the CSS block +	 * @param string CSS block +	 */ +	public function registerStyleSheet($key,$css)  	{ -		return isset($this->_hiddenFields[$key]); +		$this->_styleSheets[$key]=$css;  	} -	public function isScriptRegistered($key) +	/** +	 * Registers a javascript file in the page head +	 * @param string a unique key identifying the file +	 * @param string URL to the javascript file +	 */ +	public function registerHeadScriptFile($key,$url)  	{ -		return isset($this->_scripts[$key]); +		$this->_headScriptFiles[$key]=$url;  	} -	public function isScriptFileRegistered($key) +	/** +	 * Registers a javascript block in the page head. +	 * @param string a unique key identifying the script block +	 * @param string javascript block +	 */ +	public function registerHeadScript($key,$script)  	{ -		return isset($this->_scriptFiles[$key]); +		$this->_headScripts[$key]=$script;  	} -	public function isBeginScriptRegistered($key) +	/** +	 * Registers a javascript file to be rendered within the form +	 * @param string a unique key identifying the file +	 * @param string URL to the javascript file to be rendered +	 */ +	public function registerScriptFile($key,$url)  	{ -		return isset($this->_beginScripts[$key]); +		$this->_scriptFiles[$key]=$url;  	} -	public function isEndScriptRegistered($key) +	/** +	 * Registers a javascript script block at the beginning of the form +	 * @param string a unique key identifying the script block +	 * @param string javascript block +	 */ +	public function registerBeginScript($key,$script)  	{ -		return isset($this->_endScripts[$key]); +		$this->_beginScripts[$key]=$script;  	} -/*	public function isHeadScriptFileRegistered($key) +	/** +	 * Registers a javascript script block at the end of the form +	 * @param string a unique key identifying the script block +	 * @param string javascript block +	 */ +	public function registerEndScript($key,$script)  	{ -		return isset($this->_headScriptFiles[$key]); +		$this->_endScripts[$key]=$script;  	} -	public function isHeadScriptRegistered($key) +	/** +	 * Registers a hidden field to be rendered in the form. +	 * @param string a unique key identifying the hidden field +	 * @param string hidden field value +	 */ +	public function registerHiddenField($name,$value)  	{ -		return isset($this->_headScripts[$key]); +		// if the named hidden field exists and has a value null, it means the hidden field is rendered already +		if(!isset($this->_hiddenFields[$name]) || $this->_hiddenFields[$name]!==null) +			$this->_hiddenFields[$name]=$value;  	} -*/ +	/** +	 * @param string a unique key +	 * @return boolean whether there is a CSS file registered with the specified key +	 */  	public function isStyleSheetFileRegistered($key)  	{  		return isset($this->_styleSheetFiles[$key]);  	} +	/** +	 * @param string a unique key +	 * @return boolean whether there is a CSS block registered with the specified key +	 */  	public function isStyleSheetRegistered($key)  	{  		return isset($this->_styleSheets[$key]);  	} -/*	public function isOnSubmitStatementRegistered($key) +	/** +	 * @param string a unique key +	 * @return boolean whether there is a head javascript file registered with the specified key +	 */ +	public function isHeadScriptFileRegistered($key)  	{ -		return isset($this->_onSubmitStatements[$key]); +		return isset($this->_headScriptFiles[$key]);  	} -	public function registerArrayDeclaration($name,$value) -	{ -		$this->_arrayDeclares[$name][]=$value; -	} -*/ -	public function registerScriptFile($key,$url) +	/** +	 * @param string a unique key +	 * @return boolean whether there is a head javascript block registered with the specified key +	 */ +	public function isHeadScriptRegistered($key)  	{ -		$this->_scriptFiles[$key]=$url; +		return isset($this->_headScripts[$key]);  	} -	public function registerHiddenField($name,$value) +	/** +	 * @param string a unique key +	 * @return boolean whether there is a javascript file registered with the specified key +	 */ +	public function isScriptFileRegistered($key)  	{ -		// if the named hidden field exists and has a value null, it means the hidden field is rendered already -		if(!isset($this->_hiddenFields[$name]) || $this->_hiddenFields[$name]!==null) -			$this->_hiddenFields[$name]=$value; +		return isset($this->_scriptFiles[$key]);  	} -/*	public function registerOnSubmitStatement($key,$script) -	{ -		$this->_onSubmitStatements[$key]=$script; -	} -*/ -	public function registerBeginScript($key,$script) +	/** +	 * @param string a unique key +	 * @return boolean whether there is a beginning javascript block registered with the specified key +	 */ +	public function isBeginScriptRegistered($key)  	{ -		$this->_beginScripts[$key]=$script; +		return isset($this->_beginScripts[$key]);  	} -	public function registerEndScript($key,$script) +	/** +	 * @param string a unique key +	 * @return boolean whether there is an ending javascript block registered with the specified key +	 */ +	public function isEndScriptRegistered($key)  	{ -		$this->_endScripts[$key]=$script; +		return isset($this->_endScripts[$key]);  	} -/*	public function registerHeadScriptFile($key,$url) +	/** +	 * @param string a unique key +	 * @return boolean whether there is a hidden field registered with the specified key +	 */ +	public function isHiddenFieldRegistered($key)  	{ -		$this->_headScriptFiles[$key]=$url; +		return isset($this->_hiddenFields[$key]);  	} -	public function registerHeadScript($key,$script) -	{ -		$this->_headScripts[$key]=$script; -	} -*/ -	public function registerStyleSheetFile($key,$url) +	/** +	 * @param THtmlWriter writer for the rendering purpose +	 */ +	public function renderStyleSheetFiles($writer)  	{ -		$this->_styleSheetFiles[$key]=$url; +		$str=''; +		foreach($this->_styleSheetFiles as $url) +			$str.="<link rel=\"stylesheet\" type=\"text/css\" href=\"".THttpUtility::htmlEncode($url)."\" />\n"; +		$writer->write($str);  	} -	public function registerStyleSheet($key,$css) +	/** +	 * @param THtmlWriter writer for the rendering purpose +	 */ +	public function renderStyleSheets($writer)  	{ -		$this->_styleSheets[$key]=$css; +		if(count($this->_styleSheets)) +			$writer->write("<style type=\"text/css\">\n/*<![CDATA[*/\n".implode("\n",$this->_styleSheets)."\n/*]]>*/\n</style>\n");  	} -/*	public function registerExpandoAttribute($controlID,$name,$value) +	/** +	 * @param THtmlWriter writer for the rendering purpose +	 */ +	public function renderHeadScriptFiles($writer)  	{ -		$this->_expandoAttributes[$controlID][$name]=$value; +		$writer->write(TJavaScript::renderScriptFiles($this->_headScriptFiles));  	} -	public function renderArrayDeclarations($writer) +	/** +	 * @param THtmlWriter writer for the rendering purpose +	 */ +	public function renderHeadScripts($writer)  	{ -		if(count($this->_arrayDeclares)) -		{ -			$str="<script type=\"text/javascript\">\n//<![CDATA[\n"; -			foreach($this->_arrayDeclares as $name=>$array) -				$str.="var $name=new Array(".implode(',',$array).");\n"; -			$str.="\n//]]>\n</script>\n"; -			$writer->write($str); -		} +		$writer->write(TJavaScript::renderScriptBlocks($this->_headScripts));  	} -*/ + +	/** +	 * @param THtmlWriter writer for the rendering purpose +	 */  	public function renderScriptFiles($writer)  	{ -		$str=''; -		foreach($this->_scriptFiles as $include) -			$str.="<script type=\"text/javascript\" src=\"".THttpUtility::htmlEncode($include)."\"></script>\n"; -		$writer->write($str); +		$writer->write(TJavaScript::renderScriptFiles($this->_scriptFiles));  	} -/*	public function renderOnSubmitStatements($writer) -	{ -		// ??? -	} -*/ +	/** +	 * @param THtmlWriter writer for the rendering purpose +	 */  	public function renderBeginScripts($writer)  	{ -		if(count($this->_beginScripts)) -			$writer->write("<script type=\"text/javascript\">\n//<![CDATA[\n".implode("\n",$this->_beginScripts)."\n//]]>\n</script>\n"); +		$writer->write(TJavaScript::renderScriptBlocks($this->_beginScripts));  	} +	/** +	 * @param THtmlWriter writer for the rendering purpose +	 */  	public function renderEndScripts($writer)  	{ -		if(count($this->_endScripts)) -			$writer->write("<script type=\"text/javascript\">\n//<![CDATA[\n".implode("\n",$this->_endScripts)."\n//]]>\n</script>\n"); +		$writer->write(TJavaScript::renderScriptBlocks($this->_endScripts));  	} +	/** +	 * @param THtmlWriter writer for the rendering purpose +	 */  	public function renderHiddenFields($writer)  	{  		$str=''; @@ -362,74 +419,6 @@ class TClientScriptManager extends TApplicationComponent  			$writer->write("<div>\n".$str."</div>\n");  	} -/*	public function renderExpandoAttributes($writer) -	{ -		if(count($this->_expandoAttributes)) -		{ -			$str="<script type=\"text/javascript\">\n//<![CDATA[\n"; -			foreach($this->_expandoAttributes as $controlID=>$attrs) -			{ -				$str.="var $controlID = document.all ? document.all[\"$controlID\"] : document.getElementById(\"$controlID\");\n"; -				foreach($attrs as $name=>$value) -				{ -					if($value===null) -						$str.="{$key}[\"$name\"]=null;\n"; -					else -						$str.="{$key}[\"$name\"]=\"$value\";\n"; -				} -			} -			$str.="\n//]]>\n</script>\n"; -			$writer->write($str); -		} -	} -*/ - -/*	public function renderHeadScriptFiles($writer) -	{ -		$str=''; -		foreach($this->_headScriptFiles as $url) -			$str.="<script type=\"text/javascript\" src=\"".THttpUtility::htmlEncode($url)."\"></script>\n"; -		$writer->write($str); -	} - -	public function renderHeadScripts($writer) -	{ -		if(count($this->_headScripts)) -			$writer->write("<script type=\"text/javascript\">\n//<![CDATA[\n".implode("\n",$this->_headScripts)."\n//]]>\n</script>\n"); -	} -*/ - -	public function renderJavascriptBlock($code) -	{ -		return "<script type=\"text/javascript\">\n/*<![CDATA[*/\n{$code}\n/*]]>*/\n</script>"; -	} - -	public function renderStyleSheetFiles($writer) -	{ -		$str=''; -		foreach($this->_styleSheetFiles as $url) -		{ -			$str.="<link rel=\"stylesheet\" type=\"text/css\" href=\"".THttpUtility::htmlEncode($url)."\" />\n"; -		} -		$writer->write($str); -	} - -	public function renderStyleSheets($writer) -	{ -		if(count($this->_styleSheets)) -			$writer->write("<style type=\"text/css\">\n".implode("\n",$this->_styleSheets)."\n</style>\n"); -	} - -	public function getHasHiddenFields() -	{ -		return count($this->_hiddenFields)>0; -	} - -/*	public function getHasSubmitStatements() -	{ -		return count($this->_onSubmitStatements)>0; -	} -*/  /*	public function registerClientEvent($control, $event, $code)  	{  		if(empty($code)) return; @@ -438,207 +427,28 @@ class TClientScriptManager extends TApplicationComponent  		$key = "prado:{$control->ClientID}:{$event}";  		$this->registerEndScript($key, $script);  	} -*/ -} - -/** - * PradoClientScript class. - * - * Resolves Prado client script dependencies. e.g. TPradoClientScript::getScripts("dom"); - * - * - <b>base</b> basic javascript utilities, e.g. $() - * - <b>dom</b> DOM and Form functions, e.g. $F(inputID) to retrive form input values. - * - <b>effects</b> Effects such as fade, shake, move - * - <b>controls</b> Prado client-side components, e.g. Slider, AJAX components - * - <b>validator</b> Prado client-side validators. - * - <b>ajax</b> Prado AJAX library including Prototype's AJAX and JSON. - * - * Dependencies for each library are automatically resolved. - * - * Namespace: System.Web.UI - * - * @author Wei Zhuo<weizhuo[at]gmail[dot]com> - * @version $Revision: 1.1 $  $Date: 2005/11/06 23:02:33 $ - * @package System.Web.UI - */ -class TPradoClientScript -{ -	/** -	 * Client-side javascript library dependencies -	 * @var array -	 */ -	protected static $_dependencies = array( -		'prado' => array('prado'), -		'effects' => array('prado', 'effects'), -		'ajax' => array('prado', 'effects', 'ajax'), -		'validator' => array('prado', 'validator'), -		'logger' => array('prado', 'logger'), -		'datepicker' => array('prado', 'datepicker'), -		'rico' => array('prado', 'effects', 'ajax', 'rico'), -		'colorpicker' => array('prado', 'colorpicker') -		); -	/** -	 * Resolve dependencies for the given library name(s). -	 * @param string|array name(s) of the library to be loaded. -	 * @return array list of library file names (w/o extension) for the specified library name(s). -	 */ -	public function getScripts($scripts) +	public function registerFocusScript($target)  	{ -		$files = array(); -		if(!is_array($scripts)) $scripts = array($scripts); -		foreach($scripts as $script) +		if(!$this->_focusScriptRegistered)  		{ -			if(isset(self::$_dependencies[$script])) -				$files = array_merge($files, self::$_dependencies[$script]); -			$files[] = $script; +			$this->_focusScriptRegistered=true; +			$this->registerPradoScript('prado'); +			$this->registerEndScript('prado:focus','Prado.Focus.setFocus("'.THttpUtility::quoteJavaScriptString($target).'");');  		} -		$files = array_unique($files); -		return $files;  	} - -	/** -	 * TODO: clean up -	 * -	public function getPostBackEventReference($control,$parameter='',$options=null,$javascriptPrefix=true) +	public function registerScrollScript($x,$y)  	{ -		if(!$options || (!$options->getPerformValidation() && !$options->getTrackFocus() && $options->getClientSubmit() && $options->getActionUrl()=='')) -		{ -			$this->registerPostBackScript(); -			if(($form=$this->_page->getForm())!==null) -				$formID=$form->getClientID(); -			else -				throw new TConfigurationException('clientscriptmanager_form_required'); -			$postback=self::POSTBACK_FUNC.'(\''.$formID.'\',\''.$control->getUniqueID().'\',\''.THttpUtility::quoteJavaScriptString($parameter).'\')'; -			if($options && $options->getAutoPostBack()) -				$postback='setTimeout(\''.THttpUtility::quoteJavaScriptString($postback).'\',0)'; -			return $javascriptPrefix?'javascript:'.$postback:$postback; -		} -		$opt=''; -		$flag=false; -		if($options->getPerformValidation()) -		{ -			$flag=true; -			$this->registerValidationScript(); -			$opt.=',true,'; -		} -		else -			$opt.=',false,'; -		if($options->getValidationGroup()!=='') -		{ -			$flag=true; -			$opt.='"'.$options->getValidationGroup().'",'; -		} -		else -			$opt.='\'\','; -		if($options->getActionUrl()!=='') -		{ -			$flag=true; -			$this->_page->setCrossPagePostBack(true); -			$opt.='"'.$options->getActionUrl().'",'; -		} -		else -			$opt.='null,'; -		if($options->getTrackFocus()) -		{ -			$flag=true; -			$this->registerFocusScript(); -			$opt.='true,'; -		} -		else -			$opt.='false,'; -		if($options->getClientSubmit()) +		if(!$this->_scrollScriptRegistered)  		{ -			$flag=true; -			$opt.='true'; +			$this->_scrollScriptRegistered=true; +			$this->registerHiddenField(TPage::FIELD_SCROLL_X,$x); +			$this->registerHiddenField(TPage::FIELD_SCROLL_Y,$y); +			// TBD, need scroll.js  		} -		else -			$opt.='false'; -		if(!$flag) -			return ''; -		$this->registerPostBackScript(); -		if(($form=$this->_page->getForm())!==null) -			$formID=$form->getClientID(); -		else -			throw new TConfigurationException('clientscriptmanager_form_required'); -		$postback=self::POSTBACK_FUNC.'(\''.$formID.'\',\''.$control->getUniqueID().'\',\''.THttpUtility::quoteJavaScriptString($parameter).'\''.$opt.')'; -		if($options && $options->getAutoPostBack()) -			$postback='setTimeout(\''.THttpUtility::quoteJavaScriptString($postback).'\',0)'; -		return $javascriptPrefix?'javascript:'.$postback:$postback; -	}*/ - -} - -/*class TPostBackOptions extends TComponent -{ -	public $_actionUrl=''; -	public $_autoPostBack=false; -	public $_clientSubmit=true; -	public $_performValidation=false; -	public $_validationGroup=''; -	public $_trackFocus=false; - -	public function getActionUrl() -	{ -		return $this->_actionUrl; -	} - -	public function setActionUrl($value) -	{ -		$this->_actionUrl=THttpUtility::quoteJavaScriptString($value); -	} - -	public function getAutoPostBack() -	{ -		return $this->_autoPostBack; -	} - -	public function setAutoPostBack($value) -	{ -		$this->_autoPostBack=$value; -	} - -	public function getClientSubmit() -	{ -		return $this->_clientSubmit; -	} - -	public function setClientSubmit($value) -	{ -		$this->_clientSubmit=$value; -	} - -	public function getPerformValidation() -	{ -		return $this->_performValidation; -	} - -	public function setPerformValidation($value) -	{ -		$this->_performValidation=$value;  	} - -	public function getValidationGroup() -	{ -		return $this->_validationGroup; -	} - -	public function setValidationGroup($value) -	{ -		$this->_validationGroup=$value; -	} - -	public function getTrackFocus() -	{ -		return $this->_trackFocus; -	} - -	public function setTrackFocus($value) -	{ -		$this->_trackFocus=$value; -	} -}  */ +}  ?>
\ No newline at end of file diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php index cedc807f..4aa01dc4 100644 --- a/framework/Web/UI/WebControls/TTextHighlighter.php +++ b/framework/Web/UI/WebControls/TTextHighlighter.php @@ -168,8 +168,7 @@ class TTextHighlighter extends TWebControl  	protected function getHeaderTemplate()
  	{
  		$id = $this->getClientID();
 -		$cs = $this->getPage()->getClientScript();
 -		return $cs->renderJavascriptBlock("new Prado.WebUI.TTextHighlighter('{$id}');");
 +		return TJavaScript::renderScriptBlock("new Prado.WebUI.TTextHighlighter('{$id}');");
  	}
  }
  ?>
\ No newline at end of file | 
