summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2015-01-20 23:42:12 +0100
committerFabio Bas <ctrlaltca@gmail.com>2015-01-20 23:42:12 +0100
commitca22da21b0cedab985e698f4dedf3ac1158a1487 (patch)
treea20472bc56644eea7b98aeaadb851ad29fe3dc1a
parentab5b3b30e2fc7e1ef60cb5ead102f48d8ec1aa84 (diff)
one class per file: framework/Web/UI/WebControls
-rw-r--r--framework/Web/UI/WebControls/IDataSource.php24
-rw-r--r--framework/Web/UI/WebControls/IItemDataRenderer.php50
-rw-r--r--framework/Web/UI/WebControls/IListControlAdapter.php50
-rw-r--r--framework/Web/UI/WebControls/IRepeatInfoUser.php54
-rw-r--r--framework/Web/UI/WebControls/TAccordion.php205
-rw-r--r--framework/Web/UI/WebControls/TAccordionView.php173
-rw-r--r--framework/Web/UI/WebControls/TAccordionViewCollection.php53
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php142
-rw-r--r--framework/Web/UI/WebControls/TBulletStyle.php34
-rw-r--r--framework/Web/UI/WebControls/TBulletedList.php83
-rw-r--r--framework/Web/UI/WebControls/TBulletedListDisplayMode.php31
-rw-r--r--framework/Web/UI/WebControls/TBulletedListEventParameter.php45
-rw-r--r--framework/Web/UI/WebControls/TButton.php23
-rw-r--r--framework/Web/UI/WebControls/TButtonColumnType.php32
-rw-r--r--framework/Web/UI/WebControls/TButtonType.php30
-rw-r--r--framework/Web/UI/WebControls/TCheckBox.php21
-rw-r--r--framework/Web/UI/WebControls/TCheckBoxItem.php19
-rw-r--r--framework/Web/UI/WebControls/TCheckBoxList.php11
-rw-r--r--framework/Web/UI/WebControls/TCircleHotSpot.php87
-rw-r--r--framework/Web/UI/WebControls/TClientSideValidationSummaryOptions.php82
-rw-r--r--framework/Web/UI/WebControls/TColorPicker.php50
-rw-r--r--framework/Web/UI/WebControls/TColorPickerClientSide.php38
-rw-r--r--framework/Web/UI/WebControls/TColorPickerMode.php31
-rw-r--r--framework/Web/UI/WebControls/TCompareValidator.php31
-rw-r--r--framework/Web/UI/WebControls/TCompleteWizardStep.php40
-rw-r--r--framework/Web/UI/WebControls/TContentDirection.php30
-rw-r--r--framework/Web/UI/WebControls/TCustomValidator.php61
-rw-r--r--framework/Web/UI/WebControls/TDataBoundControl.php75
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php575
-rw-r--r--framework/Web/UI/WebControls/TDataGridColumn.php25
-rw-r--r--framework/Web/UI/WebControls/TDataGridColumnCollection.php68
-rw-r--r--framework/Web/UI/WebControls/TDataGridCommandEventParameter.php70
-rw-r--r--framework/Web/UI/WebControls/TDataGridItem.php155
-rw-r--r--framework/Web/UI/WebControls/TDataGridItemCollection.php43
-rw-r--r--framework/Web/UI/WebControls/TDataGridItemEventParameter.php52
-rw-r--r--framework/Web/UI/WebControls/TDataGridPageChangedEventParameter.php68
-rw-r--r--framework/Web/UI/WebControls/TDataGridPager.php73
-rw-r--r--framework/Web/UI/WebControls/TDataGridPagerButtonType.php34
-rw-r--r--framework/Web/UI/WebControls/TDataGridPagerEventParameter.php52
-rw-r--r--framework/Web/UI/WebControls/TDataGridPagerMode.php33
-rw-r--r--framework/Web/UI/WebControls/TDataGridPagerPosition.php36
-rw-r--r--framework/Web/UI/WebControls/TDataGridSortCommandEventParameter.php68
-rw-r--r--framework/Web/UI/WebControls/TDataList.php273
-rw-r--r--framework/Web/UI/WebControls/TDataListCommandEventParameter.php65
-rw-r--r--framework/Web/UI/WebControls/TDataListItem.php160
-rw-r--r--framework/Web/UI/WebControls/TDataListItemCollection.php37
-rw-r--r--framework/Web/UI/WebControls/TDataListItemEventParameter.php48
-rw-r--r--framework/Web/UI/WebControls/TDataSourceControl.php44
-rw-r--r--framework/Web/UI/WebControls/TDataSourceSelectParameters.php71
-rw-r--r--framework/Web/UI/WebControls/TDataSourceView.php92
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php98
-rw-r--r--framework/Web/UI/WebControls/TDatePickerClientScript.php46
-rw-r--r--framework/Web/UI/WebControls/TDatePickerInputMode.php29
-rw-r--r--framework/Web/UI/WebControls/TDatePickerMode.php33
-rw-r--r--framework/Web/UI/WebControls/TDatePickerPositionMode.php28
-rw-r--r--framework/Web/UI/WebControls/TDisplayStyle.php32
-rw-r--r--framework/Web/UI/WebControls/THead.php199
-rw-r--r--framework/Web/UI/WebControls/THorizontalAlign.php34
-rw-r--r--framework/Web/UI/WebControls/THotSpot.php322
-rw-r--r--framework/Web/UI/WebControls/THotSpotCollection.php37
-rw-r--r--framework/Web/UI/WebControls/THotSpotMode.php33
-rw-r--r--framework/Web/UI/WebControls/TImageButton.php68
-rw-r--r--framework/Web/UI/WebControls/TImageClickEventParameter.php77
-rw-r--r--framework/Web/UI/WebControls/TImageMap.php610
-rw-r--r--framework/Web/UI/WebControls/TImageMapEventParameter.php44
-rw-r--r--framework/Web/UI/WebControls/TInlineFrame.php50
-rw-r--r--framework/Web/UI/WebControls/TInlineFrameAlign.php38
-rw-r--r--framework/Web/UI/WebControls/TInlineFrameScrollBars.php32
-rw-r--r--framework/Web/UI/WebControls/TListBox.php22
-rw-r--r--framework/Web/UI/WebControls/TListControl.php45
-rw-r--r--framework/Web/UI/WebControls/TListItemType.php42
-rw-r--r--framework/Web/UI/WebControls/TListSelectionMode.php29
-rw-r--r--framework/Web/UI/WebControls/TMetaTag.php146
-rw-r--r--framework/Web/UI/WebControls/TMetaTagCollection.php70
-rw-r--r--framework/Web/UI/WebControls/TMultiView.php110
-rw-r--r--framework/Web/UI/WebControls/TOutputCache.php123
-rw-r--r--framework/Web/UI/WebControls/TOutputCacheCalculateKeyEventParameter.php45
-rw-r--r--framework/Web/UI/WebControls/TOutputCacheCheckDependencyEventParameter.php60
-rw-r--r--framework/Web/UI/WebControls/TOutputCacheTextWriterMulti.php45
-rw-r--r--framework/Web/UI/WebControls/TPager.php97
-rw-r--r--framework/Web/UI/WebControls/TPagerButtonType.php30
-rw-r--r--framework/Web/UI/WebControls/TPagerMode.php31
-rw-r--r--framework/Web/UI/WebControls/TPagerPageChangedEventParameter.php63
-rw-r--r--framework/Web/UI/WebControls/TPanelStyle.php48
-rw-r--r--framework/Web/UI/WebControls/TPolygonHotSpot.php51
-rw-r--r--framework/Web/UI/WebControls/TRadioButtonItem.php19
-rw-r--r--framework/Web/UI/WebControls/TRadioButtonList.php11
-rw-r--r--framework/Web/UI/WebControls/TRangeValidationDataType.php32
-rw-r--r--framework/Web/UI/WebControls/TRangeValidator.php24
-rw-r--r--framework/Web/UI/WebControls/TReadOnlyDataSource.php39
-rw-r--r--framework/Web/UI/WebControls/TReadOnlyDataSourceView.php38
-rw-r--r--framework/Web/UI/WebControls/TRectangleHotSpot.php103
-rw-r--r--framework/Web/UI/WebControls/TRepeatDirection.php30
-rw-r--r--framework/Web/UI/WebControls/TRepeatInfo.php88
-rw-r--r--framework/Web/UI/WebControls/TRepeatLayout.php31
-rw-r--r--framework/Web/UI/WebControls/TRepeater.php246
-rw-r--r--framework/Web/UI/WebControls/TRepeaterCommandEventParameter.php65
-rw-r--r--framework/Web/UI/WebControls/TRepeaterItem.php133
-rw-r--r--framework/Web/UI/WebControls/TRepeaterItemCollection.php38
-rw-r--r--framework/Web/UI/WebControls/TRepeaterItemEventParameter.php47
-rw-r--r--framework/Web/UI/WebControls/TScrollBars.php35
-rw-r--r--framework/Web/UI/WebControls/TServerValidateEventParameter.php69
-rw-r--r--framework/Web/UI/WebControls/TSlider.php78
-rw-r--r--framework/Web/UI/WebControls/TSliderClientScript.php65
-rw-r--r--framework/Web/UI/WebControls/TSliderDirection.php30
-rw-r--r--framework/Web/UI/WebControls/TStyle.php481
-rw-r--r--framework/Web/UI/WebControls/TTabPanel.php209
-rw-r--r--framework/Web/UI/WebControls/TTabView.php176
-rw-r--r--framework/Web/UI/WebControls/TTabViewCollection.php53
-rw-r--r--framework/Web/UI/WebControls/TTable.php58
-rw-r--r--framework/Web/UI/WebControls/TTableCaptionAlign.php36
-rw-r--r--framework/Web/UI/WebControls/TTableCellCollection.php38
-rw-r--r--framework/Web/UI/WebControls/TTableGridLines.php33
-rw-r--r--framework/Web/UI/WebControls/TTableHeaderCell.php24
-rw-r--r--framework/Web/UI/WebControls/TTableHeaderScope.php31
-rw-r--r--framework/Web/UI/WebControls/TTableItemStyle.php157
-rw-r--r--framework/Web/UI/WebControls/TTableRow.php53
-rw-r--r--framework/Web/UI/WebControls/TTableRowCollection.php39
-rw-r--r--framework/Web/UI/WebControls/TTableRowSection.php32
-rw-r--r--framework/Web/UI/WebControls/TTableStyle.php250
-rw-r--r--framework/Web/UI/WebControls/TTemplatedWizardStep.php114
-rw-r--r--framework/Web/UI/WebControls/TTextAlign.php28
-rw-r--r--framework/Web/UI/WebControls/TTextBox.php69
-rw-r--r--framework/Web/UI/WebControls/TTextBoxAutoCompleteType.php55
-rw-r--r--framework/Web/UI/WebControls/TTextBoxMode.php31
-rw-r--r--framework/Web/UI/WebControls/TTextHighlighter.php11
-rw-r--r--framework/Web/UI/WebControls/TTextHighlighterLineNumberStyle.php21
-rw-r--r--framework/Web/UI/WebControls/TValidationCompareOperator.php38
-rw-r--r--framework/Web/UI/WebControls/TValidationDataType.php33
-rw-r--r--framework/Web/UI/WebControls/TValidationSummary.php119
-rw-r--r--framework/Web/UI/WebControls/TValidationSummaryDisplayMode.php33
-rw-r--r--framework/Web/UI/WebControls/TValidationSummaryDisplayStyle.php31
-rw-r--r--framework/Web/UI/WebControls/TValidatorClientSide.php106
-rw-r--r--framework/Web/UI/WebControls/TValidatorDisplayStyle.php32
-rw-r--r--framework/Web/UI/WebControls/TVerticalAlign.php32
-rw-r--r--framework/Web/UI/WebControls/TView.php90
-rw-r--r--framework/Web/UI/WebControls/TViewCollection.php37
-rw-r--r--framework/Web/UI/WebControls/TWizard.php710
-rw-r--r--framework/Web/UI/WebControls/TWizardFinishNavigationTemplate.php43
-rw-r--r--framework/Web/UI/WebControls/TWizardNavigationButtonType.php32
-rw-r--r--framework/Web/UI/WebControls/TWizardNavigationContainer.php95
-rw-r--r--framework/Web/UI/WebControls/TWizardNavigationEventParameter.php86
-rw-r--r--framework/Web/UI/WebControls/TWizardNavigationTemplate.php80
-rw-r--r--framework/Web/UI/WebControls/TWizardSideBarListItemTemplate.php32
-rw-r--r--framework/Web/UI/WebControls/TWizardSideBarTemplate.php34
-rw-r--r--framework/Web/UI/WebControls/TWizardStartNavigationTemplate.php39
-rw-r--r--framework/Web/UI/WebControls/TWizardStep.php103
-rw-r--r--framework/Web/UI/WebControls/TWizardStepCollection.php71
-rw-r--r--framework/Web/UI/WebControls/TWizardStepNavigationTemplate.php43
-rw-r--r--framework/Web/UI/WebControls/TWizardStepType.php35
150 files changed, 6460 insertions, 5328 deletions
diff --git a/framework/Web/UI/WebControls/IDataSource.php b/framework/Web/UI/WebControls/IDataSource.php
new file mode 100644
index 00000000..21e2e341
--- /dev/null
+++ b/framework/Web/UI/WebControls/IDataSource.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * IDataSource, TDataSourceControl, TReadOnlyDataSource class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * IDataSource class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+interface IDataSource
+{
+ public function getView($viewName);
+ public function getViewNames();
+ public function onDataSourceChanged($param);
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/IItemDataRenderer.php b/framework/Web/UI/WebControls/IItemDataRenderer.php
new file mode 100644
index 00000000..7705f1cc
--- /dev/null
+++ b/framework/Web/UI/WebControls/IItemDataRenderer.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * TDataBoundControl class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * IItemDataRenderer interface.
+ *
+ * IItemDataRenderer defines the interface that an item renderer
+ * needs to implement. Besides the {@link getData Data} property, a list item
+ * renderer also needs to provide {@link getItemIndex ItemIndex} and
+ * {@link getItemType ItemType} property.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.1.0
+ */
+interface IItemDataRenderer extends IDataRenderer
+{
+ /**
+ * Returns a value indicating the zero-based index of the item in the corresponding data control's item collection.
+ * If the item is not in the collection (e.g. it is a header item), it returns -1.
+ * @return integer zero-based index of the item.
+ */
+ public function getItemIndex();
+
+ /**
+ * Sets the zero-based index for the item.
+ * If the item is not in the item collection (e.g. it is a header item), -1 should be used.
+ * @param integer zero-based index of the item.
+ */
+ public function setItemIndex($value);
+
+ /**
+ * @return TListItemType the item type.
+ */
+ public function getItemType();
+
+ /**
+ * @param TListItemType the item type.
+ */
+ public function setItemType($value);
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/IListControlAdapter.php b/framework/Web/UI/WebControls/IListControlAdapter.php
new file mode 100644
index 00000000..19015644
--- /dev/null
+++ b/framework/Web/UI/WebControls/IListControlAdapter.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * TListControl class file
+ *
+ * @author Robin J. Rogge <rojaro@gmail.com>
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * IListControlAdapter interface
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @version $Revision: $ Sun Jun 25 04:53:43 EST 2006 $
+ * @package System.Web.UI.ActiveControls
+ * @since 3.0
+ */
+interface IListControlAdapter
+{
+ /**
+ * Selects an item based on zero-base index on the client side.
+ * @param integer the index (zero-based) of the item to be selected
+ */
+ public function setSelectedIndex($index);
+ /**
+ * Selects a list of item based on zero-base indices on the client side.
+ * @param array list of index of items to be selected
+ */
+ public function setSelectedIndices($indices);
+
+ /**
+ * Sets selection by item value on the client side.
+ * @param string the value of the item to be selected.
+ */
+ public function setSelectedValue($value);
+
+ /**
+ * Sets selection by a list of item values on the client side.
+ * @param array list of the selected item values
+ */
+ public function setSelectedValues($values);
+
+ /**
+ * Clears all existing selections on the client side.
+ */
+ public function clearSelection();
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/IRepeatInfoUser.php b/framework/Web/UI/WebControls/IRepeatInfoUser.php
new file mode 100644
index 00000000..5b7936dc
--- /dev/null
+++ b/framework/Web/UI/WebControls/IRepeatInfoUser.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * IRepeatInfoUser, TRepeatInfo class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+Prado::using('System.Web.UI.WebControls.TTable');
+
+/**
+ * IRepeatInfoUser interface.
+ * This interface must be implemented by classes who want to use {@link TRepeatInfo}.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+interface IRepeatInfoUser
+{
+ /**
+ * @return boolean whether the repeat user contains footer
+ */
+ public function getHasFooter();
+ /**
+ * @return boolean whether the repeat user contains header
+ */
+ public function getHasHeader();
+ /**
+ * @return boolean whether the repeat user contains separators
+ */
+ public function getHasSeparators();
+ /**
+ * @return integer number of items to be rendered (excluding header, footer and separators)
+ */
+ public function getItemCount();
+ /**
+ * @param string item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager)
+ * @param integer zero-based index of the current rendering item.
+ * @return TStyle CSS style used for rendering items (including header, footer and separators)
+ */
+ public function generateItemStyle($itemType,$index);
+ /**
+ * Renders an item.
+ * @param THtmlWriter writer for the rendering purpose
+ * @param TRepeatInfo repeat information
+ * @param string item type
+ * @param integer zero-based index of the item being rendered
+ */
+ public function renderItem($writer,$repeatInfo,$itemType,$index);
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TAccordion.php b/framework/Web/UI/WebControls/TAccordion.php
index fc794cd4..cf8abfe2 100644
--- a/framework/Web/UI/WebControls/TAccordion.php
+++ b/framework/Web/UI/WebControls/TAccordion.php
@@ -533,208 +533,3 @@ class TAccordion extends TWebControl implements IPostBackDataHandler
}
}
-
-/**
- * Class TAccordionView.
- *
- * TAccordionView represents a single view in a {@link TAccordion}.
- *
- * TAccordionView is represented inside the {@link TAccordion} with an header label whose text is defined by
- * the {@link setCaption Caption} property; optionally the label can be an hyperlink: use the
- * {@link setNavigateUrl NavigateUrl} property to define the destination url.
- *
- * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
- * @package System.Web.UI.WebControls
- * @since 3.2
- */
-class TAccordionView extends TWebControl
-{
- private $_active=false;
-
- /**
- * @return the tag name for the view element
- */
- protected function getTagName()
- {
- return 'div';
- }
-
- /**
- * Adds attributes to renderer.
- * @param THtmlWriter the renderer
- */
- protected function addAttributesToRender($writer)
- {
- if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
- $this->getStyle()->setStyleField('display','none');
-
- $this->getStyle()->mergeWith($this->getParent()->getViewStyle());
-
- parent::addAttributesToRender($writer);
-
- $writer->addAttribute('id',$this->getClientID());
- }
-
- /**
- * @return string the caption displayed on this header. Defaults to ''.
- */
- public function getCaption()
- {
- return $this->getViewState('Caption','');
- }
-
- /**
- * @param string the caption displayed on this header
- */
- public function setCaption($value)
- {
- $this->setViewState('Caption',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return string the URL of the target page. Defaults to ''.
- */
- public function getNavigateUrl()
- {
- return $this->getViewState('NavigateUrl','');
- }
-
- /**
- * Sets the URL of the target page.
- * If not empty, clicking on this header will redirect the browser to the specified URL.
- * @param string the URL of the target page.
- */
- public function setNavigateUrl($value)
- {
- $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return string the text content displayed on this view. Defaults to ''.
- */
- public function getText()
- {
- return $this->getViewState('Text','');
- }
-
- /**
- * Sets the text content to be displayed on this view.
- * If this is not empty, the child content of the view will be ignored.
- * @param string the text content displayed on this view
- */
- public function setText($value)
- {
- $this->setViewState('Text',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return boolean whether this accordion view is active. Defaults to false.
- */
- public function getActive()
- {
- return $this->_active;
- }
-
- /**
- * @param boolean whether this accordion view is active.
- */
- public function setActive($value)
- {
- $this->_active=TPropertyValue::ensureBoolean($value);
- }
-
- /**
- * Renders body contents of the accordion view.
- * @param THtmlWriter the writer used for the rendering purpose.
- */
- public function renderContents($writer)
- {
- if(($text=$this->getText())!=='')
- $writer->write($text);
- else if($this->getHasControls())
- parent::renderContents($writer);
- }
-
- /**
- * Renders the header associated with the accordion view.
- * @param THtmlWriter the writer for rendering purpose.
- */
- public function renderHeader($writer)
- {
- if($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript())
- {
- $writer->addAttribute('id',$this->getClientID().'_0');
-
- $style=$this->getActive()?$this->getParent()->getActiveHeaderStyle():$this->getParent()->getHeaderStyle();
-
- $style->addAttributesToRender($writer);
-
- $writer->renderBeginTag($this->getTagName());
-
- $this->renderHeaderContent($writer);
-
- $writer->renderEndTag();
- }
- }
-
- /**
- * Renders the content in the header.
- * By default, a hyperlink is displayed.
- * @param THtmlWriter the HTML writer
- */
- protected function renderHeaderContent($writer)
- {
- $url = $this->getNavigateUrl();
- if(($caption=$this->getCaption())==='')
- $caption='&nbsp;';
-
- if ($url!='')
- $writer->write("<a href=\"{$url}\">");
- $writer->write("{$caption}");
- if ($url!='')
- $writer->write("</a>");
- }
-}
-
-/**
- * Class TAccordionViewCollection.
- *
- * TAccordionViewCollection is a collection of {@link TAccordionView} to be used inside a {@link TAccordion}.
- *
- * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
- * @package System.Web.UI.WebControls
- * @since 3.2
- */
-class TAccordionViewCollection extends TControlCollection
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by performing sanity check on the type of new item.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TAccordionView} object.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TAccordionView)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('tabviewcollection_tabview_required');
- }
-
- /**
- * Finds the index of the accordion view whose ID is the same as the one being looked for.
- * @param string the explicit ID of the accordion view to be looked for
- * @return integer the index of the accordion view found, -1 if not found.
- */
- public function findIndexByID($id)
- {
- foreach($this as $index=>$view)
- {
- if($view->getID(false)===$id)
- return $index;
- }
- return -1;
- }
-}
-
diff --git a/framework/Web/UI/WebControls/TAccordionView.php b/framework/Web/UI/WebControls/TAccordionView.php
new file mode 100644
index 00000000..bdd4f865
--- /dev/null
+++ b/framework/Web/UI/WebControls/TAccordionView.php
@@ -0,0 +1,173 @@
+<?php
+/**
+ * TAccordion class file.
+ *
+ * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ * @since 3.2
+ */
+
+/**
+ * Class TAccordionView.
+ *
+ * TAccordionView represents a single view in a {@link TAccordion}.
+ *
+ * TAccordionView is represented inside the {@link TAccordion} with an header label whose text is defined by
+ * the {@link setCaption Caption} property; optionally the label can be an hyperlink: use the
+ * {@link setNavigateUrl NavigateUrl} property to define the destination url.
+ *
+ * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
+ * @package System.Web.UI.WebControls
+ * @since 3.2
+ */
+class TAccordionView extends TWebControl
+{
+ private $_active=false;
+
+ /**
+ * @return the tag name for the view element
+ */
+ protected function getTagName()
+ {
+ return 'div';
+ }
+
+ /**
+ * Adds attributes to renderer.
+ * @param THtmlWriter the renderer
+ */
+ protected function addAttributesToRender($writer)
+ {
+ if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
+ $this->getStyle()->setStyleField('display','none');
+
+ $this->getStyle()->mergeWith($this->getParent()->getViewStyle());
+
+ parent::addAttributesToRender($writer);
+
+ $writer->addAttribute('id',$this->getClientID());
+ }
+
+ /**
+ * @return string the caption displayed on this header. Defaults to ''.
+ */
+ public function getCaption()
+ {
+ return $this->getViewState('Caption','');
+ }
+
+ /**
+ * @param string the caption displayed on this header
+ */
+ public function setCaption($value)
+ {
+ $this->setViewState('Caption',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return string the URL of the target page. Defaults to ''.
+ */
+ public function getNavigateUrl()
+ {
+ return $this->getViewState('NavigateUrl','');
+ }
+
+ /**
+ * Sets the URL of the target page.
+ * If not empty, clicking on this header will redirect the browser to the specified URL.
+ * @param string the URL of the target page.
+ */
+ public function setNavigateUrl($value)
+ {
+ $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return string the text content displayed on this view. Defaults to ''.
+ */
+ public function getText()
+ {
+ return $this->getViewState('Text','');
+ }
+
+ /**
+ * Sets the text content to be displayed on this view.
+ * If this is not empty, the child content of the view will be ignored.
+ * @param string the text content displayed on this view
+ */
+ public function setText($value)
+ {
+ $this->setViewState('Text',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return boolean whether this accordion view is active. Defaults to false.
+ */
+ public function getActive()
+ {
+ return $this->_active;
+ }
+
+ /**
+ * @param boolean whether this accordion view is active.
+ */
+ public function setActive($value)
+ {
+ $this->_active=TPropertyValue::ensureBoolean($value);
+ }
+
+ /**
+ * Renders body contents of the accordion view.
+ * @param THtmlWriter the writer used for the rendering purpose.
+ */
+ public function renderContents($writer)
+ {
+ if(($text=$this->getText())!=='')
+ $writer->write($text);
+ else if($this->getHasControls())
+ parent::renderContents($writer);
+ }
+
+ /**
+ * Renders the header associated with the accordion view.
+ * @param THtmlWriter the writer for rendering purpose.
+ */
+ public function renderHeader($writer)
+ {
+ if($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript())
+ {
+ $writer->addAttribute('id',$this->getClientID().'_0');
+
+ $style=$this->getActive()?$this->getParent()->getActiveHeaderStyle():$this->getParent()->getHeaderStyle();
+
+ $style->addAttributesToRender($writer);
+
+ $writer->renderBeginTag($this->getTagName());
+
+ $this->renderHeaderContent($writer);
+
+ $writer->renderEndTag();
+ }
+ }
+
+ /**
+ * Renders the content in the header.
+ * By default, a hyperlink is displayed.
+ * @param THtmlWriter the HTML writer
+ */
+ protected function renderHeaderContent($writer)
+ {
+ $url = $this->getNavigateUrl();
+ if(($caption=$this->getCaption())==='')
+ $caption='&nbsp;';
+
+ if ($url!='')
+ $writer->write("<a href=\"{$url}\">");
+ $writer->write("{$caption}");
+ if ($url!='')
+ $writer->write("</a>");
+ }
+}
diff --git a/framework/Web/UI/WebControls/TAccordionViewCollection.php b/framework/Web/UI/WebControls/TAccordionViewCollection.php
new file mode 100644
index 00000000..57728a81
--- /dev/null
+++ b/framework/Web/UI/WebControls/TAccordionViewCollection.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * TAccordion class file.
+ *
+ * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ * @since 3.2
+ */
+
+/**
+ * Class TAccordionViewCollection.
+ *
+ * TAccordionViewCollection is a collection of {@link TAccordionView} to be used inside a {@link TAccordion}.
+ *
+ * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
+ * @package System.Web.UI.WebControls
+ * @since 3.2
+ */
+class TAccordionViewCollection extends TControlCollection
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by performing sanity check on the type of new item.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TAccordionView} object.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TAccordionView)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('tabviewcollection_tabview_required');
+ }
+
+ /**
+ * Finds the index of the accordion view whose ID is the same as the one being looked for.
+ * @param string the explicit ID of the accordion view to be looked for
+ * @return integer the index of the accordion view found, -1 if not found.
+ */
+ public function findIndexByID($id)
+ {
+ foreach($this as $index=>$view)
+ {
+ if($view->getID(false)===$id)
+ return $index;
+ }
+ return -1;
+ }
+}
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index a23e2104..c8ae5f1a 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -603,145 +603,3 @@ abstract class TBaseValidator extends TLabel implements IValidator
parent::renderContents($writer);
}
}
-
-/**
- * TValidatorClientSide class.
- *
- * Client-side validator events can be modified through the {@link
- * TBaseValidator::getClientSide ClientSide} property of a validator. The
- * subproperties of ClientSide are those of the TValidatorClientSide
- * properties. The client-side validator supports the following events.
- *
- * The <tt>OnValidate</tt> event is raise before the validator validation
- * functions are called.
- *
- * The <tt>OnValidationSuccess</tt> event is raised after the validator has successfully
- * validate the control.
- *
- * The <tt>OnValidationError</tt> event is raised after the validator fails validation.
- *
- * See the quickstart documentation for further details.
- *
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TValidatorClientSide extends TClientSideOptions
-{
- /**
- * @return string javascript code for client-side OnValidate event.
- */
- public function getOnValidate()
- {
- return $this->getOption('OnValidate');
- }
-
- /**
- * Client-side OnValidate validator event is raise before the validators
- * validation functions are called.
- * @param string javascript code for client-side OnValidate event.
- */
- public function setOnValidate($javascript)
- {
- $this->setFunction('OnValidate', $javascript);
- }
-
- /**
- * Client-side OnSuccess event is raise after validation is successfull.
- * This will override the default client-side validator behaviour.
- * @param string javascript code for client-side OnSuccess event.
- */
- public function setOnValidationSuccess($javascript)
- {
- $this->setFunction('OnValidationSuccess', $javascript);
- }
-
- /**
- * @return string javascript code for client-side OnSuccess event.
- */
- public function getOnValidationSuccess()
- {
- return $this->getOption('OnValidationSuccess');
- }
-
- /**
- * Client-side OnError event is raised after validation failure.
- * This will override the default client-side validator behaviour.
- * @param string javascript code for client-side OnError event.
- */
- public function setOnValidationError($javascript)
- {
- $this->setFunction('OnValidationError', $javascript);
- }
-
- /**
- * @return string javascript code for client-side OnError event.
- */
- public function getOnValidationError()
- {
- return $this->getOption('OnValidationError');
- }
-
- /**
- * @param boolean true to revalidate when the control to validate changes value.
- */
- public function setObserveChanges($value)
- {
- $this->setOption('ObserveChanges', TPropertyValue::ensureBoolean($value));
- }
-
- /**
- * @return boolean true to observe changes.
- */
- public function getObserveChanges()
- {
- $changes = $this->getOption('ObserveChanges');
- return ($changes===null) ? true : $changes;
- }
-}
-
-
-/**
- * TValidatorDisplayStyle class.
- * TValidatorDisplayStyle defines the enumerable type for the possible styles
- * that a validator control can display the error message.
- *
- * The following enumerable values are defined:
- * - None: the error message is not displayed
- * - Dynamic: the error message dynamically appears when the validator fails validation
- * - Fixed: Similar to Dynamic except that the error message physically occupies the page layout (even though it may not be visible)
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TValidatorDisplayStyle extends TEnumerable
-{
- const None='None';
- const Dynamic='Dynamic';
- const Fixed='Fixed';
-}
-
-/**
- * TValidationDataType class.
- * TValidationDataType defines the enumerable type for the possible data types that
- * a comparison validator can validate upon.
- *
- * The following enumerable values are defined:
- * - Integer
- * - Float
- * - Date
- * - String
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TValidationDataType extends TEnumerable
-{
- const Integer='Integer';
- const Float='Float';
- const Date='Date';
- const String='String';
-}
-
diff --git a/framework/Web/UI/WebControls/TBulletStyle.php b/framework/Web/UI/WebControls/TBulletStyle.php
new file mode 100644
index 00000000..e8327f96
--- /dev/null
+++ b/framework/Web/UI/WebControls/TBulletStyle.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * TBulletedList class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TBulletStyle class.
+ * TBulletStyle defines the enumerable type for the possible bullet styles that may be used
+ * for a {@link TBulletedList} control.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TBulletStyle extends TEnumerable
+{
+ const NotSet='NotSet';
+ const None='None';
+ const Numbered='Numbered';
+ const LowerAlpha='LowerAlpha';
+ const UpperAlpha='UpperAlpha';
+ const LowerRoman='LowerRoman';
+ const UpperRoman='UpperRoman';
+ const Disc='Disc';
+ const Circle='Circle';
+ const Square='Square';
+ const CustomImage='CustomImage';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TBulletedList.php b/framework/Web/UI/WebControls/TBulletedList.php
index 9cd3654e..f08a621a 100644
--- a/framework/Web/UI/WebControls/TBulletedList.php
+++ b/framework/Web/UI/WebControls/TBulletedList.php
@@ -403,85 +403,4 @@ class TBulletedList extends TListControl implements IPostBackEventHandler
{
throw new TNotSupportedException('bulletedlist_selectedvalue_unsupported');
}
-}
-
-/**
- * TBulletedListEventParameter
- * Event parameter for {@link TBulletedList::onClick Click} event of the
- * bulleted list. The {@link getIndex Index} gives the zero-based index
- * of the item that is currently being clicked.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TBulletedListEventParameter extends TEventParameter
-{
- /**
- * @var integer index of the item clicked
- */
- private $_index;
-
- /**
- * Constructor.
- * @param integer index of the item clicked
- */
- public function __construct($index)
- {
- $this->_index=$index;
- }
-
- /**
- * @return integer zero-based index of the item (rendered as a link button) that is clicked
- */
- public function getIndex()
- {
- return $this->_index;
- }
-}
-
-/**
- * TBulletStyle class.
- * TBulletStyle defines the enumerable type for the possible bullet styles that may be used
- * for a {@link TBulletedList} control.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TBulletStyle extends TEnumerable
-{
- const NotSet='NotSet';
- const None='None';
- const Numbered='Numbered';
- const LowerAlpha='LowerAlpha';
- const UpperAlpha='UpperAlpha';
- const LowerRoman='LowerRoman';
- const UpperRoman='UpperRoman';
- const Disc='Disc';
- const Circle='Circle';
- const Square='Square';
- const CustomImage='CustomImage';
-}
-
-/**
- * TBulletedListDisplayMode class.
- * TBulletedListDisplayMode defines the enumerable type for the possible display mode
- * of a {@link TBulletedList} control.
- *
- * The following enumerable values are defined:
- * - Text: the bulleted list items are displayed as plain texts
- * - HyperLink: the bulleted list items are displayed as hyperlinks
- * - LinkButton: the bulleted list items are displayed as link buttons that can cause postbacks
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TBulletedListDisplayMode extends TEnumerable
-{
- const Text='Text';
- const HyperLink='HyperLink';
- const LinkButton='LinkButton';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TBulletedListDisplayMode.php b/framework/Web/UI/WebControls/TBulletedListDisplayMode.php
new file mode 100644
index 00000000..283cc5ac
--- /dev/null
+++ b/framework/Web/UI/WebControls/TBulletedListDisplayMode.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * TBulletedList class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TBulletedListDisplayMode class.
+ * TBulletedListDisplayMode defines the enumerable type for the possible display mode
+ * of a {@link TBulletedList} control.
+ *
+ * The following enumerable values are defined:
+ * - Text: the bulleted list items are displayed as plain texts
+ * - HyperLink: the bulleted list items are displayed as hyperlinks
+ * - LinkButton: the bulleted list items are displayed as link buttons that can cause postbacks
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TBulletedListDisplayMode extends TEnumerable
+{
+ const Text='Text';
+ const HyperLink='HyperLink';
+ const LinkButton='LinkButton';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TBulletedListEventParameter.php b/framework/Web/UI/WebControls/TBulletedListEventParameter.php
new file mode 100644
index 00000000..d1734586
--- /dev/null
+++ b/framework/Web/UI/WebControls/TBulletedListEventParameter.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * TBulletedList class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TBulletedListEventParameter
+ * Event parameter for {@link TBulletedList::onClick Click} event of the
+ * bulleted list. The {@link getIndex Index} gives the zero-based index
+ * of the item that is currently being clicked.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TBulletedListEventParameter extends TEventParameter
+{
+ /**
+ * @var integer index of the item clicked
+ */
+ private $_index;
+
+ /**
+ * Constructor.
+ * @param integer index of the item clicked
+ */
+ public function __construct($index)
+ {
+ $this->_index=$index;
+ }
+
+ /**
+ * @return integer zero-based index of the item (rendered as a link button) that is clicked
+ */
+ public function getIndex()
+ {
+ return $this->_index;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TButton.php b/framework/Web/UI/WebControls/TButton.php
index f24985e6..a50d6883 100644
--- a/framework/Web/UI/WebControls/TButton.php
+++ b/framework/Web/UI/WebControls/TButton.php
@@ -341,25 +341,4 @@ class TButton extends TWebControl implements IPostBackEventHandler, IButtonContr
{
$this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TButtonType'),TButtonType::Submit);
}
-}
-
-/**
- * TButtonType class.
- * TButtonType defines the enumerable type for the possible types that a {@link TButton} can take.
- *
- * The following enumerable values are defined:
- * - Submit: a normal submit button
- * - Reset: a reset button
- * - Button: a client button (normally does not perform form submission)
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TButtonType extends TEnumerable
-{
- const Submit='Submit';
- const Reset='Reset';
- const Button='Button';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TButtonColumnType.php b/framework/Web/UI/WebControls/TButtonColumnType.php
new file mode 100644
index 00000000..3bf6a05a
--- /dev/null
+++ b/framework/Web/UI/WebControls/TButtonColumnType.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TDataGridColumn class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TButtonColumnType class.
+ * TButtonColumnType defines the enumerable type for the possible types of buttons
+ * that can be used in a {@link TButtonColumn}.
+ *
+ * The following enumerable values are defined:
+ * - LinkButton: link buttons
+ * - PushButton: form buttons
+ * - ImageButton: image buttons
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TButtonColumnType extends TEnumerable
+{
+ const LinkButton='LinkButton';
+ const PushButton='PushButton';
+ const ImageButton='ImageButton';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TButtonType.php b/framework/Web/UI/WebControls/TButtonType.php
new file mode 100644
index 00000000..c4aff275
--- /dev/null
+++ b/framework/Web/UI/WebControls/TButtonType.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * TButton class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TButtonType class.
+ * TButtonType defines the enumerable type for the possible types that a {@link TButton} can take.
+ *
+ * The following enumerable values are defined:
+ * - Submit: a normal submit button
+ * - Reset: a reset button
+ * - Button: a client button (normally does not perform form submission)
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TButtonType extends TEnumerable
+{
+ const Submit='Submit';
+ const Reset='Reset';
+ const Button='Button';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php
index a28beac7..a1294c05 100644
--- a/framework/Web/UI/WebControls/TCheckBox.php
+++ b/framework/Web/UI/WebControls/TCheckBox.php
@@ -506,23 +506,4 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
$options['EventTarget'] = $this->getUniqueID();
return $options;
}
-}
-
-/**
- * TTextAlign class.
- * TTextAlign defines the enumerable type for the possible text alignments
- *
- * The following enumerable values are defined:
- * - Left: left aligned
- * - Right: right aligned
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TTextAlign extends TEnumerable
-{
- const Left='Left';
- const Right='Right';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TCheckBoxItem.php b/framework/Web/UI/WebControls/TCheckBoxItem.php
new file mode 100644
index 00000000..040c84a5
--- /dev/null
+++ b/framework/Web/UI/WebControls/TCheckBoxItem.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * TCheckBoxList class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+class TCheckBoxItem extends TCheckBox {
+ /**
+ * Override client implementation to avoid emitting the javascript
+ */
+ protected function renderClientControlScript($writer)
+ {
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php
index 029b6c89..3b5f6bc2 100644
--- a/framework/Web/UI/WebControls/TCheckBoxList.php
+++ b/framework/Web/UI/WebControls/TCheckBoxList.php
@@ -497,13 +497,4 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
return $options;
}
-}
-
-class TCheckBoxItem extends TCheckBox {
- /**
- * Override client implementation to avoid emitting the javascript
- */
- protected function renderClientControlScript($writer)
- {
- }
-}
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TCircleHotSpot.php b/framework/Web/UI/WebControls/TCircleHotSpot.php
new file mode 100644
index 00000000..cf22c306
--- /dev/null
+++ b/framework/Web/UI/WebControls/TCircleHotSpot.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * TImageMap and related class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * Class TCircleHotSpot.
+ *
+ * TCircleHotSpot defines a circular hot spot region in a {@link TImageMap}
+ * control.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TCircleHotSpot extends THotSpot
+{
+ /**
+ * @return string shape of this hotspot.
+ */
+ public function getShape()
+ {
+ return 'circle';
+ }
+
+ /**
+ * @return string coordinates defining this hotspot shape
+ */
+ public function getCoordinates()
+ {
+ return $this->getX().','.$this->getY().','.$this->getRadius();
+ }
+
+ /**
+ * @return integer radius of the circular HotSpot region. Defaults to 0.
+ */
+ public function getRadius()
+ {
+ return $this->getViewState('Radius',0);
+ }
+
+ /**
+ * @param integer radius of the circular HotSpot region.
+ */
+ public function setRadius($value)
+ {
+ $this->setViewState('Radius',TPropertyValue::ensureInteger($value),0);
+ }
+
+ /**
+ * @return integer the X coordinate of the center of the circular HotSpot region. Defaults to 0.
+ */
+ public function getX()
+ {
+ return $this->getViewState('X',0);
+ }
+
+ /**
+ * @param integer the X coordinate of the center of the circular HotSpot region.
+ */
+ public function setX($value)
+ {
+ $this->setViewState('X',TPropertyValue::ensureInteger($value),0);
+ }
+
+ /**
+ * @return integer the Y coordinate of the center of the circular HotSpot region. Defaults to 0.
+ */
+ public function getY()
+ {
+ return $this->getViewState('Y',0);
+ }
+
+ /**
+ * @param integer the Y coordinate of the center of the circular HotSpot region.
+ */
+ public function setY($value)
+ {
+ $this->setViewState('Y',TPropertyValue::ensureInteger($value),0);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TClientSideValidationSummaryOptions.php b/framework/Web/UI/WebControls/TClientSideValidationSummaryOptions.php
new file mode 100644
index 00000000..90492a78
--- /dev/null
+++ b/framework/Web/UI/WebControls/TClientSideValidationSummaryOptions.php
@@ -0,0 +1,82 @@
+<?php
+/**
+ * TValidationSummary class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TClientSideValidationSummaryOptions class.
+ *
+ * Client-side validation summary events such as {@link setOnHideSummary
+ * OnHideSummary} and {@link setOnShowSummary OnShowSummary} can be modified
+ * through the {@link TBaseValidator:: getClientSide ClientSide} property of a
+ * validation summary.
+ *
+ * The <tt>OnHideSummary</tt> event is raise when the validation summary
+ * requests to hide the messages.
+ *
+ * The <tt>OnShowSummary</tt> event is raised when the validation summary
+ * requests to show the messages.
+ *
+ * See the quickstart documentation for further details.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TClientSideValidationSummaryOptions extends TClientSideOptions
+{
+ /**
+ * @return string javascript code for client-side OnHideSummary event.
+ */
+ public function getOnHideSummary()
+ {
+ return $this->getOption('OnHideSummary');
+ }
+
+ /**
+ * Client-side OnHideSummary validation summary event is raise when all the
+ * validators are valid. This will override the default client-side
+ * validation summary behaviour.
+ * @param string javascript code for client-side OnHideSummary event.
+ */
+ public function setOnHideSummary($javascript)
+ {
+ $this->setFunction('OnHideSummary', $javascript);
+ }
+
+ /**
+ * Client-side OnShowSummary event is raise when one or more validators are
+ * not valid. This will override the default client-side validation summary
+ * behaviour.
+ * @param string javascript code for client-side OnShowSummary event.
+ */
+ public function setOnShowSummary($javascript)
+ {
+ $this->setFunction('OnShowSummary', $javascript);
+ }
+
+ /**
+ * @return string javascript code for client-side OnShowSummary event.
+ */
+ public function getOnShowSummary()
+ {
+ return $this->getOption('OnShowSummary');
+ }
+
+ /**
+ * Ensure the string is a valid javascript function. The code block
+ * is enclosed with "function(summary, validators){ }" block.
+ * @param string javascript code.
+ * @return string javascript function code.
+ */
+ protected function ensureFunction($javascript)
+ {
+ return "function(summary, validators){ {$javascript} }";
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TColorPicker.php b/framework/Web/UI/WebControls/TColorPicker.php
index 7b20318c..79e48123 100644
--- a/framework/Web/UI/WebControls/TColorPicker.php
+++ b/framework/Web/UI/WebControls/TColorPicker.php
@@ -234,53 +234,3 @@ class TColorPicker extends TTextBox
return 'Prado.WebUI.TColorPicker';
}
}
-
-/**
- * TColorPickerMode class.
- * TColorPickerMode defines the enumerable type for the possible UI mode
- * that a {@link TColorPicker} control can take.
- *
- * The following enumerable values are defined:
- * # Simple - Grid with 12 simple colors.
- * # Basic - Grid with the most common 70 colors. This is the default mode.
- * # Full - Full-featured color picker.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TColorPickerMode extends TEnumerable
-{
- const Simple='Simple';
- const Basic='Basic';
- const Full='Full';
-}
-
-/**
- * TColorPickerClientSide class.
- *
- * Client-side javascript code options.
- *
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @package System.Web.UI.WebControls
- * @since 3.1
- */
-class TColorPickerClientSide extends TClientSideOptions
-{
- /**
- * @return string javascript code for when a color is selected.
- */
- public function getOnColorSelected()
- {
- return $this->getOption('OnColorSelected');
- }
-
- /**
- * @param string javascript code for when a color is selected.
- */
- public function setOnColorSelected($javascript)
- {
- $this->setFunction('OnColorSelected', $javascript);
- }
-}
-
diff --git a/framework/Web/UI/WebControls/TColorPickerClientSide.php b/framework/Web/UI/WebControls/TColorPickerClientSide.php
new file mode 100644
index 00000000..4fb09928
--- /dev/null
+++ b/framework/Web/UI/WebControls/TColorPickerClientSide.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * TColorPicker class file
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TColorPickerClientSide class.
+ *
+ * Client-side javascript code options.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.WebControls
+ * @since 3.1
+ */
+class TColorPickerClientSide extends TClientSideOptions
+{
+ /**
+ * @return string javascript code for when a color is selected.
+ */
+ public function getOnColorSelected()
+ {
+ return $this->getOption('OnColorSelected');
+ }
+
+ /**
+ * @param string javascript code for when a color is selected.
+ */
+ public function setOnColorSelected($javascript)
+ {
+ $this->setFunction('OnColorSelected', $javascript);
+ }
+}
diff --git a/framework/Web/UI/WebControls/TColorPickerMode.php b/framework/Web/UI/WebControls/TColorPickerMode.php
new file mode 100644
index 00000000..d4b11b26
--- /dev/null
+++ b/framework/Web/UI/WebControls/TColorPickerMode.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * TColorPicker class file
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TColorPickerMode class.
+ * TColorPickerMode defines the enumerable type for the possible UI mode
+ * that a {@link TColorPicker} control can take.
+ *
+ * The following enumerable values are defined:
+ * # Simple - Grid with 12 simple colors.
+ * # Basic - Grid with the most common 70 colors. This is the default mode.
+ * # Full - Full-featured color picker.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TColorPickerMode extends TEnumerable
+{
+ const Simple='Simple';
+ const Basic='Basic';
+ const Full='Full';
+}
diff --git a/framework/Web/UI/WebControls/TCompareValidator.php b/framework/Web/UI/WebControls/TCompareValidator.php
index b902b67b..caf81a7f 100644
--- a/framework/Web/UI/WebControls/TCompareValidator.php
+++ b/framework/Web/UI/WebControls/TCompareValidator.php
@@ -230,33 +230,4 @@ class TCompareValidator extends TBaseValidator
$options['DateFormat']=$dateFormat;
return $options;
}
-}
-
-
-/**
- * TValidationCompareOperator class.
- * TValidationCompareOperator defines the enumerable type for the comparison operations
- * that {@link TCompareValidator} can perform validation with.
- *
- * The following enumerable values are defined:
- * - Equal
- * - NotEqual
- * - GreaterThan
- * - GreaterThanEqual
- * - LessThan
- * - LessThanEqual
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TValidationCompareOperator extends TEnumerable
-{
- const Equal='Equal';
- const NotEqual='NotEqual';
- const GreaterThan='GreaterThan';
- const GreaterThanEqual='GreaterThanEqual';
- const LessThan='LessThan';
- const LessThanEqual='LessThanEqual';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TCompleteWizardStep.php b/framework/Web/UI/WebControls/TCompleteWizardStep.php
new file mode 100644
index 00000000..a98f4459
--- /dev/null
+++ b/framework/Web/UI/WebControls/TCompleteWizardStep.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TCompleteWizardStep class.
+ *
+ * TCompleteWizardStep represents a wizard step of type TWizardStepType::Complete.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TCompleteWizardStep extends TWizardStep
+{
+ /**
+ * @return TWizardStepType the wizard step type. Always TWizardStepType::Complete.
+ */
+ public function getStepType()
+ {
+ return TWizardStepType::Complete;
+ }
+
+ /**
+ * @param string the wizard step type.
+ * @throws TInvalidOperationException whenever this method is invoked.
+ */
+ public function setStepType($value)
+ {
+ throw new TInvalidOperationException('completewizardstep_steptype_readonly');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TContentDirection.php b/framework/Web/UI/WebControls/TContentDirection.php
new file mode 100644
index 00000000..c52f1c18
--- /dev/null
+++ b/framework/Web/UI/WebControls/TContentDirection.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * TPanelStyle class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TContentDirection class.
+ * TContentDirection defines the enumerable type for the possible directions that a panel can be at.
+ *
+ * The following enumerable values are defined:
+ * - NotSet: the direction is not specified
+ * - LeftToRight: content in a panel is left to right
+ * - RightToLeft: content in a panel is right to left
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TContentDirection extends TEnumerable
+{
+ const NotSet='NotSet';
+ const LeftToRight='LeftToRight';
+ const RightToLeft='RightToLeft';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TCustomValidator.php b/framework/Web/UI/WebControls/TCustomValidator.php
index 6966a075..249f9026 100644
--- a/framework/Web/UI/WebControls/TCustomValidator.php
+++ b/framework/Web/UI/WebControls/TCustomValidator.php
@@ -142,63 +142,4 @@ class TCustomValidator extends TBaseValidator
if($this->getClientValidationFunction()!=='')
parent::registerClientScriptValidator();
}
-}
-
-/**
- * TServerValidateEventParameter class
- *
- * TServerValidateEventParameter encapsulates the parameter data for
- * <b>OnServerValidate</b> event of TCustomValidator components.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TServerValidateEventParameter extends TEventParameter
-{
- /**
- * the value to be validated
- * @var string
- */
- private $_value='';
- /**
- * whether the value is valid
- * @var boolean
- */
- private $_isValid=true;
-
- /**
- * Constructor.
- * @param string property value to be validated
- * @param boolean whether the value is valid
- */
- public function __construct($value,$isValid)
- {
- $this->_value=$value;
- $this->setIsValid($isValid);
- }
-
- /**
- * @return string value to be validated
- */
- public function getValue()
- {
- return $this->_value;
- }
-
- /**
- * @return boolean whether the value is valid
- */
- public function getIsValid()
- {
- return $this->_isValid;
- }
-
- /**
- * @param boolean whether the value is valid
- */
- public function setIsValid($value)
- {
- $this->_isValid=TPropertyValue::ensureBoolean($value);
- }
-}
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataBoundControl.php b/framework/Web/UI/WebControls/TDataBoundControl.php
index 2a287aac..f95d2d1e 100644
--- a/framework/Web/UI/WebControls/TDataBoundControl.php
+++ b/framework/Web/UI/WebControls/TDataBoundControl.php
@@ -506,77 +506,4 @@ abstract class TDataBoundControl extends TWebControl
$this->_parameters=new TDataSourceSelectParameters;
return $this->_parameters;
}
-}
-
-
-/**
- * TListItemType class.
- * TListItemType defines the enumerable type for the possible types
- * that databound list items could take.
- *
- * The following enumerable values are defined:
- * - Header: header item
- * - Footer: footer item
- * - Item: content item (neither header nor footer)
- * - Separator: separator between items
- * - AlternatingItem: alternating content item
- * - EditItem: content item in edit mode
- * - SelectedItem: selected content item
- * - Pager: pager
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TListItemType extends TEnumerable
-{
- const Header='Header';
- const Footer='Footer';
- const Item='Item';
- const Separator='Separator';
- const AlternatingItem='AlternatingItem';
- const EditItem='EditItem';
- const SelectedItem='SelectedItem';
- const Pager='Pager';
-}
-
-
-/**
- * IItemDataRenderer interface.
- *
- * IItemDataRenderer defines the interface that an item renderer
- * needs to implement. Besides the {@link getData Data} property, a list item
- * renderer also needs to provide {@link getItemIndex ItemIndex} and
- * {@link getItemType ItemType} property.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.1.0
- */
-interface IItemDataRenderer extends IDataRenderer
-{
- /**
- * Returns a value indicating the zero-based index of the item in the corresponding data control's item collection.
- * If the item is not in the collection (e.g. it is a header item), it returns -1.
- * @return integer zero-based index of the item.
- */
- public function getItemIndex();
-
- /**
- * Sets the zero-based index for the item.
- * If the item is not in the item collection (e.g. it is a header item), -1 should be used.
- * @param integer zero-based index of the item.
- */
- public function setItemIndex($value);
-
- /**
- * @return TListItemType the item type.
- */
- public function getItemType();
-
- /**
- * @param TListItemType the item type.
- */
- public function setItemType($value);
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index 96e799aa..685c2b5b 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -1668,577 +1668,4 @@ class TDataGrid extends TBaseDataList implements INamingContainer
$writer->writeLine();
$this->renderEndTag($writer);
}
-}
-
-/**
- * TDataGridItemEventParameter class
- *
- * TDataGridItemEventParameter encapsulates the parameter data for
- * {@link TDataGrid::onItemCreated OnItemCreated} event of {@link TDataGrid} controls.
- * The {@link getItem Item} property indicates the datagrid item related with the event.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridItemEventParameter extends TEventParameter
-{
- /**
- * The TDataGridItem control responsible for the event.
- * @var TDataGridItem
- */
- private $_item=null;
-
- /**
- * Constructor.
- * @param TDataGridItem datagrid item related with the corresponding event
- */
- public function __construct(TDataGridItem $item)
- {
- $this->_item=$item;
- }
-
- /**
- * @return TDataGridItem datagrid item related with the corresponding event
- */
- public function getItem()
- {
- return $this->_item;
- }
-}
-
-/**
- * TDataGridPagerEventParameter class
- *
- * TDataGridPagerEventParameter encapsulates the parameter data for
- * {@link TDataGrid::onPagerCreated OnPagerCreated} event of {@link TDataGrid} controls.
- * The {@link getPager Pager} property indicates the datagrid pager related with the event.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridPagerEventParameter extends TEventParameter
-{
- /**
- * The TDataGridPager control responsible for the event.
- * @var TDataGridPager
- */
- protected $_pager=null;
-
- /**
- * Constructor.
- * @param TDataGridPager datagrid pager related with the corresponding event
- */
- public function __construct(TDataGridPager $pager)
- {
- $this->_pager=$pager;
- }
-
- /**
- * @return TDataGridPager datagrid pager related with the corresponding event
- */
- public function getPager()
- {
- return $this->_pager;
- }
-}
-
-/**
- * TDataGridCommandEventParameter class
- *
- * TDataGridCommandEventParameter encapsulates the parameter data for
- * {@link TDataGrid::onItemCommand ItemCommand} event of {@link TDataGrid} controls.
- *
- * The {@link getItem Item} property indicates the datagrid item related with the event.
- * The {@link getCommandSource CommandSource} refers to the control that originally
- * raises the Command event.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridCommandEventParameter extends TCommandEventParameter
-{
- /**
- * @var TDataGridItem the TDataGridItem control responsible for the event.
- */
- private $_item=null;
- /**
- * @var TControl the control originally raises the <b>Command</b> event.
- */
- private $_source=null;
-
- /**
- * Constructor.
- * @param TDataGridItem datagrid item responsible for the event
- * @param TControl original event sender
- * @param TCommandEventParameter original event parameter
- */
- public function __construct($item,$source,TCommandEventParameter $param)
- {
- $this->_item=$item;
- $this->_source=$source;
- parent::__construct($param->getCommandName(),$param->getCommandParameter());
- }
-
- /**
- * @return TDataGridItem the TDataGridItem control responsible for the event.
- */
- public function getItem()
- {
- return $this->_item;
- }
-
- /**
- * @return TControl the control originally raises the <b>Command</b> event.
- */
- public function getCommandSource()
- {
- return $this->_source;
- }
-}
-
-/**
- * TDataGridSortCommandEventParameter class
- *
- * TDataGridSortCommandEventParameter encapsulates the parameter data for
- * {@link TDataGrid::onSortCommand SortCommand} event of {@link TDataGrid} controls.
- *
- * The {@link getCommandSource CommandSource} property refers to the control
- * that originally raises the OnCommand event, while {@link getSortExpression SortExpression}
- * gives the sort expression carried with the sort command.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridSortCommandEventParameter extends TEventParameter
-{
- /**
- * @var string sort expression
- */
- private $_sortExpression='';
- /**
- * @var TControl original event sender
- */
- private $_source=null;
-
- /**
- * Constructor.
- * @param TControl the control originally raises the <b>OnCommand</b> event.
- * @param TDataGridCommandEventParameter command event parameter
- */
- public function __construct($source,TDataGridCommandEventParameter $param)
- {
- $this->_source=$source;
- $this->_sortExpression=$param->getCommandParameter();
- }
-
- /**
- * @return TControl the control originally raises the <b>OnCommand</b> event.
- */
- public function getCommandSource()
- {
- return $this->_source;
- }
-
- /**
- * @return string sort expression
- */
- public function getSortExpression()
- {
- return $this->_sortExpression;
- }
-}
-
-/**
- * TDataGridPageChangedEventParameter class
- *
- * TDataGridPageChangedEventParameter encapsulates the parameter data for
- * {@link TDataGrid::onPageIndexChanged PageIndexChanged} event of {@link TDataGrid} controls.
- *
- * The {@link getCommandSource CommandSource} property refers to the control
- * that originally raises the OnCommand event, while {@link getNewPageIndex NewPageIndex}
- * returns the new page index carried with the page command.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridPageChangedEventParameter extends TEventParameter
-{
- /**
- * @var integer new page index
- */
- private $_newIndex;
- /**
- * @var TControl original event sender
- */
- private $_source=null;
-
- /**
- * Constructor.
- * @param TControl the control originally raises the <b>OnCommand</b> event.
- * @param integer new page index
- */
- public function __construct($source,$newPageIndex)
- {
- $this->_source=$source;
- $this->_newIndex=$newPageIndex;
- }
-
- /**
- * @return TControl the control originally raises the <b>OnCommand</b> event.
- */
- public function getCommandSource()
- {
- return $this->_source;
- }
-
- /**
- * @return integer new page index
- */
- public function getNewPageIndex()
- {
- return $this->_newIndex;
- }
-}
-
-/**
- * TDataGridItem class
- *
- * A TDataGridItem control represents an item in the {@link TDataGrid} control,
- * such as heading section, footer section, or a data item.
- * The index and data value of the item can be accessed via {@link getItemIndex ItemIndex}>
- * and {@link getDataItem DataItem} properties, respectively. The type of the item
- * is given by {@link getItemType ItemType} property. Property {@link getDataSourceIndex DataSourceIndex}
- * gives the index of the item from the bound data source.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridItem extends TTableRow implements INamingContainer
-{
- /**
- * @var integer index of the data item in the Items collection of datagrid
- */
- private $_itemIndex='';
- /**
- * @var integer index of the item from the bound data source
- */
- private $_dataSourceIndex=0;
- /**
- * type of the TDataGridItem
- * @var string
- */
- private $_itemType='';
- /**
- * value of the data item
- * @var mixed
- */
- private $_data=null;
-
- /**
- * Constructor.
- * @param integer zero-based index of the item in the item collection of datagrid
- * @param TListItemType item type
- */
- public function __construct($itemIndex,$dataSourceIndex,$itemType)
- {
- $this->_itemIndex=$itemIndex;
- $this->_dataSourceIndex=$dataSourceIndex;
- $this->setItemType($itemType);
- if($itemType===TListItemType::Header)
- $this->setTableSection(TTableRowSection::Header);
- else if($itemType===TListItemType::Footer)
- $this->setTableSection(TTableRowSection::Footer);
- }
-
- /**
- * @return TListItemType item type.
- */
- public function getItemType()
- {
- return $this->_itemType;
- }
-
- /**
- * @param TListItemType item type
- */
- public function setItemType($value)
- {
- $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');
- }
-
- /**
- * @return integer zero-based index of the item in the item collection of datagrid
- */
- public function getItemIndex()
- {
- return $this->_itemIndex;
- }
-
- /**
- * @return integer the index of the datagrid item from the bound data source
- */
- public function getDataSourceIndex()
- {
- return $this->_dataSourceIndex;
- }
-
- /**
- * @return mixed data associated with the item
- * @since 3.1.0
- */
- public function getData()
- {
- return $this->_data;
- }
-
- /**
- * @param mixed data to be associated with the item
- * @since 3.1.0
- */
- public function setData($value)
- {
- $this->_data=$value;
- }
-
- /**
- * This property is deprecated since v3.1.0.
- * @return mixed data associated with the item
- * @deprecated deprecated since v3.1.0. Use {@link getData} instead.
- */
- public function getDataItem()
- {
- return $this->getData();
- }
-
- /**
- * This property is deprecated since v3.1.0.
- * @param mixed data to be associated with the item
- * @deprecated deprecated since version 3.1.0. Use {@link setData} instead.
- */
- public function setDataItem($value)
- {
- return $this->setData($value);
- }
-
- /**
- * This method overrides parent's implementation by wrapping event parameter
- * for <b>OnCommand</b> event with item information.
- * @param TControl the sender of the event
- * @param TEventParameter event parameter
- * @return boolean whether the event bubbling should stop here.
- */
- public function bubbleEvent($sender,$param)
- {
- if($param instanceof TCommandEventParameter)
- {
- $this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param));
- return true;
- }
- else
- return false;
- }
-}
-
-
-/**
- * TDataGridPager class.
- *
- * TDataGridPager represents a datagrid pager.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridPager extends TPanel implements INamingContainer
-{
- private $_dataGrid;
-
- /**
- * Constructor.
- * @param TDataGrid datagrid object
- */
- public function __construct($dataGrid)
- {
- $this->_dataGrid=$dataGrid;
- }
-
- /**
- * This method overrides parent's implementation by wrapping event parameter
- * for <b>OnCommand</b> event with item information.
- * @param TControl the sender of the event
- * @param TEventParameter event parameter
- * @return boolean whether the event bubbling should stop here.
- */
- public function bubbleEvent($sender,$param)
- {
- if($param instanceof TCommandEventParameter)
- {
- $this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param));
- return true;
- }
- else
- return false;
- }
-
- /**
- * @return TDataGrid the datagrid owning this pager
- */
- public function getDataGrid()
- {
- return $this->_dataGrid;
- }
-
- /**
- * @return string item type.
- */
- public function getItemType()
- {
- return TListItemType::Pager;
- }
-}
-
-
-/**
- * TDataGridItemCollection class.
- *
- * TDataGridItemCollection represents a collection of data grid items.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridItemCollection extends TList
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by inserting only TDataGridItem.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a TDataGridItem.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TDataGridItem)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('datagriditemcollection_datagriditem_required');
- }
-}
-
-/**
- * TDataGridColumnCollection class.
- *
- * TDataGridColumnCollection represents a collection of data grid columns.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridColumnCollection extends TList
-{
- /**
- * the control that owns this collection.
- * @var TControl
- */
- private $_o;
-
- /**
- * Constructor.
- * @param TDataGrid the control that owns this collection.
- */
- public function __construct(TDataGrid $owner)
- {
- $this->_o=$owner;
- }
-
- /**
- * @return TDataGrid the control that owns this collection.
- */
- protected function getOwner()
- {
- return $this->_o;
- }
-
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by inserting only TDataGridColumn.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a TDataGridColumn.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TDataGridColumn)
- {
- $item->setOwner($this->_o);
- parent::insertAt($index,$item);
- }
- else
- throw new TInvalidDataTypeException('datagridcolumncollection_datagridcolumn_required');
- }
-}
-
-/**
- * TDataGridPagerMode class.
- * TDataGridPagerMode defines the enumerable type for the possible modes that a datagrid pager can take.
- *
- * The following enumerable values are defined:
- * - NextPrev: pager buttons are displayed as next and previous pages
- * - Numeric: pager buttons are displayed as numeric page numbers
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TDataGridPagerMode extends TEnumerable
-{
- const NextPrev='NextPrev';
- const Numeric='Numeric';
-}
-
-
-/**
- * TDataGridPagerButtonType class.
- * TDataGridPagerButtonType defines the enumerable type for the possible types of datagrid pager buttons.
- *
- * The following enumerable values are defined:
- * - LinkButton: link buttons
- * - PushButton: form submit buttons
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TDataGridPagerButtonType extends TEnumerable
-{
- const LinkButton='LinkButton';
- const PushButton='PushButton';
-}
-
-
-/**
- * TDataGridPagerPosition class.
- * TDataGridPagerPosition defines the enumerable type for the possible positions that a datagrid pager can be located at.
- *
- * The following enumerable values are defined:
- * - Bottom: pager appears only at the bottom of the data grid.
- * - Top: pager appears only at the top of the data grid.
- * - TopAndBottom: pager appears on both top and bottom of the data grid.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TDataGridPagerPosition extends TEnumerable
-{
- const Bottom='Bottom';
- const Top='Top';
- const TopAndBottom='TopAndBottom';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridColumn.php b/framework/Web/UI/WebControls/TDataGridColumn.php
index 1c8831d2..703baa24 100644
--- a/framework/Web/UI/WebControls/TDataGridColumn.php
+++ b/framework/Web/UI/WebControls/TDataGridColumn.php
@@ -538,27 +538,4 @@ abstract class TDataGridColumn extends TApplicationComponent
else
return sprintf($formatString,$value);
}
-}
-
-
-/**
- * TButtonColumnType class.
- * TButtonColumnType defines the enumerable type for the possible types of buttons
- * that can be used in a {@link TButtonColumn}.
- *
- * The following enumerable values are defined:
- * - LinkButton: link buttons
- * - PushButton: form buttons
- * - ImageButton: image buttons
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TButtonColumnType extends TEnumerable
-{
- const LinkButton='LinkButton';
- const PushButton='PushButton';
- const ImageButton='ImageButton';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridColumnCollection.php b/framework/Web/UI/WebControls/TDataGridColumnCollection.php
new file mode 100644
index 00000000..42892ce2
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridColumnCollection.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataGridColumnCollection class.
+ *
+ * TDataGridColumnCollection represents a collection of data grid columns.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridColumnCollection extends TList
+{
+ /**
+ * the control that owns this collection.
+ * @var TControl
+ */
+ private $_o;
+
+ /**
+ * Constructor.
+ * @param TDataGrid the control that owns this collection.
+ */
+ public function __construct(TDataGrid $owner)
+ {
+ $this->_o=$owner;
+ }
+
+ /**
+ * @return TDataGrid the control that owns this collection.
+ */
+ protected function getOwner()
+ {
+ return $this->_o;
+ }
+
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by inserting only TDataGridColumn.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a TDataGridColumn.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TDataGridColumn)
+ {
+ $item->setOwner($this->_o);
+ parent::insertAt($index,$item);
+ }
+ else
+ throw new TInvalidDataTypeException('datagridcolumncollection_datagridcolumn_required');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridCommandEventParameter.php b/framework/Web/UI/WebControls/TDataGridCommandEventParameter.php
new file mode 100644
index 00000000..f1570e58
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridCommandEventParameter.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataGridCommandEventParameter class
+ *
+ * TDataGridCommandEventParameter encapsulates the parameter data for
+ * {@link TDataGrid::onItemCommand ItemCommand} event of {@link TDataGrid} controls.
+ *
+ * The {@link getItem Item} property indicates the datagrid item related with the event.
+ * The {@link getCommandSource CommandSource} refers to the control that originally
+ * raises the Command event.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridCommandEventParameter extends TCommandEventParameter
+{
+ /**
+ * @var TDataGridItem the TDataGridItem control responsible for the event.
+ */
+ private $_item=null;
+ /**
+ * @var TControl the control originally raises the <b>Command</b> event.
+ */
+ private $_source=null;
+
+ /**
+ * Constructor.
+ * @param TDataGridItem datagrid item responsible for the event
+ * @param TControl original event sender
+ * @param TCommandEventParameter original event parameter
+ */
+ public function __construct($item,$source,TCommandEventParameter $param)
+ {
+ $this->_item=$item;
+ $this->_source=$source;
+ parent::__construct($param->getCommandName(),$param->getCommandParameter());
+ }
+
+ /**
+ * @return TDataGridItem the TDataGridItem control responsible for the event.
+ */
+ public function getItem()
+ {
+ return $this->_item;
+ }
+
+ /**
+ * @return TControl the control originally raises the <b>Command</b> event.
+ */
+ public function getCommandSource()
+ {
+ return $this->_source;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridItem.php b/framework/Web/UI/WebControls/TDataGridItem.php
new file mode 100644
index 00000000..7f89e8eb
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridItem.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataGridItem class
+ *
+ * A TDataGridItem control represents an item in the {@link TDataGrid} control,
+ * such as heading section, footer section, or a data item.
+ * The index and data value of the item can be accessed via {@link getItemIndex ItemIndex}>
+ * and {@link getDataItem DataItem} properties, respectively. The type of the item
+ * is given by {@link getItemType ItemType} property. Property {@link getDataSourceIndex DataSourceIndex}
+ * gives the index of the item from the bound data source.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridItem extends TTableRow implements INamingContainer
+{
+ /**
+ * @var integer index of the data item in the Items collection of datagrid
+ */
+ private $_itemIndex='';
+ /**
+ * @var integer index of the item from the bound data source
+ */
+ private $_dataSourceIndex=0;
+ /**
+ * type of the TDataGridItem
+ * @var string
+ */
+ private $_itemType='';
+ /**
+ * value of the data item
+ * @var mixed
+ */
+ private $_data=null;
+
+ /**
+ * Constructor.
+ * @param integer zero-based index of the item in the item collection of datagrid
+ * @param TListItemType item type
+ */
+ public function __construct($itemIndex,$dataSourceIndex,$itemType)
+ {
+ $this->_itemIndex=$itemIndex;
+ $this->_dataSourceIndex=$dataSourceIndex;
+ $this->setItemType($itemType);
+ if($itemType===TListItemType::Header)
+ $this->setTableSection(TTableRowSection::Header);
+ else if($itemType===TListItemType::Footer)
+ $this->setTableSection(TTableRowSection::Footer);
+ }
+
+ /**
+ * @return TListItemType item type.
+ */
+ public function getItemType()
+ {
+ return $this->_itemType;
+ }
+
+ /**
+ * @param TListItemType item type
+ */
+ public function setItemType($value)
+ {
+ $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');
+ }
+
+ /**
+ * @return integer zero-based index of the item in the item collection of datagrid
+ */
+ public function getItemIndex()
+ {
+ return $this->_itemIndex;
+ }
+
+ /**
+ * @return integer the index of the datagrid item from the bound data source
+ */
+ public function getDataSourceIndex()
+ {
+ return $this->_dataSourceIndex;
+ }
+
+ /**
+ * @return mixed data associated with the item
+ * @since 3.1.0
+ */
+ public function getData()
+ {
+ return $this->_data;
+ }
+
+ /**
+ * @param mixed data to be associated with the item
+ * @since 3.1.0
+ */
+ public function setData($value)
+ {
+ $this->_data=$value;
+ }
+
+ /**
+ * This property is deprecated since v3.1.0.
+ * @return mixed data associated with the item
+ * @deprecated deprecated since v3.1.0. Use {@link getData} instead.
+ */
+ public function getDataItem()
+ {
+ return $this->getData();
+ }
+
+ /**
+ * This property is deprecated since v3.1.0.
+ * @param mixed data to be associated with the item
+ * @deprecated deprecated since version 3.1.0. Use {@link setData} instead.
+ */
+ public function setDataItem($value)
+ {
+ return $this->setData($value);
+ }
+
+ /**
+ * This method overrides parent's implementation by wrapping event parameter
+ * for <b>OnCommand</b> event with item information.
+ * @param TControl the sender of the event
+ * @param TEventParameter event parameter
+ * @return boolean whether the event bubbling should stop here.
+ */
+ public function bubbleEvent($sender,$param)
+ {
+ if($param instanceof TCommandEventParameter)
+ {
+ $this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param));
+ return true;
+ }
+ else
+ return false;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridItemCollection.php b/framework/Web/UI/WebControls/TDataGridItemCollection.php
new file mode 100644
index 00000000..1f53f59f
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridItemCollection.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TDataGridItemCollection class.
+ *
+ * TDataGridItemCollection represents a collection of data grid items.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridItemCollection extends TList
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by inserting only TDataGridItem.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a TDataGridItem.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TDataGridItem)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('datagriditemcollection_datagriditem_required');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridItemEventParameter.php b/framework/Web/UI/WebControls/TDataGridItemEventParameter.php
new file mode 100644
index 00000000..165dcbc4
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridItemEventParameter.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataGridItemEventParameter class
+ *
+ * TDataGridItemEventParameter encapsulates the parameter data for
+ * {@link TDataGrid::onItemCreated OnItemCreated} event of {@link TDataGrid} controls.
+ * The {@link getItem Item} property indicates the datagrid item related with the event.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridItemEventParameter extends TEventParameter
+{
+ /**
+ * The TDataGridItem control responsible for the event.
+ * @var TDataGridItem
+ */
+ private $_item=null;
+
+ /**
+ * Constructor.
+ * @param TDataGridItem datagrid item related with the corresponding event
+ */
+ public function __construct(TDataGridItem $item)
+ {
+ $this->_item=$item;
+ }
+
+ /**
+ * @return TDataGridItem datagrid item related with the corresponding event
+ */
+ public function getItem()
+ {
+ return $this->_item;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridPageChangedEventParameter.php b/framework/Web/UI/WebControls/TDataGridPageChangedEventParameter.php
new file mode 100644
index 00000000..f02f7d49
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridPageChangedEventParameter.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataGridPageChangedEventParameter class
+ *
+ * TDataGridPageChangedEventParameter encapsulates the parameter data for
+ * {@link TDataGrid::onPageIndexChanged PageIndexChanged} event of {@link TDataGrid} controls.
+ *
+ * The {@link getCommandSource CommandSource} property refers to the control
+ * that originally raises the OnCommand event, while {@link getNewPageIndex NewPageIndex}
+ * returns the new page index carried with the page command.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridPageChangedEventParameter extends TEventParameter
+{
+ /**
+ * @var integer new page index
+ */
+ private $_newIndex;
+ /**
+ * @var TControl original event sender
+ */
+ private $_source=null;
+
+ /**
+ * Constructor.
+ * @param TControl the control originally raises the <b>OnCommand</b> event.
+ * @param integer new page index
+ */
+ public function __construct($source,$newPageIndex)
+ {
+ $this->_source=$source;
+ $this->_newIndex=$newPageIndex;
+ }
+
+ /**
+ * @return TControl the control originally raises the <b>OnCommand</b> event.
+ */
+ public function getCommandSource()
+ {
+ return $this->_source;
+ }
+
+ /**
+ * @return integer new page index
+ */
+ public function getNewPageIndex()
+ {
+ return $this->_newIndex;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridPager.php b/framework/Web/UI/WebControls/TDataGridPager.php
new file mode 100644
index 00000000..75aca937
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridPager.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TDataGridPager class.
+ *
+ * TDataGridPager represents a datagrid pager.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridPager extends TPanel implements INamingContainer
+{
+ private $_dataGrid;
+
+ /**
+ * Constructor.
+ * @param TDataGrid datagrid object
+ */
+ public function __construct($dataGrid)
+ {
+ $this->_dataGrid=$dataGrid;
+ }
+
+ /**
+ * This method overrides parent's implementation by wrapping event parameter
+ * for <b>OnCommand</b> event with item information.
+ * @param TControl the sender of the event
+ * @param TEventParameter event parameter
+ * @return boolean whether the event bubbling should stop here.
+ */
+ public function bubbleEvent($sender,$param)
+ {
+ if($param instanceof TCommandEventParameter)
+ {
+ $this->raiseBubbleEvent($this,new TDataGridCommandEventParameter($this,$sender,$param));
+ return true;
+ }
+ else
+ return false;
+ }
+
+ /**
+ * @return TDataGrid the datagrid owning this pager
+ */
+ public function getDataGrid()
+ {
+ return $this->_dataGrid;
+ }
+
+ /**
+ * @return string item type.
+ */
+ public function getItemType()
+ {
+ return TListItemType::Pager;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridPagerButtonType.php b/framework/Web/UI/WebControls/TDataGridPagerButtonType.php
new file mode 100644
index 00000000..0ebef61e
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridPagerButtonType.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TDataGridPagerButtonType class.
+ * TDataGridPagerButtonType defines the enumerable type for the possible types of datagrid pager buttons.
+ *
+ * The following enumerable values are defined:
+ * - LinkButton: link buttons
+ * - PushButton: form submit buttons
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TDataGridPagerButtonType extends TEnumerable
+{
+ const LinkButton='LinkButton';
+ const PushButton='PushButton';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridPagerEventParameter.php b/framework/Web/UI/WebControls/TDataGridPagerEventParameter.php
new file mode 100644
index 00000000..5710fcc6
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridPagerEventParameter.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataGridPagerEventParameter class
+ *
+ * TDataGridPagerEventParameter encapsulates the parameter data for
+ * {@link TDataGrid::onPagerCreated OnPagerCreated} event of {@link TDataGrid} controls.
+ * The {@link getPager Pager} property indicates the datagrid pager related with the event.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridPagerEventParameter extends TEventParameter
+{
+ /**
+ * The TDataGridPager control responsible for the event.
+ * @var TDataGridPager
+ */
+ protected $_pager=null;
+
+ /**
+ * Constructor.
+ * @param TDataGridPager datagrid pager related with the corresponding event
+ */
+ public function __construct(TDataGridPager $pager)
+ {
+ $this->_pager=$pager;
+ }
+
+ /**
+ * @return TDataGridPager datagrid pager related with the corresponding event
+ */
+ public function getPager()
+ {
+ return $this->_pager;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridPagerMode.php b/framework/Web/UI/WebControls/TDataGridPagerMode.php
new file mode 100644
index 00000000..fbf0a12c
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridPagerMode.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataGridPagerMode class.
+ * TDataGridPagerMode defines the enumerable type for the possible modes that a datagrid pager can take.
+ *
+ * The following enumerable values are defined:
+ * - NextPrev: pager buttons are displayed as next and previous pages
+ * - Numeric: pager buttons are displayed as numeric page numbers
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TDataGridPagerMode extends TEnumerable
+{
+ const NextPrev='NextPrev';
+ const Numeric='Numeric';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridPagerPosition.php b/framework/Web/UI/WebControls/TDataGridPagerPosition.php
new file mode 100644
index 00000000..eb2fe267
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridPagerPosition.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TDataGridPagerPosition class.
+ * TDataGridPagerPosition defines the enumerable type for the possible positions that a datagrid pager can be located at.
+ *
+ * The following enumerable values are defined:
+ * - Bottom: pager appears only at the bottom of the data grid.
+ * - Top: pager appears only at the top of the data grid.
+ * - TopAndBottom: pager appears on both top and bottom of the data grid.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TDataGridPagerPosition extends TEnumerable
+{
+ const Bottom='Bottom';
+ const Top='Top';
+ const TopAndBottom='TopAndBottom';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataGridSortCommandEventParameter.php b/framework/Web/UI/WebControls/TDataGridSortCommandEventParameter.php
new file mode 100644
index 00000000..11f6d8e8
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridSortCommandEventParameter.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * TDataGrid related class files.
+ * This file contains the definition of the following classes:
+ * TDataGrid, TDataGridItem, TDataGridItemCollection, TDataGridColumnCollection,
+ * TDataGridPagerStyle, TDataGridItemEventParameter,
+ * TDataGridCommandEventParameter, TDataGridSortCommandEventParameter,
+ * TDataGridPageChangedEventParameter
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataGridSortCommandEventParameter class
+ *
+ * TDataGridSortCommandEventParameter encapsulates the parameter data for
+ * {@link TDataGrid::onSortCommand SortCommand} event of {@link TDataGrid} controls.
+ *
+ * The {@link getCommandSource CommandSource} property refers to the control
+ * that originally raises the OnCommand event, while {@link getSortExpression SortExpression}
+ * gives the sort expression carried with the sort command.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridSortCommandEventParameter extends TEventParameter
+{
+ /**
+ * @var string sort expression
+ */
+ private $_sortExpression='';
+ /**
+ * @var TControl original event sender
+ */
+ private $_source=null;
+
+ /**
+ * Constructor.
+ * @param TControl the control originally raises the <b>OnCommand</b> event.
+ * @param TDataGridCommandEventParameter command event parameter
+ */
+ public function __construct($source,TDataGridCommandEventParameter $param)
+ {
+ $this->_source=$source;
+ $this->_sortExpression=$param->getCommandParameter();
+ }
+
+ /**
+ * @return TControl the control originally raises the <b>OnCommand</b> event.
+ */
+ public function getCommandSource()
+ {
+ return $this->_source;
+ }
+
+ /**
+ * @return string sort expression
+ */
+ public function getSortExpression()
+ {
+ return $this->_sortExpression;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php
index 021fdf6d..a17ac6c3 100644
--- a/framework/Web/UI/WebControls/TDataList.php
+++ b/framework/Web/UI/WebControls/TDataList.php
@@ -1486,275 +1486,4 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs
parent::render($writer);
}
}
-}
-
-
-/**
- * TDataListItemEventParameter class
- *
- * TDataListItemEventParameter encapsulates the parameter data for
- * {@link TDataList::onItemCreated ItemCreated} event of {@link TDataList} controls.
- * The {@link getItem Item} property indicates the DataList item related with the event.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataListItemEventParameter extends TEventParameter
-{
- /**
- * The datalist item control responsible for the event.
- * @var TControl
- */
- private $_item=null;
-
- /**
- * Constructor.
- * @param TControl DataList item related with the corresponding event
- */
- public function __construct($item)
- {
- $this->_item=$item;
- }
-
- /**
- * @return TControl datalist item related with the corresponding event
- */
- public function getItem()
- {
- return $this->_item;
- }
-}
-
-/**
- * TDataListCommandEventParameter class
- *
- * TDataListCommandEventParameter encapsulates the parameter data for
- * {@link TDataList::onItemCommand ItemCommand} event of {@link TDataList} controls.
- *
- * The {@link getItem Item} property indicates the DataList item related with the event.
- * The {@link getCommandSource CommandSource} refers to the control that originally
- * raises the Command event.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataListCommandEventParameter extends TCommandEventParameter
-{
- /**
- * @var TControl the datalist item control responsible for the event.
- */
- private $_item=null;
- /**
- * @var TControl the control originally raises the <b>OnCommand</b> event.
- */
- private $_source=null;
-
- /**
- * Constructor.
- * @param TControl datalist item responsible for the event
- * @param TControl original event sender
- * @param TCommandEventParameter original event parameter
- */
- public function __construct($item,$source,TCommandEventParameter $param)
- {
- $this->_item=$item;
- $this->_source=$source;
- parent::__construct($param->getCommandName(),$param->getCommandParameter());
- }
-
- /**
- * @return TControl the datalist item control responsible for the event.
- */
- public function getItem()
- {
- return $this->_item;
- }
-
- /**
- * @return TControl the control originally raises the <b>OnCommand</b> event.
- */
- public function getCommandSource()
- {
- return $this->_source;
- }
-}
-
-/**
- * TDataListItem class
- *
- * A TDataListItem control represents an item in the {@link TDataList} control,
- * such as heading section, footer section, or a data item.
- * The index and data value of the item can be accessed via {@link getItemIndex ItemIndex}>
- * and {@link getDataItem DataItem} properties, respectively. The type of the item
- * is given by {@link getItemType ItemType} property.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataListItem extends TWebControl implements INamingContainer, IItemDataRenderer
-{
- /**
- * index of the data item in the Items collection of DataList
- */
- private $_itemIndex;
- /**
- * type of the TDataListItem
- * @var TListItemType
- */
- private $_itemType;
- /**
- * value of the data associated with this item
- * @var mixed
- */
- private $_data;
-
- private $_tagName='span';
-
- /**
- * Returns the tag name used for this control.
- * @return string tag name of the control to be rendered
- */
- protected function getTagName()
- {
- return $this->_tagName;
- }
-
- /**
- * @param string tag name of the control to be rendered
- */
- public function setTagName($value)
- {
- $this->_tagName=$value;
- }
-
- /**
- * Creates a style object for the control.
- * This method creates a {@link TTableItemStyle} to be used by a datalist item.
- * @return TStyle control style to be used
- */
- protected function createStyle()
- {
- return new TTableItemStyle;
- }
-
- /**
- * @return TListItemType item type
- */
- public function getItemType()
- {
- return $this->_itemType;
- }
-
- /**
- * @param TListItemType item type.
- */
- public function setItemType($value)
- {
- $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');
- }
-
- /**
- * @return integer zero-based index of the item in the item collection of datalist
- */
- public function getItemIndex()
- {
- return $this->_itemIndex;
- }
-
- /**
- * Sets the zero-based index for the item.
- * If the item is not in the item collection (e.g. it is a header item), -1 should be used.
- * @param integer zero-based index of the item.
- */
- public function setItemIndex($value)
- {
- $this->_itemIndex=TPropertyValue::ensureInteger($value);
- }
-
- /**
- * @return mixed data associated with the item
- * @since 3.1.0
- */
- public function getData()
- {
- return $this->_data;
- }
-
- /**
- * @param mixed data to be associated with the item
- * @since 3.1.0
- */
- public function setData($value)
- {
- $this->_data=$value;
- }
-
- /**
- * This property is deprecated since v3.1.0.
- * @return mixed data associated with the item
- * @deprecated deprecated since v3.1.0. Use {@link getData} instead.
- */
- public function getDataItem()
- {
- return $this->getData();
- }
-
- /**
- * This property is deprecated since v3.1.0.
- * @param mixed data to be associated with the item
- * @deprecated deprecated since version 3.1.0. Use {@link setData} instead.
- */
- public function setDataItem($value)
- {
- return $this->setData($value);
- }
-
- /**
- * This method overrides parent's implementation by wrapping event parameter
- * for <b>OnCommand</b> event with item information.
- * @param TControl the sender of the event
- * @param TEventParameter event parameter
- * @return boolean whether the event bubbling should stop here.
- */
- public function bubbleEvent($sender,$param)
- {
- if($param instanceof TCommandEventParameter)
- {
- $this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param));
- return true;
- }
- else
- return false;
- }
-}
-
-/**
- * TDataListItemCollection class.
- *
- * TDataListItemCollection represents a collection of data list items.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataListItemCollection extends TList
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by inserting only TControl descendants.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a TControl descendant.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TControl)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('datalistitemcollection_datalistitem_required');
- }
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataListCommandEventParameter.php b/framework/Web/UI/WebControls/TDataListCommandEventParameter.php
new file mode 100644
index 00000000..92f639ad
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataListCommandEventParameter.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * TDataList class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataListCommandEventParameter class
+ *
+ * TDataListCommandEventParameter encapsulates the parameter data for
+ * {@link TDataList::onItemCommand ItemCommand} event of {@link TDataList} controls.
+ *
+ * The {@link getItem Item} property indicates the DataList item related with the event.
+ * The {@link getCommandSource CommandSource} refers to the control that originally
+ * raises the Command event.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataListCommandEventParameter extends TCommandEventParameter
+{
+ /**
+ * @var TControl the datalist item control responsible for the event.
+ */
+ private $_item=null;
+ /**
+ * @var TControl the control originally raises the <b>OnCommand</b> event.
+ */
+ private $_source=null;
+
+ /**
+ * Constructor.
+ * @param TControl datalist item responsible for the event
+ * @param TControl original event sender
+ * @param TCommandEventParameter original event parameter
+ */
+ public function __construct($item,$source,TCommandEventParameter $param)
+ {
+ $this->_item=$item;
+ $this->_source=$source;
+ parent::__construct($param->getCommandName(),$param->getCommandParameter());
+ }
+
+ /**
+ * @return TControl the datalist item control responsible for the event.
+ */
+ public function getItem()
+ {
+ return $this->_item;
+ }
+
+ /**
+ * @return TControl the control originally raises the <b>OnCommand</b> event.
+ */
+ public function getCommandSource()
+ {
+ return $this->_source;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataListItem.php b/framework/Web/UI/WebControls/TDataListItem.php
new file mode 100644
index 00000000..9991d4c1
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataListItem.php
@@ -0,0 +1,160 @@
+<?php
+/**
+ * TDataList class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataListItem class
+ *
+ * A TDataListItem control represents an item in the {@link TDataList} control,
+ * such as heading section, footer section, or a data item.
+ * The index and data value of the item can be accessed via {@link getItemIndex ItemIndex}>
+ * and {@link getDataItem DataItem} properties, respectively. The type of the item
+ * is given by {@link getItemType ItemType} property.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataListItem extends TWebControl implements INamingContainer, IItemDataRenderer
+{
+ /**
+ * index of the data item in the Items collection of DataList
+ */
+ private $_itemIndex;
+ /**
+ * type of the TDataListItem
+ * @var TListItemType
+ */
+ private $_itemType;
+ /**
+ * value of the data associated with this item
+ * @var mixed
+ */
+ private $_data;
+
+ private $_tagName='span';
+
+ /**
+ * Returns the tag name used for this control.
+ * @return string tag name of the control to be rendered
+ */
+ protected function getTagName()
+ {
+ return $this->_tagName;
+ }
+
+ /**
+ * @param string tag name of the control to be rendered
+ */
+ public function setTagName($value)
+ {
+ $this->_tagName=$value;
+ }
+
+ /**
+ * Creates a style object for the control.
+ * This method creates a {@link TTableItemStyle} to be used by a datalist item.
+ * @return TStyle control style to be used
+ */
+ protected function createStyle()
+ {
+ return new TTableItemStyle;
+ }
+
+ /**
+ * @return TListItemType item type
+ */
+ public function getItemType()
+ {
+ return $this->_itemType;
+ }
+
+ /**
+ * @param TListItemType item type.
+ */
+ public function setItemType($value)
+ {
+ $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');
+ }
+
+ /**
+ * @return integer zero-based index of the item in the item collection of datalist
+ */
+ public function getItemIndex()
+ {
+ return $this->_itemIndex;
+ }
+
+ /**
+ * Sets the zero-based index for the item.
+ * If the item is not in the item collection (e.g. it is a header item), -1 should be used.
+ * @param integer zero-based index of the item.
+ */
+ public function setItemIndex($value)
+ {
+ $this->_itemIndex=TPropertyValue::ensureInteger($value);
+ }
+
+ /**
+ * @return mixed data associated with the item
+ * @since 3.1.0
+ */
+ public function getData()
+ {
+ return $this->_data;
+ }
+
+ /**
+ * @param mixed data to be associated with the item
+ * @since 3.1.0
+ */
+ public function setData($value)
+ {
+ $this->_data=$value;
+ }
+
+ /**
+ * This property is deprecated since v3.1.0.
+ * @return mixed data associated with the item
+ * @deprecated deprecated since v3.1.0. Use {@link getData} instead.
+ */
+ public function getDataItem()
+ {
+ return $this->getData();
+ }
+
+ /**
+ * This property is deprecated since v3.1.0.
+ * @param mixed data to be associated with the item
+ * @deprecated deprecated since version 3.1.0. Use {@link setData} instead.
+ */
+ public function setDataItem($value)
+ {
+ return $this->setData($value);
+ }
+
+ /**
+ * This method overrides parent's implementation by wrapping event parameter
+ * for <b>OnCommand</b> event with item information.
+ * @param TControl the sender of the event
+ * @param TEventParameter event parameter
+ * @return boolean whether the event bubbling should stop here.
+ */
+ public function bubbleEvent($sender,$param)
+ {
+ if($param instanceof TCommandEventParameter)
+ {
+ $this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param));
+ return true;
+ }
+ else
+ return false;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataListItemCollection.php b/framework/Web/UI/WebControls/TDataListItemCollection.php
new file mode 100644
index 00000000..11a63837
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataListItemCollection.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * TDataList class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataListItemCollection class.
+ *
+ * TDataListItemCollection represents a collection of data list items.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataListItemCollection extends TList
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by inserting only TControl descendants.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a TControl descendant.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TControl)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('datalistitemcollection_datalistitem_required');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataListItemEventParameter.php b/framework/Web/UI/WebControls/TDataListItemEventParameter.php
new file mode 100644
index 00000000..9983e9f9
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataListItemEventParameter.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * TDataList class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TDataListItemEventParameter class
+ *
+ * TDataListItemEventParameter encapsulates the parameter data for
+ * {@link TDataList::onItemCreated ItemCreated} event of {@link TDataList} controls.
+ * The {@link getItem Item} property indicates the DataList item related with the event.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataListItemEventParameter extends TEventParameter
+{
+ /**
+ * The datalist item control responsible for the event.
+ * @var TControl
+ */
+ private $_item=null;
+
+ /**
+ * Constructor.
+ * @param TControl DataList item related with the corresponding event
+ */
+ public function __construct($item)
+ {
+ $this->_item=$item;
+ }
+
+ /**
+ * @return TControl datalist item related with the corresponding event
+ */
+ public function getItem()
+ {
+ return $this->_item;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataSourceControl.php b/framework/Web/UI/WebControls/TDataSourceControl.php
index afe4de2d..e6f37293 100644
--- a/framework/Web/UI/WebControls/TDataSourceControl.php
+++ b/framework/Web/UI/WebControls/TDataSourceControl.php
@@ -10,20 +10,6 @@
*/
/**
- * IDataSource class
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-interface IDataSource
-{
- public function getView($viewName);
- public function getViewNames();
- public function onDataSourceChanged($param);
-}
-
-/**
* TDataSourceControl class
*
* @author Qiang Xue <qiang.xue@gmail.com>
@@ -82,33 +68,3 @@ abstract class TDataSourceControl extends TControl implements IDataSource
throw new TNotSupportedException('datasourcecontrol_visible_unsupported');
}
}
-
-/**
- * TDataSourceControl class
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TReadOnlyDataSource extends TDataSourceControl
-{
- private $_dataSource;
- private $_dataMember;
-
- public function __construct($dataSource,$dataMember)
- {
- if(!is_array($dataSource) && !($dataSource instanceof IDataSource) && !($dataSource instanceof Traversable))
- throw new TInvalidDataTypeException('readonlydatasource_datasource_invalid');
- $this->_dataSource=$dataSource;
- $this->_dataMember=$dataMember;
- }
-
- public function getView($viewName)
- {
- if($this->_dataSource instanceof IDataSource)
- return $this->_dataSource->getView($viewName);
- else
- return new TReadOnlyDataSourceView($this,$this->_dataMember,$this->_dataSource);
- }
-}
-
diff --git a/framework/Web/UI/WebControls/TDataSourceSelectParameters.php b/framework/Web/UI/WebControls/TDataSourceSelectParameters.php
new file mode 100644
index 00000000..10cc55ec
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataSourceSelectParameters.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * TDataSourceSelectParameters, TDataSourceView, TReadOnlyDataSourceView class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataSourceSelectParameters class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataSourceSelectParameters extends TComponent
+{
+ private $_retrieveTotalRowCount=false;
+ private $_startRowIndex=0;
+ private $_totalRowCount=0;
+ private $_maximumRows=0;
+
+ public function getStartRowIndex()
+ {
+ return $this->_startRowIndex;
+ }
+
+ public function setStartRowIndex($value)
+ {
+ if(($value=TPropertyValue::ensureInteger($value))<0)
+ $value=0;
+ $this->_startRowIndex=$value;
+ }
+
+ public function getMaximumRows()
+ {
+ return $this->_maximumRows;
+ }
+
+ public function setMaximumRows($value)
+ {
+ if(($value=TPropertyValue::ensureInteger($value))<0)
+ $value=0;
+ $this->_maximumRows=$value;
+ }
+
+ public function getRetrieveTotalRowCount()
+ {
+ return $this->_retrieveTotalRowCount;
+ }
+
+ public function setRetrieveTotalRowCount($value)
+ {
+ $this->_retrieveTotalRowCount=TPropertyValue::ensureBoolean($value);
+ }
+
+ public function getTotalRowCount()
+ {
+ return $this->_totalRowCount;
+ }
+
+ public function setTotalRowCount($value)
+ {
+ if(($value=TPropertyValue::ensureInteger($value))<0)
+ $value=0;
+ $this->_totalRowCount=$value;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDataSourceView.php b/framework/Web/UI/WebControls/TDataSourceView.php
index b9a76a32..a4692571 100644
--- a/framework/Web/UI/WebControls/TDataSourceView.php
+++ b/framework/Web/UI/WebControls/TDataSourceView.php
@@ -10,67 +10,6 @@
*/
/**
- * TDataSourceSelectParameters class
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataSourceSelectParameters extends TComponent
-{
- private $_retrieveTotalRowCount=false;
- private $_startRowIndex=0;
- private $_totalRowCount=0;
- private $_maximumRows=0;
-
- public function getStartRowIndex()
- {
- return $this->_startRowIndex;
- }
-
- public function setStartRowIndex($value)
- {
- if(($value=TPropertyValue::ensureInteger($value))<0)
- $value=0;
- $this->_startRowIndex=$value;
- }
-
- public function getMaximumRows()
- {
- return $this->_maximumRows;
- }
-
- public function setMaximumRows($value)
- {
- if(($value=TPropertyValue::ensureInteger($value))<0)
- $value=0;
- $this->_maximumRows=$value;
- }
-
- public function getRetrieveTotalRowCount()
- {
- return $this->_retrieveTotalRowCount;
- }
-
- public function setRetrieveTotalRowCount($value)
- {
- $this->_retrieveTotalRowCount=TPropertyValue::ensureBoolean($value);
- }
-
- public function getTotalRowCount()
- {
- return $this->_totalRowCount;
- }
-
- public function setTotalRowCount($value)
- {
- if(($value=TPropertyValue::ensureInteger($value))<0)
- $value=0;
- $this->_totalRowCount=$value;
- }
-}
-
-/**
* TDataSourceView class
*
* @author Qiang Xue <qiang.xue@gmail.com>
@@ -170,33 +109,4 @@ abstract class TDataSourceView extends TComponent
{
$this->raiseEvent('OnDataSourceViewChanged',$this,$param);
}
-}
-
-/**
- * TReadOnlyDataSourceView class
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TReadOnlyDataSourceView extends TDataSourceView
-{
- private $_dataSource=null;
-
- public function __construct(IDataSource $owner,$viewName,$dataSource)
- {
- parent::__construct($owner,$viewName);
- if($dataSource===null || is_array($dataSource))
- $this->_dataSource=new TMap($dataSource);
- else if($dataSource instanceof Traversable)
- $this->_dataSource=$dataSource;
- else
- throw new TInvalidDataTypeException('readonlydatasourceview_datasource_invalid');
- }
-
- public function select($parameters)
- {
- return $this->_dataSource;
- }
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index f910f06e..cf226663 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -879,100 +879,4 @@ class TDatePicker extends TTextBox
$cs->registerEndScript("prado:".$this->getClientID(), $code);
}
}
-}
-
-/**
- * TDatePickerClientScript class.
- *
- * Client-side date picker event {@link setOnDateChanged OnDateChanged}
- * can be modified through the {@link TDatePicker::getClientSide ClientSide}
- * property of a date picker.
- *
- * The <tt>OnDateChanged</tt> event is raise when the date picker's date
- * is changed.
- * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
- * as parameter to this event
- *
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TDatePickerClientScript extends TClientSideOptions
-{
- /**
- * Javascript code to execute when the date picker's date is changed.
- * @param string javascript code
- */
- public function setOnDateChanged($javascript)
- {
- $this->setFunction('OnDateChanged', $javascript);
- }
-
- /**
- * @return string javascript code to execute when the date picker's date is changed.
- */
- public function getOnDateChanged()
- {
- return $this->getOption('OnDateChanged');
- }
-}
-
-
-/**
- * TDatePickerInputMode class.
- * TDatePickerInputMode defines the enumerable type for the possible datepicker input methods.
- *
- * The following enumerable values are defined:
- * - TextBox: text boxes are used to input date values
- * - DropDownList: dropdown lists are used to pick up date values
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TDatePickerInputMode extends TEnumerable
-{
- const TextBox='TextBox';
- const DropDownList='DropDownList';
-}
-
-/**
- * TDatePickerMode class.
- * TDatePickerMode defines the enumerable type for the possible UI mode
- * that a {@link TDatePicker} control can take.
- *
- * The following enumerable values are defined:
- * - Basic: Only shows a text input, focusing on the input shows the date picker
- * - Clickable: Only shows a text input, clicking on the input shows the date picker (since 3.2)
- * - Button: Shows a button next to the text input, clicking on the button shows the date, button text can be by the
- * - ImageButton: Shows an image next to the text input, clicking on the image shows the date picker,
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TDatePickerMode extends TEnumerable
-{
- const Basic='Basic';
- const Clickable='Clickable';
- const Button='Button';
- const ImageButton='ImageButton';
-}
-
-/**
- * TDatePickerPositionMode class.
- * TDatePickerPositionMode defines the positions available for the calendar popup, relative to the corresponding input.
- *
- * The following enumerable values are defined:
- * - Top: the date picker is placed above the input field
- * - Bottom: the date picker is placed below the input field
- *
- * @author Carl G. Mathisen <carlgmathisen@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.1.4
- */
-class TDatePickerPositionMode extends TEnumerable
-{
- const Top='Top';
- const Bottom='Bottom';
-}
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDatePickerClientScript.php b/framework/Web/UI/WebControls/TDatePickerClientScript.php
new file mode 100644
index 00000000..67fe7b95
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDatePickerClientScript.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * TDatePicker class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDatePickerClientScript class.
+ *
+ * Client-side date picker event {@link setOnDateChanged OnDateChanged}
+ * can be modified through the {@link TDatePicker::getClientSide ClientSide}
+ * property of a date picker.
+ *
+ * The <tt>OnDateChanged</tt> event is raise when the date picker's date
+ * is changed.
+ * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
+ * as parameter to this event
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TDatePickerClientScript extends TClientSideOptions
+{
+ /**
+ * Javascript code to execute when the date picker's date is changed.
+ * @param string javascript code
+ */
+ public function setOnDateChanged($javascript)
+ {
+ $this->setFunction('OnDateChanged', $javascript);
+ }
+
+ /**
+ * @return string javascript code to execute when the date picker's date is changed.
+ */
+ public function getOnDateChanged()
+ {
+ return $this->getOption('OnDateChanged');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDatePickerInputMode.php b/framework/Web/UI/WebControls/TDatePickerInputMode.php
new file mode 100644
index 00000000..7bf4cb5b
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDatePickerInputMode.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * TDatePicker class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TDatePickerInputMode class.
+ * TDatePickerInputMode defines the enumerable type for the possible datepicker input methods.
+ *
+ * The following enumerable values are defined:
+ * - TextBox: text boxes are used to input date values
+ * - DropDownList: dropdown lists are used to pick up date values
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TDatePickerInputMode extends TEnumerable
+{
+ const TextBox='TextBox';
+ const DropDownList='DropDownList';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDatePickerMode.php b/framework/Web/UI/WebControls/TDatePickerMode.php
new file mode 100644
index 00000000..c3b228d8
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDatePickerMode.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * TDatePicker class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDatePickerMode class.
+ * TDatePickerMode defines the enumerable type for the possible UI mode
+ * that a {@link TDatePicker} control can take.
+ *
+ * The following enumerable values are defined:
+ * - Basic: Only shows a text input, focusing on the input shows the date picker
+ * - Clickable: Only shows a text input, clicking on the input shows the date picker (since 3.2)
+ * - Button: Shows a button next to the text input, clicking on the button shows the date, button text can be by the
+ * - ImageButton: Shows an image next to the text input, clicking on the image shows the date picker,
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TDatePickerMode extends TEnumerable
+{
+ const Basic='Basic';
+ const Clickable='Clickable';
+ const Button='Button';
+ const ImageButton='ImageButton';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDatePickerPositionMode.php b/framework/Web/UI/WebControls/TDatePickerPositionMode.php
new file mode 100644
index 00000000..a5feb6d6
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDatePickerPositionMode.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * TDatePicker class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDatePickerPositionMode class.
+ * TDatePickerPositionMode defines the positions available for the calendar popup, relative to the corresponding input.
+ *
+ * The following enumerable values are defined:
+ * - Top: the date picker is placed above the input field
+ * - Bottom: the date picker is placed below the input field
+ *
+ * @author Carl G. Mathisen <carlgmathisen@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.1.4
+ */
+class TDatePickerPositionMode extends TEnumerable
+{
+ const Top='Top';
+ const Bottom='Bottom';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDisplayStyle.php b/framework/Web/UI/WebControls/TDisplayStyle.php
new file mode 100644
index 00000000..d444f4fd
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDisplayStyle.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TStyle class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDisplayStyle defines the enumerable type for the possible styles
+ * that a web control can display.
+ *
+ * The following enumerable values are defined:
+ * - None: the control is not displayed and not included in the layout.
+ * - Dynamic: the control is displayed and included in the layout, the layout flow is dependent on the control (equivalent to display:'' in css).
+ * - Fixed: Similar to Dynamic with CSS "visibility" set "shown".
+ * - Hidden: the control is not displayed and is included in the layout.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.WebControls
+ * @since 3.1
+ */
+class TDisplayStyle extends TEnumerable
+{
+ const None='None';
+ const Dynamic='Dynamic';
+ const Fixed='Fixed';
+ const Hidden='Hidden';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php
index 707bbfcc..32eb2cfa 100644
--- a/framework/Web/UI/WebControls/THead.php
+++ b/framework/Web/UI/WebControls/THead.php
@@ -172,201 +172,4 @@ class THead extends TControl
parent::render($writer);
$writer->write("</head>\n");
}
-}
-
-/**
- * TMetaTag class.
- *
- * TMetaTag represents a meta tag appearing in a page head section.
- * You can set its {@link setID ID}, {@link setHttpEquiv HttpEquiv},
- * {@link setName Name}, {@link setContent Content}, {@link setScheme Scheme}
- * properties, which correspond to id, http-equiv, name, content, and scheme
- * attributes for a meta tag, respectively.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TMetaTag extends TComponent
-{
- /**
- * @var string id of the meta tag
- */
- private $_id='';
- /**
- * @var string http-equiv attribute of the meta tag
- */
- private $_httpEquiv='';
- /**
- * @var string name attribute of the meta tag
- */
- private $_name='';
- /**
- * @var string content attribute of the meta tag
- */
- private $_content='';
- /**
- * @var string scheme attribute of the meta tag
- */
- private $_scheme='';
-
- /**
- * @return string id of the meta tag
- */
- public function getID()
- {
- return $this->_id;
- }
-
- /**
- * @param string id of the meta tag
- */
- public function setID($value)
- {
- $this->_id=$value;
- }
-
- /**
- * @return string http-equiv attribute of the meta tag
- */
- public function getHttpEquiv()
- {
- return $this->_httpEquiv;
- }
-
- /**
- * @param string http-equiv attribute of the meta tag
- */
- public function setHttpEquiv($value)
- {
- $this->_httpEquiv=$value;
- }
-
- /**
- * @return string name attribute of the meta tag
- */
- public function getName()
- {
- return $this->_name;
- }
-
- /**
- * @param string name attribute of the meta tag
- */
- public function setName($value)
- {
- $this->_name=$value;
- }
-
- /**
- * @return string content attribute of the meta tag
- */
- public function getContent()
- {
- return $this->_content;
- }
-
- /**
- * @param string content attribute of the meta tag
- */
- public function setContent($value)
- {
- $this->_content=$value;
- }
-
- /**
- * @return string scheme attribute of the meta tag
- */
- public function getScheme()
- {
- return $this->_scheme;
- }
-
- /**
- * @param string scheme attribute of the meta tag
- */
- public function setScheme($value)
- {
- $this->_scheme=$value;
- }
-
- /**
- * Renders the meta tag.
- * @param THtmlWriter writer for the rendering purpose
- */
- public function render($writer)
- {
- if($this->_id!=='')
- $writer->addAttribute('id',$this->_id);
- if($this->_name!=='')
- $writer->addAttribute('name',$this->_name);
- if($this->_httpEquiv!=='')
- $writer->addAttribute('http-equiv',$this->_httpEquiv);
- if($this->_scheme!=='')
- $writer->addAttribute('scheme',$this->_scheme);
- $writer->addAttribute('content',$this->_content);
- $writer->renderBeginTag('meta');
- $writer->renderEndTag();
- }
-}
-
-
-/**
- * TMetaTagCollection class
- *
- * TMetaTagCollection represents a collection of meta tags
- * contained in a {@link THead} control.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TMetaTagCollection extends TList
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by performing type
- * check on the item being added.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TMetaTag}
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TMetaTag)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('metatagcollection_metatag_invalid');
- }
-
- /**
- * Finds the lowest cardinal index of the meta tag whose id is the one being looked for.
- * @param string the ID of the meta tag to be looked for
- * @return integer the index of the meta tag found, -1 if not found.
- */
- public function findIndexByID($id)
- {
- $index=0;
- foreach($this as $item)
- {
- if($item->getID()===$id)
- return $index;
- $index++;
- }
- return -1;
- }
-
- /**
- * Finds the item whose value is the one being looked for.
- * @param string the id of the meta tag to be looked for
- * @return TMetaTag the meta tag found, null if not found.
- */
- public function findMetaTagByID($id)
- {
- if(($index=$this->findIndexByID($id))>=0)
- return $this->itemAt($index);
- else
- return null;
- }
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/THorizontalAlign.php b/framework/Web/UI/WebControls/THorizontalAlign.php
new file mode 100644
index 00000000..56bb9b17
--- /dev/null
+++ b/framework/Web/UI/WebControls/THorizontalAlign.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * TStyle class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * THorizontalAlign class.
+ * THorizontalAlign defines the enumerable type for the possible horizontal alignments in a CSS style.
+ *
+ * The following enumerable values are defined:
+ * - NotSet: the alignment is not specified.
+ * - Left: left aligned
+ * - Right: right aligned
+ * - Center: center aligned
+ * - Justify: the begin and end are justified
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class THorizontalAlign extends TEnumerable
+{
+ const NotSet='NotSet';
+ const Left='Left';
+ const Right='Right';
+ const Center='Center';
+ const Justify='Justify';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/THotSpot.php b/framework/Web/UI/WebControls/THotSpot.php
new file mode 100644
index 00000000..bc398f10
--- /dev/null
+++ b/framework/Web/UI/WebControls/THotSpot.php
@@ -0,0 +1,322 @@
+<?php
+/**
+ * TImageMap and related class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * THotSpot class.
+ *
+ * THotSpot implements the basic functionality common to all hot spot shapes.
+ * Derived classes include {@link TCircleHotSpot}, {@link TPolygonHotSpot}
+ * and {@link TRectangleHotSpot}.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+abstract class THotSpot extends TComponent
+{
+ private $_viewState=array();
+
+ /**
+ * Returns a viewstate value.
+ *
+ * This function is very useful in defining getter functions for component properties
+ * that must be kept in viewstate.
+ * @param string the name of the viewstate value to be returned
+ * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned
+ * @return mixed the viewstate value corresponding to $key
+ */
+ protected function getViewState($key,$defaultValue=null)
+ {
+ return isset($this->_viewState[$key])?$this->_viewState[$key]:$defaultValue;
+ }
+
+ /**
+ * Sets a viewstate value.
+ *
+ * This function is very useful in defining setter functions for control properties
+ * that must be kept in viewstate.
+ * Make sure that the viewstate value must be serializable and unserializable.
+ * @param string the name of the viewstate value
+ * @param mixed the viewstate value to be set
+ * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate.
+ */
+ protected function setViewState($key,$value,$defaultValue=null)
+ {
+ if($value===$defaultValue)
+ unset($this->_viewState[$key]);
+ else
+ $this->_viewState[$key]=$value;
+ }
+
+ /**
+ * @return string shape of the hotspot, can be 'circle', 'rect', 'poly', etc.
+ */
+ abstract public function getShape();
+ /**
+ * @return string coordinates defining the hotspot shape.
+ */
+ abstract public function getCoordinates();
+
+ /**
+ * @return string the access key that allows you to quickly navigate to the HotSpot region. Defaults to ''.
+ */
+ public function getAccessKey()
+ {
+ return $this->getViewState('AccessKey','');
+ }
+
+ /**
+ * @param string the access key that allows you to quickly navigate to the HotSpot region.
+ */
+ public function setAccessKey($value)
+ {
+ $this->setViewState('AccessKey',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return string the alternate text to display for a HotSpot object. Defaults to ''.
+ */
+ public function getAlternateText()
+ {
+ return $this->getViewState('AlternateText','');
+ }
+
+ /**
+ * @param string the alternate text to display for a HotSpot object.
+ */
+ public function setAlternateText($value)
+ {
+ $this->setViewState('AlternateText',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return THotSpotMode the behavior of a HotSpot object when it is clicked. Defaults to THotSpotMode::NotSet.
+ */
+ public function getHotSpotMode()
+ {
+ return $this->getViewState('HotSpotMode',THotSpotMode::NotSet);
+ }
+
+ /**
+ * @param THotSpotMode the behavior of a HotSpot object when it is clicked.
+ */
+ public function setHotSpotMode($value)
+ {
+ $this->setViewState('HotSpotMode',TPropertyValue::ensureEnum($value,'THotSpotMode'),THotSpotMode::NotSet);
+ }
+
+ /**
+ * @return string the URL to navigate to when a HotSpot object is clicked. Defaults to ''.
+ */
+ public function getNavigateUrl()
+ {
+ return $this->getViewState('NavigateUrl','');
+ }
+
+ /**
+ * @param string the URL to navigate to when a HotSpot object is clicked.
+ */
+ public function setNavigateUrl($value)
+ {
+ $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return string a value that is post back when the HotSpot is clicked. Defaults to ''.
+ */
+ public function getPostBackValue()
+ {
+ return $this->getViewState('PostBackValue','');
+ }
+
+ /**
+ * @param string a value that is post back when the HotSpot is clicked.
+ */
+ public function setPostBackValue($value)
+ {
+ $this->setViewState('PostBackValue',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return integer the tab index of the HotSpot region. Defaults to 0.
+ */
+ public function getTabIndex()
+ {
+ return $this->getViewState('TabIndex',0);
+ }
+
+ /**
+ * @param integer the tab index of the HotSpot region.
+ */
+ public function setTabIndex($value)
+ {
+ $this->setViewState('TabIndex',TPropertyValue::ensureInteger($value),0);
+ }
+
+ /**
+ * @return boolean whether postback event trigger by this hotspot will cause input validation, default is true
+ */
+ public function getCausesValidation()
+ {
+ return $this->getViewState('CausesValidation',true);
+ }
+
+ /**
+ * @param boolean whether postback event trigger by this hotspot will cause input validation
+ */
+ public function setCausesValidation($value)
+ {
+ $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true);
+ }
+
+ /**
+ * @return string the group of validators which the hotspot causes validation upon postback
+ */
+ public function getValidationGroup()
+ {
+ return $this->getViewState('ValidationGroup','');
+ }
+
+ /**
+ * @param string the group of validators which the hotspot causes validation upon postback
+ */
+ public function setValidationGroup($value)
+ {
+ $this->setViewState('ValidationGroup',$value,'');
+ }
+
+ /**
+ * @return string the target window or frame to display the new page when the HotSpot region
+ * is clicked. Defaults to ''.
+ */
+ public function getTarget()
+ {
+ return $this->getViewState('Target','');
+ }
+
+ /**
+ * @param string the target window or frame to display the new page when the HotSpot region
+ * is clicked.
+ */
+ public function setTarget($value)
+ {
+ $this->setViewState('Target',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return boolean whether the hotspot has custom attributes
+ */
+ public function getHasAttributes()
+ {
+ if($attributes=$this->getViewState('Attributes',null))
+ return $attributes->getCount()>0;
+ else
+ return false;
+ }
+
+ /**
+ * Returns the list of custom attributes.
+ * Custom attributes are name-value pairs that may be rendered
+ * as HTML tags' attributes.
+ * @return TAttributeCollection the list of custom attributes
+ */
+ public function getAttributes()
+ {
+ if($attributes=$this->getViewState('Attributes',null))
+ return $attributes;
+ else
+ {
+ $attributes=new TAttributeCollection;
+ $this->setViewState('Attributes',$attributes,null);
+ return $attributes;
+ }
+ }
+
+ /**
+ * @return boolean whether the named attribute exists
+ */
+ public function hasAttribute($name)
+ {
+ if($attributes=$this->getViewState('Attributes',null))
+ return $attributes->contains($name);
+ else
+ return false;
+ }
+
+ /**
+ * @return string attribute value, null if attribute does not exist
+ */
+ public function getAttribute($name)
+ {
+ if($attributes=$this->getViewState('Attributes',null))
+ return $attributes->itemAt($name);
+ else
+ return null;
+ }
+
+ /**
+ * Sets a custom hotspot attribute.
+ * @param string attribute name
+ * @param string value of the attribute
+ */
+ public function setAttribute($name,$value)
+ {
+ $this->getAttributes()->add($name,$value);
+ }
+
+ /**
+ * Removes the named attribute.
+ * @param string the name of the attribute to be removed.
+ * @return string attribute value removed, null if attribute does not exist.
+ */
+ public function removeAttribute($name)
+ {
+ if($attributes=$this->getViewState('Attributes',null))
+ return $attributes->remove($name);
+ else
+ return null;
+ }
+
+ /**
+ * Renders this hotspot.
+ * @param THtmlWriter
+ */
+ public function render($writer)
+ {
+ $writer->addAttribute('shape',$this->getShape());
+ $writer->addAttribute('coords',$this->getCoordinates());
+ if(($mode=$this->getHotSpotMode())===THotSpotMode::NotSet)
+ $mode=THotSpotMode::Navigate;
+ if($mode===THotSpotMode::Navigate)
+ {
+ $writer->addAttribute('href',$this->getNavigateUrl());
+ if(($target=$this->getTarget())!=='')
+ $writer->addAttribute('target',$target);
+ }
+ else if($mode===THotSpotMode::Inactive)
+ $writer->addAttribute('nohref','true');
+ $text=$this->getAlternateText();
+ $writer->addAttribute('title',$text);
+ $writer->addAttribute('alt',$text);
+ if(($accessKey=$this->getAccessKey())!=='')
+ $writer->addAttribute('accesskey',$accessKey);
+ if(($tabIndex=$this->getTabIndex())!==0)
+ $writer->addAttribute('tabindex',"$tabIndex");
+ if($this->getHasAttributes())
+ {
+ foreach($this->getAttributes() as $name=>$value)
+ $writer->addAttribute($name,$value);
+ }
+ $writer->renderBeginTag('area');
+ $writer->renderEndTag();
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/THotSpotCollection.php b/framework/Web/UI/WebControls/THotSpotCollection.php
new file mode 100644
index 00000000..4c2d0b2b
--- /dev/null
+++ b/framework/Web/UI/WebControls/THotSpotCollection.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * TImageMap and related class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * THotSpotCollection class.
+ *
+ * THotSpotCollection represents a collection of hotspots in an imagemap.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class THotSpotCollection extends TList
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by inserting only {@link THotSpot}.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a THotSpot.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof THotSpot)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('hotspotcollection_hotspot_required');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/THotSpotMode.php b/framework/Web/UI/WebControls/THotSpotMode.php
new file mode 100644
index 00000000..be272741
--- /dev/null
+++ b/framework/Web/UI/WebControls/THotSpotMode.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * TImageMap and related class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * THotSpotMode class.
+ * THotSpotMode defines the enumerable type for the possible hot spot modes.
+ *
+ * The following enumerable values are defined:
+ * - NotSet: the mode is not specified
+ * - Navigate: clicking on the hotspot will redirect the browser to a different page
+ * - PostBack: clicking on the hotspot will cause a postback
+ * - Inactive: the hotspot is inactive (not clickable)
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class THotSpotMode extends TEnumerable
+{
+ const NotSet='NotSet';
+ const Navigate='Navigate';
+ const PostBack='PostBack';
+ const Inactive='Inactive';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TImageButton.php b/framework/Web/UI/WebControls/TImageButton.php
index ff876b07..2f793b3f 100644
--- a/framework/Web/UI/WebControls/TImageButton.php
+++ b/framework/Web/UI/WebControls/TImageButton.php
@@ -368,71 +368,3 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven
{
}
}
-
-/**
- * TImageClickEventParameter class
- *
- * TImageClickEventParameter encapsulates the parameter data for
- * {@link TImageButton::onClick Click} event of {@link TImageButton} controls.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TImageClickEventParameter extends TEventParameter
-{
- /**
- * the X coordinate of the clicking point
- * @var integer
- */
- private $_x=0;
- /**
- * the Y coordinate of the clicking point
- * @var integer
- */
- private $_y=0;
-
- /**
- * Constructor.
- * @param integer X coordinate of the clicking point
- * @param integer Y coordinate of the clicking point
- */
- public function __construct($x,$y)
- {
- $this->_x=$x;
- $this->_y=$y;
- }
-
- /**
- * @return integer X coordinate of the clicking point, defaults to 0
- */
- public function getX()
- {
- return $this->_x;
- }
-
- /**
- * @param integer X coordinate of the clicking point
- */
- public function setX($value)
- {
- $this->_x=TPropertyValue::ensureInteger($value);
- }
-
- /**
- * @return integer Y coordinate of the clicking point, defaults to 0
- */
- public function getY()
- {
- return $this->_y;
- }
-
- /**
- * @param integer Y coordinate of the clicking point
- */
- public function setY($value)
- {
- $this->_y=TPropertyValue::ensureInteger($value);
- }
-}
-
diff --git a/framework/Web/UI/WebControls/TImageClickEventParameter.php b/framework/Web/UI/WebControls/TImageClickEventParameter.php
new file mode 100644
index 00000000..54bf5673
--- /dev/null
+++ b/framework/Web/UI/WebControls/TImageClickEventParameter.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * TImageButton class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TImageClickEventParameter class
+ *
+ * TImageClickEventParameter encapsulates the parameter data for
+ * {@link TImageButton::onClick Click} event of {@link TImageButton} controls.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TImageClickEventParameter extends TEventParameter
+{
+ /**
+ * the X coordinate of the clicking point
+ * @var integer
+ */
+ private $_x=0;
+ /**
+ * the Y coordinate of the clicking point
+ * @var integer
+ */
+ private $_y=0;
+
+ /**
+ * Constructor.
+ * @param integer X coordinate of the clicking point
+ * @param integer Y coordinate of the clicking point
+ */
+ public function __construct($x,$y)
+ {
+ $this->_x=$x;
+ $this->_y=$y;
+ }
+
+ /**
+ * @return integer X coordinate of the clicking point, defaults to 0
+ */
+ public function getX()
+ {
+ return $this->_x;
+ }
+
+ /**
+ * @param integer X coordinate of the clicking point
+ */
+ public function setX($value)
+ {
+ $this->_x=TPropertyValue::ensureInteger($value);
+ }
+
+ /**
+ * @return integer Y coordinate of the clicking point, defaults to 0
+ */
+ public function getY()
+ {
+ return $this->_y;
+ }
+
+ /**
+ * @param integer Y coordinate of the clicking point
+ */
+ public function setY($value)
+ {
+ $this->_y=TPropertyValue::ensureInteger($value);
+ }
+}
diff --git a/framework/Web/UI/WebControls/TImageMap.php b/framework/Web/UI/WebControls/TImageMap.php
index 23409b1c..3ca178b2 100644
--- a/framework/Web/UI/WebControls/TImageMap.php
+++ b/framework/Web/UI/WebControls/TImageMap.php
@@ -217,612 +217,4 @@ class TImageMap extends TImage implements IPostBackEventHandler
{
$this->raiseEvent('OnClick',$this,$param);
}
-}
-
-/**
- * TImageMapEventParameter class.
- *
- * TImageMapEventParameter represents a postback event parameter
- * when a hotspot is clicked and posts back in a {@link TImageMap}.
- * To retrieve the post back value associated with the hotspot being clicked,
- * access {@link getPostBackValue PostBackValue}.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TImageMapEventParameter extends TEventParameter
-{
- private $_postBackValue;
-
- /**
- * Constructor.
- * @param string post back value associated with the hotspot clicked
- */
- public function __construct($postBackValue)
- {
- $this->_postBackValue=$postBackValue;
- }
-
- /**
- * @return string post back value associated with the hotspot clicked
- */
- public function getPostBackValue()
- {
- return $this->_postBackValue;
- }
-}
-
-/**
- * THotSpotCollection class.
- *
- * THotSpotCollection represents a collection of hotspots in an imagemap.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class THotSpotCollection extends TList
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by inserting only {@link THotSpot}.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a THotSpot.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof THotSpot)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('hotspotcollection_hotspot_required');
- }
-}
-
-
-/**
- * THotSpot class.
- *
- * THotSpot implements the basic functionality common to all hot spot shapes.
- * Derived classes include {@link TCircleHotSpot}, {@link TPolygonHotSpot}
- * and {@link TRectangleHotSpot}.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-abstract class THotSpot extends TComponent
-{
- private $_viewState=array();
-
- /**
- * Returns a viewstate value.
- *
- * This function is very useful in defining getter functions for component properties
- * that must be kept in viewstate.
- * @param string the name of the viewstate value to be returned
- * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned
- * @return mixed the viewstate value corresponding to $key
- */
- protected function getViewState($key,$defaultValue=null)
- {
- return isset($this->_viewState[$key])?$this->_viewState[$key]:$defaultValue;
- }
-
- /**
- * Sets a viewstate value.
- *
- * This function is very useful in defining setter functions for control properties
- * that must be kept in viewstate.
- * Make sure that the viewstate value must be serializable and unserializable.
- * @param string the name of the viewstate value
- * @param mixed the viewstate value to be set
- * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate.
- */
- protected function setViewState($key,$value,$defaultValue=null)
- {
- if($value===$defaultValue)
- unset($this->_viewState[$key]);
- else
- $this->_viewState[$key]=$value;
- }
-
- /**
- * @return string shape of the hotspot, can be 'circle', 'rect', 'poly', etc.
- */
- abstract public function getShape();
- /**
- * @return string coordinates defining the hotspot shape.
- */
- abstract public function getCoordinates();
-
- /**
- * @return string the access key that allows you to quickly navigate to the HotSpot region. Defaults to ''.
- */
- public function getAccessKey()
- {
- return $this->getViewState('AccessKey','');
- }
-
- /**
- * @param string the access key that allows you to quickly navigate to the HotSpot region.
- */
- public function setAccessKey($value)
- {
- $this->setViewState('AccessKey',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return string the alternate text to display for a HotSpot object. Defaults to ''.
- */
- public function getAlternateText()
- {
- return $this->getViewState('AlternateText','');
- }
-
- /**
- * @param string the alternate text to display for a HotSpot object.
- */
- public function setAlternateText($value)
- {
- $this->setViewState('AlternateText',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return THotSpotMode the behavior of a HotSpot object when it is clicked. Defaults to THotSpotMode::NotSet.
- */
- public function getHotSpotMode()
- {
- return $this->getViewState('HotSpotMode',THotSpotMode::NotSet);
- }
-
- /**
- * @param THotSpotMode the behavior of a HotSpot object when it is clicked.
- */
- public function setHotSpotMode($value)
- {
- $this->setViewState('HotSpotMode',TPropertyValue::ensureEnum($value,'THotSpotMode'),THotSpotMode::NotSet);
- }
-
- /**
- * @return string the URL to navigate to when a HotSpot object is clicked. Defaults to ''.
- */
- public function getNavigateUrl()
- {
- return $this->getViewState('NavigateUrl','');
- }
-
- /**
- * @param string the URL to navigate to when a HotSpot object is clicked.
- */
- public function setNavigateUrl($value)
- {
- $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return string a value that is post back when the HotSpot is clicked. Defaults to ''.
- */
- public function getPostBackValue()
- {
- return $this->getViewState('PostBackValue','');
- }
-
- /**
- * @param string a value that is post back when the HotSpot is clicked.
- */
- public function setPostBackValue($value)
- {
- $this->setViewState('PostBackValue',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return integer the tab index of the HotSpot region. Defaults to 0.
- */
- public function getTabIndex()
- {
- return $this->getViewState('TabIndex',0);
- }
-
- /**
- * @param integer the tab index of the HotSpot region.
- */
- public function setTabIndex($value)
- {
- $this->setViewState('TabIndex',TPropertyValue::ensureInteger($value),0);
- }
-
- /**
- * @return boolean whether postback event trigger by this hotspot will cause input validation, default is true
- */
- public function getCausesValidation()
- {
- return $this->getViewState('CausesValidation',true);
- }
-
- /**
- * @param boolean whether postback event trigger by this hotspot will cause input validation
- */
- public function setCausesValidation($value)
- {
- $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true);
- }
-
- /**
- * @return string the group of validators which the hotspot causes validation upon postback
- */
- public function getValidationGroup()
- {
- return $this->getViewState('ValidationGroup','');
- }
-
- /**
- * @param string the group of validators which the hotspot causes validation upon postback
- */
- public function setValidationGroup($value)
- {
- $this->setViewState('ValidationGroup',$value,'');
- }
-
- /**
- * @return string the target window or frame to display the new page when the HotSpot region
- * is clicked. Defaults to ''.
- */
- public function getTarget()
- {
- return $this->getViewState('Target','');
- }
-
- /**
- * @param string the target window or frame to display the new page when the HotSpot region
- * is clicked.
- */
- public function setTarget($value)
- {
- $this->setViewState('Target',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return boolean whether the hotspot has custom attributes
- */
- public function getHasAttributes()
- {
- if($attributes=$this->getViewState('Attributes',null))
- return $attributes->getCount()>0;
- else
- return false;
- }
-
- /**
- * Returns the list of custom attributes.
- * Custom attributes are name-value pairs that may be rendered
- * as HTML tags' attributes.
- * @return TAttributeCollection the list of custom attributes
- */
- public function getAttributes()
- {
- if($attributes=$this->getViewState('Attributes',null))
- return $attributes;
- else
- {
- $attributes=new TAttributeCollection;
- $this->setViewState('Attributes',$attributes,null);
- return $attributes;
- }
- }
-
- /**
- * @return boolean whether the named attribute exists
- */
- public function hasAttribute($name)
- {
- if($attributes=$this->getViewState('Attributes',null))
- return $attributes->contains($name);
- else
- return false;
- }
-
- /**
- * @return string attribute value, null if attribute does not exist
- */
- public function getAttribute($name)
- {
- if($attributes=$this->getViewState('Attributes',null))
- return $attributes->itemAt($name);
- else
- return null;
- }
-
- /**
- * Sets a custom hotspot attribute.
- * @param string attribute name
- * @param string value of the attribute
- */
- public function setAttribute($name,$value)
- {
- $this->getAttributes()->add($name,$value);
- }
-
- /**
- * Removes the named attribute.
- * @param string the name of the attribute to be removed.
- * @return string attribute value removed, null if attribute does not exist.
- */
- public function removeAttribute($name)
- {
- if($attributes=$this->getViewState('Attributes',null))
- return $attributes->remove($name);
- else
- return null;
- }
-
- /**
- * Renders this hotspot.
- * @param THtmlWriter
- */
- public function render($writer)
- {
- $writer->addAttribute('shape',$this->getShape());
- $writer->addAttribute('coords',$this->getCoordinates());
- if(($mode=$this->getHotSpotMode())===THotSpotMode::NotSet)
- $mode=THotSpotMode::Navigate;
- if($mode===THotSpotMode::Navigate)
- {
- $writer->addAttribute('href',$this->getNavigateUrl());
- if(($target=$this->getTarget())!=='')
- $writer->addAttribute('target',$target);
- }
- else if($mode===THotSpotMode::Inactive)
- $writer->addAttribute('nohref','true');
- $text=$this->getAlternateText();
- $writer->addAttribute('title',$text);
- $writer->addAttribute('alt',$text);
- if(($accessKey=$this->getAccessKey())!=='')
- $writer->addAttribute('accesskey',$accessKey);
- if(($tabIndex=$this->getTabIndex())!==0)
- $writer->addAttribute('tabindex',"$tabIndex");
- if($this->getHasAttributes())
- {
- foreach($this->getAttributes() as $name=>$value)
- $writer->addAttribute($name,$value);
- }
- $writer->renderBeginTag('area');
- $writer->renderEndTag();
- }
-}
-
-/**
- * Class TCircleHotSpot.
- *
- * TCircleHotSpot defines a circular hot spot region in a {@link TImageMap}
- * control.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TCircleHotSpot extends THotSpot
-{
- /**
- * @return string shape of this hotspot.
- */
- public function getShape()
- {
- return 'circle';
- }
-
- /**
- * @return string coordinates defining this hotspot shape
- */
- public function getCoordinates()
- {
- return $this->getX().','.$this->getY().','.$this->getRadius();
- }
-
- /**
- * @return integer radius of the circular HotSpot region. Defaults to 0.
- */
- public function getRadius()
- {
- return $this->getViewState('Radius',0);
- }
-
- /**
- * @param integer radius of the circular HotSpot region.
- */
- public function setRadius($value)
- {
- $this->setViewState('Radius',TPropertyValue::ensureInteger($value),0);
- }
-
- /**
- * @return integer the X coordinate of the center of the circular HotSpot region. Defaults to 0.
- */
- public function getX()
- {
- return $this->getViewState('X',0);
- }
-
- /**
- * @param integer the X coordinate of the center of the circular HotSpot region.
- */
- public function setX($value)
- {
- $this->setViewState('X',TPropertyValue::ensureInteger($value),0);
- }
-
- /**
- * @return integer the Y coordinate of the center of the circular HotSpot region. Defaults to 0.
- */
- public function getY()
- {
- return $this->getViewState('Y',0);
- }
-
- /**
- * @param integer the Y coordinate of the center of the circular HotSpot region.
- */
- public function setY($value)
- {
- $this->setViewState('Y',TPropertyValue::ensureInteger($value),0);
- }
-}
-
-/**
- * Class TRectangleHotSpot.
- *
- * TRectangleHotSpot defines a rectangle hot spot region in a {@link
- * TImageMap} control.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TRectangleHotSpot extends THotSpot
-{
- /**
- * @return string shape of this hotspot.
- */
- public function getShape()
- {
- return 'rect';
- }
-
- /**
- * @return string coordinates defining this hotspot shape
- */
- public function getCoordinates()
- {
- return $this->getLeft().','.$this->getTop().','.$this->getRight().','.$this->getBottom();
- }
-
- /**
- * @return integer the Y coordinate of the bottom side of the rectangle HotSpot region. Defaults to 0.
- */
- public function getBottom()
- {
- return $this->getViewState('Bottom',0);
- }
-
- /**
- * @param integer the Y coordinate of the bottom side of the rectangle HotSpot region.
- */
- public function setBottom($value)
- {
- $this->setViewState('Bottom',TPropertyValue::ensureInteger($value),0);
- }
-
- /**
- * @return integer the X coordinate of the right side of the rectangle HotSpot region. Defaults to 0.
- */
- public function getLeft()
- {
- return $this->getViewState('Left',0);
- }
-
- /**
- * @param integer the X coordinate of the right side of the rectangle HotSpot region.
- */
- public function setLeft($value)
- {
- $this->setViewState('Left',TPropertyValue::ensureInteger($value),0);
- }
-
- /**
- * @return integer the X coordinate of the right side of the rectangle HotSpot region. Defaults to 0.
- */
- public function getRight()
- {
- return $this->getViewState('Right',0);
- }
-
- /**
- * @param integer the X coordinate of the right side of the rectangle HotSpot region.
- */
- public function setRight($value)
- {
- $this->setViewState('Right',TPropertyValue::ensureInteger($value),0);
- }
-
- /**
- * @return integer the Y coordinate of the top side of the rectangle HotSpot region. Defaults to 0.
- */
- public function getTop()
- {
- return $this->getViewState('Top',0);
- }
-
- /**
- * @param integer the Y coordinate of the top side of the rectangle HotSpot region.
- */
- public function setTop($value)
- {
- $this->setViewState('Top',TPropertyValue::ensureInteger($value),0);
- }
-}
-
-/**
- * Class TPolygonHotSpot.
- *
- * TPolygonHotSpot defines a polygon hot spot region in a {@link
- * TImageMap} control.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TPolygonHotSpot extends THotSpot
-{
- /**
- * @return string shape of this hotspot.
- */
- public function getShape()
- {
- return 'poly';
- }
-
- /**
- * @return string coordinates of the vertices defining the polygon.
- * Coordinates are concatenated together with comma ','. Each pair
- * represents (x,y) of a vertex.
- */
- public function getCoordinates()
- {
- return $this->getViewState('Coordinates','');
- }
-
- /**
- * @param string coordinates of the vertices defining the polygon.
- * Coordinates are concatenated together with comma ','. Each pair
- * represents (x,y) of a vertex.
- */
- public function setCoordinates($value)
- {
- $this->setViewState('Coordinates',$value,'');
- }
-}
-
-
-/**
- * THotSpotMode class.
- * THotSpotMode defines the enumerable type for the possible hot spot modes.
- *
- * The following enumerable values are defined:
- * - NotSet: the mode is not specified
- * - Navigate: clicking on the hotspot will redirect the browser to a different page
- * - PostBack: clicking on the hotspot will cause a postback
- * - Inactive: the hotspot is inactive (not clickable)
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class THotSpotMode extends TEnumerable
-{
- const NotSet='NotSet';
- const Navigate='Navigate';
- const PostBack='PostBack';
- const Inactive='Inactive';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TImageMapEventParameter.php b/framework/Web/UI/WebControls/TImageMapEventParameter.php
new file mode 100644
index 00000000..b170b387
--- /dev/null
+++ b/framework/Web/UI/WebControls/TImageMapEventParameter.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * TImageMap and related class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TImageMapEventParameter class.
+ *
+ * TImageMapEventParameter represents a postback event parameter
+ * when a hotspot is clicked and posts back in a {@link TImageMap}.
+ * To retrieve the post back value associated with the hotspot being clicked,
+ * access {@link getPostBackValue PostBackValue}.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TImageMapEventParameter extends TEventParameter
+{
+ private $_postBackValue;
+
+ /**
+ * Constructor.
+ * @param string post back value associated with the hotspot clicked
+ */
+ public function __construct($postBackValue)
+ {
+ $this->_postBackValue=$postBackValue;
+ }
+
+ /**
+ * @return string post back value associated with the hotspot clicked
+ */
+ public function getPostBackValue()
+ {
+ return $this->_postBackValue;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TInlineFrame.php b/framework/Web/UI/WebControls/TInlineFrame.php
index 09e82315..38b8ea76 100644
--- a/framework/Web/UI/WebControls/TInlineFrame.php
+++ b/framework/Web/UI/WebControls/TInlineFrame.php
@@ -221,52 +221,4 @@ class TInlineFrame extends TWebControl implements IDataRenderer
parent::addAttributesToRender($writer);
}
-}
-
-/**
- * TInlineFrameAlign class.
- * TInlineFrameAlign defines the enumerable type for the possible alignments
- * that the content in a {@link TInlineFrame} could be.
- *
- * The following enumerable values are defined:
- * - NotSet: the alignment is not specified.
- * - Left: left aligned
- * - Right: right aligned
- * - Top: top aligned
- * - Middle: middle aligned
- * - Bottom: bottom aligned
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TInlineFrameAlign extends TEnumerable
-{
- const NotSet='NotSet';
- const Left='Left';
- const Right='Right';
- const Top='Top';
- const Middle='Middle';
- const Bottom='Bottom';
-}
-
-/**
- * TInlineFrameScrollBars class.
- * TInlineFrameScrollBars defines the enumerable type for the possible scroll bar mode
- * that a {@link TInlineFrame} control could use.
- *
- * The following enumerable values are defined:
- * - None: no scroll bars.
- * - Auto: scroll bars automatically appeared when needed.
- * - Both: show both horizontal and vertical scroll bars all the time.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TInlineFrameScrollBars extends TEnumerable
-{
- const None='None';
- const Auto='Auto';
- const Both='Both';
-}
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TInlineFrameAlign.php b/framework/Web/UI/WebControls/TInlineFrameAlign.php
new file mode 100644
index 00000000..ec5c1f33
--- /dev/null
+++ b/framework/Web/UI/WebControls/TInlineFrameAlign.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * TInlineFrame class file.
+ *
+ * @author Jason Ragsdale <jrags@jasrags.net>
+ * @author Harry Pottash <hpottash@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TInlineFrameAlign class.
+ * TInlineFrameAlign defines the enumerable type for the possible alignments
+ * that the content in a {@link TInlineFrame} could be.
+ *
+ * The following enumerable values are defined:
+ * - NotSet: the alignment is not specified.
+ * - Left: left aligned
+ * - Right: right aligned
+ * - Top: top aligned
+ * - Middle: middle aligned
+ * - Bottom: bottom aligned
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TInlineFrameAlign extends TEnumerable
+{
+ const NotSet='NotSet';
+ const Left='Left';
+ const Right='Right';
+ const Top='Top';
+ const Middle='Middle';
+ const Bottom='Bottom';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TInlineFrameScrollBars.php b/framework/Web/UI/WebControls/TInlineFrameScrollBars.php
new file mode 100644
index 00000000..7fd851ca
--- /dev/null
+++ b/framework/Web/UI/WebControls/TInlineFrameScrollBars.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TInlineFrame class file.
+ *
+ * @author Jason Ragsdale <jrags@jasrags.net>
+ * @author Harry Pottash <hpottash@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TInlineFrameScrollBars class.
+ * TInlineFrameScrollBars defines the enumerable type for the possible scroll bar mode
+ * that a {@link TInlineFrame} control could use.
+ *
+ * The following enumerable values are defined:
+ * - None: no scroll bars.
+ * - Auto: scroll bars automatically appeared when needed.
+ * - Both: show both horizontal and vertical scroll bars all the time.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TInlineFrameScrollBars extends TEnumerable
+{
+ const None='None';
+ const Auto='Auto';
+ const Both='Both';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TListBox.php b/framework/Web/UI/WebControls/TListBox.php
index 1d72f0c2..c350d9c3 100644
--- a/framework/Web/UI/WebControls/TListBox.php
+++ b/framework/Web/UI/WebControls/TListBox.php
@@ -236,24 +236,4 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl
{
$this->_isValid=TPropertyValue::ensureBoolean($value);
}
-}
-
-
-/**
- * TListSelectionMode class.
- * TListSelectionMode defines the enumerable type for the possible selection modes of a {@link TListBox}.
- *
- * The following enumerable values are defined:
- * - Single: single selection
- * - Multiple: allow multiple selection
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TListSelectionMode extends TEnumerable
-{
- const Single='Single';
- const Multiple='Multiple';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php
index f8655761..fae8e1cc 100644
--- a/framework/Web/UI/WebControls/TListControl.php
+++ b/framework/Web/UI/WebControls/TListControl.php
@@ -1,5 +1,4 @@
<?php
-
/**
* TListControl class file
*
@@ -11,6 +10,7 @@
* @package System.Web.UI.WebControls
*/
+
/**
* Includes the supporting classes
*/
@@ -879,45 +879,4 @@ abstract class TListControl extends TDataBoundControl implements IDataRenderer
else
return sprintf($formatString,$value);
}
-}
-
-/**
- * IListControlAdapter interface
- *
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @version $Revision: $ Sun Jun 25 04:53:43 EST 2006 $
- * @package System.Web.UI.ActiveControls
- * @since 3.0
- */
-interface IListControlAdapter
-{
- /**
- * Selects an item based on zero-base index on the client side.
- * @param integer the index (zero-based) of the item to be selected
- */
- public function setSelectedIndex($index);
- /**
- * Selects a list of item based on zero-base indices on the client side.
- * @param array list of index of items to be selected
- */
- public function setSelectedIndices($indices);
-
- /**
- * Sets selection by item value on the client side.
- * @param string the value of the item to be selected.
- */
- public function setSelectedValue($value);
-
- /**
- * Sets selection by a list of item values on the client side.
- * @param array list of the selected item values
- */
- public function setSelectedValues($values);
-
- /**
- * Clears all existing selections on the client side.
- */
- public function clearSelection();
-}
-
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TListItemType.php b/framework/Web/UI/WebControls/TListItemType.php
new file mode 100644
index 00000000..a62bbc2c
--- /dev/null
+++ b/framework/Web/UI/WebControls/TListItemType.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * TDataBoundControl class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TListItemType class.
+ * TListItemType defines the enumerable type for the possible types
+ * that databound list items could take.
+ *
+ * The following enumerable values are defined:
+ * - Header: header item
+ * - Footer: footer item
+ * - Item: content item (neither header nor footer)
+ * - Separator: separator between items
+ * - AlternatingItem: alternating content item
+ * - EditItem: content item in edit mode
+ * - SelectedItem: selected content item
+ * - Pager: pager
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TListItemType extends TEnumerable
+{
+ const Header='Header';
+ const Footer='Footer';
+ const Item='Item';
+ const Separator='Separator';
+ const AlternatingItem='AlternatingItem';
+ const EditItem='EditItem';
+ const SelectedItem='SelectedItem';
+ const Pager='Pager';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TListSelectionMode.php b/framework/Web/UI/WebControls/TListSelectionMode.php
new file mode 100644
index 00000000..1a496df7
--- /dev/null
+++ b/framework/Web/UI/WebControls/TListSelectionMode.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * TListBox class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TListSelectionMode class.
+ * TListSelectionMode defines the enumerable type for the possible selection modes of a {@link TListBox}.
+ *
+ * The following enumerable values are defined:
+ * - Single: single selection
+ * - Multiple: allow multiple selection
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TListSelectionMode extends TEnumerable
+{
+ const Single='Single';
+ const Multiple='Multiple';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TMetaTag.php b/framework/Web/UI/WebControls/TMetaTag.php
new file mode 100644
index 00000000..ffa3f1f6
--- /dev/null
+++ b/framework/Web/UI/WebControls/TMetaTag.php
@@ -0,0 +1,146 @@
+<?php
+/**
+ * THead class file
+ *
+ * @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI
+ */
+
+/**
+ * TMetaTag class.
+ *
+ * TMetaTag represents a meta tag appearing in a page head section.
+ * You can set its {@link setID ID}, {@link setHttpEquiv HttpEquiv},
+ * {@link setName Name}, {@link setContent Content}, {@link setScheme Scheme}
+ * properties, which correspond to id, http-equiv, name, content, and scheme
+ * attributes for a meta tag, respectively.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TMetaTag extends TComponent
+{
+ /**
+ * @var string id of the meta tag
+ */
+ private $_id='';
+ /**
+ * @var string http-equiv attribute of the meta tag
+ */
+ private $_httpEquiv='';
+ /**
+ * @var string name attribute of the meta tag
+ */
+ private $_name='';
+ /**
+ * @var string content attribute of the meta tag
+ */
+ private $_content='';
+ /**
+ * @var string scheme attribute of the meta tag
+ */
+ private $_scheme='';
+
+ /**
+ * @return string id of the meta tag
+ */
+ public function getID()
+ {
+ return $this->_id;
+ }
+
+ /**
+ * @param string id of the meta tag
+ */
+ public function setID($value)
+ {
+ $this->_id=$value;
+ }
+
+ /**
+ * @return string http-equiv attribute of the meta tag
+ */
+ public function getHttpEquiv()
+ {
+ return $this->_httpEquiv;
+ }
+
+ /**
+ * @param string http-equiv attribute of the meta tag
+ */
+ public function setHttpEquiv($value)
+ {
+ $this->_httpEquiv=$value;
+ }
+
+ /**
+ * @return string name attribute of the meta tag
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ /**
+ * @param string name attribute of the meta tag
+ */
+ public function setName($value)
+ {
+ $this->_name=$value;
+ }
+
+ /**
+ * @return string content attribute of the meta tag
+ */
+ public function getContent()
+ {
+ return $this->_content;
+ }
+
+ /**
+ * @param string content attribute of the meta tag
+ */
+ public function setContent($value)
+ {
+ $this->_content=$value;
+ }
+
+ /**
+ * @return string scheme attribute of the meta tag
+ */
+ public function getScheme()
+ {
+ return $this->_scheme;
+ }
+
+ /**
+ * @param string scheme attribute of the meta tag
+ */
+ public function setScheme($value)
+ {
+ $this->_scheme=$value;
+ }
+
+ /**
+ * Renders the meta tag.
+ * @param THtmlWriter writer for the rendering purpose
+ */
+ public function render($writer)
+ {
+ if($this->_id!=='')
+ $writer->addAttribute('id',$this->_id);
+ if($this->_name!=='')
+ $writer->addAttribute('name',$this->_name);
+ if($this->_httpEquiv!=='')
+ $writer->addAttribute('http-equiv',$this->_httpEquiv);
+ if($this->_scheme!=='')
+ $writer->addAttribute('scheme',$this->_scheme);
+ $writer->addAttribute('content',$this->_content);
+ $writer->renderBeginTag('meta');
+ $writer->renderEndTag();
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TMetaTagCollection.php b/framework/Web/UI/WebControls/TMetaTagCollection.php
new file mode 100644
index 00000000..b3d9246b
--- /dev/null
+++ b/framework/Web/UI/WebControls/TMetaTagCollection.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * THead class file
+ *
+ * @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI
+ */
+
+
+/**
+ * TMetaTagCollection class
+ *
+ * TMetaTagCollection represents a collection of meta tags
+ * contained in a {@link THead} control.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TMetaTagCollection extends TList
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by performing type
+ * check on the item being added.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TMetaTag}
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TMetaTag)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('metatagcollection_metatag_invalid');
+ }
+
+ /**
+ * Finds the lowest cardinal index of the meta tag whose id is the one being looked for.
+ * @param string the ID of the meta tag to be looked for
+ * @return integer the index of the meta tag found, -1 if not found.
+ */
+ public function findIndexByID($id)
+ {
+ $index=0;
+ foreach($this as $item)
+ {
+ if($item->getID()===$id)
+ return $index;
+ $index++;
+ }
+ return -1;
+ }
+
+ /**
+ * Finds the item whose value is the one being looked for.
+ * @param string the id of the meta tag to be looked for
+ * @return TMetaTag the meta tag found, null if not found.
+ */
+ public function findMetaTagByID($id)
+ {
+ if(($index=$this->findIndexByID($id))>=0)
+ return $this->itemAt($index);
+ else
+ return null;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TMultiView.php b/framework/Web/UI/WebControls/TMultiView.php
index 05725ff7..b1756bb3 100644
--- a/framework/Web/UI/WebControls/TMultiView.php
+++ b/framework/Web/UI/WebControls/TMultiView.php
@@ -263,112 +263,4 @@ class TMultiView extends TControl
if(($view=$this->getActiveView())!==null)
$view->renderControl($writer);
}
-}
-
-/**
- * TViewCollection class.
- * TViewCollection represents a collection that only takes {@link TView} instances
- * as collection elements.
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TViewCollection extends TControlCollection
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by ensuring only {@link TView}
- * controls be added into the collection.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is neither a string nor a TControl.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TView)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('viewcollection_view_required');
- }
-}
-
-/**
- * TView class
- *
- * TView is a container for a group of controls. TView must be contained
- * within a {@link TMultiView} control in which only one view can be active
- * at one time.
- *
- * To activate a view, set {@link setActive Active} to true.
- * When a view is activated, it raises {@link onActivate OnActivate} event;
- * and when a view is deactivated, it raises {@link onDeactivate OnDeactivate}.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TView extends TControl
-{
- private $_active=false;
-
- /**
- * Raises <b>OnActivate</b> event.
- * @param TEventParameter event parameter
- */
- public function onActivate($param)
- {
- $this->raiseEvent('OnActivate',$this,$param);
- }
-
- /**
- * Raises <b>OnDeactivate</b> event.
- * @param TEventParameter event parameter
- */
- public function onDeactivate($param)
- {
- $this->raiseEvent('OnDeactivate',$this,$param);
- }
-
- /**
- * @return boolean whether this view is active. Defaults to false.
- */
- public function getActive()
- {
- return $this->_active;
- }
-
- /**
- * @param boolean whether this view is active.
- */
- public function setActive($value)
- {
- $value=TPropertyValue::ensureBoolean($value);
- $this->_active=$value;
- parent::setVisible($value);
- }
-
- /**
- * @param boolean whether the parents should also be checked if visible
- * @return boolean whether this view is visible.
- * The view is visible if it is active and its parent is visible.
- */
- public function getVisible($checkParents=true)
- {
- if(($parent=$this->getParent())===null)
- return $this->getActive();
- else if($this->getActive())
- return $parent->getVisible($checkParents);
- else
- return false;
- }
-
- /**
- * @param boolean
- * @throws TInvalidOperationException whenever this method is invoked.
- */
- public function setVisible($value)
- {
- throw new TInvalidOperationException('view_visible_readonly');
- }
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TOutputCache.php b/framework/Web/UI/WebControls/TOutputCache.php
index 2a5ce734..8ce30bd0 100644
--- a/framework/Web/UI/WebControls/TOutputCache.php
+++ b/framework/Web/UI/WebControls/TOutputCache.php
@@ -492,125 +492,4 @@ class TOutputCache extends TControl implements INamingContainer
else
parent::render($writer);
}
-}
-
-/**
- * TOutputCacheCheckDependencyEventParameter class
- *
- * TOutputCacheCheckDependencyEventParameter encapsulates the parameter data for
- * <b>OnCheckDependency</b> event of {@link TOutputCache} control.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TOutputCacheCheckDependencyEventParameter extends TEventParameter
-{
- private $_isValid=true;
- private $_cacheTime=0;
-
- /**
- * @return boolean whether the dependency remains valid. Defaults to true.
- */
- public function getIsValid()
- {
- return $this->_isValid;
- }
-
- /**
- * @param boolean whether the dependency remains valid
- */
- public function setIsValid($value)
- {
- $this->_isValid=TPropertyValue::ensureBoolean($value);
- }
-
- /**
- * @return integer the timestamp of the cached result. You may use this to help determine any dependency is changed.
- * @since 3.1.1
- */
- public function getCacheTime()
- {
- return $this->_cacheTime;
- }
-
- /**
- * @param integer the timestamp of the cached result. This is used internally.
- * @since 3.1.1
- */
- public function setCacheTime($value)
- {
- $this->_cacheTime=TPropertyValue::ensureInteger($value);
- }
-}
-
-
-/**
- * TOutputCacheCalculateKeyEventParameter class
- *
- * TOutputCacheCalculateKeyEventParameter encapsulates the parameter data for
- * <b>OnCalculateKey</b> event of {@link TOutputCache} control.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TOutputCacheCalculateKeyEventParameter extends TEventParameter
-{
- /**
- * @var string cache key to be appended to the default calculation scheme.
- */
- private $_cacheKey='';
-
- /**
- * @return string cache key to be appended to the default calculation scheme.
- */
- public function getCacheKey()
- {
- return $this->_cacheKey;
- }
-
- /**
- * @param string cache key to be appended to the default calculation scheme
- */
- public function setCacheKey($value)
- {
- $this->_cacheKey=TPropertyValue::ensureString($value);
- }
-}
-
-/**
- * TOutputCacheTextWriterMulti class
- *
- * TOutputCacheTextWriterMulti is an internal class used by
- * TOutputCache to write simultaneously to multiple writers.
- *
- * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.2
- */
-class TOutputCacheTextWriterMulti extends TTextWriter
-{
- protected $_writers;
-
- public function __construct(Array $writers)
- {
- //parent::__construct();
- $this->_writers = $writers;
- }
-
- public function write($s)
- {
- foreach($this->_writers as $writer)
- $writer->write($s);
- }
-
- public function flush()
- {
- foreach($this->_writers as $writer)
- $s = $writer->flush();
- return $s;
- }
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TOutputCacheCalculateKeyEventParameter.php b/framework/Web/UI/WebControls/TOutputCacheCalculateKeyEventParameter.php
new file mode 100644
index 00000000..a8bf59ed
--- /dev/null
+++ b/framework/Web/UI/WebControls/TOutputCacheCalculateKeyEventParameter.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * TOutputCache class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TOutputCacheCalculateKeyEventParameter class
+ *
+ * TOutputCacheCalculateKeyEventParameter encapsulates the parameter data for
+ * <b>OnCalculateKey</b> event of {@link TOutputCache} control.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TOutputCacheCalculateKeyEventParameter extends TEventParameter
+{
+ /**
+ * @var string cache key to be appended to the default calculation scheme.
+ */
+ private $_cacheKey='';
+
+ /**
+ * @return string cache key to be appended to the default calculation scheme.
+ */
+ public function getCacheKey()
+ {
+ return $this->_cacheKey;
+ }
+
+ /**
+ * @param string cache key to be appended to the default calculation scheme
+ */
+ public function setCacheKey($value)
+ {
+ $this->_cacheKey=TPropertyValue::ensureString($value);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TOutputCacheCheckDependencyEventParameter.php b/framework/Web/UI/WebControls/TOutputCacheCheckDependencyEventParameter.php
new file mode 100644
index 00000000..37be0e60
--- /dev/null
+++ b/framework/Web/UI/WebControls/TOutputCacheCheckDependencyEventParameter.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * TOutputCache class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TOutputCacheCheckDependencyEventParameter class
+ *
+ * TOutputCacheCheckDependencyEventParameter encapsulates the parameter data for
+ * <b>OnCheckDependency</b> event of {@link TOutputCache} control.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TOutputCacheCheckDependencyEventParameter extends TEventParameter
+{
+ private $_isValid=true;
+ private $_cacheTime=0;
+
+ /**
+ * @return boolean whether the dependency remains valid. Defaults to true.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+
+ /**
+ * @param boolean whether the dependency remains valid
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+
+ /**
+ * @return integer the timestamp of the cached result. You may use this to help determine any dependency is changed.
+ * @since 3.1.1
+ */
+ public function getCacheTime()
+ {
+ return $this->_cacheTime;
+ }
+
+ /**
+ * @param integer the timestamp of the cached result. This is used internally.
+ * @since 3.1.1
+ */
+ public function setCacheTime($value)
+ {
+ $this->_cacheTime=TPropertyValue::ensureInteger($value);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TOutputCacheTextWriterMulti.php b/framework/Web/UI/WebControls/TOutputCacheTextWriterMulti.php
new file mode 100644
index 00000000..2917a9bc
--- /dev/null
+++ b/framework/Web/UI/WebControls/TOutputCacheTextWriterMulti.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * TOutputCache class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TOutputCacheTextWriterMulti class
+ *
+ * TOutputCacheTextWriterMulti is an internal class used by
+ * TOutputCache to write simultaneously to multiple writers.
+ *
+ * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu>
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.2
+ */
+class TOutputCacheTextWriterMulti extends TTextWriter
+{
+ protected $_writers;
+
+ public function __construct(Array $writers)
+ {
+ //parent::__construct();
+ $this->_writers = $writers;
+ }
+
+ public function write($s)
+ {
+ foreach($this->_writers as $writer)
+ $writer->write($s);
+ }
+
+ public function flush()
+ {
+ foreach($this->_writers as $writer)
+ $s = $writer->flush();
+ return $s;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TPager.php b/framework/Web/UI/WebControls/TPager.php
index b4b9c2b0..aea6e8ea 100644
--- a/framework/Web/UI/WebControls/TPager.php
+++ b/framework/Web/UI/WebControls/TPager.php
@@ -712,99 +712,4 @@ class TPager extends TWebControl implements INamingContainer
else
return false;
}
-}
-
-/**
- * TPagerPageChangedEventParameter class
- *
- * TPagerPageChangedEventParameter encapsulates the parameter data for
- * {@link TPager::onPageIndexChanged PageIndexChanged} event of {@link TPager} controls.
- *
- * The {@link getCommandSource CommandSource} property refers to the control
- * that originally raises the OnCommand event, while {@link getNewPageIndex NewPageIndex}
- * returns the new page index carried with the page command.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.2
- */
-class TPagerPageChangedEventParameter extends TEventParameter
-{
- /**
- * @var integer new page index
- */
- private $_newIndex;
- /**
- * @var TControl original event sender
- */
- private $_source=null;
-
- /**
- * Constructor.
- * @param TControl the control originally raises the <b>OnCommand</b> event.
- * @param integer new page index
- */
- public function __construct($source,$newPageIndex)
- {
- $this->_source=$source;
- $this->_newIndex=$newPageIndex;
- }
-
- /**
- * @return TControl the control originally raises the <b>OnCommand</b> event.
- */
- public function getCommandSource()
- {
- return $this->_source;
- }
-
- /**
- * @return integer new page index
- */
- public function getNewPageIndex()
- {
- return $this->_newIndex;
- }
-}
-
-
-/**
- * TPagerMode class.
- * TPagerMode defines the enumerable type for the possible modes that a {@link TPager} control can take.
- *
- * The following enumerable values are defined:
- * - NextPrev: pager buttons are displayed as next and previous pages
- * - Numeric: pager buttons are displayed as numeric page numbers
- * - DropDownList: a dropdown list is used to select pages
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TPagerMode extends TEnumerable
-{
- const NextPrev='NextPrev';
- const Numeric='Numeric';
- const DropDownList='DropDownList';
-}
-
-
-/**
- * TPagerButtonType class.
- * TPagerButtonType defines the enumerable type for the possible types of pager buttons.
- *
- * The following enumerable values are defined:
- * - LinkButton: link buttons
- * - PushButton: form submit buttons
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TPagerButtonType extends TEnumerable
-{
- const LinkButton='LinkButton';
- const PushButton='PushButton';
- const ImageButton='ImageButton';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TPagerButtonType.php b/framework/Web/UI/WebControls/TPagerButtonType.php
new file mode 100644
index 00000000..7e61a574
--- /dev/null
+++ b/framework/Web/UI/WebControls/TPagerButtonType.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * TPager class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TPagerButtonType class.
+ * TPagerButtonType defines the enumerable type for the possible types of pager buttons.
+ *
+ * The following enumerable values are defined:
+ * - LinkButton: link buttons
+ * - PushButton: form submit buttons
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TPagerButtonType extends TEnumerable
+{
+ const LinkButton='LinkButton';
+ const PushButton='PushButton';
+ const ImageButton='ImageButton';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TPagerMode.php b/framework/Web/UI/WebControls/TPagerMode.php
new file mode 100644
index 00000000..ed52f668
--- /dev/null
+++ b/framework/Web/UI/WebControls/TPagerMode.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * TPager class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TPagerMode class.
+ * TPagerMode defines the enumerable type for the possible modes that a {@link TPager} control can take.
+ *
+ * The following enumerable values are defined:
+ * - NextPrev: pager buttons are displayed as next and previous pages
+ * - Numeric: pager buttons are displayed as numeric page numbers
+ * - DropDownList: a dropdown list is used to select pages
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TPagerMode extends TEnumerable
+{
+ const NextPrev='NextPrev';
+ const Numeric='Numeric';
+ const DropDownList='DropDownList';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TPagerPageChangedEventParameter.php b/framework/Web/UI/WebControls/TPagerPageChangedEventParameter.php
new file mode 100644
index 00000000..d9f187e0
--- /dev/null
+++ b/framework/Web/UI/WebControls/TPagerPageChangedEventParameter.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * TPager class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TPagerPageChangedEventParameter class
+ *
+ * TPagerPageChangedEventParameter encapsulates the parameter data for
+ * {@link TPager::onPageIndexChanged PageIndexChanged} event of {@link TPager} controls.
+ *
+ * The {@link getCommandSource CommandSource} property refers to the control
+ * that originally raises the OnCommand event, while {@link getNewPageIndex NewPageIndex}
+ * returns the new page index carried with the page command.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.2
+ */
+class TPagerPageChangedEventParameter extends TEventParameter
+{
+ /**
+ * @var integer new page index
+ */
+ private $_newIndex;
+ /**
+ * @var TControl original event sender
+ */
+ private $_source=null;
+
+ /**
+ * Constructor.
+ * @param TControl the control originally raises the <b>OnCommand</b> event.
+ * @param integer new page index
+ */
+ public function __construct($source,$newPageIndex)
+ {
+ $this->_source=$source;
+ $this->_newIndex=$newPageIndex;
+ }
+
+ /**
+ * @return TControl the control originally raises the <b>OnCommand</b> event.
+ */
+ public function getCommandSource()
+ {
+ return $this->_source;
+ }
+
+ /**
+ * @return integer new page index
+ */
+ public function getNewPageIndex()
+ {
+ return $this->_newIndex;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TPanelStyle.php b/framework/Web/UI/WebControls/TPanelStyle.php
index d1dfe62e..a31e2aee 100644
--- a/framework/Web/UI/WebControls/TPanelStyle.php
+++ b/framework/Web/UI/WebControls/TPanelStyle.php
@@ -225,50 +225,4 @@ class TPanelStyle extends TStyle
$this->_wrap=$style->_wrap;
}
}
-}
-
-/**
- * TContentDirection class.
- * TContentDirection defines the enumerable type for the possible directions that a panel can be at.
- *
- * The following enumerable values are defined:
- * - NotSet: the direction is not specified
- * - LeftToRight: content in a panel is left to right
- * - RightToLeft: content in a panel is right to left
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TContentDirection extends TEnumerable
-{
- const NotSet='NotSet';
- const LeftToRight='LeftToRight';
- const RightToLeft='RightToLeft';
-}
-
-/**
- * TScrollBars class.
- * TScrollBars defines the enumerable type for the possible scroll bar mode
- * that a {@link TPanel} control could use.
- *
- * The following enumerable values are defined:
- * - None: no scroll bars.
- * - Auto: scroll bars automatically appeared when needed.
- * - Both: show both horizontal and vertical scroll bars all the time.
- * - Horizontal: horizontal scroll bar only
- * - Vertical: vertical scroll bar only
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TScrollBars extends TEnumerable
-{
- const None='None';
- const Auto='Auto';
- const Both='Both';
- const Horizontal='Horizontal';
- const Vertical='Vertical';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TPolygonHotSpot.php b/framework/Web/UI/WebControls/TPolygonHotSpot.php
new file mode 100644
index 00000000..0c22bc71
--- /dev/null
+++ b/framework/Web/UI/WebControls/TPolygonHotSpot.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * TImageMap and related class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * Class TPolygonHotSpot.
+ *
+ * TPolygonHotSpot defines a polygon hot spot region in a {@link
+ * TImageMap} control.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TPolygonHotSpot extends THotSpot
+{
+ /**
+ * @return string shape of this hotspot.
+ */
+ public function getShape()
+ {
+ return 'poly';
+ }
+
+ /**
+ * @return string coordinates of the vertices defining the polygon.
+ * Coordinates are concatenated together with comma ','. Each pair
+ * represents (x,y) of a vertex.
+ */
+ public function getCoordinates()
+ {
+ return $this->getViewState('Coordinates','');
+ }
+
+ /**
+ * @param string coordinates of the vertices defining the polygon.
+ * Coordinates are concatenated together with comma ','. Each pair
+ * represents (x,y) of a vertex.
+ */
+ public function setCoordinates($value)
+ {
+ $this->setViewState('Coordinates',$value,'');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRadioButtonItem.php b/framework/Web/UI/WebControls/TRadioButtonItem.php
new file mode 100644
index 00000000..14ad7ec6
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRadioButtonItem.php
@@ -0,0 +1,19 @@
+<?php
+/**
+ * TRadioButtonList class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+class TRadioButtonItem extends TRadioButton {
+ /**
+ * Override client implementation to avoid emitting the javascript
+ */
+ protected function renderClientControlScript($writer)
+ {
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRadioButtonList.php b/framework/Web/UI/WebControls/TRadioButtonList.php
index 3afe3ec2..97ea6031 100644
--- a/framework/Web/UI/WebControls/TRadioButtonList.php
+++ b/framework/Web/UI/WebControls/TRadioButtonList.php
@@ -95,13 +95,4 @@ class TRadioButtonList extends TCheckBoxList
{
return 'Prado.WebUI.TRadioButtonList';
}
-}
-
-class TRadioButtonItem extends TRadioButton {
- /**
- * Override client implementation to avoid emitting the javascript
- */
- protected function renderClientControlScript($writer)
- {
- }
-}
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRangeValidationDataType.php b/framework/Web/UI/WebControls/TRangeValidationDataType.php
new file mode 100644
index 00000000..d876110c
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRangeValidationDataType.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TRangeValidator class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TRangeValidationDataType class.
+ * TRangeValidationDataType defines the enumerable type for the possible data types that
+ * a range validator can validate upon.
+ *
+ * The following enumerable values are defined:
+ * - Integer
+ * - Float
+ * - Date
+ * - String
+ * - StringLength
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TRangeValidationDataType extends TValidationDataType
+{
+ const StringLength='StringLength';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRangeValidator.php b/framework/Web/UI/WebControls/TRangeValidator.php
index 8a3c0e35..1fa4b49e 100644
--- a/framework/Web/UI/WebControls/TRangeValidator.php
+++ b/framework/Web/UI/WebControls/TRangeValidator.php
@@ -332,26 +332,4 @@ class TRangeValidator extends TBaseValidator
$options['DateFormat']=$dateFormat;
return $options;
}
-}
-
-
-/**
- * TRangeValidationDataType class.
- * TRangeValidationDataType defines the enumerable type for the possible data types that
- * a range validator can validate upon.
- *
- * The following enumerable values are defined:
- * - Integer
- * - Float
- * - Date
- * - String
- * - StringLength
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TRangeValidationDataType extends TValidationDataType
-{
- const StringLength='StringLength';
-}
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TReadOnlyDataSource.php b/framework/Web/UI/WebControls/TReadOnlyDataSource.php
new file mode 100644
index 00000000..ead471ab
--- /dev/null
+++ b/framework/Web/UI/WebControls/TReadOnlyDataSource.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * IDataSource, TDataSourceControl, TReadOnlyDataSource class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TDataSourceControl class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TReadOnlyDataSource extends TDataSourceControl
+{
+ private $_dataSource;
+ private $_dataMember;
+
+ public function __construct($dataSource,$dataMember)
+ {
+ if(!is_array($dataSource) && !($dataSource instanceof IDataSource) && !($dataSource instanceof Traversable))
+ throw new TInvalidDataTypeException('readonlydatasource_datasource_invalid');
+ $this->_dataSource=$dataSource;
+ $this->_dataMember=$dataMember;
+ }
+
+ public function getView($viewName)
+ {
+ if($this->_dataSource instanceof IDataSource)
+ return $this->_dataSource->getView($viewName);
+ else
+ return new TReadOnlyDataSourceView($this,$this->_dataMember,$this->_dataSource);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TReadOnlyDataSourceView.php b/framework/Web/UI/WebControls/TReadOnlyDataSourceView.php
new file mode 100644
index 00000000..a6991941
--- /dev/null
+++ b/framework/Web/UI/WebControls/TReadOnlyDataSourceView.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * TDataSourceSelectParameters, TDataSourceView, TReadOnlyDataSourceView class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TReadOnlyDataSourceView class
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TReadOnlyDataSourceView extends TDataSourceView
+{
+ private $_dataSource=null;
+
+ public function __construct(IDataSource $owner,$viewName,$dataSource)
+ {
+ parent::__construct($owner,$viewName);
+ if($dataSource===null || is_array($dataSource))
+ $this->_dataSource=new TMap($dataSource);
+ else if($dataSource instanceof Traversable)
+ $this->_dataSource=$dataSource;
+ else
+ throw new TInvalidDataTypeException('readonlydatasourceview_datasource_invalid');
+ }
+
+ public function select($parameters)
+ {
+ return $this->_dataSource;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRectangleHotSpot.php b/framework/Web/UI/WebControls/TRectangleHotSpot.php
new file mode 100644
index 00000000..bca9f81c
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRectangleHotSpot.php
@@ -0,0 +1,103 @@
+<?php
+/**
+ * TImageMap and related class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * Class TRectangleHotSpot.
+ *
+ * TRectangleHotSpot defines a rectangle hot spot region in a {@link
+ * TImageMap} control.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TRectangleHotSpot extends THotSpot
+{
+ /**
+ * @return string shape of this hotspot.
+ */
+ public function getShape()
+ {
+ return 'rect';
+ }
+
+ /**
+ * @return string coordinates defining this hotspot shape
+ */
+ public function getCoordinates()
+ {
+ return $this->getLeft().','.$this->getTop().','.$this->getRight().','.$this->getBottom();
+ }
+
+ /**
+ * @return integer the Y coordinate of the bottom side of the rectangle HotSpot region. Defaults to 0.
+ */
+ public function getBottom()
+ {
+ return $this->getViewState('Bottom',0);
+ }
+
+ /**
+ * @param integer the Y coordinate of the bottom side of the rectangle HotSpot region.
+ */
+ public function setBottom($value)
+ {
+ $this->setViewState('Bottom',TPropertyValue::ensureInteger($value),0);
+ }
+
+ /**
+ * @return integer the X coordinate of the right side of the rectangle HotSpot region. Defaults to 0.
+ */
+ public function getLeft()
+ {
+ return $this->getViewState('Left',0);
+ }
+
+ /**
+ * @param integer the X coordinate of the right side of the rectangle HotSpot region.
+ */
+ public function setLeft($value)
+ {
+ $this->setViewState('Left',TPropertyValue::ensureInteger($value),0);
+ }
+
+ /**
+ * @return integer the X coordinate of the right side of the rectangle HotSpot region. Defaults to 0.
+ */
+ public function getRight()
+ {
+ return $this->getViewState('Right',0);
+ }
+
+ /**
+ * @param integer the X coordinate of the right side of the rectangle HotSpot region.
+ */
+ public function setRight($value)
+ {
+ $this->setViewState('Right',TPropertyValue::ensureInteger($value),0);
+ }
+
+ /**
+ * @return integer the Y coordinate of the top side of the rectangle HotSpot region. Defaults to 0.
+ */
+ public function getTop()
+ {
+ return $this->getViewState('Top',0);
+ }
+
+ /**
+ * @param integer the Y coordinate of the top side of the rectangle HotSpot region.
+ */
+ public function setTop($value)
+ {
+ $this->setViewState('Top',TPropertyValue::ensureInteger($value),0);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRepeatDirection.php b/framework/Web/UI/WebControls/TRepeatDirection.php
new file mode 100644
index 00000000..869e0af0
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRepeatDirection.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * IRepeatInfoUser, TRepeatInfo class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TRepeatDirection class.
+ * TRepeatDirection defines the enumerable type for the possible directions
+ * that repeated contents can repeat along
+ *
+ * The following enumerable values are defined:
+ * - Vertical
+ * - Horizontal
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TRepeatDirection extends TEnumerable
+{
+ const Vertical='Vertical';
+ const Horizontal='Horizontal';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRepeatInfo.php b/framework/Web/UI/WebControls/TRepeatInfo.php
index 7b65b3b3..058baa95 100644
--- a/framework/Web/UI/WebControls/TRepeatInfo.php
+++ b/framework/Web/UI/WebControls/TRepeatInfo.php
@@ -9,50 +9,6 @@
* @package System.Web.UI.WebControls
*/
-Prado::using('System.Web.UI.WebControls.TTable');
-
-/**
- * IRepeatInfoUser interface.
- * This interface must be implemented by classes who want to use {@link TRepeatInfo}.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-interface IRepeatInfoUser
-{
- /**
- * @return boolean whether the repeat user contains footer
- */
- public function getHasFooter();
- /**
- * @return boolean whether the repeat user contains header
- */
- public function getHasHeader();
- /**
- * @return boolean whether the repeat user contains separators
- */
- public function getHasSeparators();
- /**
- * @return integer number of items to be rendered (excluding header, footer and separators)
- */
- public function getItemCount();
- /**
- * @param string item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager)
- * @param integer zero-based index of the current rendering item.
- * @return TStyle CSS style used for rendering items (including header, footer and separators)
- */
- public function generateItemStyle($itemType,$index);
- /**
- * Renders an item.
- * @param THtmlWriter writer for the rendering purpose
- * @param TRepeatInfo repeat information
- * @param string item type
- * @param integer zero-based index of the item being rendered
- */
- public function renderItem($writer,$repeatInfo,$itemType,$index);
-}
-
/**
* TRepeatInfo class.
* TRepeatInfo represents repeat information for controls like {@link TCheckBoxList}.
@@ -510,46 +466,4 @@ class TRepeatInfo extends TComponent
$user->renderItem($writer,$this,'Footer',-1);
$writer->writeLine();
}
-}
-
-
-/**
- * TRepeatDirection class.
- * TRepeatDirection defines the enumerable type for the possible directions
- * that repeated contents can repeat along
- *
- * The following enumerable values are defined:
- * - Vertical
- * - Horizontal
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TRepeatDirection extends TEnumerable
-{
- const Vertical='Vertical';
- const Horizontal='Horizontal';
-}
-
-/**
- * TRepeatLayout class.
- * TRepeatLayout defines the enumerable type for the possible layouts
- * that repeated contents can take.
- *
- * The following enumerable values are defined:
- * - Table: the repeated contents are organized using an HTML table
- * - Flow: the repeated contents are organized using HTML spans and breaks
- * - Raw: the repeated contents are stacked together without any additional decorations
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TRepeatLayout extends TEnumerable
-{
- const Table='Table';
- const Flow='Flow';
- const Raw='Raw';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRepeatLayout.php b/framework/Web/UI/WebControls/TRepeatLayout.php
new file mode 100644
index 00000000..ee038008
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRepeatLayout.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * IRepeatInfoUser, TRepeatInfo class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TRepeatLayout class.
+ * TRepeatLayout defines the enumerable type for the possible layouts
+ * that repeated contents can take.
+ *
+ * The following enumerable values are defined:
+ * - Table: the repeated contents are organized using an HTML table
+ * - Flow: the repeated contents are organized using HTML spans and breaks
+ * - Raw: the repeated contents are stacked together without any additional decorations
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TRepeatLayout extends TEnumerable
+{
+ const Table='Table';
+ const Flow='Flow';
+ const Raw='Raw';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php
index a563a12d..16d3dda5 100644
--- a/framework/Web/UI/WebControls/TRepeater.php
+++ b/framework/Web/UI/WebControls/TRepeater.php
@@ -772,248 +772,4 @@ class TRepeater extends TDataBoundControl implements INamingContainer
{
return TDataFieldAccessor::getDataFieldValue($data,$field);
}
-}
-
-/**
- * TRepeaterItemEventParameter class
- *
- * TRepeaterItemEventParameter encapsulates the parameter data for
- * {@link TRepeater::onItemCreated ItemCreated} event of {@link TRepeater} controls.
- * The {@link getItem Item} property indicates the repeater item related with the event.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TRepeaterItemEventParameter extends TEventParameter
-{
- /**
- * The repeater item control responsible for the event.
- * @var TControl
- */
- private $_item=null;
-
- /**
- * Constructor.
- * @param TControl repeater item related with the corresponding event
- */
- public function __construct($item)
- {
- $this->_item=$item;
- }
-
- /**
- * @return TControl repeater item related with the corresponding event
- */
- public function getItem()
- {
- return $this->_item;
- }
-}
-
-/**
- * TRepeaterCommandEventParameter class
- *
- * TRepeaterCommandEventParameter encapsulates the parameter data for
- * {@link TRepeater::onItemCommand ItemCommand} event of {@link TRepeater} controls.
- *
- * The {@link getItem Item} property indicates the repeater item related with the event.
- * The {@link getCommandSource CommandSource} refers to the control that originally
- * raises the Command event.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TRepeaterCommandEventParameter extends TCommandEventParameter
-{
- /**
- * @var TControl the repeater item control responsible for the event.
- */
- private $_item=null;
- /**
- * @var TControl the control originally raises the <b>OnCommand</b> event.
- */
- private $_source=null;
-
- /**
- * Constructor.
- * @param TControl repeater item responsible for the event
- * @param TControl original event sender
- * @param TCommandEventParameter original event parameter
- */
- public function __construct($item,$source,TCommandEventParameter $param)
- {
- $this->_item=$item;
- $this->_source=$source;
- parent::__construct($param->getCommandName(),$param->getCommandParameter());
- }
-
- /**
- * @return TControl the repeater item control responsible for the event.
- */
- public function getItem()
- {
- return $this->_item;
- }
-
- /**
- * @return TControl the control originally raises the <b>OnCommand</b> event.
- */
- public function getCommandSource()
- {
- return $this->_source;
- }
-}
-
-/**
- * TRepeaterItem class
- *
- * A TRepeaterItem control represents an item in the {@link TRepeater} control,
- * such as heading section, footer section, or a data item.
- * The index and data value of the item can be accessed via {@link getItemIndex ItemIndex}>
- * and {@link getDataItem DataItem} properties, respectively. The type of the item
- * is given by {@link getItemType ItemType} property.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TRepeaterItem extends TControl implements INamingContainer, IItemDataRenderer
-{
- /**
- * index of the data item in the Items collection of repeater
- */
- private $_itemIndex;
- /**
- * type of the TRepeaterItem
- * @var TListItemType
- */
- private $_itemType;
- /**
- * data associated with this item
- * @var mixed
- */
- private $_data;
-
- /**
- * @return TListItemType item type
- */
- public function getItemType()
- {
- return $this->_itemType;
- }
-
- /**
- * @param TListItemType item type.
- */
- public function setItemType($value)
- {
- $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');
- }
-
- /**
- * Returns a value indicating the zero-based index of the item in the corresponding data control's item collection.
- * If the item is not in the collection (e.g. it is a header item), it returns -1.
- * @return integer zero-based index of the item.
- */
- public function getItemIndex()
- {
- return $this->_itemIndex;
- }
-
- /**
- * Sets the zero-based index for the item.
- * If the item is not in the item collection (e.g. it is a header item), -1 should be used.
- * @param integer zero-based index of the item.
- */
- public function setItemIndex($value)
- {
- $this->_itemIndex=TPropertyValue::ensureInteger($value);
- }
-
- /**
- * @return mixed data associated with the item
- * @since 3.1.0
- */
- public function getData()
- {
- return $this->_data;
- }
-
- /**
- * @param mixed data to be associated with the item
- * @since 3.1.0
- */
- public function setData($value)
- {
- $this->_data=$value;
- }
-
- /**
- * This property is deprecated since v3.1.0.
- * @return mixed data associated with the item
- * @deprecated deprecated since v3.1.0. Use {@link getData} instead.
- */
- public function getDataItem()
- {
- return $this->getData();
- }
-
- /**
- * This property is deprecated since v3.1.0.
- * @param mixed data to be associated with the item
- * @deprecated deprecated since version 3.1.0. Use {@link setData} instead.
- */
- public function setDataItem($value)
- {
- return $this->setData($value);
- }
-
- /**
- * This method overrides parent's implementation by wrapping event parameter
- * for <b>OnCommand</b> event with item information.
- * @param TControl the sender of the event
- * @param TEventParameter event parameter
- * @return boolean whether the event bubbling should stop here.
- */
- public function bubbleEvent($sender,$param)
- {
- if($param instanceof TCommandEventParameter)
- {
- $this->raiseBubbleEvent($this,new TRepeaterCommandEventParameter($this,$sender,$param));
- return true;
- }
- else
- return false;
- }
-}
-
-
-/**
- * TRepeaterItemCollection class.
- *
- * TRepeaterItemCollection represents a collection of repeater items.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TRepeaterItemCollection extends TList
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by inserting only objects that are descendant of {@link TControl}.
- * @param integer the speicified position.
- * @param TControl new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a control.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TControl)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('repeateritemcollection_item_invalid');
- }
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRepeaterCommandEventParameter.php b/framework/Web/UI/WebControls/TRepeaterCommandEventParameter.php
new file mode 100644
index 00000000..892bdd7d
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRepeaterCommandEventParameter.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * TRepeater class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TRepeaterCommandEventParameter class
+ *
+ * TRepeaterCommandEventParameter encapsulates the parameter data for
+ * {@link TRepeater::onItemCommand ItemCommand} event of {@link TRepeater} controls.
+ *
+ * The {@link getItem Item} property indicates the repeater item related with the event.
+ * The {@link getCommandSource CommandSource} refers to the control that originally
+ * raises the Command event.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TRepeaterCommandEventParameter extends TCommandEventParameter
+{
+ /**
+ * @var TControl the repeater item control responsible for the event.
+ */
+ private $_item=null;
+ /**
+ * @var TControl the control originally raises the <b>OnCommand</b> event.
+ */
+ private $_source=null;
+
+ /**
+ * Constructor.
+ * @param TControl repeater item responsible for the event
+ * @param TControl original event sender
+ * @param TCommandEventParameter original event parameter
+ */
+ public function __construct($item,$source,TCommandEventParameter $param)
+ {
+ $this->_item=$item;
+ $this->_source=$source;
+ parent::__construct($param->getCommandName(),$param->getCommandParameter());
+ }
+
+ /**
+ * @return TControl the repeater item control responsible for the event.
+ */
+ public function getItem()
+ {
+ return $this->_item;
+ }
+
+ /**
+ * @return TControl the control originally raises the <b>OnCommand</b> event.
+ */
+ public function getCommandSource()
+ {
+ return $this->_source;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRepeaterItem.php b/framework/Web/UI/WebControls/TRepeaterItem.php
new file mode 100644
index 00000000..fbf17981
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRepeaterItem.php
@@ -0,0 +1,133 @@
+<?php
+/**
+ * TRepeater class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TRepeaterItem class
+ *
+ * A TRepeaterItem control represents an item in the {@link TRepeater} control,
+ * such as heading section, footer section, or a data item.
+ * The index and data value of the item can be accessed via {@link getItemIndex ItemIndex}>
+ * and {@link getDataItem DataItem} properties, respectively. The type of the item
+ * is given by {@link getItemType ItemType} property.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TRepeaterItem extends TControl implements INamingContainer, IItemDataRenderer
+{
+ /**
+ * index of the data item in the Items collection of repeater
+ */
+ private $_itemIndex;
+ /**
+ * type of the TRepeaterItem
+ * @var TListItemType
+ */
+ private $_itemType;
+ /**
+ * data associated with this item
+ * @var mixed
+ */
+ private $_data;
+
+ /**
+ * @return TListItemType item type
+ */
+ public function getItemType()
+ {
+ return $this->_itemType;
+ }
+
+ /**
+ * @param TListItemType item type.
+ */
+ public function setItemType($value)
+ {
+ $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType');
+ }
+
+ /**
+ * Returns a value indicating the zero-based index of the item in the corresponding data control's item collection.
+ * If the item is not in the collection (e.g. it is a header item), it returns -1.
+ * @return integer zero-based index of the item.
+ */
+ public function getItemIndex()
+ {
+ return $this->_itemIndex;
+ }
+
+ /**
+ * Sets the zero-based index for the item.
+ * If the item is not in the item collection (e.g. it is a header item), -1 should be used.
+ * @param integer zero-based index of the item.
+ */
+ public function setItemIndex($value)
+ {
+ $this->_itemIndex=TPropertyValue::ensureInteger($value);
+ }
+
+ /**
+ * @return mixed data associated with the item
+ * @since 3.1.0
+ */
+ public function getData()
+ {
+ return $this->_data;
+ }
+
+ /**
+ * @param mixed data to be associated with the item
+ * @since 3.1.0
+ */
+ public function setData($value)
+ {
+ $this->_data=$value;
+ }
+
+ /**
+ * This property is deprecated since v3.1.0.
+ * @return mixed data associated with the item
+ * @deprecated deprecated since v3.1.0. Use {@link getData} instead.
+ */
+ public function getDataItem()
+ {
+ return $this->getData();
+ }
+
+ /**
+ * This property is deprecated since v3.1.0.
+ * @param mixed data to be associated with the item
+ * @deprecated deprecated since version 3.1.0. Use {@link setData} instead.
+ */
+ public function setDataItem($value)
+ {
+ return $this->setData($value);
+ }
+
+ /**
+ * This method overrides parent's implementation by wrapping event parameter
+ * for <b>OnCommand</b> event with item information.
+ * @param TControl the sender of the event
+ * @param TEventParameter event parameter
+ * @return boolean whether the event bubbling should stop here.
+ */
+ public function bubbleEvent($sender,$param)
+ {
+ if($param instanceof TCommandEventParameter)
+ {
+ $this->raiseBubbleEvent($this,new TRepeaterCommandEventParameter($this,$sender,$param));
+ return true;
+ }
+ else
+ return false;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRepeaterItemCollection.php b/framework/Web/UI/WebControls/TRepeaterItemCollection.php
new file mode 100644
index 00000000..25584818
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRepeaterItemCollection.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * TRepeater class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TRepeaterItemCollection class.
+ *
+ * TRepeaterItemCollection represents a collection of repeater items.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TRepeaterItemCollection extends TList
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by inserting only objects that are descendant of {@link TControl}.
+ * @param integer the speicified position.
+ * @param TControl new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a control.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TControl)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('repeateritemcollection_item_invalid');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TRepeaterItemEventParameter.php b/framework/Web/UI/WebControls/TRepeaterItemEventParameter.php
new file mode 100644
index 00000000..d95c6767
--- /dev/null
+++ b/framework/Web/UI/WebControls/TRepeaterItemEventParameter.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * TRepeater class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TRepeaterItemEventParameter class
+ *
+ * TRepeaterItemEventParameter encapsulates the parameter data for
+ * {@link TRepeater::onItemCreated ItemCreated} event of {@link TRepeater} controls.
+ * The {@link getItem Item} property indicates the repeater item related with the event.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TRepeaterItemEventParameter extends TEventParameter
+{
+ /**
+ * The repeater item control responsible for the event.
+ * @var TControl
+ */
+ private $_item=null;
+
+ /**
+ * Constructor.
+ * @param TControl repeater item related with the corresponding event
+ */
+ public function __construct($item)
+ {
+ $this->_item=$item;
+ }
+
+ /**
+ * @return TControl repeater item related with the corresponding event
+ */
+ public function getItem()
+ {
+ return $this->_item;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TScrollBars.php b/framework/Web/UI/WebControls/TScrollBars.php
new file mode 100644
index 00000000..a8e29356
--- /dev/null
+++ b/framework/Web/UI/WebControls/TScrollBars.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * TPanelStyle class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TScrollBars class.
+ * TScrollBars defines the enumerable type for the possible scroll bar mode
+ * that a {@link TPanel} control could use.
+ *
+ * The following enumerable values are defined:
+ * - None: no scroll bars.
+ * - Auto: scroll bars automatically appeared when needed.
+ * - Both: show both horizontal and vertical scroll bars all the time.
+ * - Horizontal: horizontal scroll bar only
+ * - Vertical: vertical scroll bar only
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TScrollBars extends TEnumerable
+{
+ const None='None';
+ const Auto='Auto';
+ const Both='Both';
+ const Horizontal='Horizontal';
+ const Vertical='Vertical';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TServerValidateEventParameter.php b/framework/Web/UI/WebControls/TServerValidateEventParameter.php
new file mode 100644
index 00000000..2438dbdf
--- /dev/null
+++ b/framework/Web/UI/WebControls/TServerValidateEventParameter.php
@@ -0,0 +1,69 @@
+<?php
+/**
+ * TCustomValidator class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TServerValidateEventParameter class
+ *
+ * TServerValidateEventParameter encapsulates the parameter data for
+ * <b>OnServerValidate</b> event of TCustomValidator components.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TServerValidateEventParameter extends TEventParameter
+{
+ /**
+ * the value to be validated
+ * @var string
+ */
+ private $_value='';
+ /**
+ * whether the value is valid
+ * @var boolean
+ */
+ private $_isValid=true;
+
+ /**
+ * Constructor.
+ * @param string property value to be validated
+ * @param boolean whether the value is valid
+ */
+ public function __construct($value,$isValid)
+ {
+ $this->_value=$value;
+ $this->setIsValid($isValid);
+ }
+
+ /**
+ * @return string value to be validated
+ */
+ public function getValue()
+ {
+ return $this->_value;
+ }
+
+ /**
+ * @return boolean whether the value is valid
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+
+ /**
+ * @param boolean whether the value is valid
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TSlider.php b/framework/Web/UI/WebControls/TSlider.php
index e9573ea9..ce8e3bfd 100644
--- a/framework/Web/UI/WebControls/TSlider.php
+++ b/framework/Web/UI/WebControls/TSlider.php
@@ -491,80 +491,4 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
$options = array_merge($options,$this->_clientScript->getOptions()->toArray());
return $options;
}
-}
-
-/**
- * TSliderClientScript class.
- *
- * Client-side slider events {@link setOnChange OnChange} and {@line setOnMove OnMove}
- * can be modified through the {@link TSlider:: getClientSide ClientSide}
- * property of a slider.
- *
- * The current value of the slider can be get in the 'value' js variable
- *
- * The <tt>OnMove</tt> event is raised when the slider moves
- * The <tt>OnChange</tt> event is raised when the slider value is changed (or at the end of a move)
- *
- * @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.1.1
- */
-class TSliderClientScript extends TClientSideOptions
-{
- /**
- * Javascript code to execute when the slider value is changed.
- * @param string javascript code
- */
- public function setOnChange($javascript)
- {
- $code=TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
- $this->setFunction('onChange', $code);
- }
-
- /**
- * @return string javascript code to execute when the slider value is changed.
- */
- public function getOnChange()
- {
- return $this->getOption('onChange');
- }
-
- /* Javascript code to execute when the slider moves.
- * @param string javascript code
- */
- public function setOnSlide($javascript)
- {
- $code=TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
- $this->setFunction('onSlide', $code);
- }
-
- /**
- * @return string javascript code to execute when the slider moves.
- */
- public function getOnSlide()
- {
- return $this->getOption('onSlide');
- }
-}
-
-
-/**
- * TSliderDirection class.
- *
- * TSliderDirection defines the enumerable type for the possible direction that can be used in a {@link TSlider}
- *
- * The following enumerable values are defined :
- * - Horizontal : Horizontal slider
- * - Vertical : Vertical slider
- *
- * @author Christophe Boulain <Christophe.Boulain@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.1.1
- */
-class TSliderDirection extends TEnumerable
-{
- const Horizontal='Horizontal';
- const Vertical='Vertical';
-}
-
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TSliderClientScript.php b/framework/Web/UI/WebControls/TSliderClientScript.php
new file mode 100644
index 00000000..f50a31d3
--- /dev/null
+++ b/framework/Web/UI/WebControls/TSliderClientScript.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * TSlider class file.
+ *
+ * @author Christophe Boulain <Christophe.Boulain@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ * @since 3.1.1
+ */
+
+/**
+ * TSliderClientScript class.
+ *
+ * Client-side slider events {@link setOnChange OnChange} and {@line setOnMove OnMove}
+ * can be modified through the {@link TSlider:: getClientSide ClientSide}
+ * property of a slider.
+ *
+ * The current value of the slider can be get in the 'value' js variable
+ *
+ * The <tt>OnMove</tt> event is raised when the slider moves
+ * The <tt>OnChange</tt> event is raised when the slider value is changed (or at the end of a move)
+ *
+ * @author Christophe Boulain <Christophe.Boulain@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.1.1
+ */
+class TSliderClientScript extends TClientSideOptions
+{
+ /**
+ * Javascript code to execute when the slider value is changed.
+ * @param string javascript code
+ */
+ public function setOnChange($javascript)
+ {
+ $code=TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
+ $this->setFunction('onChange', $code);
+ }
+
+ /**
+ * @return string javascript code to execute when the slider value is changed.
+ */
+ public function getOnChange()
+ {
+ return $this->getOption('onChange');
+ }
+
+ /* Javascript code to execute when the slider moves.
+ * @param string javascript code
+ */
+ public function setOnSlide($javascript)
+ {
+ $code=TJavascript::quoteJsLiteral("function (value) { {$javascript} }");
+ $this->setFunction('onSlide', $code);
+ }
+
+ /**
+ * @return string javascript code to execute when the slider moves.
+ */
+ public function getOnSlide()
+ {
+ return $this->getOption('onSlide');
+ }
+}
diff --git a/framework/Web/UI/WebControls/TSliderDirection.php b/framework/Web/UI/WebControls/TSliderDirection.php
new file mode 100644
index 00000000..5e131dde
--- /dev/null
+++ b/framework/Web/UI/WebControls/TSliderDirection.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * TSlider class file.
+ *
+ * @author Christophe Boulain <Christophe.Boulain@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ * @since 3.1.1
+ */
+
+/**
+ * TSliderDirection class.
+ *
+ * TSliderDirection defines the enumerable type for the possible direction that can be used in a {@link TSlider}
+ *
+ * The following enumerable values are defined :
+ * - Horizontal : Horizontal slider
+ * - Vertical : Vertical slider
+ *
+ * @author Christophe Boulain <Christophe.Boulain@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.1.1
+ */
+class TSliderDirection extends TEnumerable
+{
+ const Horizontal='Horizontal';
+ const Vertical='Vertical';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TStyle.php b/framework/Web/UI/WebControls/TStyle.php
index f30b3461..17b7e9a8 100644
--- a/framework/Web/UI/WebControls/TStyle.php
+++ b/framework/Web/UI/WebControls/TStyle.php
@@ -403,483 +403,4 @@ class TStyle extends TComponent
{
return $this->_fields;
}
-}
-
-/**
- * TDisplayStyle defines the enumerable type for the possible styles
- * that a web control can display.
- *
- * The following enumerable values are defined:
- * - None: the control is not displayed and not included in the layout.
- * - Dynamic: the control is displayed and included in the layout, the layout flow is dependent on the control (equivalent to display:'' in css).
- * - Fixed: Similar to Dynamic with CSS "visibility" set "shown".
- * - Hidden: the control is not displayed and is included in the layout.
- *
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @package System.Web.UI.WebControls
- * @since 3.1
- */
-class TDisplayStyle extends TEnumerable
-{
- const None='None';
- const Dynamic='Dynamic';
- const Fixed='Fixed';
- const Hidden='Hidden';
-}
-
-/**
- * TTableStyle class.
- * TTableStyle represents the CSS style specific for HTML table.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TTableStyle extends TStyle
-{
- /**
- * @var TVerticalAlign the URL of the background image for the table
- */
- private $_backImageUrl=null;
- /**
- * @var THorizontalAlign horizontal alignment of the contents within the table
- */
- private $_horizontalAlign=null;
- /**
- * @var integer cellpadding of the table
- */
- private $_cellPadding=null;
- /**
- * @var integer cellspacing of the table
- */
- private $_cellSpacing=null;
- /**
- * @var TTableGridLines grid line setting of the table
- */
- private $_gridLines=null;
- /**
- * @var boolean whether the table border should be collapsed
- */
- private $_borderCollapse=null;
-
- /**
- * Sets the style attributes to default values.
- * This method overrides the parent implementation by
- * resetting additional TTableStyle specific attributes.
- */
- public function reset()
- {
- $this->_backImageUrl=null;
- $this->_horizontalAlign=null;
- $this->_cellPadding=null;
- $this->_cellSpacing=null;
- $this->_gridLines=null;
- $this->_borderCollapse=null;
- }
-
- /**
- * Copies the fields in a new style to this style.
- * If a style field is set in the new style, the corresponding field
- * in this style will be overwritten.
- * @param TStyle the new style
- */
- public function copyFrom($style)
- {
- parent::copyFrom($style);
- if($style instanceof TTableStyle)
- {
- if($style->_backImageUrl!==null)
- $this->_backImageUrl=$style->_backImageUrl;
- if($style->_horizontalAlign!==null)
- $this->_horizontalAlign=$style->_horizontalAlign;
- if($style->_cellPadding!==null)
- $this->_cellPadding=$style->_cellPadding;
- if($style->_cellSpacing!==null)
- $this->_cellSpacing=$style->_cellSpacing;
- if($style->_gridLines!==null)
- $this->_gridLines=$style->_gridLines;
- if($style->_borderCollapse!==null)
- $this->_borderCollapse=$style->_borderCollapse;
- }
- }
-
- /**
- * Merges the style with a new one.
- * If a style field is not set in this style, it will be overwritten by
- * the new one.
- * @param TStyle the new style
- */
- public function mergeWith($style)
- {
- parent::mergeWith($style);
- if($style instanceof TTableStyle)
- {
- if($this->_backImageUrl===null && $style->_backImageUrl!==null)
- $this->_backImageUrl=$style->_backImageUrl;
- if($this->_horizontalAlign===null && $style->_horizontalAlign!==null)
- $this->_horizontalAlign=$style->_horizontalAlign;
- if($this->_cellPadding===null && $style->_cellPadding!==null)
- $this->_cellPadding=$style->_cellPadding;
- if($this->_cellSpacing===null && $style->_cellSpacing!==null)
- $this->_cellSpacing=$style->_cellSpacing;
- if($this->_gridLines===null && $style->_gridLines!==null)
- $this->_gridLines=$style->_gridLines;
- if($this->_borderCollapse===null && $style->_borderCollapse!==null)
- $this->_borderCollapse=$style->_borderCollapse;
- }
- }
-
-
- /**
- * Adds attributes related to CSS styles to renderer.
- * This method overrides the parent implementation.
- * @param THtmlWriter the writer used for the rendering purpose
- */
- public function addAttributesToRender($writer)
- {
- if(($url=trim($this->getBackImageUrl()))!=='')
- $writer->addStyleAttribute('background-image','url('.$url.')');
-
- if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet)
- $writer->addStyleAttribute('text-align',strtolower($horizontalAlign));
-
- if(($cellPadding=$this->getCellPadding())>=0)
- $writer->addAttribute('cellpadding',"$cellPadding");
-
- if(($cellSpacing=$this->getCellSpacing())>=0)
- $writer->addAttribute('cellspacing',"$cellSpacing");
-
- if($this->getBorderCollapse())
- $writer->addStyleAttribute('border-collapse','collapse');
-
- switch($this->getGridLines())
- {
- case TTableGridLines::Horizontal : $writer->addAttribute('rules','rows'); break;
- case TTableGridLines::Vertical : $writer->addAttribute('rules','cols'); break;
- case TTableGridLines::Both : $writer->addAttribute('rules','all'); break;
- }
-
- parent::addAttributesToRender($writer);
- }
-
- /**
- * @return string the URL of the background image for the table
- */
- public function getBackImageUrl()
- {
- return $this->_backImageUrl===null?'':$this->_backImageUrl;
- }
-
- /**
- * Sets the URL of the background image for the table
- * @param string the URL
- */
- public function setBackImageUrl($value)
- {
- $this->_backImageUrl=$value;
- }
-
- /**
- * @return THorizontalAlign the horizontal alignment of the contents within the table, defaults to THorizontalAlign::NotSet.
- */
- public function getHorizontalAlign()
- {
- return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign;
- }
-
- /**
- * Sets the horizontal alignment of the contents within the table.
- * @param THorizontalAlign the horizontal alignment
- */
- public function setHorizontalAlign($value)
- {
- $this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign');
- }
-
- /**
- * @return integer cellpadding of the table. Defaults to -1, meaning not set.
- */
- public function getCellPadding()
- {
- return $this->_cellPadding===null?-1:$this->_cellPadding;
- }
-
- /**
- * @param integer cellpadding of the table. A value equal to -1 clears up the setting.
- * @throws TInvalidDataValueException if the value is less than -1.
- */
- public function setCellPadding($value)
- {
- if(($this->_cellPadding=TPropertyValue::ensureInteger($value))<-1)
- throw new TInvalidDataValueException('tablestyle_cellpadding_invalid');
- }
-
- /**
- * @return integer cellspacing of the table. Defaults to -1, meaning not set.
- */
- public function getCellSpacing()
- {
- return $this->_cellSpacing===null?-1:$this->_cellSpacing;
- }
-
- /**
- * @param integer cellspacing of the table. A value equal to -1 clears up the setting.
- * @throws TInvalidDataValueException if the value is less than -1.
- */
- public function setCellSpacing($value)
- {
- if(($this->_cellSpacing=TPropertyValue::ensureInteger($value))<-1)
- throw new TInvalidDataValueException('tablestyle_cellspacing_invalid');
- }
-
- /**
- * @return TTableGridLines the grid line setting of the table. Defaults to TTableGridLines::None.
- */
- public function getGridLines()
- {
- return $this->_gridLines===null?TTableGridLines::None:$this->_gridLines;
- }
-
- /**
- * Sets the grid line style of the table.
- * @param TTableGridLines the grid line setting of the table
- */
- public function setGridLines($value)
- {
- $this->_gridLines=TPropertyValue::ensureEnum($value,'TTableGridLines');
- }
-
-
- /**
- * @return boolean whether the table borders should be collapsed. Defaults to false.
- */
- public function getBorderCollapse()
- {
- return $this->_borderCollapse===null?false:$this->_borderCollapse;
- }
-
- /**
- * @param boolean whether the table borders should be collapsed.
- */
- public function setBorderCollapse($value)
- {
- $this->_borderCollapse=TPropertyValue::ensureBoolean($value);
- }
-}
-
-/**
- * TTableItemStyle class.
- * TTableItemStyle represents the CSS style specific for HTML table item.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TTableItemStyle extends TStyle
-{
- /**
- * @var THorizontalAlign horizontal alignment of the contents within the table item
- */
- private $_horizontalAlign=null;
- /**
- * @var TVerticalAlign vertical alignment of the contents within the table item
- */
- private $_verticalAlign=null;
- /**
- * @var boolean whether the content wraps within the table item
- */
- private $_wrap=null;
-
- /**
- * Sets the style attributes to default values.
- * This method overrides the parent implementation by
- * resetting additional TTableItemStyle specific attributes.
- */
- public function reset()
- {
- parent::reset();
- $this->_verticalAlign=null;
- $this->_horizontalAlign=null;
- $this->_wrap=null;
- }
-
- /**
- * Copies the fields in a new style to this style.
- * If a style field is set in the new style, the corresponding field
- * in this style will be overwritten.
- * @param TStyle the new style
- */
- public function copyFrom($style)
- {
- parent::copyFrom($style);
- if($style instanceof TTableItemStyle)
- {
- if($this->_verticalAlign===null && $style->_verticalAlign!==null)
- $this->_verticalAlign=$style->_verticalAlign;
- if($this->_horizontalAlign===null && $style->_horizontalAlign!==null)
- $this->_horizontalAlign=$style->_horizontalAlign;
- if($this->_wrap===null && $style->_wrap!==null)
- $this->_wrap=$style->_wrap;
- }
- }
-
- /**
- * Merges the style with a new one.
- * If a style field is not set in this style, it will be overwritten by
- * the new one.
- * @param TStyle the new style
- */
- public function mergeWith($style)
- {
- parent::mergeWith($style);
- if($style instanceof TTableItemStyle)
- {
- if($style->_verticalAlign!==null)
- $this->_verticalAlign=$style->_verticalAlign;
- if($style->_horizontalAlign!==null)
- $this->_horizontalAlign=$style->_horizontalAlign;
- if($style->_wrap!==null)
- $this->_wrap=$style->_wrap;
- }
- }
-
- /**
- * Adds attributes related to CSS styles to renderer.
- * This method overrides the parent implementation.
- * @param THtmlWriter the writer used for the rendering purpose
- */
- public function addAttributesToRender($writer)
- {
- if(!$this->getWrap())
- $writer->addStyleAttribute('white-space','nowrap');
-
- if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet)
- $writer->addAttribute('align',strtolower($horizontalAlign));
-
- if(($verticalAlign=$this->getVerticalAlign())!==TVerticalAlign::NotSet)
- $writer->addAttribute('valign',strtolower($verticalAlign));
-
- parent::addAttributesToRender($writer);
- }
-
- /**
- * @return THorizontalAlign the horizontal alignment of the contents within the table item, defaults to THorizontalAlign::NotSet.
- */
- public function getHorizontalAlign()
- {
- return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign;
- }
-
- /**
- * Sets the horizontal alignment of the contents within the table item.
- * @param THorizontalAlign the horizontal alignment
- */
- public function setHorizontalAlign($value)
- {
- $this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign');
- }
-
- /**
- * @return TVerticalAlign the vertical alignment of the contents within the table item, defaults to TVerticalAlign::NotSet.
- */
- public function getVerticalAlign()
- {
- return $this->_verticalAlign===null?TVerticalAlign::NotSet:$this->_verticalAlign;
- }
-
- /**
- * Sets the vertical alignment of the contents within the table item.
- * @param TVerticalAlign the horizontal alignment
- */
- public function setVerticalAlign($value)
- {
- $this->_verticalAlign=TPropertyValue::ensureEnum($value,'TVerticalAlign');
- }
-
- /**
- * @return boolean whether the content wraps within the table item. Defaults to true.
- */
- public function getWrap()
- {
- return $this->_wrap===null?true:$this->_wrap;
- }
-
- /**
- * Sets the value indicating whether the content wraps within the table item.
- * @param boolean whether the content wraps within the panel.
- */
- public function setWrap($value)
- {
- $this->_wrap=TPropertyValue::ensureBoolean($value);
- }
-}
-
-/**
- * THorizontalAlign class.
- * THorizontalAlign defines the enumerable type for the possible horizontal alignments in a CSS style.
- *
- * The following enumerable values are defined:
- * - NotSet: the alignment is not specified.
- * - Left: left aligned
- * - Right: right aligned
- * - Center: center aligned
- * - Justify: the begin and end are justified
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class THorizontalAlign extends TEnumerable
-{
- const NotSet='NotSet';
- const Left='Left';
- const Right='Right';
- const Center='Center';
- const Justify='Justify';
-}
-
-/**
- * TVerticalAlign class.
- * TVerticalAlign defines the enumerable type for the possible vertical alignments in a CSS style.
- *
- * The following enumerable values are defined:
- * - NotSet: the alignment is not specified.
- * - Top: top aligned
- * - Bottom: bottom aligned
- * - Middle: middle aligned
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TVerticalAlign extends TEnumerable
-{
- const NotSet='NotSet';
- const Top='Top';
- const Bottom='Bottom';
- const Middle='Middle';
-}
-
-
-/**
- * TTableGridLines class.
- * TTableGridLines defines the enumerable type for the possible grid line types of an HTML table.
- *
- * The following enumerable values are defined:
- * - None: no grid lines
- * - Horizontal: horizontal grid lines only
- * - Vertical: vertical grid lines only
- * - Both: both horizontal and vertical grid lines are shown
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TTableGridLines extends TEnumerable
-{
- const None='None';
- const Horizontal='Horizontal';
- const Vertical='Vertical';
- const Both='Both';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTabPanel.php b/framework/Web/UI/WebControls/TTabPanel.php
index 8f1564db..5b545025 100644
--- a/framework/Web/UI/WebControls/TTabPanel.php
+++ b/framework/Web/UI/WebControls/TTabPanel.php
@@ -518,211 +518,4 @@ class TTabPanel extends TWebControl implements IPostBackDataHandler
}
}
}
-}
-
-/**
- * TTabView class.
- *
- * TTabView represents a view in a {@link TTabPanel} control.
- *
- * The content in a TTabView can be specified by the {@link setText Text} property
- * or its child controls. In template syntax, the latter means enclosing the content
- * within the TTabView component element. If both are set, {@link getText Text} takes precedence.
- *
- * Each TTabView is associated with a tab in the tab bar of the TTabPanel control.
- * The tab caption is specified by {@link setCaption Caption}. If {@link setNavigateUrl NavigateUrl}
- * is set, the tab will contain a hyperlink pointing to the specified URL. In this case,
- * clicking on the tab will redirect the browser to the specified URL.
- *
- * TTabView may be toggled between visible (active) and invisible (inactive) by
- * setting the {@link setActive Active} property.
- *
- * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.1.1
- */
-class TTabView extends TWebControl
-{
- private $_active=false;
-
- /**
- * @return the tag name for the view element
- */
- protected function getTagName()
- {
- return 'div';
- }
-
- /**
- * Adds attributes to renderer.
- * @param THtmlWriter the renderer
- */
- protected function addAttributesToRender($writer)
- {
- if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
- $this->getStyle()->setStyleField('display','none');
-
- $this->getStyle()->mergeWith($this->getParent()->getViewStyle());
-
- parent::addAttributesToRender($writer);
-
- $writer->addAttribute('id',$this->getClientID());
- }
-
- /**
- * @return string the caption displayed on this tab. Defaults to ''.
- */
- public function getCaption()
- {
- return $this->getViewState('Caption','');
- }
-
- /**
- * @param string the caption displayed on this tab
- */
- public function setCaption($value)
- {
- $this->setViewState('Caption',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return string the URL of the target page. Defaults to ''.
- */
- public function getNavigateUrl()
- {
- return $this->getViewState('NavigateUrl','');
- }
-
- /**
- * Sets the URL of the target page.
- * If not empty, clicking on this tab will redirect the browser to the specified URL.
- * @param string the URL of the target page.
- */
- public function setNavigateUrl($value)
- {
- $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return string the text content displayed on this view. Defaults to ''.
- */
- public function getText()
- {
- return $this->getViewState('Text','');
- }
-
- /**
- * Sets the text content to be displayed on this view.
- * If this is not empty, the child content of the view will be ignored.
- * @param string the text content displayed on this view
- */
- public function setText($value)
- {
- $this->setViewState('Text',TPropertyValue::ensureString($value),'');
- }
-
- /**
- * @return boolean whether this tab view is active. Defaults to false.
- */
- public function getActive()
- {
- return $this->_active;
- }
-
- /**
- * @param boolean whether this tab view is active.
- */
- public function setActive($value)
- {
- $this->_active=TPropertyValue::ensureBoolean($value);
- }
-
- /**
- * Renders body contents of the tab view.
- * @param THtmlWriter the writer used for the rendering purpose.
- */
- public function renderContents($writer)
- {
- if(($text=$this->getText())!=='')
- $writer->write($text);
- else if($this->getHasControls())
- parent::renderContents($writer);
- }
-
- /**
- * Renders the tab associated with the tab view.
- * @param THtmlWriter the writer for rendering purpose.
- */
- public function renderTab($writer)
- {
- if($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript())
- {
- $writer->addAttribute('id',$this->getClientID().'_0');
-
- $style=$this->getActive()?$this->getParent()->getActiveTabStyle():$this->getParent()->getTabStyle();
- $style->addAttributesToRender($writer);
-
- $writer->renderBeginTag($this->getTagName());
-
- $this->renderTabContent($writer);
-
- $writer->renderEndTag();
- }
- }
-
- /**
- * Renders the content in the tab.
- * By default, a hyperlink is displayed.
- * @param THtmlWriter the HTML writer
- */
- protected function renderTabContent($writer)
- {
- if(($url=$this->getNavigateUrl())==='')
- $url='javascript://';
- if(($caption=$this->getCaption())==='')
- $caption='&nbsp;';
- $writer->write("<a href=\"{$url}\">{$caption}</a>");
- }
-}
-
-/**
- * TTabViewCollection class.
- *
- * TTabViewCollection is used to maintain a list of views belong to a {@link TTabPanel}.
- *
- * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.1.1
- */
-class TTabViewCollection extends TControlCollection
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by performing sanity check on the type of new item.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TTabView} object.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TTabView)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('tabviewcollection_tabview_required');
- }
-
- /**
- * Finds the index of the tab view whose ID is the same as the one being looked for.
- * @param string the explicit ID of the tab view to be looked for
- * @return integer the index of the tab view found, -1 if not found.
- */
- public function findIndexByID($id)
- {
- foreach($this as $index=>$view)
- {
- if($view->getID(false)===$id)
- return $index;
- }
- return -1;
- }
-}
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTabView.php b/framework/Web/UI/WebControls/TTabView.php
new file mode 100644
index 00000000..11a6b1ee
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTabView.php
@@ -0,0 +1,176 @@
+<?php
+/**
+ * TTabPanel class file.
+ *
+ * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ * @since 3.1.1
+ */
+
+/**
+ * TTabView class.
+ *
+ * TTabView represents a view in a {@link TTabPanel} control.
+ *
+ * The content in a TTabView can be specified by the {@link setText Text} property
+ * or its child controls. In template syntax, the latter means enclosing the content
+ * within the TTabView component element. If both are set, {@link getText Text} takes precedence.
+ *
+ * Each TTabView is associated with a tab in the tab bar of the TTabPanel control.
+ * The tab caption is specified by {@link setCaption Caption}. If {@link setNavigateUrl NavigateUrl}
+ * is set, the tab will contain a hyperlink pointing to the specified URL. In this case,
+ * clicking on the tab will redirect the browser to the specified URL.
+ *
+ * TTabView may be toggled between visible (active) and invisible (inactive) by
+ * setting the {@link setActive Active} property.
+ *
+ * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.1.1
+ */
+class TTabView extends TWebControl
+{
+ private $_active=false;
+
+ /**
+ * @return the tag name for the view element
+ */
+ protected function getTagName()
+ {
+ return 'div';
+ }
+
+ /**
+ * Adds attributes to renderer.
+ * @param THtmlWriter the renderer
+ */
+ protected function addAttributesToRender($writer)
+ {
+ if(!$this->getActive() && $this->getPage()->getClientSupportsJavaScript())
+ $this->getStyle()->setStyleField('display','none');
+
+ $this->getStyle()->mergeWith($this->getParent()->getViewStyle());
+
+ parent::addAttributesToRender($writer);
+
+ $writer->addAttribute('id',$this->getClientID());
+ }
+
+ /**
+ * @return string the caption displayed on this tab. Defaults to ''.
+ */
+ public function getCaption()
+ {
+ return $this->getViewState('Caption','');
+ }
+
+ /**
+ * @param string the caption displayed on this tab
+ */
+ public function setCaption($value)
+ {
+ $this->setViewState('Caption',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return string the URL of the target page. Defaults to ''.
+ */
+ public function getNavigateUrl()
+ {
+ return $this->getViewState('NavigateUrl','');
+ }
+
+ /**
+ * Sets the URL of the target page.
+ * If not empty, clicking on this tab will redirect the browser to the specified URL.
+ * @param string the URL of the target page.
+ */
+ public function setNavigateUrl($value)
+ {
+ $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return string the text content displayed on this view. Defaults to ''.
+ */
+ public function getText()
+ {
+ return $this->getViewState('Text','');
+ }
+
+ /**
+ * Sets the text content to be displayed on this view.
+ * If this is not empty, the child content of the view will be ignored.
+ * @param string the text content displayed on this view
+ */
+ public function setText($value)
+ {
+ $this->setViewState('Text',TPropertyValue::ensureString($value),'');
+ }
+
+ /**
+ * @return boolean whether this tab view is active. Defaults to false.
+ */
+ public function getActive()
+ {
+ return $this->_active;
+ }
+
+ /**
+ * @param boolean whether this tab view is active.
+ */
+ public function setActive($value)
+ {
+ $this->_active=TPropertyValue::ensureBoolean($value);
+ }
+
+ /**
+ * Renders body contents of the tab view.
+ * @param THtmlWriter the writer used for the rendering purpose.
+ */
+ public function renderContents($writer)
+ {
+ if(($text=$this->getText())!=='')
+ $writer->write($text);
+ else if($this->getHasControls())
+ parent::renderContents($writer);
+ }
+
+ /**
+ * Renders the tab associated with the tab view.
+ * @param THtmlWriter the writer for rendering purpose.
+ */
+ public function renderTab($writer)
+ {
+ if($this->getVisible(false) && $this->getPage()->getClientSupportsJavaScript())
+ {
+ $writer->addAttribute('id',$this->getClientID().'_0');
+
+ $style=$this->getActive()?$this->getParent()->getActiveTabStyle():$this->getParent()->getTabStyle();
+ $style->addAttributesToRender($writer);
+
+ $writer->renderBeginTag($this->getTagName());
+
+ $this->renderTabContent($writer);
+
+ $writer->renderEndTag();
+ }
+ }
+
+ /**
+ * Renders the content in the tab.
+ * By default, a hyperlink is displayed.
+ * @param THtmlWriter the HTML writer
+ */
+ protected function renderTabContent($writer)
+ {
+ if(($url=$this->getNavigateUrl())==='')
+ $url='javascript://';
+ if(($caption=$this->getCaption())==='')
+ $caption='&nbsp;';
+ $writer->write("<a href=\"{$url}\">{$caption}</a>");
+ }
+}
diff --git a/framework/Web/UI/WebControls/TTabViewCollection.php b/framework/Web/UI/WebControls/TTabViewCollection.php
new file mode 100644
index 00000000..bece3ed6
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTabViewCollection.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * TTabPanel class file.
+ *
+ * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ * @since 3.1.1
+ */
+
+/**
+ * TTabViewCollection class.
+ *
+ * TTabViewCollection is used to maintain a list of views belong to a {@link TTabPanel}.
+ *
+ * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.1.1
+ */
+class TTabViewCollection extends TControlCollection
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by performing sanity check on the type of new item.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a {@link TTabView} object.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TTabView)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('tabviewcollection_tabview_required');
+ }
+
+ /**
+ * Finds the index of the tab view whose ID is the same as the one being looked for.
+ * @param string the explicit ID of the tab view to be looked for
+ * @return integer the index of the tab view found, -1 if not found.
+ */
+ public function findIndexByID($id)
+ {
+ foreach($this as $index=>$view)
+ {
+ if($view->getID(false)===$id)
+ return $index;
+ }
+ return -1;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTable.php b/framework/Web/UI/WebControls/TTable.php
index 4102cd4b..923c4e70 100644
--- a/framework/Web/UI/WebControls/TTable.php
+++ b/framework/Web/UI/WebControls/TTable.php
@@ -347,60 +347,4 @@ class TTable extends TWebControl
}
}
}
-}
-
-
-/**
- * TTableRowCollection class.
- *
- * TTableRowCollection is used to maintain a list of rows belong to a table.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TTableRowCollection extends TControlCollection
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by performing additional
- * operations for each newly added table row.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a TTableRow object.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TTableRow)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('tablerowcollection_tablerow_required');
- }
-}
-
-
-/**
- * TTableCaptionAlign class.
- * TTableCaptionAlign defines the enumerable type for the possible alignments
- * that a table caption can take.
- *
- * The following enumerable values are defined:
- * - NotSet: alignment not specified
- * - Top: top aligned
- * - Bottom: bottom aligned
- * - Left: left aligned
- * - Right: right aligned
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TTableCaptionAlign extends TEnumerable
-{
- const NotSet='NotSet';
- const Top='Top';
- const Bottom='Bottom';
- const Left='Left';
- const Right='Right';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableCaptionAlign.php b/framework/Web/UI/WebControls/TTableCaptionAlign.php
new file mode 100644
index 00000000..6fb78a62
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTableCaptionAlign.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * TTable and TTableRowCollection class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TTableCaptionAlign class.
+ * TTableCaptionAlign defines the enumerable type for the possible alignments
+ * that a table caption can take.
+ *
+ * The following enumerable values are defined:
+ * - NotSet: alignment not specified
+ * - Top: top aligned
+ * - Bottom: bottom aligned
+ * - Left: left aligned
+ * - Right: right aligned
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TTableCaptionAlign extends TEnumerable
+{
+ const NotSet='NotSet';
+ const Top='Top';
+ const Bottom='Bottom';
+ const Left='Left';
+ const Right='Right';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableCellCollection.php b/framework/Web/UI/WebControls/TTableCellCollection.php
new file mode 100644
index 00000000..86ef11c7
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTableCellCollection.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * TTableRow and TTableCellCollection class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TTableCellCollection class.
+ *
+ * TTableCellCollection is used to maintain a list of cells belong to a table row.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TTableCellCollection extends TControlCollection
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by performing additional
+ * operations for each newly added table cell.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a TTableCell object.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TTableCell)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('tablecellcollection_tablecell_required');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableGridLines.php b/framework/Web/UI/WebControls/TTableGridLines.php
new file mode 100644
index 00000000..d9bf141a
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTableGridLines.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * TStyle class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TTableGridLines class.
+ * TTableGridLines defines the enumerable type for the possible grid line types of an HTML table.
+ *
+ * The following enumerable values are defined:
+ * - None: no grid lines
+ * - Horizontal: horizontal grid lines only
+ * - Vertical: vertical grid lines only
+ * - Both: both horizontal and vertical grid lines are shown
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TTableGridLines extends TEnumerable
+{
+ const None='None';
+ const Horizontal='Horizontal';
+ const Vertical='Vertical';
+ const Both='Both';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableHeaderCell.php b/framework/Web/UI/WebControls/TTableHeaderCell.php
index 43b21b45..817c0930 100644
--- a/framework/Web/UI/WebControls/TTableHeaderCell.php
+++ b/framework/Web/UI/WebControls/TTableHeaderCell.php
@@ -96,26 +96,4 @@ class TTableHeaderCell extends TTableCell
{
$this->setViewState('CategoryText',$value,'');
}
-}
-
-
-/**
- * TTableHeaderScope class.
- * TTableHeaderScope defines the enumerable type for the possible table scopes that a table header is associated with.
- *
- * The following enumerable values are defined:
- * - NotSet: the scope is not specified
- * - Row: the scope is row-wise
- * - Column: the scope is column-wise
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TTableHeaderScope extends TEnumerable
-{
- const NotSet='NotSet';
- const Row='Row';
- const Column='Column';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableHeaderScope.php b/framework/Web/UI/WebControls/TTableHeaderScope.php
new file mode 100644
index 00000000..dd43b84b
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTableHeaderScope.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * TTableHeaderCell class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TTableHeaderScope class.
+ * TTableHeaderScope defines the enumerable type for the possible table scopes that a table header is associated with.
+ *
+ * The following enumerable values are defined:
+ * - NotSet: the scope is not specified
+ * - Row: the scope is row-wise
+ * - Column: the scope is column-wise
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TTableHeaderScope extends TEnumerable
+{
+ const NotSet='NotSet';
+ const Row='Row';
+ const Column='Column';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableItemStyle.php b/framework/Web/UI/WebControls/TTableItemStyle.php
new file mode 100644
index 00000000..ccafabbf
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTableItemStyle.php
@@ -0,0 +1,157 @@
+<?php
+/**
+ * TStyle class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TTableItemStyle class.
+ * TTableItemStyle represents the CSS style specific for HTML table item.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TTableItemStyle extends TStyle
+{
+ /**
+ * @var THorizontalAlign horizontal alignment of the contents within the table item
+ */
+ private $_horizontalAlign=null;
+ /**
+ * @var TVerticalAlign vertical alignment of the contents within the table item
+ */
+ private $_verticalAlign=null;
+ /**
+ * @var boolean whether the content wraps within the table item
+ */
+ private $_wrap=null;
+
+ /**
+ * Sets the style attributes to default values.
+ * This method overrides the parent implementation by
+ * resetting additional TTableItemStyle specific attributes.
+ */
+ public function reset()
+ {
+ parent::reset();
+ $this->_verticalAlign=null;
+ $this->_horizontalAlign=null;
+ $this->_wrap=null;
+ }
+
+ /**
+ * Copies the fields in a new style to this style.
+ * If a style field is set in the new style, the corresponding field
+ * in this style will be overwritten.
+ * @param TStyle the new style
+ */
+ public function copyFrom($style)
+ {
+ parent::copyFrom($style);
+ if($style instanceof TTableItemStyle)
+ {
+ if($this->_verticalAlign===null && $style->_verticalAlign!==null)
+ $this->_verticalAlign=$style->_verticalAlign;
+ if($this->_horizontalAlign===null && $style->_horizontalAlign!==null)
+ $this->_horizontalAlign=$style->_horizontalAlign;
+ if($this->_wrap===null && $style->_wrap!==null)
+ $this->_wrap=$style->_wrap;
+ }
+ }
+
+ /**
+ * Merges the style with a new one.
+ * If a style field is not set in this style, it will be overwritten by
+ * the new one.
+ * @param TStyle the new style
+ */
+ public function mergeWith($style)
+ {
+ parent::mergeWith($style);
+ if($style instanceof TTableItemStyle)
+ {
+ if($style->_verticalAlign!==null)
+ $this->_verticalAlign=$style->_verticalAlign;
+ if($style->_horizontalAlign!==null)
+ $this->_horizontalAlign=$style->_horizontalAlign;
+ if($style->_wrap!==null)
+ $this->_wrap=$style->_wrap;
+ }
+ }
+
+ /**
+ * Adds attributes related to CSS styles to renderer.
+ * This method overrides the parent implementation.
+ * @param THtmlWriter the writer used for the rendering purpose
+ */
+ public function addAttributesToRender($writer)
+ {
+ if(!$this->getWrap())
+ $writer->addStyleAttribute('white-space','nowrap');
+
+ if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet)
+ $writer->addAttribute('align',strtolower($horizontalAlign));
+
+ if(($verticalAlign=$this->getVerticalAlign())!==TVerticalAlign::NotSet)
+ $writer->addAttribute('valign',strtolower($verticalAlign));
+
+ parent::addAttributesToRender($writer);
+ }
+
+ /**
+ * @return THorizontalAlign the horizontal alignment of the contents within the table item, defaults to THorizontalAlign::NotSet.
+ */
+ public function getHorizontalAlign()
+ {
+ return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign;
+ }
+
+ /**
+ * Sets the horizontal alignment of the contents within the table item.
+ * @param THorizontalAlign the horizontal alignment
+ */
+ public function setHorizontalAlign($value)
+ {
+ $this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign');
+ }
+
+ /**
+ * @return TVerticalAlign the vertical alignment of the contents within the table item, defaults to TVerticalAlign::NotSet.
+ */
+ public function getVerticalAlign()
+ {
+ return $this->_verticalAlign===null?TVerticalAlign::NotSet:$this->_verticalAlign;
+ }
+
+ /**
+ * Sets the vertical alignment of the contents within the table item.
+ * @param TVerticalAlign the horizontal alignment
+ */
+ public function setVerticalAlign($value)
+ {
+ $this->_verticalAlign=TPropertyValue::ensureEnum($value,'TVerticalAlign');
+ }
+
+ /**
+ * @return boolean whether the content wraps within the table item. Defaults to true.
+ */
+ public function getWrap()
+ {
+ return $this->_wrap===null?true:$this->_wrap;
+ }
+
+ /**
+ * Sets the value indicating whether the content wraps within the table item.
+ * @param boolean whether the content wraps within the panel.
+ */
+ public function setWrap($value)
+ {
+ $this->_wrap=TPropertyValue::ensureBoolean($value);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableRow.php b/framework/Web/UI/WebControls/TTableRow.php
index d0bc6bfb..59b69dd7 100644
--- a/framework/Web/UI/WebControls/TTableRow.php
+++ b/framework/Web/UI/WebControls/TTableRow.php
@@ -150,55 +150,4 @@ class TTableRow extends TWebControl
}
}
}
-}
-
-/**
- * TTableCellCollection class.
- *
- * TTableCellCollection is used to maintain a list of cells belong to a table row.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TTableCellCollection extends TControlCollection
-{
- /**
- * Inserts an item at the specified position.
- * This overrides the parent implementation by performing additional
- * operations for each newly added table cell.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item to be inserted is not a TTableCell object.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TTableCell)
- parent::insertAt($index,$item);
- else
- throw new TInvalidDataTypeException('tablecellcollection_tablecell_required');
- }
-}
-
-
-/**
- * TTableRowSection class.
- * TTableRowSection defines the enumerable type for the possible table sections
- * that a {@link TTableRow} can be within.
- *
- * The following enumerable values are defined:
- * - Header: in table header
- * - Body: in table body
- * - Footer: in table footer
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TTableRowSection extends TEnumerable
-{
- const Header='Header';
- const Body='Body';
- const Footer='Footer';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableRowCollection.php b/framework/Web/UI/WebControls/TTableRowCollection.php
new file mode 100644
index 00000000..c1c8021c
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTableRowCollection.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * TTable and TTableRowCollection class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TTableRowCollection class.
+ *
+ * TTableRowCollection is used to maintain a list of rows belong to a table.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TTableRowCollection extends TControlCollection
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by performing additional
+ * operations for each newly added table row.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a TTableRow object.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TTableRow)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('tablerowcollection_tablerow_required');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableRowSection.php b/framework/Web/UI/WebControls/TTableRowSection.php
new file mode 100644
index 00000000..03b4c242
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTableRowSection.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TTableRow and TTableCellCollection class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TTableRowSection class.
+ * TTableRowSection defines the enumerable type for the possible table sections
+ * that a {@link TTableRow} can be within.
+ *
+ * The following enumerable values are defined:
+ * - Header: in table header
+ * - Body: in table body
+ * - Footer: in table footer
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TTableRowSection extends TEnumerable
+{
+ const Header='Header';
+ const Body='Body';
+ const Footer='Footer';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTableStyle.php b/framework/Web/UI/WebControls/TTableStyle.php
new file mode 100644
index 00000000..18ecf28f
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTableStyle.php
@@ -0,0 +1,250 @@
+<?php
+/**
+ * TStyle class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TTableStyle class.
+ * TTableStyle represents the CSS style specific for HTML table.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TTableStyle extends TStyle
+{
+ /**
+ * @var TVerticalAlign the URL of the background image for the table
+ */
+ private $_backImageUrl=null;
+ /**
+ * @var THorizontalAlign horizontal alignment of the contents within the table
+ */
+ private $_horizontalAlign=null;
+ /**
+ * @var integer cellpadding of the table
+ */
+ private $_cellPadding=null;
+ /**
+ * @var integer cellspacing of the table
+ */
+ private $_cellSpacing=null;
+ /**
+ * @var TTableGridLines grid line setting of the table
+ */
+ private $_gridLines=null;
+ /**
+ * @var boolean whether the table border should be collapsed
+ */
+ private $_borderCollapse=null;
+
+ /**
+ * Sets the style attributes to default values.
+ * This method overrides the parent implementation by
+ * resetting additional TTableStyle specific attributes.
+ */
+ public function reset()
+ {
+ $this->_backImageUrl=null;
+ $this->_horizontalAlign=null;
+ $this->_cellPadding=null;
+ $this->_cellSpacing=null;
+ $this->_gridLines=null;
+ $this->_borderCollapse=null;
+ }
+
+ /**
+ * Copies the fields in a new style to this style.
+ * If a style field is set in the new style, the corresponding field
+ * in this style will be overwritten.
+ * @param TStyle the new style
+ */
+ public function copyFrom($style)
+ {
+ parent::copyFrom($style);
+ if($style instanceof TTableStyle)
+ {
+ if($style->_backImageUrl!==null)
+ $this->_backImageUrl=$style->_backImageUrl;
+ if($style->_horizontalAlign!==null)
+ $this->_horizontalAlign=$style->_horizontalAlign;
+ if($style->_cellPadding!==null)
+ $this->_cellPadding=$style->_cellPadding;
+ if($style->_cellSpacing!==null)
+ $this->_cellSpacing=$style->_cellSpacing;
+ if($style->_gridLines!==null)
+ $this->_gridLines=$style->_gridLines;
+ if($style->_borderCollapse!==null)
+ $this->_borderCollapse=$style->_borderCollapse;
+ }
+ }
+
+ /**
+ * Merges the style with a new one.
+ * If a style field is not set in this style, it will be overwritten by
+ * the new one.
+ * @param TStyle the new style
+ */
+ public function mergeWith($style)
+ {
+ parent::mergeWith($style);
+ if($style instanceof TTableStyle)
+ {
+ if($this->_backImageUrl===null && $style->_backImageUrl!==null)
+ $this->_backImageUrl=$style->_backImageUrl;
+ if($this->_horizontalAlign===null && $style->_horizontalAlign!==null)
+ $this->_horizontalAlign=$style->_horizontalAlign;
+ if($this->_cellPadding===null && $style->_cellPadding!==null)
+ $this->_cellPadding=$style->_cellPadding;
+ if($this->_cellSpacing===null && $style->_cellSpacing!==null)
+ $this->_cellSpacing=$style->_cellSpacing;
+ if($this->_gridLines===null && $style->_gridLines!==null)
+ $this->_gridLines=$style->_gridLines;
+ if($this->_borderCollapse===null && $style->_borderCollapse!==null)
+ $this->_borderCollapse=$style->_borderCollapse;
+ }
+ }
+
+
+ /**
+ * Adds attributes related to CSS styles to renderer.
+ * This method overrides the parent implementation.
+ * @param THtmlWriter the writer used for the rendering purpose
+ */
+ public function addAttributesToRender($writer)
+ {
+ if(($url=trim($this->getBackImageUrl()))!=='')
+ $writer->addStyleAttribute('background-image','url('.$url.')');
+
+ if(($horizontalAlign=$this->getHorizontalAlign())!==THorizontalAlign::NotSet)
+ $writer->addStyleAttribute('text-align',strtolower($horizontalAlign));
+
+ if(($cellPadding=$this->getCellPadding())>=0)
+ $writer->addAttribute('cellpadding',"$cellPadding");
+
+ if(($cellSpacing=$this->getCellSpacing())>=0)
+ $writer->addAttribute('cellspacing',"$cellSpacing");
+
+ if($this->getBorderCollapse())
+ $writer->addStyleAttribute('border-collapse','collapse');
+
+ switch($this->getGridLines())
+ {
+ case TTableGridLines::Horizontal : $writer->addAttribute('rules','rows'); break;
+ case TTableGridLines::Vertical : $writer->addAttribute('rules','cols'); break;
+ case TTableGridLines::Both : $writer->addAttribute('rules','all'); break;
+ }
+
+ parent::addAttributesToRender($writer);
+ }
+
+ /**
+ * @return string the URL of the background image for the table
+ */
+ public function getBackImageUrl()
+ {
+ return $this->_backImageUrl===null?'':$this->_backImageUrl;
+ }
+
+ /**
+ * Sets the URL of the background image for the table
+ * @param string the URL
+ */
+ public function setBackImageUrl($value)
+ {
+ $this->_backImageUrl=$value;
+ }
+
+ /**
+ * @return THorizontalAlign the horizontal alignment of the contents within the table, defaults to THorizontalAlign::NotSet.
+ */
+ public function getHorizontalAlign()
+ {
+ return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign;
+ }
+
+ /**
+ * Sets the horizontal alignment of the contents within the table.
+ * @param THorizontalAlign the horizontal alignment
+ */
+ public function setHorizontalAlign($value)
+ {
+ $this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign');
+ }
+
+ /**
+ * @return integer cellpadding of the table. Defaults to -1, meaning not set.
+ */
+ public function getCellPadding()
+ {
+ return $this->_cellPadding===null?-1:$this->_cellPadding;
+ }
+
+ /**
+ * @param integer cellpadding of the table. A value equal to -1 clears up the setting.
+ * @throws TInvalidDataValueException if the value is less than -1.
+ */
+ public function setCellPadding($value)
+ {
+ if(($this->_cellPadding=TPropertyValue::ensureInteger($value))<-1)
+ throw new TInvalidDataValueException('tablestyle_cellpadding_invalid');
+ }
+
+ /**
+ * @return integer cellspacing of the table. Defaults to -1, meaning not set.
+ */
+ public function getCellSpacing()
+ {
+ return $this->_cellSpacing===null?-1:$this->_cellSpacing;
+ }
+
+ /**
+ * @param integer cellspacing of the table. A value equal to -1 clears up the setting.
+ * @throws TInvalidDataValueException if the value is less than -1.
+ */
+ public function setCellSpacing($value)
+ {
+ if(($this->_cellSpacing=TPropertyValue::ensureInteger($value))<-1)
+ throw new TInvalidDataValueException('tablestyle_cellspacing_invalid');
+ }
+
+ /**
+ * @return TTableGridLines the grid line setting of the table. Defaults to TTableGridLines::None.
+ */
+ public function getGridLines()
+ {
+ return $this->_gridLines===null?TTableGridLines::None:$this->_gridLines;
+ }
+
+ /**
+ * Sets the grid line style of the table.
+ * @param TTableGridLines the grid line setting of the table
+ */
+ public function setGridLines($value)
+ {
+ $this->_gridLines=TPropertyValue::ensureEnum($value,'TTableGridLines');
+ }
+
+
+ /**
+ * @return boolean whether the table borders should be collapsed. Defaults to false.
+ */
+ public function getBorderCollapse()
+ {
+ return $this->_borderCollapse===null?false:$this->_borderCollapse;
+ }
+
+ /**
+ * @param boolean whether the table borders should be collapsed.
+ */
+ public function setBorderCollapse($value)
+ {
+ $this->_borderCollapse=TPropertyValue::ensureBoolean($value);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTemplatedWizardStep.php b/framework/Web/UI/WebControls/TTemplatedWizardStep.php
new file mode 100644
index 00000000..f928ba08
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTemplatedWizardStep.php
@@ -0,0 +1,114 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TTemplatedWizardStep class.
+ *
+ * TTemplatedWizardStep represents a wizard step whose content and navigation
+ * can be customized using templates. To customize the step content, specify
+ * {@link setContentTemplate ContentTemplate}. To customize navigation specific
+ * to the step, specify {@link setNavigationTemplate NavigationTemplate}. Note,
+ * if the navigation template is not specified, default navigation will be used.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TTemplatedWizardStep extends TWizardStep implements INamingContainer
+{
+ /**
+ * @var ITemplate the template for displaying the navigation UI of a wizard step.
+ */
+ private $_navigationTemplate=null;
+ /**
+ * @var ITemplate the template for displaying the content within the wizard step.
+ */
+ private $_contentTemplate=null;
+ /**
+ * @var TWizardNavigationContainer
+ */
+ private $_navigationContainer=null;
+
+ /**
+ * Creates child controls.
+ * This method mainly instantiates the content template, if any.
+ */
+ public function createChildControls()
+ {
+ $this->getControls()->clear();
+ if($this->_contentTemplate)
+ $this->_contentTemplate->instantiateIn($this);
+ }
+
+ /**
+ * Ensures child controls are created.
+ * @param mixed event parameter
+ */
+ public function onInit($param)
+ {
+ parent::onInit($param);
+ $this->ensureChildControls();
+ }
+
+ /**
+ * @return ITemplate the template for the content of the wizard step.
+ */
+ public function getContentTemplate()
+ {
+ return $this->_contentTemplate;
+ }
+
+ /**
+ * @param ITemplate the template for the content of the wizard step.
+ */
+ public function setContentTemplate($value)
+ {
+ $this->_contentTemplate=$value;
+ }
+
+ /**
+ * @return ITemplate the template for displaying the navigation UI of a wizard step. Defaults to null.
+ */
+ public function getNavigationTemplate()
+ {
+ return $this->_navigationTemplate;
+ }
+
+ /**
+ * @param ITemplate the template for displaying the navigation UI of a wizard step.
+ */
+ public function setNavigationTemplate($value)
+ {
+ $this->_navigationTemplate=$value;
+ }
+
+ /**
+ * @return TWizardNavigationContainer the control containing the navigation.
+ * It could be null if no navigation template is specified.
+ */
+ public function getNavigationContainer()
+ {
+ return $this->_navigationContainer;
+ }
+
+ /**
+ * Instantiates the navigation template if any
+ */
+ public function instantiateNavigationTemplate()
+ {
+ if(!$this->_navigationContainer && $this->_navigationTemplate)
+ {
+ $this->_navigationContainer=new TWizardNavigationContainer;
+ $this->_navigationTemplate->instantiateIn($this->_navigationContainer);
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTextAlign.php b/framework/Web/UI/WebControls/TTextAlign.php
new file mode 100644
index 00000000..df09ae6a
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTextAlign.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * TCheckBox class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TTextAlign class.
+ * TTextAlign defines the enumerable type for the possible text alignments
+ *
+ * The following enumerable values are defined:
+ * - Left: left aligned
+ * - Right: right aligned
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TTextAlign extends TEnumerable
+{
+ const Left='Left';
+ const Right='Right';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php
index 0d14dd7c..8b37778b 100644
--- a/framework/Web/UI/WebControls/TTextBox.php
+++ b/framework/Web/UI/WebControls/TTextBox.php
@@ -578,71 +578,4 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
{
$this->setViewState('Wrap',TPropertyValue::ensureBoolean($value),true);
}
-}
-
-/**
- * TTextBoxMode class.
- * TTextBoxMode defines the enumerable type for the possible mode
- * that a {@link TTextBox} control could be at.
- *
- * The following enumerable values are defined:
- * - SingleLine: the textbox will be a regular single line input
- * - MultiLine: the textbox will be a textarea allowing multiple line input
- * - Password: the textbox will hide user input like a password input box
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TTextBoxMode extends TEnumerable
-{
- const SingleLine='SingleLine';
- const MultiLine='MultiLine';
- const Password='Password';
-}
-
-/**
- * TTextBoxAutoCompleteType class.
- * TTextBoxAutoCompleteType defines the possible AutoComplete type that is supported
- * by a {@link TTextBox} control.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TTextBoxAutoCompleteType extends TEnumerable
-{
- const BusinessCity='BusinessCity';
- const BusinessCountryRegion='BusinessCountryRegion';
- const BusinessFax='BusinessFax';
- const BusinessPhone='BusinessPhone';
- const BusinessState='BusinessState';
- const BusinessStreetAddress='BusinessStreetAddress';
- const BusinessUrl='BusinessUrl';
- const BusinessZipCode='BusinessZipCode';
- const Cellular='Cellular';
- const Company='Company';
- const Department='Department';
- const Disabled='Disabled';
- const DisplayName='DisplayName';
- const Email='Email';
- const FirstName='FirstName';
- const Gender='Gender';
- const HomeCity='HomeCity';
- const HomeCountryRegion='HomeCountryRegion';
- const HomeFax='HomeFax';
- const Homepage='Homepage';
- const HomePhone='HomePhone';
- const HomeState='HomeState';
- const HomeStreetAddress='HomeStreetAddress';
- const HomeZipCode='HomeZipCode';
- const JobTitle='JobTitle';
- const LastName='LastName';
- const MiddleName='MiddleName';
- const None='None';
- const Notes='Notes';
- const Office='Office';
- const Pager='Pager';
- const Search='Search';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTextBoxAutoCompleteType.php b/framework/Web/UI/WebControls/TTextBoxAutoCompleteType.php
new file mode 100644
index 00000000..497affe1
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTextBoxAutoCompleteType.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * TTextBox class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TTextBoxAutoCompleteType class.
+ * TTextBoxAutoCompleteType defines the possible AutoComplete type that is supported
+ * by a {@link TTextBox} control.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TTextBoxAutoCompleteType extends TEnumerable
+{
+ const BusinessCity='BusinessCity';
+ const BusinessCountryRegion='BusinessCountryRegion';
+ const BusinessFax='BusinessFax';
+ const BusinessPhone='BusinessPhone';
+ const BusinessState='BusinessState';
+ const BusinessStreetAddress='BusinessStreetAddress';
+ const BusinessUrl='BusinessUrl';
+ const BusinessZipCode='BusinessZipCode';
+ const Cellular='Cellular';
+ const Company='Company';
+ const Department='Department';
+ const Disabled='Disabled';
+ const DisplayName='DisplayName';
+ const Email='Email';
+ const FirstName='FirstName';
+ const Gender='Gender';
+ const HomeCity='HomeCity';
+ const HomeCountryRegion='HomeCountryRegion';
+ const HomeFax='HomeFax';
+ const Homepage='Homepage';
+ const HomePhone='HomePhone';
+ const HomeState='HomeState';
+ const HomeStreetAddress='HomeStreetAddress';
+ const HomeZipCode='HomeZipCode';
+ const JobTitle='JobTitle';
+ const LastName='LastName';
+ const MiddleName='MiddleName';
+ const None='None';
+ const Notes='Notes';
+ const Office='Office';
+ const Pager='Pager';
+ const Search='Search';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTextBoxMode.php b/framework/Web/UI/WebControls/TTextBoxMode.php
new file mode 100644
index 00000000..a1cc5231
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTextBoxMode.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * TTextBox class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TTextBoxMode class.
+ * TTextBoxMode defines the enumerable type for the possible mode
+ * that a {@link TTextBox} control could be at.
+ *
+ * The following enumerable values are defined:
+ * - SingleLine: the textbox will be a regular single line input
+ * - MultiLine: the textbox will be a textarea allowing multiple line input
+ * - Password: the textbox will hide user input like a password input box
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TTextBoxMode extends TEnumerable
+{
+ const SingleLine='SingleLine';
+ const MultiLine='MultiLine';
+ const Password='Password';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php
index a10171db..220f6597 100644
--- a/framework/Web/UI/WebControls/TTextHighlighter.php
+++ b/framework/Web/UI/WebControls/TTextHighlighter.php
@@ -197,14 +197,3 @@ class TTextHighlighter extends TTextProcessor
}
-
-/**
- * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
- * @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/TTextHighlighterLineNumberStyle.php b/framework/Web/UI/WebControls/TTextHighlighterLineNumberStyle.php
new file mode 100644
index 00000000..71b217be
--- /dev/null
+++ b/framework/Web/UI/WebControls/TTextHighlighterLineNumberStyle.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * TTextHighlighter class file
+ *
+ * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TTextHighlighterLineNumberStyle extends TEnumerable
+{
+ const Li='Li';
+ const Table='Table';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TValidationCompareOperator.php b/framework/Web/UI/WebControls/TValidationCompareOperator.php
new file mode 100644
index 00000000..d2d55829
--- /dev/null
+++ b/framework/Web/UI/WebControls/TValidationCompareOperator.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * TCompareValidator class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TValidationCompareOperator class.
+ * TValidationCompareOperator defines the enumerable type for the comparison operations
+ * that {@link TCompareValidator} can perform validation with.
+ *
+ * The following enumerable values are defined:
+ * - Equal
+ * - NotEqual
+ * - GreaterThan
+ * - GreaterThanEqual
+ * - LessThan
+ * - LessThanEqual
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TValidationCompareOperator extends TEnumerable
+{
+ const Equal='Equal';
+ const NotEqual='NotEqual';
+ const GreaterThan='GreaterThan';
+ const GreaterThanEqual='GreaterThanEqual';
+ const LessThan='LessThan';
+ const LessThanEqual='LessThanEqual';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TValidationDataType.php b/framework/Web/UI/WebControls/TValidationDataType.php
new file mode 100644
index 00000000..f4f88b76
--- /dev/null
+++ b/framework/Web/UI/WebControls/TValidationDataType.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * TBaseValidator class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TValidationDataType class.
+ * TValidationDataType defines the enumerable type for the possible data types that
+ * a comparison validator can validate upon.
+ *
+ * The following enumerable values are defined:
+ * - Integer
+ * - Float
+ * - Date
+ * - String
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TValidationDataType extends TEnumerable
+{
+ const Integer='Integer';
+ const Float='Float';
+ const Date='Date';
+ const String='String';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php
index 3d5b61ca..6c962cc1 100644
--- a/framework/Web/UI/WebControls/TValidationSummary.php
+++ b/framework/Web/UI/WebControls/TValidationSummary.php
@@ -410,122 +410,3 @@ class TValidationSummary extends TWebControl
$writer->write($this->getHeaderText());
}
}
-
-/**
- * TClientSideValidationSummaryOptions class.
- *
- * Client-side validation summary events such as {@link setOnHideSummary
- * OnHideSummary} and {@link setOnShowSummary OnShowSummary} can be modified
- * through the {@link TBaseValidator:: getClientSide ClientSide} property of a
- * validation summary.
- *
- * The <tt>OnHideSummary</tt> event is raise when the validation summary
- * requests to hide the messages.
- *
- * The <tt>OnShowSummary</tt> event is raised when the validation summary
- * requests to show the messages.
- *
- * See the quickstart documentation for further details.
- *
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TClientSideValidationSummaryOptions extends TClientSideOptions
-{
- /**
- * @return string javascript code for client-side OnHideSummary event.
- */
- public function getOnHideSummary()
- {
- return $this->getOption('OnHideSummary');
- }
-
- /**
- * Client-side OnHideSummary validation summary event is raise when all the
- * validators are valid. This will override the default client-side
- * validation summary behaviour.
- * @param string javascript code for client-side OnHideSummary event.
- */
- public function setOnHideSummary($javascript)
- {
- $this->setFunction('OnHideSummary', $javascript);
- }
-
- /**
- * Client-side OnShowSummary event is raise when one or more validators are
- * not valid. This will override the default client-side validation summary
- * behaviour.
- * @param string javascript code for client-side OnShowSummary event.
- */
- public function setOnShowSummary($javascript)
- {
- $this->setFunction('OnShowSummary', $javascript);
- }
-
- /**
- * @return string javascript code for client-side OnShowSummary event.
- */
- public function getOnShowSummary()
- {
- return $this->getOption('OnShowSummary');
- }
-
- /**
- * Ensure the string is a valid javascript function. The code block
- * is enclosed with "function(summary, validators){ }" block.
- * @param string javascript code.
- * @return string javascript function code.
- */
- protected function ensureFunction($javascript)
- {
- return "function(summary, validators){ {$javascript} }";
- }
-}
-
-
-/**
- * TValidationSummaryDisplayMode class.
- * TValidationSummaryDisplayMode defines the enumerable type for the possible modes
- * that a {@link TValidationSummary} can organize and display the collected error messages.
- *
- * The following enumerable values are defined:
- * - SimpleList: the error messages are displayed as a list without any decorations.
- * - SingleParagraph: the error messages are concatenated together into a paragraph.
- * - BulletList: the error messages are displayed as a bulleted list.
- * - HeaderOnly: only the HeaderText will be display.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TValidationSummaryDisplayMode extends TEnumerable
-{
- const SimpleList='SimpleList';
- const SingleParagraph='SingleParagraph';
- const BulletList='BulletList';
- const HeaderOnly='HeaderOnly';
-}
-
-
-/**
- * TValidationSummaryDisplay class.
- * TValidationSummaryDisplay defines the enumerable type for the possible styles
- * that a {@link TValidationSummary} can display the collected error messages.
- *
- * The following enumerable values are defined:
- * - None: the error messages are not displayed
- * - Dynamic: the error messages are dynamically added to display as the corresponding validators fail
- * - Fixed: Similar to Dynamic except that the error messages physically occupy the page layout (even though they may not be visible)
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TValidationSummaryDisplayStyle extends TEnumerable
-{
- const None='None';
- const Dynamic='Dynamic';
- const Fixed='Fixed';
-}
-
diff --git a/framework/Web/UI/WebControls/TValidationSummaryDisplayMode.php b/framework/Web/UI/WebControls/TValidationSummaryDisplayMode.php
new file mode 100644
index 00000000..db895d65
--- /dev/null
+++ b/framework/Web/UI/WebControls/TValidationSummaryDisplayMode.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * TValidationSummary class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TValidationSummaryDisplayMode class.
+ * TValidationSummaryDisplayMode defines the enumerable type for the possible modes
+ * that a {@link TValidationSummary} can organize and display the collected error messages.
+ *
+ * The following enumerable values are defined:
+ * - SimpleList: the error messages are displayed as a list without any decorations.
+ * - SingleParagraph: the error messages are concatenated together into a paragraph.
+ * - BulletList: the error messages are displayed as a bulleted list.
+ * - HeaderOnly: only the HeaderText will be display.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TValidationSummaryDisplayMode extends TEnumerable
+{
+ const SimpleList='SimpleList';
+ const SingleParagraph='SingleParagraph';
+ const BulletList='BulletList';
+ const HeaderOnly='HeaderOnly';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TValidationSummaryDisplayStyle.php b/framework/Web/UI/WebControls/TValidationSummaryDisplayStyle.php
new file mode 100644
index 00000000..09e88e1f
--- /dev/null
+++ b/framework/Web/UI/WebControls/TValidationSummaryDisplayStyle.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * TValidationSummary class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TValidationSummaryDisplayStylw class.
+ * TValidationSummaryDisplayStyle defines the enumerable type for the possible styles
+ * that a {@link TValidationSummary} can display the collected error messages.
+ *
+ * The following enumerable values are defined:
+ * - None: the error messages are not displayed
+ * - Dynamic: the error messages are dynamically added to display as the corresponding validators fail
+ * - Fixed: Similar to Dynamic except that the error messages physically occupy the page layout (even though they may not be visible)
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TValidationSummaryDisplayStyle extends TEnumerable
+{
+ const None='None';
+ const Dynamic='Dynamic';
+ const Fixed='Fixed';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TValidatorClientSide.php b/framework/Web/UI/WebControls/TValidatorClientSide.php
new file mode 100644
index 00000000..84bfd2f6
--- /dev/null
+++ b/framework/Web/UI/WebControls/TValidatorClientSide.php
@@ -0,0 +1,106 @@
+<?php
+/**
+ * TBaseValidator class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TValidatorClientSide class.
+ *
+ * Client-side validator events can be modified through the {@link
+ * TBaseValidator::getClientSide ClientSide} property of a validator. The
+ * subproperties of ClientSide are those of the TValidatorClientSide
+ * properties. The client-side validator supports the following events.
+ *
+ * The <tt>OnValidate</tt> event is raise before the validator validation
+ * functions are called.
+ *
+ * The <tt>OnValidationSuccess</tt> event is raised after the validator has successfully
+ * validate the control.
+ *
+ * The <tt>OnValidationError</tt> event is raised after the validator fails validation.
+ *
+ * See the quickstart documentation for further details.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TValidatorClientSide extends TClientSideOptions
+{
+ /**
+ * @return string javascript code for client-side OnValidate event.
+ */
+ public function getOnValidate()
+ {
+ return $this->getOption('OnValidate');
+ }
+
+ /**
+ * Client-side OnValidate validator event is raise before the validators
+ * validation functions are called.
+ * @param string javascript code for client-side OnValidate event.
+ */
+ public function setOnValidate($javascript)
+ {
+ $this->setFunction('OnValidate', $javascript);
+ }
+
+ /**
+ * Client-side OnSuccess event is raise after validation is successfull.
+ * This will override the default client-side validator behaviour.
+ * @param string javascript code for client-side OnSuccess event.
+ */
+ public function setOnValidationSuccess($javascript)
+ {
+ $this->setFunction('OnValidationSuccess', $javascript);
+ }
+
+ /**
+ * @return string javascript code for client-side OnSuccess event.
+ */
+ public function getOnValidationSuccess()
+ {
+ return $this->getOption('OnValidationSuccess');
+ }
+
+ /**
+ * Client-side OnError event is raised after validation failure.
+ * This will override the default client-side validator behaviour.
+ * @param string javascript code for client-side OnError event.
+ */
+ public function setOnValidationError($javascript)
+ {
+ $this->setFunction('OnValidationError', $javascript);
+ }
+
+ /**
+ * @return string javascript code for client-side OnError event.
+ */
+ public function getOnValidationError()
+ {
+ return $this->getOption('OnValidationError');
+ }
+
+ /**
+ * @param boolean true to revalidate when the control to validate changes value.
+ */
+ public function setObserveChanges($value)
+ {
+ $this->setOption('ObserveChanges', TPropertyValue::ensureBoolean($value));
+ }
+
+ /**
+ * @return boolean true to observe changes.
+ */
+ public function getObserveChanges()
+ {
+ $changes = $this->getOption('ObserveChanges');
+ return ($changes===null) ? true : $changes;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TValidatorDisplayStyle.php b/framework/Web/UI/WebControls/TValidatorDisplayStyle.php
new file mode 100644
index 00000000..8e3ca8b5
--- /dev/null
+++ b/framework/Web/UI/WebControls/TValidatorDisplayStyle.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TBaseValidator class file
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TValidatorDisplayStyle class.
+ * TValidatorDisplayStyle defines the enumerable type for the possible styles
+ * that a validator control can display the error message.
+ *
+ * The following enumerable values are defined:
+ * - None: the error message is not displayed
+ * - Dynamic: the error message dynamically appears when the validator fails validation
+ * - Fixed: Similar to Dynamic except that the error message physically occupies the page layout (even though it may not be visible)
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TValidatorDisplayStyle extends TEnumerable
+{
+ const None='None';
+ const Dynamic='Dynamic';
+ const Fixed='Fixed';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TVerticalAlign.php b/framework/Web/UI/WebControls/TVerticalAlign.php
new file mode 100644
index 00000000..d9b93634
--- /dev/null
+++ b/framework/Web/UI/WebControls/TVerticalAlign.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TStyle class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TVerticalAlign class.
+ * TVerticalAlign defines the enumerable type for the possible vertical alignments in a CSS style.
+ *
+ * The following enumerable values are defined:
+ * - NotSet: the alignment is not specified.
+ * - Top: top aligned
+ * - Bottom: bottom aligned
+ * - Middle: middle aligned
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TVerticalAlign extends TEnumerable
+{
+ const NotSet='NotSet';
+ const Top='Top';
+ const Bottom='Bottom';
+ const Middle='Middle';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TView.php b/framework/Web/UI/WebControls/TView.php
new file mode 100644
index 00000000..b165ea7c
--- /dev/null
+++ b/framework/Web/UI/WebControls/TView.php
@@ -0,0 +1,90 @@
+<?php
+/**
+ * TMultiView and TView class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TView class
+ *
+ * TView is a container for a group of controls. TView must be contained
+ * within a {@link TMultiView} control in which only one view can be active
+ * at one time.
+ *
+ * To activate a view, set {@link setActive Active} to true.
+ * When a view is activated, it raises {@link onActivate OnActivate} event;
+ * and when a view is deactivated, it raises {@link onDeactivate OnDeactivate}.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TView extends TControl
+{
+ private $_active=false;
+
+ /**
+ * Raises <b>OnActivate</b> event.
+ * @param TEventParameter event parameter
+ */
+ public function onActivate($param)
+ {
+ $this->raiseEvent('OnActivate',$this,$param);
+ }
+
+ /**
+ * Raises <b>OnDeactivate</b> event.
+ * @param TEventParameter event parameter
+ */
+ public function onDeactivate($param)
+ {
+ $this->raiseEvent('OnDeactivate',$this,$param);
+ }
+
+ /**
+ * @return boolean whether this view is active. Defaults to false.
+ */
+ public function getActive()
+ {
+ return $this->_active;
+ }
+
+ /**
+ * @param boolean whether this view is active.
+ */
+ public function setActive($value)
+ {
+ $value=TPropertyValue::ensureBoolean($value);
+ $this->_active=$value;
+ parent::setVisible($value);
+ }
+
+ /**
+ * @param boolean whether the parents should also be checked if visible
+ * @return boolean whether this view is visible.
+ * The view is visible if it is active and its parent is visible.
+ */
+ public function getVisible($checkParents=true)
+ {
+ if(($parent=$this->getParent())===null)
+ return $this->getActive();
+ else if($this->getActive())
+ return $parent->getVisible($checkParents);
+ else
+ return false;
+ }
+
+ /**
+ * @param boolean
+ * @throws TInvalidOperationException whenever this method is invoked.
+ */
+ public function setVisible($value)
+ {
+ throw new TInvalidOperationException('view_visible_readonly');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TViewCollection.php b/framework/Web/UI/WebControls/TViewCollection.php
new file mode 100644
index 00000000..aae7244f
--- /dev/null
+++ b/framework/Web/UI/WebControls/TViewCollection.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * TMultiView and TView class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TViewCollection class.
+ * TViewCollection represents a collection that only takes {@link TView} instances
+ * as collection elements.
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TViewCollection extends TControlCollection
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by ensuring only {@link TView}
+ * controls be added into the collection.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is neither a string nor a TControl.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TView)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('viewcollection_view_required');
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php
index 6b82a691..75653f4e 100644
--- a/framework/Web/UI/WebControls/TWizard.php
+++ b/framework/Web/UI/WebControls/TWizard.php
@@ -1434,712 +1434,4 @@ class TWizard extends TWebControl implements INamingContainer
}
return false;
}
-}
-
-
-/**
- * TWizardStep class.
- *
- * TWizardStep represents a wizard step. The wizard owning the step
- * can be obtained by {@link getWizard Wizard}.
- * To specify the type of the step, set {@link setStepType StepType};
- * For step title, set {@link setTitle Title}. If a step can be re-visited,
- * set {@link setAllowReturn AllowReturn} to true.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardStep extends TView
-{
- private $_wizard;
-
- /**
- * @return TWizard the wizard owning this step
- */
- public function getWizard()
- {
- return $this->_wizard;
- }
-
- /**
- * Sets the wizard owning this step.
- * This method is used internally by {@link TWizard}.
- * @param TWizard the wizard owning this step
- */
- public function setWizard($wizard)
- {
- $this->_wizard=$wizard;
- }
-
- /**
- * @return string the title for this step.
- */
- public function getTitle()
- {
- return $this->getViewState('Title','');
- }
-
- /**
- * @param string the title for this step.
- */
- public function setTitle($value)
- {
- $this->setViewState('Title',$value,'');
- if($this->_wizard)
- $this->_wizard->wizardStepsChanged();
- }
-
- /**
- * @return boolean whether this step can be re-visited. Default to true.
- */
- public function getAllowReturn()
- {
- return $this->getViewState('AllowReturn',true);
- }
-
- /**
- * @param boolean whether this step can be re-visited.
- */
- public function setAllowReturn($value)
- {
- $this->setViewState('AllowReturn',TPropertyValue::ensureBoolean($value),true);
- }
-
- /**
- * @return TWizardStepType the wizard step type. Defaults to TWizardStepType::Auto.
- */
- public function getStepType()
- {
- return $this->getViewState('StepType',TWizardStepType::Auto);
- }
-
- /**
- * @param TWizardStepType the wizard step type.
- */
- public function setStepType($type)
- {
- $type=TPropertyValue::ensureEnum($type,'TWizardStepType');
- if($type!==$this->getStepType())
- {
- $this->setViewState('StepType',$type,TWizardStepType::Auto);
- if($this->_wizard)
- $this->_wizard->wizardStepsChanged();
- }
- }
-}
-
-
-/**
- * TCompleteWizardStep class.
- *
- * TCompleteWizardStep represents a wizard step of type TWizardStepType::Complete.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TCompleteWizardStep extends TWizardStep
-{
- /**
- * @return TWizardStepType the wizard step type. Always TWizardStepType::Complete.
- */
- public function getStepType()
- {
- return TWizardStepType::Complete;
- }
-
- /**
- * @param string the wizard step type.
- * @throws TInvalidOperationException whenever this method is invoked.
- */
- public function setStepType($value)
- {
- throw new TInvalidOperationException('completewizardstep_steptype_readonly');
- }
-}
-
-
-/**
- * TTemplatedWizardStep class.
- *
- * TTemplatedWizardStep represents a wizard step whose content and navigation
- * can be customized using templates. To customize the step content, specify
- * {@link setContentTemplate ContentTemplate}. To customize navigation specific
- * to the step, specify {@link setNavigationTemplate NavigationTemplate}. Note,
- * if the navigation template is not specified, default navigation will be used.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TTemplatedWizardStep extends TWizardStep implements INamingContainer
-{
- /**
- * @var ITemplate the template for displaying the navigation UI of a wizard step.
- */
- private $_navigationTemplate=null;
- /**
- * @var ITemplate the template for displaying the content within the wizard step.
- */
- private $_contentTemplate=null;
- /**
- * @var TWizardNavigationContainer
- */
- private $_navigationContainer=null;
-
- /**
- * Creates child controls.
- * This method mainly instantiates the content template, if any.
- */
- public function createChildControls()
- {
- $this->getControls()->clear();
- if($this->_contentTemplate)
- $this->_contentTemplate->instantiateIn($this);
- }
-
- /**
- * Ensures child controls are created.
- * @param mixed event parameter
- */
- public function onInit($param)
- {
- parent::onInit($param);
- $this->ensureChildControls();
- }
-
- /**
- * @return ITemplate the template for the content of the wizard step.
- */
- public function getContentTemplate()
- {
- return $this->_contentTemplate;
- }
-
- /**
- * @param ITemplate the template for the content of the wizard step.
- */
- public function setContentTemplate($value)
- {
- $this->_contentTemplate=$value;
- }
-
- /**
- * @return ITemplate the template for displaying the navigation UI of a wizard step. Defaults to null.
- */
- public function getNavigationTemplate()
- {
- return $this->_navigationTemplate;
- }
-
- /**
- * @param ITemplate the template for displaying the navigation UI of a wizard step.
- */
- public function setNavigationTemplate($value)
- {
- $this->_navigationTemplate=$value;
- }
-
- /**
- * @return TWizardNavigationContainer the control containing the navigation.
- * It could be null if no navigation template is specified.
- */
- public function getNavigationContainer()
- {
- return $this->_navigationContainer;
- }
-
- /**
- * Instantiates the navigation template if any
- */
- public function instantiateNavigationTemplate()
- {
- if(!$this->_navigationContainer && $this->_navigationTemplate)
- {
- $this->_navigationContainer=new TWizardNavigationContainer;
- $this->_navigationTemplate->instantiateIn($this->_navigationContainer);
- }
- }
-}
-
-
-/**
- * TWizardStepCollection class.
- *
- * TWizardStepCollection represents the collection of wizard steps owned
- * by a {@link TWizard}.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardStepCollection extends TList
-{
- /**
- * @var TWizard
- */
- private $_wizard;
-
- /**
- * Constructor.
- * @param TWizard wizard that owns this collection
- */
- public function __construct(TWizard $wizard)
- {
- $this->_wizard=$wizard;
- }
-
- /**
- * Inserts an item at the specified position.
- * This method overrides the parent implementation by checking if
- * the item being added is a {@link TWizardStep}.
- * @param integer the speicified position.
- * @param mixed new item
- * @throws TInvalidDataTypeException if the item being added is not TWizardStep.
- */
- public function insertAt($index,$item)
- {
- if($item instanceof TWizardStep)
- {
- parent::insertAt($index,$item);
- $this->_wizard->getMultiView()->getViews()->insertAt($index,$item);
- $this->_wizard->addedWizardStep($item);
- }
- else
- throw new TInvalidDataTypeException('wizardstepcollection_wizardstep_required');
- }
-
- /**
- * Removes an item at the specified position.
- * @param integer the index of the item to be removed.
- * @return mixed the removed item.
- */
- public function removeAt($index)
- {
- $step=parent::removeAt($index);
- $this->_wizard->getMultiView()->getViews()->remove($step);
- $this->_wizard->removedWizardStep($step);
- return $step;
- }
-}
-
-
-/**
- * TWizardNavigationContainer class.
- *
- * TWizardNavigationContainer represents a control containing
- * a wizard navigation. The navigation may contain a few buttons, including
- * {@link getPreviousButton PreviousButton}, {@link getNextButton NextButton},
- * {@link getCancelButton CancelButton}, {@link getCompleteButton CompleteButton}.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardNavigationContainer extends TControl implements INamingContainer
-{
- private $_previousButton=null;
- private $_nextButton=null;
- private $_cancelButton=null;
- private $_completeButton=null;
-
- /**
- * @return mixed the previous button
- */
- public function getPreviousButton()
- {
- return $this->_previousButton;
- }
-
- /**
- * @param mixed the previous button
- */
- public function setPreviousButton($value)
- {
- $this->_previousButton=$value;
- }
-
- /**
- * @return mixed the next button
- */
- public function getNextButton()
- {
- return $this->_nextButton;
- }
-
- /**
- * @param mixed the next button
- */
- public function setNextButton($value)
- {
- $this->_nextButton=$value;
- }
-
- /**
- * @return mixed the cancel button
- */
- public function getCancelButton()
- {
- return $this->_cancelButton;
- }
-
- /**
- * @param mixed the cancel button
- */
- public function setCancelButton($value)
- {
- $this->_cancelButton=$value;
- }
-
- /**
- * @return mixed the complete button
- */
- public function getCompleteButton()
- {
- return $this->_completeButton;
- }
-
- /**
- * @param mixed the complete button
- */
- public function setCompleteButton($value)
- {
- $this->_completeButton=$value;
- }
-}
-
-
-/**
- * TWizardNavigationEventParameter class.
- *
- * TWizardNavigationEventParameter represents the parameter for
- * {@link TWizard}'s navigation events.
- *
- * The index of the currently active step can be obtained from
- * {@link getCurrentStepIndex CurrentStepIndex}, while the index
- * of the candidate new step is in {@link getNextStepIndex NextStepIndex}.
- * By modifying {@link setNextStepIndex NextStepIndex}, the new step
- * can be changed to another one. If there is anything wrong with
- * the navigation and it is not wanted, set {@link setCancelNavigation CancelNavigation}
- * to true.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardNavigationEventParameter extends TEventParameter
-{
- private $_cancel=false;
- private $_currentStep;
- private $_nextStep;
-
- /**
- * Constructor.
- * @param integer current step index
- */
- public function __construct($currentStep)
- {
- $this->_currentStep=$currentStep;
- $this->_nextStep=$currentStep;
- }
-
- /**
- * @return integer the zero-based index of the currently active step.
- */
- public function getCurrentStepIndex()
- {
- return $this->_currentStep;
- }
-
- /**
- * @return integer the zero-based index of the next step. Default to {@link getCurrentStepIndex CurrentStepIndex}.
- */
- public function getNextStepIndex()
- {
- return $this->_nextStep;
- }
-
- /**
- * @param integer the zero-based index of the next step.
- */
- public function setNextStepIndex($index)
- {
- $this->_nextStep=TPropertyValue::ensureInteger($index);
- }
-
- /**
- * @return boolean whether navigation to the next step should be canceled. Default to false.
- */
- public function getCancelNavigation()
- {
- return $this->_cancel;
- }
-
- /**
- * @param boolean whether navigation to the next step should be canceled.
- */
- public function setCancelNavigation($value)
- {
- $this->_cancel=TPropertyValue::ensureBoolean($value);
- }
-}
-
-/**
- * TWizardSideBarTemplate class.
- * TWizardSideBarTemplate is the default template for wizard sidebar.
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardSideBarTemplate extends TComponent implements ITemplate
-{
- /**
- * Instantiates the template.
- * It creates a {@link TDataList} control.
- * @param TControl parent to hold the content within the template
- */
- public function instantiateIn($parent)
- {
- $dataList=new TDataList;
- $dataList->setID(TWizard::ID_SIDEBAR_LIST);
- $dataList->getSelectedItemStyle()->getFont()->setBold(true);
- $dataList->setItemTemplate(new TWizardSideBarListItemTemplate);
- $parent->getControls()->add($dataList);
- }
-}
-
-/**
- * TWizardSideBarListItemTemplate class.
- * TWizardSideBarListItemTemplate is the default template for each item in the sidebar datalist.
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardSideBarListItemTemplate extends TComponent implements ITemplate
-{
- /**
- * Instantiates the template.
- * It creates a {@link TLinkButton}.
- * @param TControl parent to hold the content within the template
- */
- public function instantiateIn($parent)
- {
- $button=new TLinkButton;
- $button->setID(TWizard::ID_SIDEBAR_BUTTON);
- $parent->getControls()->add($button);
- }
-}
-
-/**
- * TWizardNavigationTemplate class.
- * TWizardNavigationTemplate is the base class for various navigation templates.
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardNavigationTemplate extends TComponent implements ITemplate
-{
- private $_wizard;
-
- /**
- * Constructor.
- * @param TWizard the wizard owning this template
- */
- public function __construct($wizard)
- {
- $this->_wizard=$wizard;
- }
-
- /**
- * @return TWizard the wizard owning this template
- */
- public function getWizard()
- {
- return $this->_wizard;
- }
-
- /**
- * Instantiates the template.
- * Derived classes should override this method.
- * @param TControl parent to hold the content within the template
- */
- public function instantiateIn($parent)
- {
- }
-
- /**
- * Creates a navigation button.
- * It creates a {@link TButton}, {@link TLinkButton}, or {@link TImageButton},
- * depending on the given parameters.
- * @param TWizardNavigationButtonStyle button style
- * @param boolean whether the button should cause validation
- * @param string command name for the button's OnCommand event
- * @throws TInvalidDataValueException if the button type is not recognized
- */
- protected function createNavigationButton($buttonStyle,$causesValidation,$commandName)
- {
- switch($buttonStyle->getButtonType())
- {
- case TWizardNavigationButtonType::Button:
- $button=new TButton;
- break;
- case TWizardNavigationButtonType::Link:
- $button=new TLinkButton;
- break;
- case TWizardNavigationButtonType::Image:
- $button=new TImageButton;
- $button->setImageUrl($buttonStyle->getImageUrl());
- break;
- default:
- throw new TInvalidDataValueException('wizard_buttontype_unknown',$buttonStyle->getButtonType());
- }
- $button->setText($buttonStyle->getButtonText());
- $button->setCausesValidation($causesValidation);
- $button->setCommandName($commandName);
- return $button;
- }
-}
-
-/**
- * TWizardStartNavigationTemplate class.
- * TWizardStartNavigationTemplate is the template used as default wizard start navigation panel.
- * It consists of two buttons, Next and Cancel.
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardStartNavigationTemplate extends TWizardNavigationTemplate
-{
- /**
- * Instantiates the template.
- * @param TControl parent to hold the content within the template
- */
- public function instantiateIn($parent)
- {
- $nextButton=$this->createNavigationButton($this->getWizard()->getStartNextButtonStyle(),true,TWizard::CMD_NEXT);
- $cancelButton=$this->createNavigationButton($this->getWizard()->getCancelButtonStyle(),false,TWizard::CMD_CANCEL);
-
- $controls=$parent->getControls();
- $controls->add($nextButton);
- $controls->add("\n");
- $controls->add($cancelButton);
-
- $parent->setNextButton($nextButton);
- $parent->setCancelButton($cancelButton);
- }
-}
-
-/**
- * TWizardFinishNavigationTemplate class.
- * TWizardFinishNavigationTemplate is the template used as default wizard finish navigation panel.
- * It consists of three buttons, Previous, Complete and Cancel.
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardFinishNavigationTemplate extends TWizardNavigationTemplate
-{
- /**
- * Instantiates the template.
- * @param TControl parent to hold the content within the template
- */
- public function instantiateIn($parent)
- {
- $previousButton=$this->createNavigationButton($this->getWizard()->getFinishPreviousButtonStyle(),false,TWizard::CMD_PREVIOUS);
- $completeButton=$this->createNavigationButton($this->getWizard()->getFinishCompleteButtonStyle(),true,TWizard::CMD_COMPLETE);
- $cancelButton=$this->createNavigationButton($this->getWizard()->getCancelButtonStyle(),false,TWizard::CMD_CANCEL);
-
- $controls=$parent->getControls();
- $controls->add($previousButton);
- $controls->add("\n");
- $controls->add($completeButton);
- $controls->add("\n");
- $controls->add($cancelButton);
-
- $parent->setPreviousButton($previousButton);
- $parent->setCompleteButton($completeButton);
- $parent->setCancelButton($cancelButton);
- }
-}
-
-/**
- * TWizardStepNavigationTemplate class.
- * TWizardStepNavigationTemplate is the template used as default wizard step navigation panel.
- * It consists of three buttons, Previous, Next and Cancel.
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TWizardStepNavigationTemplate extends TWizardNavigationTemplate
-{
- /**
- * Instantiates the template.
- * @param TControl parent to hold the content within the template
- */
- public function instantiateIn($parent)
- {
- $previousButton=$this->createNavigationButton($this->getWizard()->getStepPreviousButtonStyle(),false,TWizard::CMD_PREVIOUS);
- $nextButton=$this->createNavigationButton($this->getWizard()->getStepNextButtonStyle(),true,TWizard::CMD_NEXT);
- $cancelButton=$this->createNavigationButton($this->getWizard()->getCancelButtonStyle(),false,TWizard::CMD_CANCEL);
-
- $controls=$parent->getControls();
- $controls->add($previousButton);
- $controls->add("\n");
- $controls->add($nextButton);
- $controls->add("\n");
- $controls->add($cancelButton);
-
- $parent->setPreviousButton($previousButton);
- $parent->setNextButton($nextButton);
- $parent->setCancelButton($cancelButton);
- }
-}
-
-
-/**
- * TWizardNavigationButtonType class.
- * TWizardNavigationButtonType defines the enumerable type for the possible types of buttons
- * that can be used in the navigation part of a {@link TWizard}.
- *
- * The following enumerable values are defined:
- * - Button: a regular click button
- * - Image: an image button
- * - Link: a hyperlink button
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TWizardNavigationButtonType extends TEnumerable
-{
- const Button='Button';
- const Image='Image';
- const Link='Link';
-}
-
-
-/**
- * TWizardStepType class.
- * TWizardStepType defines the enumerable type for the possible types of {@link TWizard wizard} steps.
- *
- * The following enumerable values are defined:
- * - Auto: the type is automatically determined based on the location of the wizard step in the whole step collection.
- * - Complete: the step is the last summary step.
- * - Start: the step is the first step
- * - Step: the step is between the begin and the end steps.
- * - Finish: the last step before the Complete step.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @package System.Web.UI.WebControls
- * @since 3.0.4
- */
-class TWizardStepType extends TEnumerable
-{
- const Auto='Auto';
- const Complete='Complete';
- const Start='Start';
- const Step='Step';
- const Finish='Finish';
-}
-
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardFinishNavigationTemplate.php b/framework/Web/UI/WebControls/TWizardFinishNavigationTemplate.php
new file mode 100644
index 00000000..d5ea53bf
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardFinishNavigationTemplate.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TWizardFinishNavigationTemplate class.
+ * TWizardFinishNavigationTemplate is the template used as default wizard finish navigation panel.
+ * It consists of three buttons, Previous, Complete and Cancel.
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardFinishNavigationTemplate extends TWizardNavigationTemplate
+{
+ /**
+ * Instantiates the template.
+ * @param TControl parent to hold the content within the template
+ */
+ public function instantiateIn($parent)
+ {
+ $previousButton=$this->createNavigationButton($this->getWizard()->getFinishPreviousButtonStyle(),false,TWizard::CMD_PREVIOUS);
+ $completeButton=$this->createNavigationButton($this->getWizard()->getFinishCompleteButtonStyle(),true,TWizard::CMD_COMPLETE);
+ $cancelButton=$this->createNavigationButton($this->getWizard()->getCancelButtonStyle(),false,TWizard::CMD_CANCEL);
+
+ $controls=$parent->getControls();
+ $controls->add($previousButton);
+ $controls->add("\n");
+ $controls->add($completeButton);
+ $controls->add("\n");
+ $controls->add($cancelButton);
+
+ $parent->setPreviousButton($previousButton);
+ $parent->setCompleteButton($completeButton);
+ $parent->setCancelButton($cancelButton);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardNavigationButtonType.php b/framework/Web/UI/WebControls/TWizardNavigationButtonType.php
new file mode 100644
index 00000000..8105c8b0
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardNavigationButtonType.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TWizardNavigationButtonType class.
+ * TWizardNavigationButtonType defines the enumerable type for the possible types of buttons
+ * that can be used in the navigation part of a {@link TWizard}.
+ *
+ * The following enumerable values are defined:
+ * - Button: a regular click button
+ * - Image: an image button
+ * - Link: a hyperlink button
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TWizardNavigationButtonType extends TEnumerable
+{
+ const Button='Button';
+ const Image='Image';
+ const Link='Link';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardNavigationContainer.php b/framework/Web/UI/WebControls/TWizardNavigationContainer.php
new file mode 100644
index 00000000..d9822d3f
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardNavigationContainer.php
@@ -0,0 +1,95 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TWizardNavigationContainer class.
+ *
+ * TWizardNavigationContainer represents a control containing
+ * a wizard navigation. The navigation may contain a few buttons, including
+ * {@link getPreviousButton PreviousButton}, {@link getNextButton NextButton},
+ * {@link getCancelButton CancelButton}, {@link getCompleteButton CompleteButton}.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardNavigationContainer extends TControl implements INamingContainer
+{
+ private $_previousButton=null;
+ private $_nextButton=null;
+ private $_cancelButton=null;
+ private $_completeButton=null;
+
+ /**
+ * @return mixed the previous button
+ */
+ public function getPreviousButton()
+ {
+ return $this->_previousButton;
+ }
+
+ /**
+ * @param mixed the previous button
+ */
+ public function setPreviousButton($value)
+ {
+ $this->_previousButton=$value;
+ }
+
+ /**
+ * @return mixed the next button
+ */
+ public function getNextButton()
+ {
+ return $this->_nextButton;
+ }
+
+ /**
+ * @param mixed the next button
+ */
+ public function setNextButton($value)
+ {
+ $this->_nextButton=$value;
+ }
+
+ /**
+ * @return mixed the cancel button
+ */
+ public function getCancelButton()
+ {
+ return $this->_cancelButton;
+ }
+
+ /**
+ * @param mixed the cancel button
+ */
+ public function setCancelButton($value)
+ {
+ $this->_cancelButton=$value;
+ }
+
+ /**
+ * @return mixed the complete button
+ */
+ public function getCompleteButton()
+ {
+ return $this->_completeButton;
+ }
+
+ /**
+ * @param mixed the complete button
+ */
+ public function setCompleteButton($value)
+ {
+ $this->_completeButton=$value;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardNavigationEventParameter.php b/framework/Web/UI/WebControls/TWizardNavigationEventParameter.php
new file mode 100644
index 00000000..0629c14e
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardNavigationEventParameter.php
@@ -0,0 +1,86 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TWizardNavigationEventParameter class.
+ *
+ * TWizardNavigationEventParameter represents the parameter for
+ * {@link TWizard}'s navigation events.
+ *
+ * The index of the currently active step can be obtained from
+ * {@link getCurrentStepIndex CurrentStepIndex}, while the index
+ * of the candidate new step is in {@link getNextStepIndex NextStepIndex}.
+ * By modifying {@link setNextStepIndex NextStepIndex}, the new step
+ * can be changed to another one. If there is anything wrong with
+ * the navigation and it is not wanted, set {@link setCancelNavigation CancelNavigation}
+ * to true.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardNavigationEventParameter extends TEventParameter
+{
+ private $_cancel=false;
+ private $_currentStep;
+ private $_nextStep;
+
+ /**
+ * Constructor.
+ * @param integer current step index
+ */
+ public function __construct($currentStep)
+ {
+ $this->_currentStep=$currentStep;
+ $this->_nextStep=$currentStep;
+ }
+
+ /**
+ * @return integer the zero-based index of the currently active step.
+ */
+ public function getCurrentStepIndex()
+ {
+ return $this->_currentStep;
+ }
+
+ /**
+ * @return integer the zero-based index of the next step. Default to {@link getCurrentStepIndex CurrentStepIndex}.
+ */
+ public function getNextStepIndex()
+ {
+ return $this->_nextStep;
+ }
+
+ /**
+ * @param integer the zero-based index of the next step.
+ */
+ public function setNextStepIndex($index)
+ {
+ $this->_nextStep=TPropertyValue::ensureInteger($index);
+ }
+
+ /**
+ * @return boolean whether navigation to the next step should be canceled. Default to false.
+ */
+ public function getCancelNavigation()
+ {
+ return $this->_cancel;
+ }
+
+ /**
+ * @param boolean whether navigation to the next step should be canceled.
+ */
+ public function setCancelNavigation($value)
+ {
+ $this->_cancel=TPropertyValue::ensureBoolean($value);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardNavigationTemplate.php b/framework/Web/UI/WebControls/TWizardNavigationTemplate.php
new file mode 100644
index 00000000..0dd7ca5a
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardNavigationTemplate.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TWizardNavigationTemplate class.
+ * TWizardNavigationTemplate is the base class for various navigation templates.
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardNavigationTemplate extends TComponent implements ITemplate
+{
+ private $_wizard;
+
+ /**
+ * Constructor.
+ * @param TWizard the wizard owning this template
+ */
+ public function __construct($wizard)
+ {
+ $this->_wizard=$wizard;
+ }
+
+ /**
+ * @return TWizard the wizard owning this template
+ */
+ public function getWizard()
+ {
+ return $this->_wizard;
+ }
+
+ /**
+ * Instantiates the template.
+ * Derived classes should override this method.
+ * @param TControl parent to hold the content within the template
+ */
+ public function instantiateIn($parent)
+ {
+ }
+
+ /**
+ * Creates a navigation button.
+ * It creates a {@link TButton}, {@link TLinkButton}, or {@link TImageButton},
+ * depending on the given parameters.
+ * @param TWizardNavigationButtonStyle button style
+ * @param boolean whether the button should cause validation
+ * @param string command name for the button's OnCommand event
+ * @throws TInvalidDataValueException if the button type is not recognized
+ */
+ protected function createNavigationButton($buttonStyle,$causesValidation,$commandName)
+ {
+ switch($buttonStyle->getButtonType())
+ {
+ case TWizardNavigationButtonType::Button:
+ $button=new TButton;
+ break;
+ case TWizardNavigationButtonType::Link:
+ $button=new TLinkButton;
+ break;
+ case TWizardNavigationButtonType::Image:
+ $button=new TImageButton;
+ $button->setImageUrl($buttonStyle->getImageUrl());
+ break;
+ default:
+ throw new TInvalidDataValueException('wizard_buttontype_unknown',$buttonStyle->getButtonType());
+ }
+ $button->setText($buttonStyle->getButtonText());
+ $button->setCausesValidation($causesValidation);
+ $button->setCommandName($commandName);
+ return $button;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardSideBarListItemTemplate.php b/framework/Web/UI/WebControls/TWizardSideBarListItemTemplate.php
new file mode 100644
index 00000000..fd5562ae
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardSideBarListItemTemplate.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TWizardSideBarListItemTemplate class.
+ * TWizardSideBarListItemTemplate is the default template for each item in the sidebar datalist.
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardSideBarListItemTemplate extends TComponent implements ITemplate
+{
+ /**
+ * Instantiates the template.
+ * It creates a {@link TLinkButton}.
+ * @param TControl parent to hold the content within the template
+ */
+ public function instantiateIn($parent)
+ {
+ $button=new TLinkButton;
+ $button->setID(TWizard::ID_SIDEBAR_BUTTON);
+ $parent->getControls()->add($button);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardSideBarTemplate.php b/framework/Web/UI/WebControls/TWizardSideBarTemplate.php
new file mode 100644
index 00000000..ca073e53
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardSideBarTemplate.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TWizardSideBarTemplate class.
+ * TWizardSideBarTemplate is the default template for wizard sidebar.
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardSideBarTemplate extends TComponent implements ITemplate
+{
+ /**
+ * Instantiates the template.
+ * It creates a {@link TDataList} control.
+ * @param TControl parent to hold the content within the template
+ */
+ public function instantiateIn($parent)
+ {
+ $dataList=new TDataList;
+ $dataList->setID(TWizard::ID_SIDEBAR_LIST);
+ $dataList->getSelectedItemStyle()->getFont()->setBold(true);
+ $dataList->setItemTemplate(new TWizardSideBarListItemTemplate);
+ $parent->getControls()->add($dataList);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardStartNavigationTemplate.php b/framework/Web/UI/WebControls/TWizardStartNavigationTemplate.php
new file mode 100644
index 00000000..9e3e5955
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardStartNavigationTemplate.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TWizardStartNavigationTemplate class.
+ * TWizardStartNavigationTemplate is the template used as default wizard start navigation panel.
+ * It consists of two buttons, Next and Cancel.
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardStartNavigationTemplate extends TWizardNavigationTemplate
+{
+ /**
+ * Instantiates the template.
+ * @param TControl parent to hold the content within the template
+ */
+ public function instantiateIn($parent)
+ {
+ $nextButton=$this->createNavigationButton($this->getWizard()->getStartNextButtonStyle(),true,TWizard::CMD_NEXT);
+ $cancelButton=$this->createNavigationButton($this->getWizard()->getCancelButtonStyle(),false,TWizard::CMD_CANCEL);
+
+ $controls=$parent->getControls();
+ $controls->add($nextButton);
+ $controls->add("\n");
+ $controls->add($cancelButton);
+
+ $parent->setNextButton($nextButton);
+ $parent->setCancelButton($cancelButton);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardStep.php b/framework/Web/UI/WebControls/TWizardStep.php
new file mode 100644
index 00000000..347ceeeb
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardStep.php
@@ -0,0 +1,103 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TWizardStep class.
+ *
+ * TWizardStep represents a wizard step. The wizard owning the step
+ * can be obtained by {@link getWizard Wizard}.
+ * To specify the type of the step, set {@link setStepType StepType};
+ * For step title, set {@link setTitle Title}. If a step can be re-visited,
+ * set {@link setAllowReturn AllowReturn} to true.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardStep extends TView
+{
+ private $_wizard;
+
+ /**
+ * @return TWizard the wizard owning this step
+ */
+ public function getWizard()
+ {
+ return $this->_wizard;
+ }
+
+ /**
+ * Sets the wizard owning this step.
+ * This method is used internally by {@link TWizard}.
+ * @param TWizard the wizard owning this step
+ */
+ public function setWizard($wizard)
+ {
+ $this->_wizard=$wizard;
+ }
+
+ /**
+ * @return string the title for this step.
+ */
+ public function getTitle()
+ {
+ return $this->getViewState('Title','');
+ }
+
+ /**
+ * @param string the title for this step.
+ */
+ public function setTitle($value)
+ {
+ $this->setViewState('Title',$value,'');
+ if($this->_wizard)
+ $this->_wizard->wizardStepsChanged();
+ }
+
+ /**
+ * @return boolean whether this step can be re-visited. Default to true.
+ */
+ public function getAllowReturn()
+ {
+ return $this->getViewState('AllowReturn',true);
+ }
+
+ /**
+ * @param boolean whether this step can be re-visited.
+ */
+ public function setAllowReturn($value)
+ {
+ $this->setViewState('AllowReturn',TPropertyValue::ensureBoolean($value),true);
+ }
+
+ /**
+ * @return TWizardStepType the wizard step type. Defaults to TWizardStepType::Auto.
+ */
+ public function getStepType()
+ {
+ return $this->getViewState('StepType',TWizardStepType::Auto);
+ }
+
+ /**
+ * @param TWizardStepType the wizard step type.
+ */
+ public function setStepType($type)
+ {
+ $type=TPropertyValue::ensureEnum($type,'TWizardStepType');
+ if($type!==$this->getStepType())
+ {
+ $this->setViewState('StepType',$type,TWizardStepType::Auto);
+ if($this->_wizard)
+ $this->_wizard->wizardStepsChanged();
+ }
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardStepCollection.php b/framework/Web/UI/WebControls/TWizardStepCollection.php
new file mode 100644
index 00000000..8a205c75
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardStepCollection.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TWizardStepCollection class.
+ *
+ * TWizardStepCollection represents the collection of wizard steps owned
+ * by a {@link TWizard}.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardStepCollection extends TList
+{
+ /**
+ * @var TWizard
+ */
+ private $_wizard;
+
+ /**
+ * Constructor.
+ * @param TWizard wizard that owns this collection
+ */
+ public function __construct(TWizard $wizard)
+ {
+ $this->_wizard=$wizard;
+ }
+
+ /**
+ * Inserts an item at the specified position.
+ * This method overrides the parent implementation by checking if
+ * the item being added is a {@link TWizardStep}.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item being added is not TWizardStep.
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof TWizardStep)
+ {
+ parent::insertAt($index,$item);
+ $this->_wizard->getMultiView()->getViews()->insertAt($index,$item);
+ $this->_wizard->addedWizardStep($item);
+ }
+ else
+ throw new TInvalidDataTypeException('wizardstepcollection_wizardstep_required');
+ }
+
+ /**
+ * Removes an item at the specified position.
+ * @param integer the index of the item to be removed.
+ * @return mixed the removed item.
+ */
+ public function removeAt($index)
+ {
+ $step=parent::removeAt($index);
+ $this->_wizard->getMultiView()->getViews()->remove($step);
+ $this->_wizard->removedWizardStep($step);
+ return $step;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardStepNavigationTemplate.php b/framework/Web/UI/WebControls/TWizardStepNavigationTemplate.php
new file mode 100644
index 00000000..ed75bc26
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardStepNavigationTemplate.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+/**
+ * TWizardStepNavigationTemplate class.
+ * TWizardStepNavigationTemplate is the template used as default wizard step navigation panel.
+ * It consists of three buttons, Previous, Next and Cancel.
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TWizardStepNavigationTemplate extends TWizardNavigationTemplate
+{
+ /**
+ * Instantiates the template.
+ * @param TControl parent to hold the content within the template
+ */
+ public function instantiateIn($parent)
+ {
+ $previousButton=$this->createNavigationButton($this->getWizard()->getStepPreviousButtonStyle(),false,TWizard::CMD_PREVIOUS);
+ $nextButton=$this->createNavigationButton($this->getWizard()->getStepNextButtonStyle(),true,TWizard::CMD_NEXT);
+ $cancelButton=$this->createNavigationButton($this->getWizard()->getCancelButtonStyle(),false,TWizard::CMD_CANCEL);
+
+ $controls=$parent->getControls();
+ $controls->add($previousButton);
+ $controls->add("\n");
+ $controls->add($nextButton);
+ $controls->add("\n");
+ $controls->add($cancelButton);
+
+ $parent->setPreviousButton($previousButton);
+ $parent->setNextButton($nextButton);
+ $parent->setCancelButton($cancelButton);
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TWizardStepType.php b/framework/Web/UI/WebControls/TWizardStepType.php
new file mode 100644
index 00000000..5a4bd95d
--- /dev/null
+++ b/framework/Web/UI/WebControls/TWizardStepType.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * TWizard and the relevant class definitions.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.WebControls
+ */
+
+
+/**
+ * TWizardStepType class.
+ * TWizardStepType defines the enumerable type for the possible types of {@link TWizard wizard} steps.
+ *
+ * The following enumerable values are defined:
+ * - Auto: the type is automatically determined based on the location of the wizard step in the whole step collection.
+ * - Complete: the step is the last summary step.
+ * - Start: the step is the first step
+ * - Step: the step is between the begin and the end steps.
+ * - Finish: the last step before the Complete step.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TWizardStepType extends TEnumerable
+{
+ const Auto='Auto';
+ const Complete='Complete';
+ const Start='Start';
+ const Step='Step';
+ const Finish='Finish';
+} \ No newline at end of file