|
Server IP : 10.2.73.233 / Your IP : 216.73.216.223 Web Server : Apache/2.4.59 (Debian) System : Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 User : www-data ( 33) PHP Version : 5.6.40-64+0~20230107.71+debian10~1.gbp673146 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/ilpnowa/../ifk/web.back/framework/Web/UI/WebControls/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
/**
* TTextProcessor class file
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package System.Web.UI.WebControls
*/
/**
* TTextProcessor class.
*
* TTextProcessor is the base class for classes that process or transform
* text content into different forms. The text content to be processed
* is specified by {@link setText Text} property. If it is not set, the body
* content enclosed within the processor control will be processed and rendered.
* The body content includes static text strings and the rendering result
* of child controls.
*
* Note, all child classes must implement {@link processText} method.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @package System.Web.UI
* @since 3.0.1
*/
abstract class TTextProcessor extends TWebControl
{
/**
* Processes a text string.
* This method must be implemented by child classes.
* @param string text string to be processed
* @return string the processed text result
*/
abstract public function processText($text);
/**
* HTML-decodes static text.
* This method overrides parent implementation.
* @param mixed object to be added as body content
*/
public function addParsedObject($object)
{
if(is_string($object))
$object=html_entity_decode($object,ENT_QUOTES,'UTF-8');
parent::addParsedObject($object);
}
/**
* @return string text to be processed
*/
public function getText()
{
return $this->getViewState('Text','');
}
/**
* @param string text to be processed
*/
public function setText($value)
{
$this->setViewState('Text',$value);
}
/**
* Renders body content.
* This method overrides the parent implementation by replacing
* the body content with the processed text content.
* @param THtmlWriter writer
*/
public function renderContents($writer)
{
if(($text=$this->getText())==='' && $this->getHasControls())
{
$htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
parent::renderContents($htmlWriter);
$text=$htmlWriter->flush();
}
if($text!=='')
$writer->write($this->processText($text));
}
}