diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-25 20:04:57 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-25 20:04:57 +0100 |
commit | e4999b25052d1ad9400a0f9fd5289a49eea1bddc (patch) | |
tree | 50e9b819fc3326cf08e882b648f8dafc8fec3fa4 /framework/Web/UI/WebControls/TTextHighlighter.php | |
parent | 5230f8f8a86fc1ae5d90f8c74ae65c93e197502b (diff) |
More namespace changes
Changed version to 3.2.99;
Attempt at fixing autoloading
fixed enough namespaces to have some demos running
Diffstat (limited to 'framework/Web/UI/WebControls/TTextHighlighter.php')
-rw-r--r-- | framework/Web/UI/WebControls/TTextHighlighter.php | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php index 969b00a1..ea4e92ec 100644 --- a/framework/Web/UI/WebControls/TTextHighlighter.php +++ b/framework/Web/UI/WebControls/TTextHighlighter.php @@ -10,10 +10,26 @@ */ namespace Prado\Web\UI\WebControls; - -Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter',false); -Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter.Renderer.Html',false); -Prado::using('System.Web.UI.WebControls.TTextProcessor'); +use Prado\TPropertyValue; +use Prado\Prado; + +// BC trick : only define constants if Text/Highlighter.php +// is not yet included +if (!defined('HL_NUMBERS_LI')) { + /**#@+ + * Constant for use with $options['numbers'] + */ + /** + * use numbered list, deprecated, use HL_NUMBERS_OL instaed + * @deprecated + */ + define ('HL_NUMBERS_LI' , 1); + /** + * Use 2-column table with line numbers in left column and code in right column. + */ + define ('HL_NUMBERS_TABLE' , 2); + /**#@-*/ +} /** @@ -149,7 +165,7 @@ class TTextHighlighter extends TTextProcessor protected function registerStyleSheet() { $cs=$this->getPage()->getClientScript(); - $cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight','.css'); + $cssFile=Prado::getPathOfNamespace('Prado\\3rdParty\\TextHighlighter\\highlight','.css'); $cssKey='prado:TTextHighlighter:'.$cssFile; if(!$cs->isStyleSheetFileRegistered($cssKey)) $cs->registerStyleSheetFile($cssKey, $this->publishFilePath($cssFile)); @@ -165,9 +181,9 @@ class TTextHighlighter extends TTextProcessor { try { - $highlighter=Text_Highlighter::factory($this->getLanguage()); + $highlighter=\Prado\3rdParty\TextHighlighter\Text\Highlighter::factory($this->getLanguage()); } - catch(Exception $e) + catch(\Exception $e) { $highlighter=false; } |