summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php211
-rw-r--r--framework/Web/UI/WebControls/TDataGridPagerStyle.php222
4 files changed, 226 insertions, 209 deletions
diff --git a/.gitattributes b/.gitattributes
index a7050ef7..e5eb7b29 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2074,6 +2074,7 @@ framework/Web/UI/WebControls/TDataBoundControl.php -text
framework/Web/UI/WebControls/TDataGrid.php -text
framework/Web/UI/WebControls/TDataGridColumn.php -text
framework/Web/UI/WebControls/TDataGridItemRenderer.php -text
+framework/Web/UI/WebControls/TDataGridPagerStyle.php -text
framework/Web/UI/WebControls/TDataList.php -text
framework/Web/UI/WebControls/TDataListItemRenderer.php -text
framework/Web/UI/WebControls/TDataSourceControl.php -text
diff --git a/HISTORY b/HISTORY
index 6e7c19c0..7139846d 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,5 +1,6 @@
Version 3.1.0 beta to be released
=================================
+BUG: Ticket#492 - TDataGridPagerStyle not found error (Qiang)
BUG: Ticket#517 - Quickstart I18N sample: conflicting module ID (Wei)
BUG: Ticket#521 - comment tag on TActiveButton stop callback (Wei)
BUG: TXmlElement did not encode attribute and text values when being saved as a string (Qiang)
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index c10431da..411b3778 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -9,7 +9,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005 PradoSoft
+ * @copyright Copyright &copy; 2005-2007 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -23,6 +23,7 @@ Prado::using('System.Collections.TPagedDataSource');
Prado::using('System.Collections.TDummyDataSource');
Prado::using('System.Web.UI.WebControls.TTable');
Prado::using('System.Web.UI.WebControls.TPanel');
+Prado::using('System.Web.UI.WebControls.TDataGridPagerStyle');
/**
* TDataGrid class
@@ -2028,214 +2029,6 @@ class TDataGridColumnCollection extends TList
}
/**
- * TDataGridPagerStyle class.
- *
- * TDataGridPagerStyle specifies the styles available for a datagrid pager.
- *
- * @author Qiang Xue <qiang.xue@gmail.com>
- * @version $Id$
- * @package System.Web.UI.WebControls
- * @since 3.0
- */
-class TDataGridPagerStyle extends TPanelStyle
-{
- private $_mode=null;
- private $_nextText=null;
- private $_prevText=null;
- private $_buttonCount=null;
- private $_position=null;
- private $_visible=null;
- private $_buttonType=null;
-
- /**
- * @return TDataGridPagerMode pager mode. Defaults to TDataGridPagerMode::NextPrev.
- */
- public function getMode()
- {
- return $this->_mode===null?TDataGridPagerMode::NextPrev : $this->_mode;
- }
-
- /**
- * @param TDataGridPagerMode pager mode.
- */
- public function setMode($value)
- {
- $this->_mode=TPropertyValue::ensureEnum($value,'TDataGridPagerMode');
- }
-
- /**
- * @return TDataGridPagerButtonType the type of command button. Defaults to TDataGridPagerButtonType::LinkButton.
- */
- public function getButtonType()
- {
- return $this->_buttonType===null?TDataGridPagerButtonType::LinkButton:$this->_buttonType;
- }
-
- /**
- * @param TDataGridPagerButtonType the type of command button
- */
- public function setButtonType($value)
- {
- $this->_buttonType=TPropertyValue::ensureEnum($value,'TDataGridPagerButtonType');
- }
-
- /**
- * @return string text for the next page button. Defaults to '>'.
- */
- public function getNextPageText()
- {
- return $this->_nextText===null?'>':$this->_nextText;
- }
-
- /**
- * @param string text for the next page button.
- */
- public function setNextPageText($value)
- {
- $this->_nextText=$value;
- }
-
- /**
- * @return string text for the previous page button. Defaults to '<'.
- */
- public function getPrevPageText()
- {
- return $this->_prevText===null?'<':$this->_prevText;
- }
-
- /**
- * @param string text for the next page button.
- */
- public function setPrevPageText($value)
- {
- $this->_prevText=$value;
- }
-
- /**
- * @return integer maximum number of pager buttons to be displayed. Defaults to 10.
- */
- public function getPageButtonCount()
- {
- return $this->_buttonCount===null?10:$this->_buttonCount;
- }
-
- /**
- * @param integer maximum number of pager buttons to be displayed
- * @throws TInvalidDataValueException if the value is less than 1.
- */
- public function setPageButtonCount($value)
- {
- if(($value=TPropertyValue::ensureInteger($value))<1)
- throw new TInvalidDataValueException('datagridpagerstyle_pagebuttoncount_invalid');
- $this->_buttonCount=$value;
- }
-
- /**
- * @return TDataGridPagerPosition where the pager is to be displayed. Defaults to TDataGridPagerPosition::Bottom.
- */
- public function getPosition()
- {
- return $this->_position===null?TDataGridPagerPosition::Bottom:$this->_position;
- }
-
- /**
- * @param TDataGridPagerPosition where the pager is to be displayed.
- */
- public function setPosition($value)
- {
- $this->_position=TPropertyValue::ensureEnum($value,'TDataGridPagerPosition');
- }
-
- /**
- * @return boolean whether the pager is visible. Defaults to true.
- */
- public function getVisible()
- {
- return $this->_visible===null?true:$this->_visible;
- }
-
- /**
- * @param boolean whether the pager is visible.
- */
- public function setVisible($value)
- {
- $this->_visible=TPropertyValue::ensureBoolean($value);
- }
-
- /**
- * Resets the style to the original empty state.
- */
- public function reset()
- {
- parent::reset();
- $this->_visible=null;
- $this->_position=null;
- $this->_buttonCount=null;
- $this->_prevText=null;
- $this->_nextText=null;
- $this->_mode=null;
- $this->_buttonType=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 TDataGridPagerStyle)
- {
- if($style->_visible!==null)
- $this->_visible=$style->_visible;
- if($style->_position!==null)
- $this->_position=$style->_position;
- if($style->_buttonCount!==null)
- $this->_buttonCount=$style->_buttonCount;
- if($style->_prevText!==null)
- $this->_prevText=$style->_prevText;
- if($style->_nextText!==null)
- $this->_nextText=$style->_nextText;
- if($style->_mode!==null)
- $this->_mode=$style->_mode;
- if($style->_buttonType!==null)
- $this->_buttonType=$style->_buttonType;
- }
- }
-
- /**
- * 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 TDataGridPagerStyle)
- {
- if($this->_visible===null)
- $this->_visible=$style->_visible;
- if($this->_position===null)
- $this->_position=$style->_position;
- if($this->_buttonCount===null)
- $this->_buttonCount=$style->_buttonCount;
- if($this->_prevText===null)
- $this->_prevText=$style->_prevText;
- if($this->_nextText===null)
- $this->_nextText=$style->_nextText;
- if($this->_mode===null)
- $this->_mode=$style->_mode;
- if($this->_buttonType===null)
- $this->_buttonType=$style->_buttonType;
- }
- }
-}
-
-
-/**
* TDataGridPagerMode class.
* TDataGridPagerMode defines the enumerable type for the possible modes that a datagrid pager can take.
*
diff --git a/framework/Web/UI/WebControls/TDataGridPagerStyle.php b/framework/Web/UI/WebControls/TDataGridPagerStyle.php
new file mode 100644
index 00000000..91016510
--- /dev/null
+++ b/framework/Web/UI/WebControls/TDataGridPagerStyle.php
@@ -0,0 +1,222 @@
+<?php
+/**
+ * TDataGridPagerStyle class file.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2007 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @package System.Web.UI.WebControls
+ */
+
+Prado::using('System.Web.UI.WebControls.TDataGrid');
+
+/**
+ * TDataGridPagerStyle class.
+ *
+ * TDataGridPagerStyle specifies the styles available for a datagrid pager.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @version $Id$
+ * @package System.Web.UI.WebControls
+ * @since 3.0
+ */
+class TDataGridPagerStyle extends TPanelStyle
+{
+ private $_mode=null;
+ private $_nextText=null;
+ private $_prevText=null;
+ private $_buttonCount=null;
+ private $_position=null;
+ private $_visible=null;
+ private $_buttonType=null;
+
+ /**
+ * @return TDataGridPagerMode pager mode. Defaults to TDataGridPagerMode::NextPrev.
+ */
+ public function getMode()
+ {
+ return $this->_mode===null?TDataGridPagerMode::NextPrev : $this->_mode;
+ }
+
+ /**
+ * @param TDataGridPagerMode pager mode.
+ */
+ public function setMode($value)
+ {
+ $this->_mode=TPropertyValue::ensureEnum($value,'TDataGridPagerMode');
+ }
+
+ /**
+ * @return TDataGridPagerButtonType the type of command button. Defaults to TDataGridPagerButtonType::LinkButton.
+ */
+ public function getButtonType()
+ {
+ return $this->_buttonType===null?TDataGridPagerButtonType::LinkButton:$this->_buttonType;
+ }
+
+ /**
+ * @param TDataGridPagerButtonType the type of command button
+ */
+ public function setButtonType($value)
+ {
+ $this->_buttonType=TPropertyValue::ensureEnum($value,'TDataGridPagerButtonType');
+ }
+
+ /**
+ * @return string text for the next page button. Defaults to '>'.
+ */
+ public function getNextPageText()
+ {
+ return $this->_nextText===null?'>':$this->_nextText;
+ }
+
+ /**
+ * @param string text for the next page button.
+ */
+ public function setNextPageText($value)
+ {
+ $this->_nextText=$value;
+ }
+
+ /**
+ * @return string text for the previous page button. Defaults to '<'.
+ */
+ public function getPrevPageText()
+ {
+ return $this->_prevText===null?'<':$this->_prevText;
+ }
+
+ /**
+ * @param string text for the next page button.
+ */
+ public function setPrevPageText($value)
+ {
+ $this->_prevText=$value;
+ }
+
+ /**
+ * @return integer maximum number of pager buttons to be displayed. Defaults to 10.
+ */
+ public function getPageButtonCount()
+ {
+ return $this->_buttonCount===null?10:$this->_buttonCount;
+ }
+
+ /**
+ * @param integer maximum number of pager buttons to be displayed
+ * @throws TInvalidDataValueException if the value is less than 1.
+ */
+ public function setPageButtonCount($value)
+ {
+ if(($value=TPropertyValue::ensureInteger($value))<1)
+ throw new TInvalidDataValueException('datagridpagerstyle_pagebuttoncount_invalid');
+ $this->_buttonCount=$value;
+ }
+
+ /**
+ * @return TDataGridPagerPosition where the pager is to be displayed. Defaults to TDataGridPagerPosition::Bottom.
+ */
+ public function getPosition()
+ {
+ return $this->_position===null?TDataGridPagerPosition::Bottom:$this->_position;
+ }
+
+ /**
+ * @param TDataGridPagerPosition where the pager is to be displayed.
+ */
+ public function setPosition($value)
+ {
+ $this->_position=TPropertyValue::ensureEnum($value,'TDataGridPagerPosition');
+ }
+
+ /**
+ * @return boolean whether the pager is visible. Defaults to true.
+ */
+ public function getVisible()
+ {
+ return $this->_visible===null?true:$this->_visible;
+ }
+
+ /**
+ * @param boolean whether the pager is visible.
+ */
+ public function setVisible($value)
+ {
+ $this->_visible=TPropertyValue::ensureBoolean($value);
+ }
+
+ /**
+ * Resets the style to the original empty state.
+ */
+ public function reset()
+ {
+ parent::reset();
+ $this->_visible=null;
+ $this->_position=null;
+ $this->_buttonCount=null;
+ $this->_prevText=null;
+ $this->_nextText=null;
+ $this->_mode=null;
+ $this->_buttonType=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 TDataGridPagerStyle)
+ {
+ if($style->_visible!==null)
+ $this->_visible=$style->_visible;
+ if($style->_position!==null)
+ $this->_position=$style->_position;
+ if($style->_buttonCount!==null)
+ $this->_buttonCount=$style->_buttonCount;
+ if($style->_prevText!==null)
+ $this->_prevText=$style->_prevText;
+ if($style->_nextText!==null)
+ $this->_nextText=$style->_nextText;
+ if($style->_mode!==null)
+ $this->_mode=$style->_mode;
+ if($style->_buttonType!==null)
+ $this->_buttonType=$style->_buttonType;
+ }
+ }
+
+ /**
+ * 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 TDataGridPagerStyle)
+ {
+ if($this->_visible===null)
+ $this->_visible=$style->_visible;
+ if($this->_position===null)
+ $this->_position=$style->_position;
+ if($this->_buttonCount===null)
+ $this->_buttonCount=$style->_buttonCount;
+ if($this->_prevText===null)
+ $this->_prevText=$style->_prevText;
+ if($this->_nextText===null)
+ $this->_nextText=$style->_nextText;
+ if($this->_mode===null)
+ $this->_mode=$style->_mode;
+ if($this->_buttonType===null)
+ $this->_buttonType=$style->_buttonType;
+ }
+ }
+}
+
+?> \ No newline at end of file