summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TTextHighlighter.php
diff options
context:
space:
mode:
authorwei <>2006-02-01 07:12:14 +0000
committerwei <>2006-02-01 07:12:14 +0000
commitcff3c0c965c5f22918abe736432bd73a40bae5b2 (patch)
tree2609856dc7900d58ed88aca240c013a190b3981b /framework/Web/UI/WebControls/TTextHighlighter.php
parent4cec5a79840bc13480c02e1032e632e9dd9bba1f (diff)
Update syntax highlighter with Copy Code option.
Diffstat (limited to 'framework/Web/UI/WebControls/TTextHighlighter.php')
-rw-r--r--framework/Web/UI/WebControls/TTextHighlighter.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php
index 35f3cc23..de34b652 100644
--- a/framework/Web/UI/WebControls/TTextHighlighter.php
+++ b/framework/Web/UI/WebControls/TTextHighlighter.php
@@ -85,6 +85,7 @@ class TTextHighlighter extends TWebControl
{
parent::onPreRender($writer);
$this->registerHighlightStyleSheet();
+ $this->getPage()->getClientScript()->registerClientScript('prado');
}
/**
@@ -138,7 +139,16 @@ class TTextHighlighter extends TWebControl
if($this->getShowLineNumbers())
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
$geshi->enable_classes();
+ $geshi->set_header_content($this->getHeaderTemplate());
+
return $geshi->parse_code();
}
+
+ function getHeaderTemplate()
+ {
+ $id = $this->getClientID();
+ $cs = $this->getPage()->getClientScript();
+ return $cs->renderJavascriptBlock("new Prado.WebUI.TTextHighlighter('{$id}');");
+ }
}
?> \ No newline at end of file