From 0f332e6564ed67ef7eb4d715ce3bcb5ff54c50cf Mon Sep 17 00:00:00 2001 From: Ciro Mattia Gonano Date: Wed, 24 Jul 2013 12:22:49 +0200 Subject: Upgrade to newly released 3.2.2 --- framework/Web/UI/WebControls/TButtonColumn.php | 7 +++-- .../Web/UI/WebControls/TEmailAddressValidator.php | 17 ++++++----- framework/Web/UI/WebControls/THyperLink.php | 31 ++++++++++++++++++-- framework/Web/UI/WebControls/TListControl.php | 7 +++-- .../Web/UI/WebControls/TRequiredFieldValidator.php | 24 ++++++++++++--- framework/Web/UI/WebControls/TWizard.php | 34 +++++++++++----------- 6 files changed, 84 insertions(+), 36 deletions(-) (limited to 'framework/Web/UI/WebControls') diff --git a/framework/Web/UI/WebControls/TButtonColumn.php b/framework/Web/UI/WebControls/TButtonColumn.php index 7a0484c3..258fecf2 100644 --- a/framework/Web/UI/WebControls/TButtonColumn.php +++ b/framework/Web/UI/WebControls/TButtonColumn.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TButtonColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -31,7 +31,7 @@ Prado::using('System.Web.UI.WebControls.TImageButton'); * If {@link setDataTextFormatString DataTextFormatString} is not empty, * the value will be formatted before rendering. * - * The buttons in the column can be set to display as hyperlinks or push buttons + * The buttons in the column can be set to display as hyperlinks, push buttons or images * by setting the {@link setButtonType ButtonType} property. * The {@link setCommandName CommandName} will assign its value to * all button's CommandName property. The datagrid will capture @@ -48,7 +48,7 @@ Prado::using('System.Web.UI.WebControls.TImageButton'); * datagrid cell is the first child. * * @author Qiang Xue - * @version $Id: TButtonColumn.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TButtonColumn.php 3287 2013-04-30 10:10:16Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -237,6 +237,7 @@ class TButtonColumn extends TDataGridColumn { $button=new TImageButton; $button->setImageUrl($this->getImageUrl()); + $button->setToolTip($this->getText()); } $button->setText($this->getText()); $button->setCommandName($this->getCommandName()); diff --git a/framework/Web/UI/WebControls/TEmailAddressValidator.php b/framework/Web/UI/WebControls/TEmailAddressValidator.php index 3bfd3e7b..dffe912e 100644 --- a/framework/Web/UI/WebControls/TEmailAddressValidator.php +++ b/framework/Web/UI/WebControls/TEmailAddressValidator.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TEmailAddressValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -24,7 +24,7 @@ Prado::using('System.Web.UI.WebControls.TRegularExpressionValidator'); * checkdnsrr() is available in the installed PHP. * * @author Qiang Xue - * @version $Id: TEmailAddressValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TEmailAddressValidator.php 3283 2013-03-24 10:19:08Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -32,8 +32,9 @@ class TEmailAddressValidator extends TRegularExpressionValidator { /** * Regular expression used to validate the email address + * @see http://www.regular-expressions.info/email.html */ - const EMAIL_REGEXP="\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; + const EMAIL_REGEXP='[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&\'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?'; /** * Gets the name of the javascript class responsible for performing validation for this control. @@ -60,10 +61,12 @@ class TEmailAddressValidator extends TRegularExpressionValidator */ public function evaluateIsValid() { - $valid=parent::evaluateIsValid(); + $value=$this->getValidationValue($this->getValidationTarget()); + $valid=$valid=is_string($value) && strlen($value)<=254 && parent::evaluateIsValid(); + if($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) { - if(($value=$this->getValidationValue($this->getValidationTarget()))!=='') + if($value!=='') { if(($pos=strpos($value,'@'))!==false) { @@ -82,7 +85,7 @@ class TEmailAddressValidator extends TRegularExpressionValidator */ public function getCheckMXRecord() { - return $this->getViewState('CheckMXRecord',true); + return $this->getViewState('CheckMXRecord',false); } /** @@ -91,7 +94,7 @@ class TEmailAddressValidator extends TRegularExpressionValidator */ public function setCheckMXRecord($value) { - $this->setViewState('CheckMXRecord',TPropertyValue::ensureBoolean($value),true); + $this->setViewState('CheckMXRecord',TPropertyValue::ensureBoolean($value),false); } } diff --git a/framework/Web/UI/WebControls/THyperLink.php b/framework/Web/UI/WebControls/THyperLink.php index bc6c3642..56aa5391 100644 --- a/framework/Web/UI/WebControls/THyperLink.php +++ b/framework/Web/UI/WebControls/THyperLink.php @@ -6,7 +6,7 @@ * @link http://www.xisc.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version $Id: THyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -17,13 +17,16 @@ * via the {@link setNavigateUrl NavigateUrl} property, and link text is via * the {@link setText Text} property. It is also possible to display an image * by setting the {@link setImageUrl ImageUrl} property. In this case, - * {@link getText Text} is displayed as the alternate text of the image. + * the alignment of the image displayed is set by the + * {@link setImageAlign ImageAlign} property and {@link getText Text} is + * displayed as the alternate text of the image. + * * The link target is specified via the {@link setTarget Target} property. * If both {@link getImageUrl ImageUrl} and {@link getText Text} are empty, * the content enclosed within the control tag will be rendered. * * @author Qiang Xue - * @version $Id: THyperLink.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: THyperLink.php 3286 2013-04-18 06:09:19Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -92,6 +95,8 @@ class THyperLink extends TWebControl implements IDataRenderer $image->setToolTip($toolTip); if(($text=$this->getText())!=='') $image->setAlternateText($text); + if(($align=$this->getImageAlign())!=='') + $image->setImageAlign($align); $image->setBorderWidth('0'); return $image; } @@ -113,6 +118,26 @@ class THyperLink extends TWebControl implements IDataRenderer $this->setViewState('Text',$value,''); } + /** + * @return string the alignment of the image with respective to other elements on the page, defaults to empty. + */ + public function getImageAlign() + { + return $this->getViewState('ImageAlign',''); + } + + /** + * Sets the alignment of the image with respective to other elements on the page. + * Possible values include: absbottom, absmiddle, baseline, bottom, left, + * middle, right, texttop, and top. If an empty string is passed in, + * imagealign attribute will not be rendered. + * @param string the alignment of the image + */ + public function setImageAlign($value) + { + $this->setViewState('ImageAlign',$value,''); + } + /** * @return string height of the image in the THyperLink */ diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index 2cd430d6..f9fdd77f 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -8,7 +8,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TListControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -75,8 +75,11 @@ Prado::using('System.Util.TDataFieldAccessor'); * used to format how the item should be displayed. See {@link formatDataValue()} * for an explanation of the format string. * + * The {@link setPromptText PromptText} and {@link setPromptValue PromptValue} properties can + * be used to add a dummy list item that will be rendered first. + * * @author Qiang Xue - * @version $Id: TListControl.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TListControl.php 3288 2013-04-30 10:36:50Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ diff --git a/framework/Web/UI/WebControls/TRequiredFieldValidator.php b/framework/Web/UI/WebControls/TRequiredFieldValidator.php index 8d370502..7a0bad8c 100644 --- a/framework/Web/UI/WebControls/TRequiredFieldValidator.php +++ b/framework/Web/UI/WebControls/TRequiredFieldValidator.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TRequiredFieldValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -25,8 +25,11 @@ Prado::using('System.Web.UI.WebControls.TBaseValidator'); * Validation will also succeed if input is of TListControl type and the number * of selected values different from the initial value is greater than zero. * + * If the input is of TListControl type and has a {@link TListControl::setPromptValue PromptValue} + * set, it will be automatically considered as the validator's {@link setInitialValue InitialValue}. + * * @author Qiang Xue - * @version $Id: TRequiredFieldValidator.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TRequiredFieldValidator.php 3288 2013-04-30 10:36:50Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -43,15 +46,28 @@ class TRequiredFieldValidator extends TBaseValidator } /** - * @return string the initial value of the associated input control. Defaults to empty string. + * @return string the initial value of the associated input control. Defaults to empty string + * unless the control has a prompt value set. * If the associated input control does not change from this initial value * upon postback, the validation fails. */ public function getInitialValue() { - return $this->getViewState('InitialValue',''); + return $this->getViewState('InitialValue',$this->getControlPromptValue()); } + /** + * @return string the initial value of the associated input control. Defaults to empty string. + * If the associated input control does not change from this initial value + * upon postback, the validation fails. + */ + protected function getControlPromptValue() + { + $control = $this->getValidationTarget(); + if($control instanceof TListControl) + return $control->getPromptValue(); + return ''; + } /** * @param string the initial value of the associated input control. * If the associated input control does not change from this initial value diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php index c29cb90c..67cbc4e4 100644 --- a/framework/Web/UI/WebControls/TWizard.php +++ b/framework/Web/UI/WebControls/TWizard.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls */ @@ -77,7 +77,7 @@ Prado::using('System.Web.UI.WebControls.TWizardNavigationButtonStyle'); * - side bar: {@link getSideBarStyle SideBarStyle} and {@link getSideBarButtonStyle SideBarButtonStyle}. * * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -284,7 +284,6 @@ class TWizard extends TWebControl implements INamingContainer public function setShowSideBar($value) { $this->setViewState('ShowSideBar',TPropertyValue::ensureBoolean($value),true); - $this->requiresControlsRecreation(); } /** @@ -772,6 +771,7 @@ class TWizard extends TWebControl implements INamingContainer { parent::onInit($param); $this->ensureChildControls(); + $this->setEnsureId(true); if($this->getActiveStepIndex()<0 && $this->getWizardSteps()->getCount()>0) $this->setActiveStepIndex(0); } @@ -1449,7 +1449,7 @@ class TWizard extends TWebControl implements INamingContainer * set {@link setAllowReturn AllowReturn} to true. * * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1539,7 +1539,7 @@ class TWizardStep extends TView * TCompleteWizardStep represents a wizard step of type TWizardStepType::Complete. * * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1574,7 +1574,7 @@ class TCompleteWizardStep extends TWizardStep * if the navigation template is not specified, default navigation will be used. * * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1676,7 +1676,7 @@ class TTemplatedWizardStep extends TWizardStep implements INamingContainer * by a {@link TWizard}. * * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1740,7 +1740,7 @@ class TWizardStepCollection extends TList * {@link getCancelButton CancelButton}, {@link getCompleteButton CompleteButton}. * * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1832,7 +1832,7 @@ class TWizardNavigationContainer extends TControl implements INamingContainer * to true. * * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1897,7 +1897,7 @@ class TWizardNavigationEventParameter extends TEventParameter * TWizardSideBarTemplate class. * TWizardSideBarTemplate is the default template for wizard sidebar. * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1922,7 +1922,7 @@ class TWizardSideBarTemplate extends TComponent implements ITemplate * TWizardSideBarListItemTemplate class. * TWizardSideBarListItemTemplate is the default template for each item in the sidebar datalist. * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -1945,7 +1945,7 @@ class TWizardSideBarListItemTemplate extends TComponent implements ITemplate * TWizardNavigationTemplate class. * TWizardNavigationTemplate is the base class for various navigation templates. * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2017,7 +2017,7 @@ class TWizardNavigationTemplate extends TComponent implements ITemplate * TWizardStartNavigationTemplate is the template used as default wizard start navigation panel. * It consists of two buttons, Next and Cancel. * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2047,7 +2047,7 @@ class TWizardStartNavigationTemplate extends TWizardNavigationTemplate * TWizardFinishNavigationTemplate is the template used as default wizard finish navigation panel. * It consists of three buttons, Previous, Complete and Cancel. * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2081,7 +2081,7 @@ class TWizardFinishNavigationTemplate extends TWizardNavigationTemplate * TWizardStepNavigationTemplate is the template used as default wizard step navigation panel. * It consists of three buttons, Previous, Next and Cancel. * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0 */ @@ -2122,7 +2122,7 @@ class TWizardStepNavigationTemplate extends TWizardNavigationTemplate * - Link: a hyperlink button * * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ @@ -2146,7 +2146,7 @@ class TWizardNavigationButtonType extends TEnumerable * - Finish: the last step before the Complete step. * * @author Qiang Xue - * @version $Id: TWizard.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TWizard.php 3274 2013-02-15 08:32:25Z ctrlaltca $ * @package System.Web.UI.WebControls * @since 3.0.4 */ -- cgit v1.2.3