summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TActivePageAdapter.php
diff options
context:
space:
mode:
authorwei <>2006-12-09 09:17:22 +0000
committerwei <>2006-12-09 09:17:22 +0000
commit3c03a42d1edb0ec26110ace00f42e156cabff67b (patch)
tree66baa1cd4afca87668be07e62406e7d538dd1fbb /framework/Web/UI/ActiveControls/TActivePageAdapter.php
parent33b2284955a8f0015922d4c69c5082141b584f27 (diff)
Fixed #433, #384, #439, #477, #435, #422, #401, #359. Add more class docs for sqlmap.
Diffstat (limited to 'framework/Web/UI/ActiveControls/TActivePageAdapter.php')
-rw-r--r--framework/Web/UI/ActiveControls/TActivePageAdapter.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/framework/Web/UI/ActiveControls/TActivePageAdapter.php
index 2df19053..514b6880 100644
--- a/framework/Web/UI/ActiveControls/TActivePageAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActivePageAdapter.php
@@ -46,6 +46,11 @@ class TActivePageAdapter extends TControlAdapter
const CALLBACK_PAGESTATE_HEADER = 'X-PRADO-PAGESTATE';
/**
+ * Callback redirect url header name.
+ */
+ const CALLBACK_REDIRECT = 'X-PRADO-REDIRECT';
+
+ /**
* @var ICallbackEventHandler callback event handler.
*/
private $_callbackEventTarget;
@@ -112,7 +117,21 @@ class TActivePageAdapter extends TControlAdapter
public function renderCallbackResponse($writer)
{
Prado::trace("ActivePage renderCallbackResponse()",'System.Web.UI.ActiveControls.TActivePageAdapter');
- $this->renderResponse($writer);
+ if(($url = $this->getResponse()->getAdapter()->getRedirectedUrl())===null)
+ $this->renderResponse($writer);
+ else
+ $this->redirect($url);
+ }
+
+ /**
+ * Redirect url on the client-side using javascript.
+ * @param string new url to load.
+ */
+ protected function redirect($url)
+ {
+ if(!$this->getApplication()->getRequestCompleted())
+ $this->getApplication()->onEndRequest();
+ $this->getResponse()->appendHeader(self::CALLBACK_REDIRECT.': '.$url);
}
/**