From 6ab01ff111f2aca0786f4fd45df25ea6ad9be1ca Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 8 Jun 2016 15:19:11 +0200 Subject: * Prado upgraded to 3.3.1-rbd4929d --- .../Web/UI/ActiveControls/TActiveMultiView.php | 6 ------ lib/prado/framework/Web/UI/TControl.php | 25 ++++++++++++++++++++++ .../framework/Web/UI/WebControls/TDatePicker.php | 16 +++++++++----- 3 files changed, 36 insertions(+), 11 deletions(-) (limited to 'lib/prado/framework/Web/UI') diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php index 45c137d..ca26554 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php @@ -92,9 +92,6 @@ class TActiveMultiView extends TMultiView implements IActiveControl */ public function setActiveViewIndex($value) { - if(parent::getActiveViewIndex() === $value) - return; - parent::setActiveViewIndex($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); @@ -106,9 +103,6 @@ class TActiveMultiView extends TMultiView implements IActiveControl */ public function setActiveView($value) { - if(parent::getActiveView() === $value) - return; - parent::setActiveView($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); diff --git a/lib/prado/framework/Web/UI/TControl.php b/lib/prado/framework/Web/UI/TControl.php index be7b118..1b8a213 100644 --- a/lib/prado/framework/Web/UI/TControl.php +++ b/lib/prado/framework/Web/UI/TControl.php @@ -195,6 +195,31 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable return parent::__get($name); } + /** + * Checks for the existance of a property value by name or a control by ID. + * This overrides the parent implementation by allowing checking for the + * existance of a control via its ID using the following syntax, + * + * $menuBarExists = isset($this->menuBar); + * + * Do not call this method. This is a PHP magic method that we override + * to allow using isset() to detect if a component property is set or not. + * Note, the control must be configured in the template + * with explicit ID. If the name matches both a property and a control ID, + * the control ID will take the precedence. + * + * @param string the property name or control ID + * @return bool wether the control or property exists + * @see __get + */ + public function __isset($name) { + if(isset($this->_rf[self::RF_NAMED_OBJECTS][$name])) { + return true; + } else { + return parent::__isset($name); + } + } + /** * @return boolean whether there is an adapter for this control */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDatePicker.php b/lib/prado/framework/Web/UI/WebControls/TDatePicker.php index 7a164dd..a773c69 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDatePicker.php +++ b/lib/prado/framework/Web/UI/WebControls/TDatePicker.php @@ -483,10 +483,19 @@ class TDatePicker extends TTextBox { $date = @getdate(); - if(isset($values[$key.'$day'])) + $pattern = $this->getDateFormat(); + $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); + $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); + + $order = $formatter->getDayMonthYearOrdering(); + + if(isset($values[$key.'$day'])) { $day = intval($values[$key.'$day']); - else + } elseif(in_array('day', $order)) { $day = $date['mday']; + } else { + $day = 1; + } if(isset($values[$key.'$month'])) $month = intval($values[$key.'$month']) + 1; @@ -502,9 +511,6 @@ class TDatePicker extends TTextBox $date = $s->getTimeStamp(0, 0, 0, $month, $day, $year); //$date = @mktime(0, 0, 0, $month, $day, $year); - $pattern = $this->getDateFormat(); - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); return $formatter->format($date); } -- cgit v1.2.3