diff options
author | xue <> | 2005-12-29 13:01:04 +0000 |
---|---|---|
committer | xue <> | 2005-12-29 13:01:04 +0000 |
commit | c38c1e6f271f73e5d9474e63bca227e2b7a30db8 (patch) | |
tree | af07fb99f0853194aab5664124b68a19e618a0e1 /demos/quickstart/protected/controls/TTextHighlighter.php | |
parent | 3126610fdab66c4e83de00d36a762af30199238d (diff) |
Added line numbers to source view.
Diffstat (limited to 'demos/quickstart/protected/controls/TTextHighlighter.php')
-rw-r--r-- | demos/quickstart/protected/controls/TTextHighlighter.php | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/demos/quickstart/protected/controls/TTextHighlighter.php b/demos/quickstart/protected/controls/TTextHighlighter.php index b89e5274..bc74b5af 100644 --- a/demos/quickstart/protected/controls/TTextHighlighter.php +++ b/demos/quickstart/protected/controls/TTextHighlighter.php @@ -43,22 +43,19 @@ class TTextHighlighter extends TWebControl return $this->getViewState('LineNumbers', false);
}
- public function getEnableEntities()
- {
- return $this->getViewState('Entities', false);
- }
-
- public function setEnableEntities($value)
- {
- $this->setViewState('Entities', TPropertyValue::ensureBoolean($value), false);
- }
-
protected function onPreRender($writer)
{
parent::onPreRender($writer);
$this->registerTextHighlightStyleSheet();
}
+ public function addParsedObject($object)
+ {
+ if(is_string($object))
+ $object=html_entity_decode($object);
+ parent::addParsedObject($object);
+ }
+
protected function renderContents($writer)
{
$textWriter=new TTextWriter;
@@ -86,8 +83,6 @@ class TTextHighlighter extends TWebControl */
protected function highlightText($text)
{
- if(!$this->getEnableEntities())
- $text = html_entity_decode($text);
$geshi = new GeSHi(trim($text), $this->getLanguage());
if($this->getEnableLineNumbers())
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
|