diff options
-rw-r--r-- | framework/I18N/TTranslate.php | 7 | ||||
-rw-r--r-- | framework/I18N/TTranslateParameter.php | 6 | ||||
-rw-r--r-- | framework/Web/UI/ActiveControls/TActiveHyperLink.php | 3 | ||||
-rw-r--r-- | framework/Web/UI/TForm.php | 6 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TOutputCache.php | 8 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TSafeHtml.php | 6 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TTextProcessor.php | 6 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TXmlTransform.php | 6 |
8 files changed, 23 insertions, 25 deletions
diff --git a/framework/I18N/TTranslate.php b/framework/I18N/TTranslate.php index a444aeba..0ea340f4 100644 --- a/framework/I18N/TTranslate.php +++ b/framework/I18N/TTranslate.php @@ -201,8 +201,7 @@ class TTranslate extends TI18NControl */
public function render($writer)
{
- $textWriter=new TTextWriter;
- $htmlWriter=new THtmlWriter($textWriter);
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
$subs = array();
foreach($this->getParameters() as $key => $value)
$subs['{'.$key.'}'] = $value;
@@ -213,12 +212,12 @@ class TTranslate extends TI18NControl elseif($control instanceof TControl)
$control->render($htmlWriter);
elseif(is_string($control))
- $textWriter->write($control);
+ $htmlWriter->write($control);
}
$text = $this->getText();
if(strlen($text)==0)
- $text = $textWriter->flush();
+ $text = $htmlWriter->flush();
if($this->getTrim())
$text = trim($text);
diff --git a/framework/I18N/TTranslateParameter.php b/framework/I18N/TTranslateParameter.php index 37443133..8172ff03 100644 --- a/framework/I18N/TTranslateParameter.php +++ b/framework/I18N/TTranslateParameter.php @@ -110,10 +110,10 @@ class TTranslateParameter extends TControl $value = $this->getValue();
if(strlen($value) > 0)
return $value;
- $textWriter = new TTextWriter;
- $this->renderControl(new THtmlWriter($textWriter));
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+ $this->renderControl($htmlWriter);
return $this->getTrim() ?
- trim($textWriter->flush()) : $textWriter->flush();
+ trim($htmlWriter->flush()) : $htmlWriter->flush();
}
}
diff --git a/framework/Web/UI/ActiveControls/TActiveHyperLink.php b/framework/Web/UI/ActiveControls/TActiveHyperLink.php index 1a42e09c..9dbde235 100644 --- a/framework/Web/UI/ActiveControls/TActiveHyperLink.php +++ b/framework/Web/UI/ActiveControls/TActiveHyperLink.php @@ -66,8 +66,7 @@ class TActiveHyperLink extends THyperLink implements IActiveControl parent::setImageUrl($value); if($this->getActiveControl()->canUpdateClientSide() && $value !== '') { - $textWriter = new TTextWriter(); - $renderer = new THtmlWriter($textWriter); + $renderer = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); $this->createImage($value)->renderControl($renderer); $this->getPage()->getCallbackClient()->update($this, $textWriter->flush()); } diff --git a/framework/Web/UI/TForm.php b/framework/Web/UI/TForm.php index 2356a733..ee845ed5 100644 --- a/framework/Web/UI/TForm.php +++ b/framework/Web/UI/TForm.php @@ -73,9 +73,9 @@ class TForm extends TControl {
$page=$this->getPage();
$page->beginFormRender($writer);
- $textWriter=new TTextWriter;
- $this->renderChildren(new THtmlWriter($textWriter));
- $content=$textWriter->flush();
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+ $this->renderChildren( $htmlWriter );
+ $content = $htmlWriter->flush();
$page->endFormRender($writer);
$this->addAttributesToRender($writer);
diff --git a/framework/Web/UI/WebControls/TOutputCache.php b/framework/Web/UI/WebControls/TOutputCache.php index c0747a11..294519da 100644 --- a/framework/Web/UI/WebControls/TOutputCache.php +++ b/framework/Web/UI/WebControls/TOutputCache.php @@ -478,14 +478,14 @@ class TOutputCache extends TControl implements INamingContainer $writer->write($this->_contents);
else if($this->_cacheAvailable)
{
- $textWriter=new TTextWriter;
-
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+
$stack=$this->getPage()->getCachingStack();
$stack->push($this);
- parent::render(new THtmlWriter($textWriter));
+ parent::render($htmlWriter);
$stack->pop();
- $content=$textWriter->flush();
+ $content=$htmlWriter->flush();
$data=array($content,$this->_state,$this->_actions,time());
$this->_cache->set($this->getCacheKey(),$data,$this->getDuration(),$this->getCacheDependency());
$writer->write($content);
diff --git a/framework/Web/UI/WebControls/TSafeHtml.php b/framework/Web/UI/WebControls/TSafeHtml.php index d6829f8b..dba513c5 100644 --- a/framework/Web/UI/WebControls/TSafeHtml.php +++ b/framework/Web/UI/WebControls/TSafeHtml.php @@ -45,9 +45,9 @@ class TSafeHtml extends TControl */
public function render($writer)
{
- $textWriter=new TTextWriter;
- parent::render(new THtmlWriter($textWriter));
- $writer->write($this->parseSafeHtml($textWriter->flush()));
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+ parent::render($htmlWriter);
+ $writer->write($this->parseSafeHtml($htmlWriter->flush()));
}
/**
diff --git a/framework/Web/UI/WebControls/TTextProcessor.php b/framework/Web/UI/WebControls/TTextProcessor.php index 26dab754..3d900054 100644 --- a/framework/Web/UI/WebControls/TTextProcessor.php +++ b/framework/Web/UI/WebControls/TTextProcessor.php @@ -75,9 +75,9 @@ abstract class TTextProcessor extends TWebControl {
if(($text=$this->getText())==='' && $this->getHasControls())
{
- $textWriter=new TTextWriter;
- parent::renderContents(new THtmlWriter($textWriter));
- $text=$textWriter->flush();
+ $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
+ parent::renderContents($htmlWriter);
+ $text=$htmlWriter->flush();
}
if($text!=='')
$writer->write($this->processText($text));
diff --git a/framework/Web/UI/WebControls/TXmlTransform.php b/framework/Web/UI/WebControls/TXmlTransform.php index bb2c044f..d00ab974 100644 --- a/framework/Web/UI/WebControls/TXmlTransform.php +++ b/framework/Web/UI/WebControls/TXmlTransform.php @@ -169,10 +169,10 @@ class TXmlTransform extends TControl { */ public function render($writer) { if(($document=$this->getSourceXmlDocument()) === null) { - $textWriter = new TTextWriter(); - parent::render(new THtmlWriter($textWriter)); + $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); + parent::render($htmlWriter); $document = new DOMDocument(); - $document->loadXML($textWriter->flush()); + $document->loadXML($htmlWriter->flush()); } $stylesheet = $this->getTransformXmlDocument(); |