From 098556f20a2014f8ca211b0820cfa4776052641b Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Fri, 18 May 2012 18:00:24 +0000 Subject: fix #401 --- .../Web/UI/ActiveControls/TCallbackClientScript.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'framework/Web/UI/ActiveControls') diff --git a/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/framework/Web/UI/ActiveControls/TCallbackClientScript.php index 453824db..ecc213f5 100644 --- a/framework/Web/UI/ActiveControls/TCallbackClientScript.php +++ b/framework/Web/UI/ActiveControls/TCallbackClientScript.php @@ -433,6 +433,26 @@ class TCallbackClientScript extends TApplicationComponent $this->replace(null, $writer, 'Prado.Element.evaluateScript'); } + /** + * Appends a block of inline javascript enclosed in a boundary. + * Similar to to evaluateScript(), but functions declared in the + * inline block will be available to page elements. + * @param THtmlWriter writer for the content. + */ + public function appendScriptBlock($content) + { + if($content instanceof TControl) + { + $boundary = $this->getRenderedContentBoundary($content); + } + else if($content instanceof THtmlWriter) + { + $boundary = $this->getResponseContentBoundary($content); + } + + $this->callClientFunction('Prado.Element.appendScriptBlock', array($boundary)); + } + /** * Renders the control and return the content boundary from * TCallbackResponseWriter. This method should only be used by framework -- cgit v1.2.3