From 67e09d150afe55d7a956beb299dc0534f7da68eb Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 15 Jun 2006 00:56:57 +0000 Subject: Update active controls. Add comments. Add THttpResponseAdapter --- .../UI/ActiveControls/TCallbackResponseAdapter.php | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php (limited to 'framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php') diff --git a/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php b/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php new file mode 100755 index 00000000..d1ec67ad --- /dev/null +++ b/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php @@ -0,0 +1,65 @@ +_writers[] = $writer; + return parent::createNewHtmlWriter($type,$writer); + } + + public function flushContent() + { + foreach($this->_writers as $writer) + echo $writer->flush(); + parent::flushContent(); + } + + public function setResponseData($data) + { + $this->_data = $data; + } + + public function getResponseData() + { + return $this->_data; + } +} + +class TCallbackResponseWriter extends TTextWriter +{ + private $_boundary; + + public function __construct() + { + $this->_boundary = sprintf('%x',crc32((string)$this)); + } + + public function getBoundary() + { + return $this->_boundary; + } + + public function setBoundary($value) + { + $this->_boundary = $value; + } + + public function flush() + { + $content = ''; + $content .= parent::flush(); + $content .= ''; + return $content; + } +} + +?> \ No newline at end of file -- cgit v1.2.3