diff options
| author | ctrlaltca <> | 2012-06-04 13:19:53 +0000 | 
|---|---|---|
| committer | ctrlaltca <> | 2012-06-04 13:19:53 +0000 | 
| commit | 1c22314e5d19947bad8b987afbf2c9dc6bf834d6 (patch) | |
| tree | 44805f39154165959d2f2eda154ea16d6ef6b5c3 /framework/Web/UI/TClientScriptManager.php | |
| parent | 357ee6f0b72cd1657b01d8ebc5854300e5fadab4 (diff) | |
Related to r3159: Script rendering in ajax callbacks doesn't need to happen inside form rendering; avoid using assert(), throw an exception instead
Diffstat (limited to 'framework/Web/UI/TClientScriptManager.php')
| -rw-r--r-- | framework/Web/UI/TClientScriptManager.php | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 08b528b1..0096e169 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -85,7 +85,7 @@ class TClientScriptManager extends TApplicationComponent  	private $_renderedHiddenFields; -	private $_renderedScriptFiles; +	private $_renderedScriptFiles=array();  	private $_expandedPradoScripts; @@ -665,20 +665,19 @@ class TClientScriptManager extends TApplicationComponent  	public function renderScriptFilesBegin($writer)  	{ -		$this->renderScriptFilesInt($writer,true); +		$this->renderScriptFilesInt($writer);  	}  	public function renderScriptFilesEnd($writer)  	{ -		$this->renderScriptFilesInt($writer,false); +		$this->renderScriptFilesInt($writer);  	}  	/**  	 * @param THtmlWriter writer for the rendering purpose  	 */ -	public function renderScriptFilesInt($writer, $initial) +	public function renderScriptFilesInt($writer)  	{ -		if ($initial) $this->_renderedScriptFiles = array();  		if(!empty($this->_scriptFiles))  		{  			$addedScripts = array_diff($this->_scriptFiles,$this->_renderedScriptFiles); @@ -717,10 +716,11 @@ class TClientScriptManager extends TApplicationComponent  	/**  	 * Flushes all pending script registrations  	 * @param THtmlWriter writer for the rendering purpose +	 * @param TControl the control forcing the flush (used only in error messages)  	 */ -	public function flushScriptFiles($writer) +	public function flushScriptFiles($writer, $control=null)  	{ -		assert($this->_page->InFormRender); +		$this->_page->ensureRenderInForm($control);  		$this->renderScriptFilesInt($writer,false);  	} | 
