summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
authorcarlgmathisen <>2008-11-02 23:56:37 +0000
committercarlgmathisen <>2008-11-02 23:56:37 +0000
commit8d9364f64440f4c0c625f2447f4658d4d821731e (patch)
tree0f027e2266dfd990c39796af06a292ace768eb38 /framework/Web/UI
parente5764aecfdfcae26869f4fecc49c3252ccff5d5b (diff)
Issue #29
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php44
1 files changed, 41 insertions, 3 deletions
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index 6b7e96a9..916902cd 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -59,6 +59,10 @@ Prado::using('System.Web.UI.WebControls.TTextBox');
* In <tt>DropDownList</tt> mode, in addition to the popup date picker, three
* drop down list (day, month and year) are presented to select the date .
*
+ * The <b>PositionMode</b> property can be set to "Top" or "Bottom" with default
+ * as "Bottom". It specifies the position of the calendar popup, relative to the
+ * input field.
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @version $Id$
* @package System.Web.UI.WebControls
@@ -263,6 +267,22 @@ class TDatePicker extends TTextBox
{
return $this->getViewState('UpToYear', intval(@date('Y'))+10);
}
+
+ /**
+ * @param TDatePickerPositionMode calendar UI position
+ */
+ public function setPositionMode($value)
+ {
+ $this->setViewState('PositionMode', TPropertyValue::ensureEnum($value, 'TDatePickerPositionMode'), TDatePickerPositionMode::Bottom);
+ }
+
+ /**
+ * @return TDatePickerPositionMode current calendar UI position.
+ */
+ public function getPositionMode()
+ {
+ return $this->getViewState('PositionMode', TDatePickerPositionMode::Bottom);
+ }
/**
* @return integer current selected date from the date picker as timestamp, NULL if timestamp is not set previously.
@@ -505,6 +525,7 @@ class TDatePicker extends TTextBox
$options['UpToYear'] = $this->getUpToYear();
if($this->getMode()!==TDatePickerMode::Basic)
$options['Trigger'] = $this->getDatePickerButtonID();
+ $options['PositionMode'] = $this->getPositionMode();
$options = array_merge($options, $this->getCulturalOptions());
if(!is_null($this->_clientScript))
@@ -853,8 +874,8 @@ class TDatePicker extends TTextBox
*
* 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
+ * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
+ * as parameter to this event
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @version $Id$
@@ -923,3 +944,20 @@ class TDatePickerMode extends TEnumerable
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