summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-05-25 08:08:06 +0000
committerctrlaltca@gmail.com <>2011-05-25 08:08:06 +0000
commitb282fa042e344a3739d5b48ac393e50c082227e4 (patch)
tree4a62b0978119499426867e68eea94b30cc61413c /framework/Web/UI/WebControls
parent58544be11ffc793eb39d613ce7878a7feba1ee02 (diff)
fixed last blocking error related to the build script. it completes successfully now
Diffstat (limited to 'framework/Web/UI/WebControls')
-rw-r--r--framework/Web/UI/WebControls/TTextHighlighter.php142
-rw-r--r--framework/Web/UI/WebControls/TWebControl.php2
2 files changed, 75 insertions, 69 deletions
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<weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 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 ('<pre>'.htmlentities(trim($text)).'</pre>');
-
+ {
+ try
+ {
+ $highlighter=Text_Highlighter::factory($this->getLanguage());
+ }
+ catch(Exception $e)
+ {
+ $highlighter=false;
+ }
+ if($highlighter===false)
+ return ('<pre>'.htmlentities(trim($text)).'</pre>');
+
$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<weizhuo[at]gmail[dot]com>
+ * @version $Id$
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TTextHighlighterLineNumberStyle extends TEnumerable
+{
+ const Li='Li';
+ const Table='Table';
}
diff --git a/framework/Web/UI/WebControls/TWebControl.php b/framework/Web/UI/WebControls/TWebControl.php
index de9e4868..f8950ac3 100644
--- a/framework/Web/UI/WebControls/TWebControl.php
+++ b/framework/Web/UI/WebControls/TWebControl.php
@@ -400,7 +400,7 @@ class TWebControl extends TControl implements IStyleable
/**
- * @difficulty if your subclass overrides the onPreRender method be sure to call
+ * If your subclass overrides the onPreRender method be sure to call
* this method through parent::onPreRender($param); so your sub-class can be decorated,
* among other things.
* @param TEventParameter event parameter to be passed to the event handlers