diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-20 22:34:11 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-20 22:34:11 +0100 |
commit | 7369988330bf8796d9cf2564756baf4eb46871ba (patch) | |
tree | 60a0bac5467b76ab6ed45328ed8c4e65703400b7 /framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php | |
parent | ef4d964de440970b76ab48fcbd6748f43675efa3 (diff) |
one class per file: framework/Web/UI/ActiveControls
Diffstat (limited to 'framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php')
-rwxr-xr-x | framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php | 63 |
1 files changed, 1 insertions, 62 deletions
diff --git a/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php b/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php index cad3c9ee..501f50cd 100755 --- a/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php +++ b/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php @@ -94,65 +94,4 @@ class TCallbackResponseAdapter extends THttpResponseAdapter { return $this->_redirectUrl; } -} - -/** - * TCallbackResponseWriter class. - * - * TCallbackResponseWriter class enclosed a chunck of content within a - * html comment boundary. This allows multiple chuncks of content to return - * in the callback response and update multiple HTML elements. - * - * The {@link setBoundary Boundary} property sets boundary identifier in the - * HTML comment that forms the boundary. By default, the boundary identifier - * is generated using microtime. - * - * @author Wei Zhuo <weizhuo[at]gmail[dot]com> - * @package System.Web.UI.ActiveControls - * @since 3.1 - */ -class TCallbackResponseWriter extends TTextWriter -{ - /** - * @var string boundary ID - */ - private $_boundary; - - /** - * Constructor. Generates unique boundary ID using microtime. - */ - public function __construct() - { - $this->_boundary = sprintf('%x',crc32(microtime())); - } - - /** - * @return string boundary identifier. - */ - public function getBoundary() - { - return $this->_boundary; - } - - /** - * @param string boundary identifier. - */ - public function setBoundary($value) - { - $this->_boundary = $value; - } - - /** - * Returns the text content wrapped within a HTML comment with boundary - * identifier as its comment content. - * @return string text content chunck. - */ - public function flush() - { - $content = parent::flush(); - if(empty($content)) - return ""; - return '<!--'.$this->getBoundary().'-->'.$content.'<!--//'.$this->getBoundary().'-->'; - } -} - +}
\ No newline at end of file |