summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes18
-rw-r--r--demos/composer/protected/pages/Home.page34
-rw-r--r--demos/quickstart/protected/pages/ViewSource.page2
-rw-r--r--framework/Web/UI/WebControls/Highlighter/code_highlight.css (renamed from demos/quickstart/protected/controls/Highlighter/code_highlight.css)0
-rw-r--r--framework/Web/UI/WebControls/Highlighter/geshi.php (renamed from demos/quickstart/protected/controls/Highlighter/geshi.php)0
-rw-r--r--framework/Web/UI/WebControls/Highlighter/geshi/css.php (renamed from demos/quickstart/protected/controls/Highlighter/geshi/css.php)0
-rw-r--r--framework/Web/UI/WebControls/Highlighter/geshi/html.php (renamed from demos/quickstart/protected/controls/Highlighter/geshi/html.php)0
-rw-r--r--framework/Web/UI/WebControls/Highlighter/geshi/javascript.php (renamed from demos/quickstart/protected/controls/Highlighter/geshi/javascript.php)0
-rw-r--r--framework/Web/UI/WebControls/Highlighter/geshi/php.php (renamed from demos/quickstart/protected/controls/Highlighter/geshi/php.php)0
-rw-r--r--framework/Web/UI/WebControls/Highlighter/geshi/prado.php (renamed from demos/quickstart/protected/controls/Highlighter/geshi/prado.php)0
-rw-r--r--framework/Web/UI/WebControls/Highlighter/geshi/xml.php (renamed from demos/quickstart/protected/controls/Highlighter/geshi/xml.php)0
-rw-r--r--framework/Web/UI/WebControls/TRepeater.php58
-rw-r--r--framework/Web/UI/WebControls/TTextHighlighter.php (renamed from demos/quickstart/protected/controls/TTextHighlighter.php)13
13 files changed, 82 insertions, 43 deletions
diff --git a/.gitattributes b/.gitattributes
index b0f5bdee..f35b57f6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -20,21 +20,12 @@ demos/personal/themes/BlueTheme/labels.skin -text
demos/quickstart/index.php -text
demos/quickstart/protected/.htaccess -text
demos/quickstart/protected/application.xml -text
-demos/quickstart/protected/controls/Highlighter/code_highlight.css -text
-demos/quickstart/protected/controls/Highlighter/geshi.php -text
-demos/quickstart/protected/controls/Highlighter/geshi/css.php -text
-demos/quickstart/protected/controls/Highlighter/geshi/html.php -text
-demos/quickstart/protected/controls/Highlighter/geshi/javascript.php -text
-demos/quickstart/protected/controls/Highlighter/geshi/php.php -text
-demos/quickstart/protected/controls/Highlighter/geshi/prado.php -text
-demos/quickstart/protected/controls/Highlighter/geshi/xml.php -text
demos/quickstart/protected/controls/Layout.php -text
demos/quickstart/protected/controls/Layout.tpl -text
demos/quickstart/protected/controls/RunBar.php -text
demos/quickstart/protected/controls/RunBar.tpl -text
demos/quickstart/protected/controls/SampleLayout.php -text
demos/quickstart/protected/controls/SampleLayout.tpl -text
-demos/quickstart/protected/controls/TTextHighlighter.php -text
demos/quickstart/protected/controls/TopicList.php -text
demos/quickstart/protected/controls/TopicList.tpl -text
demos/quickstart/protected/pages/Configurations/AppConfig.page -text
@@ -499,6 +490,14 @@ framework/Web/UI/TPageStatePersister.php -text
framework/Web/UI/TTemplateControl.php -text
framework/Web/UI/TTemplateManager.php -text
framework/Web/UI/TThemeManager.php -text
+framework/Web/UI/WebControls/Highlighter/code_highlight.css -text
+framework/Web/UI/WebControls/Highlighter/geshi.php -text
+framework/Web/UI/WebControls/Highlighter/geshi/css.php -text
+framework/Web/UI/WebControls/Highlighter/geshi/html.php -text
+framework/Web/UI/WebControls/Highlighter/geshi/javascript.php -text
+framework/Web/UI/WebControls/Highlighter/geshi/php.php -text
+framework/Web/UI/WebControls/Highlighter/geshi/prado.php -text
+framework/Web/UI/WebControls/Highlighter/geshi/xml.php -text
framework/Web/UI/WebControls/TBaseValidator.php -text
framework/Web/UI/WebControls/TBulletedList.php -text
framework/Web/UI/WebControls/TButton.php -text
@@ -535,6 +534,7 @@ framework/Web/UI/WebControls/TStatements.php -text
framework/Web/UI/WebControls/TStyle.php -text
framework/Web/UI/WebControls/TTable.php -text
framework/Web/UI/WebControls/TTextBox.php -text
+framework/Web/UI/WebControls/TTextHighlighter.php -text
framework/Web/UI/WebControls/TWebControl.php -text
framework/core.php -text
framework/prado.php -text
diff --git a/demos/composer/protected/pages/Home.page b/demos/composer/protected/pages/Home.page
index ae4149ee..d75a61d8 100644
--- a/demos/composer/protected/pages/Home.page
+++ b/demos/composer/protected/pages/Home.page
@@ -72,9 +72,39 @@ implements <com:TTextBox ID="Interfaces" CssClass="slTextBox"/>
</com:TRepeater>
</table>
</com:TPanel>
+
<com:TPanel GroupingText="Event Definitions">
-Event Definitions:
+<table>
+<tr>
+ <th>Name</th>
+ <th>Comments</th>
+ <th>Actions</th>
+</tr>
+<com:TRepeater ID="EventList" ItemCommand="itemAction">
+<prop:ItemTemplate>
+<tr>
+ <td>
+ <com:TTextBox ID="EventName" Text=<%# $this->Parent->DataItem->Name %> CssClass="slTextBox"/>
+ </td>
+ <td>
+ <com:TTextBox ID="Comments" Text=<%# $this->Parent->DataItem->Comments %> CssClass="slTextBox"/>
+ </td>
+ <td>
+ <com:TButton ID="AddButton"
+ Text="Add"
+ CommandName="add"
+ CommandParameter=<%# $this->Parent->ItemIndex %> />
+ <com:TButton ID="RemoveButton"
+ Text="Remove"
+ CommandName="remove"
+ CommandParameter=<%# $this->Parent->ItemIndex %> />
+ </td>
+</tr>
+</prop:ItemTemplate>
+</com:TRepeater>
+</table>
</com:TPanel>
+
<br/>
Comments
<br/>
@@ -89,6 +119,8 @@ Author Email
Text=<%#$this->Page->ClassDefinition->Email%>
CssClass="slTextBox"/>
<br/>
+
+<hr/>
<com:TButton Text="Generate Code" Click="generateCode" />
<pre>
<com:TLiteral ID="SourceCode" />
diff --git a/demos/quickstart/protected/pages/ViewSource.page b/demos/quickstart/protected/pages/ViewSource.page
index c17d35af..900c45f6 100644
--- a/demos/quickstart/protected/pages/ViewSource.page
+++ b/demos/quickstart/protected/pages/ViewSource.page
@@ -10,7 +10,7 @@
<com:TLiteral ID="SourceList" />
</div>
<div id="sourceView">
-<com:TTextHighlighter ID="Highlighter" EnableLineNumbers="true" CssClass="source">
+<com:TTextHighlighter ID="Highlighter" ShowLineNumbers="true" CssClass="source">
<com:TLiteral ID="SourceView" />
</com:TTextHighlighter>
</div>
diff --git a/demos/quickstart/protected/controls/Highlighter/code_highlight.css b/framework/Web/UI/WebControls/Highlighter/code_highlight.css
index be000a83..be000a83 100644
--- a/demos/quickstart/protected/controls/Highlighter/code_highlight.css
+++ b/framework/Web/UI/WebControls/Highlighter/code_highlight.css
diff --git a/demos/quickstart/protected/controls/Highlighter/geshi.php b/framework/Web/UI/WebControls/Highlighter/geshi.php
index b124c936..b124c936 100644
--- a/demos/quickstart/protected/controls/Highlighter/geshi.php
+++ b/framework/Web/UI/WebControls/Highlighter/geshi.php
diff --git a/demos/quickstart/protected/controls/Highlighter/geshi/css.php b/framework/Web/UI/WebControls/Highlighter/geshi/css.php
index 28e4bf18..28e4bf18 100644
--- a/demos/quickstart/protected/controls/Highlighter/geshi/css.php
+++ b/framework/Web/UI/WebControls/Highlighter/geshi/css.php
diff --git a/demos/quickstart/protected/controls/Highlighter/geshi/html.php b/framework/Web/UI/WebControls/Highlighter/geshi/html.php
index e5683b8c..e5683b8c 100644
--- a/demos/quickstart/protected/controls/Highlighter/geshi/html.php
+++ b/framework/Web/UI/WebControls/Highlighter/geshi/html.php
diff --git a/demos/quickstart/protected/controls/Highlighter/geshi/javascript.php b/framework/Web/UI/WebControls/Highlighter/geshi/javascript.php
index 1a17e1e7..1a17e1e7 100644
--- a/demos/quickstart/protected/controls/Highlighter/geshi/javascript.php
+++ b/framework/Web/UI/WebControls/Highlighter/geshi/javascript.php
diff --git a/demos/quickstart/protected/controls/Highlighter/geshi/php.php b/framework/Web/UI/WebControls/Highlighter/geshi/php.php
index e78ec47c..e78ec47c 100644
--- a/demos/quickstart/protected/controls/Highlighter/geshi/php.php
+++ b/framework/Web/UI/WebControls/Highlighter/geshi/php.php
diff --git a/demos/quickstart/protected/controls/Highlighter/geshi/prado.php b/framework/Web/UI/WebControls/Highlighter/geshi/prado.php
index c9d96a35..c9d96a35 100644
--- a/demos/quickstart/protected/controls/Highlighter/geshi/prado.php
+++ b/framework/Web/UI/WebControls/Highlighter/geshi/prado.php
diff --git a/demos/quickstart/protected/controls/Highlighter/geshi/xml.php b/framework/Web/UI/WebControls/Highlighter/geshi/xml.php
index 682ca3db..682ca3db 100644
--- a/demos/quickstart/protected/controls/Highlighter/geshi/xml.php
+++ b/framework/Web/UI/WebControls/Highlighter/geshi/xml.php
diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php
index 342a764b..f46d2929 100644
--- a/framework/Web/UI/WebControls/TRepeater.php
+++ b/framework/Web/UI/WebControls/TRepeater.php
@@ -254,31 +254,6 @@ class TRepeater extends TDataBoundControl implements INamingContainer
return $item;
}
- protected function restoreItemsFromViewState()
- {
- $this->getControls()->clear();
- $items=$this->getItems();
- $items->clear();
- $this->_header=null;
- $this->_footer=null;
- if(($itemCount=$this->getViewState('ItemCount',0))>0)
- {
- if($this->_headerTemplate!=='')
- $this->_header=$this->createItemInternal(-1,'Header',false,null);
- $hasSeparator=$this->_separatorTemplate!=='';
- for($i=0;$i<$itemCount;++$i)
- {
- if($hasSeparator && $i>0)
- $this->createItemInternal($i-1,'Separator',false,null);
- $itemType=$i%2==0?'Item':'AlternatingItem';
- $items->add($this->createItemInternal($i,$itemType,false,null));
- }
- if($this->_footerTemplate!=='')
- $this->_footer=$this->createItemInternal(-1,'Footer',false,null);
- }
- $this->clearChildState();
- }
-
/**
* Saves items into viewstate.
* This method is invoked right before control state is to be saved.
@@ -304,6 +279,35 @@ class TRepeater extends TDataBoundControl implements INamingContainer
$this->clearViewState('ItemCount');
}
+ protected function restoreItemsFromViewState()
+ {
+ $this->getControls()->clear();
+ $items=$this->getItems();
+ $items->clear();
+ $this->_header=null;
+ $this->_footer=null;
+ if(($itemCount=$this->getViewState('ItemCount',0))>0)
+ {
+ if($this->_headerTemplate!=='')
+ $this->_header=$this->createItemInternal(-1,'Header',false,null);
+ $hasSeparator=$this->_separatorTemplate!=='';
+ for($i=0;$i<$itemCount;++$i)
+ {
+ if($hasSeparator && $i>0)
+ $this->createItemInternal($i-1,'Separator',false,null);
+ $itemType=$i%2==0?'Item':'AlternatingItem';
+ $items->add($this->createItemInternal($i,$itemType,false,null));
+ }
+ if($this->_footerTemplate!=='')
+ $this->_footer=$this->createItemInternal(-1,'Footer',false,null);
+ }
+ else if($this->_emptyTemplate!=='')
+ {
+ $this->_empty=$this->createItemInternal(-1,'Empty',false,null);
+ }
+ $this->clearChildState();
+ }
+
/**
* Performs databinding to populate list items from data source.
* This method is invoked by dataBind().
@@ -335,7 +339,11 @@ class TRepeater extends TDataBoundControl implements INamingContainer
$this->setViewState('ItemCount',$itemIndex,0);
}
else
+ {
+ if($this->_emptyTemplate!=='')
+ $this->_empty=$this->createItemInternal(-1,'Empty',false,null);
$this->setViewState('ItemCount',$itemIndex,-1);
+ }
}
/**
diff --git a/demos/quickstart/protected/controls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php
index bc74b5af..ec21b344 100644
--- a/demos/quickstart/protected/controls/TTextHighlighter.php
+++ b/framework/Web/UI/WebControls/TTextHighlighter.php
@@ -1,7 +1,6 @@
<?php
-require_once(dirname(__FILE__).'/Highlighter/geshi.php');
-
+Prado::using('System.Web.UI.WebControls.Highlighter.geshi');
Prado::using('System.IO.TTextWriter');
/**
@@ -33,14 +32,14 @@ class TTextHighlighter extends TWebControl
$this->setViewState('Language', $value, 'php');
}
- public function setEnableLineNumbers($value)
+ public function setShowLineNumbers($value)
{
- $this->setViewState('LineNumbers', TPropertyValue::ensureBoolean($value), false);
+ $this->setViewState('ShowLineNumbers', TPropertyValue::ensureBoolean($value), false);
}
- public function getEnableLineNumbers()
+ public function getShowLineNumbers()
{
- return $this->getViewState('LineNumbers', false);
+ return $this->getViewState('ShowLineNumbers', false);
}
protected function onPreRender($writer)
@@ -84,7 +83,7 @@ class TTextHighlighter extends TWebControl
protected function highlightText($text)
{
$geshi = new GeSHi(trim($text), $this->getLanguage());
- if($this->getEnableLineNumbers())
+ if($this->getShowLineNumbers())
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
$geshi->enable_classes();
return $geshi->parse_code();