From 15be96d7736550fbf097bb4dd3d4c971ef1f5cc1 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Wed, 25 May 2011 09:34:54 +0000 Subject: backported build script fixes to branch/3.1 --- .../UI/ActiveControls/TValueTriggeredCallback.php | 4 +- framework/Web/UI/WebControls/TTextHighlighter.php | 142 +++++++++++---------- 2 files changed, 77 insertions(+), 69 deletions(-) (limited to 'framework/Web/UI') diff --git a/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php b/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php index 305afd70..4f7c8332 100644 --- a/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php +++ b/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php @@ -4,12 +4,14 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.ActiveControls */ +Prado::using('System.Web.UI.ActiveControls.TTriggeredCallback'); + /** * TValueTriggeredCallback Class * diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php index 890deb05..8218587c 100644 --- a/framework/Web/UI/WebControls/TTextHighlighter.php +++ b/framework/Web/UI/WebControls/TTextHighlighter.php @@ -4,16 +4,16 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.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'); - +Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter.Renderer.Html',false); +Prado::using('System.Web.UI.WebControls.TTextProcessor'); + /** * TTextHighlighter class. @@ -37,8 +37,8 @@ Prado::using('System.Web.UI.WebControls.TTextProcessor'); */ class TTextHighlighter extends TTextProcessor { - private static $_lineNumberStyle=array(TTextHighlighterLineNumberStyle::Li => HL_NUMBERS_LI, TTextHighlighterLineNumberStyle::Table => HL_NUMBERS_TABLE); - + private static $_lineNumberStyle=array(TTextHighlighterLineNumberStyle::Li => HL_NUMBERS_LI, TTextHighlighterLineNumberStyle::Table => HL_NUMBERS_TABLE); + /** * @return string tag name of the panel */ @@ -99,39 +99,39 @@ class TTextHighlighter extends TTextProcessor { $this->setViewState('CopyCode', TPropertyValue::ensureBoolean($value), false); } - - /** - * @return TTextHighlighterLineNumberStyle style of row number, Table by default - */ - public function getLineNumberStyle() - { - return $this->getViewState('LineNumberStyle', TTextHighlighterLineNumberStyle::Table); + + /** + * @return TTextHighlighterLineNumberStyle style of row number, Table by default + */ + public function getLineNumberStyle() + { + return $this->getViewState('LineNumberStyle', TTextHighlighterLineNumberStyle::Table); + } + + /** + * @param TTextHighlighterLineNumberStyle style of row number + */ + public function setLineNumberStyle($value) + { + $this->setViewState('LineNumberStyle', TPropertyValue::ensureEnum($value,'TTextHighlighterLineNumberStyle')); + } + + /** + * @return integer tab size. Defaults to 4. + */ + public function getTabSize() + { + return $this->getViewState('TabSize', 4); + } + + /** + * @param integer tab size + */ + public function setTabSize($value) + { + $this->setViewState('TabSize', TPropertyValue::ensureInteger($value)); } - - /** - * @param TTextHighlighterLineNumberStyle style of row number - */ - public function setLineNumberStyle($value) - { - $this->setViewState('LineNumberStyle', TPropertyValue::ensureEnum($value,'TTextHighlighterLineNumberStyle')); - } - - /** - * @return integer tab size. Defaults to 4. - */ - public function getTabSize() - { - return $this->getViewState('TabSize', 4); - } - - /** - * @param integer tab size - */ - public function setTabSize($value) - { - $this->setViewState('TabSize', TPropertyValue::ensureInteger($value)); - } - + /** * Registers css style for the highlighted result. * This method overrides parent implementation. @@ -143,18 +143,18 @@ class TTextHighlighter extends TTextProcessor $this->registerStyleSheet(); $this->getPage()->getClientScript()->registerPradoScript('prado'); } - - /** - * Registers the stylesheet for presentation. - */ - protected function registerStyleSheet() - { - $cs=$this->getPage()->getClientScript(); - $cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight','.css'); - $cssKey='prado:TTextHighlighter:'.$cssFile; - if(!$cs->isStyleSheetFileRegistered($cssKey)) - $cs->registerStyleSheetFile($cssKey, $this->publishFilePath($cssFile)); - } + + /** + * Registers the stylesheet for presentation. + */ + protected function registerStyleSheet() + { + $cs=$this->getPage()->getClientScript(); + $cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight','.css'); + $cssKey='prado:TTextHighlighter:'.$cssFile; + if(!$cs->isStyleSheetFileRegistered($cssKey)) + $cs->registerStyleSheetFile($cssKey, $this->publishFilePath($cssFile)); + } /** * Processes a text string. @@ -163,18 +163,18 @@ class TTextHighlighter extends TTextProcessor * @return string the processed text result */ public function processText($text) - { - try - { - $highlighter=Text_Highlighter::factory($this->getLanguage()); - } - catch(Exception $e) - { - $highlighter=false; - } - if($highlighter===false) - return ('
'.htmlentities(trim($text)).'
'); - + { + try + { + $highlighter=Text_Highlighter::factory($this->getLanguage()); + } + catch(Exception $e) + { + $highlighter=false; + } + if($highlighter===false) + return ('
'.htmlentities(trim($text)).'
'); + $options["use_language"]=true; $options["tabsize"] = $this->getTabSize(); if ($this->getShowLineNumbers()) @@ -191,10 +191,16 @@ class TTextHighlighter extends TTextProcessor $id = $this->getClientID(); return TJavaScript::renderScriptBlock("new Prado.WebUI.TTextHighlighter('{$id}');"); } -} - -class TTextHighlighterLineNumberStyle extends TEnumerable -{ - const Li='Li'; - const Table='Table'; +} + +/** + * @author Wei Zhuo + * @version $Id$ + * @package System.Web.UI.WebControls + * @since 3.0 + */ +class TTextHighlighterLineNumberStyle extends TEnumerable +{ + const Li='Li'; + const Table='Table'; } -- cgit v1.2.3