diff options
Diffstat (limited to 'lib/prado/framework/Web')
185 files changed, 1282 insertions, 223 deletions
diff --git a/lib/prado/framework/Web/Javascripts/TJavaScript.php b/lib/prado/framework/Web/Javascripts/TJavaScript.php index b92b0c3..bd0f2be 100644 --- a/lib/prado/framework/Web/Javascripts/TJavaScript.php +++ b/lib/prado/framework/Web/Javascripts/TJavaScript.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo<weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.Javascripts */ diff --git a/lib/prado/framework/Web/Javascripts/css-packages.php b/lib/prado/framework/Web/Javascripts/css-packages.php new file mode 100644 index 0000000..8bc5fe5 --- /dev/null +++ b/lib/prado/framework/Web/Javascripts/css-packages.php @@ -0,0 +1,93 @@ +<?php + +//$Id: packages.php 3319 2013-09-08 20:59:44Z ctrlaltca $ + +// To make future upgrades easier +if (!defined('JQUERY_DIR')) define ('JQUERY_DIR', 'jquery'); +if (!defined('BOOTSTRAP_DIR')) define ('BOOTSTRAP_DIR', 'bootstrap3'); + +//package names and its contents (files relative to the current directory) +$packages = array( + 'jquery-ui' => array( + JQUERY_DIR.'/css/base/jquery-ui.css', + ), + 'jquery.ui.accordion' => array( + JQUERY_DIR.'/css/base/jquery.ui.accordion.css', + ), + 'jquery.ui.autocomplete' => array( + JQUERY_DIR.'/css/base/jquery.ui.autocomplete.css', + ), + 'jquery.ui.button' => array( + JQUERY_DIR.'/css/base/jquery.ui.button.css', + ), + 'jquery.ui.core' => array( + JQUERY_DIR.'/css/base/jquery.ui.core.css', + ), + 'jquery.ui.datepicker' => array( + JQUERY_DIR.'/css/base/jquery.ui.datepicker.css', + ), + 'jquery.ui.dialog' => array( + JQUERY_DIR.'/css/base/jquery.ui.dialog.css', + ), + 'jquery.ui.menu' => array( + JQUERY_DIR.'/css/base/jquery.ui.menu.css', + ), + 'jquery.ui.progressbar' => array( + JQUERY_DIR.'/css/base/jquery.ui.progressbar.css', + ), + 'jquery.ui.resizable' => array( + JQUERY_DIR.'/css/base/jquery.ui.resizable.css', + ), + 'jquery.ui.selectable' => array( + JQUERY_DIR.'/css/base/jquery.ui.selectable.css', + ), + 'jquery.ui.slider' => array( + JQUERY_DIR.'/css/base/jquery.ui.slider.css', + ), + 'jquery.ui.spinner' => array( + JQUERY_DIR.'/css/base/jquery.ui.spinner.css', + ), + 'jquery.ui.tabs' => array( + JQUERY_DIR.'/css/base/jquery.ui.tabs.css', + ), + 'jquery.ui.theme' => array( + JQUERY_DIR.'/css/base/jquery.ui.theme.css', + ), + 'jquery.ui.tooltip' => array( + JQUERY_DIR.'/css/base/jquery.ui.tooltip.css', + ), + + // bootstrap + 'bootstrap' => array( + BOOTSTRAP_DIR.'/css/bootstrap.css', + ), + 'bootstrap-theme' => array( + BOOTSTRAP_DIR.'/css/bootstrap-theme.css', + ), +); + + +//package names and their dependencies +$dependencies = array( + 'jquery-ui' => array('jquery-ui'), + 'jquery.ui.accordion' => array('jquery.ui.core', 'jquery.ui.accordion'), + 'jquery.ui.autocomplete' => array('jquery.ui.core', 'jquery.ui.autocomplete'), + 'jquery.ui.button' => array('jquery.ui.core', 'jquery.ui.button'), + 'jquery.ui.core' => array('jquery.ui.core'), + 'jquery.ui.datepicker' => array('jquery.ui.core', 'jquery.ui.datepicker'), + 'jquery.ui.dialog' => array('jquery.ui.core', 'jquery.ui.dialog'), + 'jquery.ui.menu' => array('jquery.ui.core', 'jquery.ui.menu'), + 'jquery.ui.progressbar' => array('jquery.ui.core', 'jquery.ui.progressbar'), + 'jquery.ui.resizable' => array('jquery.ui.core', 'jquery.ui.resizable'), + 'jquery.ui.selectable' => array('jquery.ui.core', 'jquery.ui.selectable'), + 'jquery.ui.slider' => array('jquery.ui.core', 'jquery.ui.slider'), + 'jquery.ui.spinner' => array('jquery.ui.core', 'jquery.ui.spinner'), + 'jquery.ui.tabs' => array('jquery.ui.core', 'jquery.ui.tabs'), + 'jquery.ui.theme' => array('jquery.ui.core', 'jquery.ui.theme'), + 'jquery.ui.tooltip' => array('jquery.ui.core', 'jquery.ui.tooltip'), + 'bootstrap' => array('bootstrap'), + 'bootstrap-theme' => array('bootstrap', 'bootstrap-theme'), +); + +return array($packages, $dependencies); + diff --git a/lib/prado/framework/Web/Javascripts/packages.php b/lib/prado/framework/Web/Javascripts/packages.php index fe16d97..68b4822 100644 --- a/lib/prado/framework/Web/Javascripts/packages.php +++ b/lib/prado/framework/Web/Javascripts/packages.php @@ -95,7 +95,7 @@ $packages = array( //bootstrap 'bootstrap' => array( - BOOTSTRAP_DIR.'/js/bootstrap.js', + BOOTSTRAP_DIR.'/js/bootstrap.js', ), 'dragdrop'=>array( diff --git a/lib/prado/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js b/lib/prado/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js index e0e67ce..1115c3b 100644 --- a/lib/prado/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js +++ b/lib/prado/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js @@ -270,6 +270,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, // go! this.options.data = this.getParameters(); this.options.url = this.getCallbackUrl(); + this.options.timeout = this.getRequestTimeOut(); this.request = Prado.CallbackRequestManager.ajax(this.options); }, @@ -449,8 +450,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack, }, /** - * Updates the page state. It will update only if EnablePageStateUpdate and - * HasPriority options are both true. + * Updates the page state. It will update only if EnablePageStateUpdate is true. */ updatePageState : function(request, datain) { diff --git a/lib/prado/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/lib/prado/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js index 1599827..04c02ac 100755 --- a/lib/prado/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js +++ b/lib/prado/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js @@ -20,6 +20,8 @@ Prado.WebUI.TActiveFileUpload = jQuery.klass(Prado.WebUI.Control, }, fileChanged : function(){ + // ie11 fix + if(this.input.value=='') return; // show the upload indicator, and hide the complete and error indicators (if they areSn't already). this.flag.value = '1'; this.complete.style.display = 'none'; diff --git a/lib/prado/framework/Web/Javascripts/source/prado/prado.js b/lib/prado/framework/Web/Javascripts/source/prado/prado.js index e100dc7..0a1c485 100644 --- a/lib/prado/framework/Web/Javascripts/source/prado/prado.js +++ b/lib/prado/framework/Web/Javascripts/source/prado/prado.js @@ -446,7 +446,11 @@ Prado.Element = focus : function(element) { - jQuery("#"+element).focus(); + jQuery(document).ajaxStop(function () { + setTimeout(function(){ + jQuery("#"+element).focus(); + }, 100); + }); }, /** diff --git a/lib/prado/framework/Web/Javascripts/source/prado/validator/validation3.js b/lib/prado/framework/Web/Javascripts/source/prado/validator/validation3.js index 98be95d..6dcf02e 100644 --- a/lib/prado/framework/Web/Javascripts/source/prado/validator/validation3.js +++ b/lib/prado/framework/Web/Javascripts/source/prado/validator/validation3.js @@ -1239,6 +1239,8 @@ Prado.WebUI.TBaseValidator = jQuery.klass(Prado.WebUI.Control, case 'TActiveCheckBox': case 'TActiveRadioButton': return value; + case 'TReCaptcha2': + return document.getElementById(this.options.ResponseFieldName).value; default: if(this.isListControlType()) return value; @@ -1603,7 +1605,7 @@ Prado.WebUI.TActiveCustomValidator = jQuery.klass(Prado.WebUI.TBaseValidator, this.options.OnValidate(this, invoker); } - return this.isValid; + return true; }, /** @@ -1994,3 +1996,83 @@ Prado.WebUI.TReCaptchaValidator = jQuery.klass(Prado.WebUI.TBaseValidator, } }); +/** + * Registry for TReCaptcha2 components + */ +Prado.WebUI.TReCaptcha2Instances = {}; +/** + * Render callback; called by google's js when loaded + */ +TReCaptcha2_onloadCallback = function() +{ + jQuery.each(Prado.WebUI.TReCaptcha2Instances, function(index, item) { + item.build(); + }); +} + +/** + * TReCaptcha2 client-side control. + * + * @class Prado.WebUI.TReCaptcha2 + * @extends Prado.WebUI.Control + */ +Prado.WebUI.TReCaptcha2 = jQuery.klass(Prado.WebUI.Control, +{ + onInit: function(options) + { + for (key in options) { this[key] = options[key]; } + this.options['callback'] = jQuery.proxy(this.callback,this); + this.options['expired-callback'] = jQuery.proxy(this.callbackExpired,this); + + Prado.WebUI.TReCaptcha2Instances[this.element.id] = this; + }, + build: function() + { + if (grecaptcha !== undefined) this.widgetId = grecaptcha.render(this.element, this.options); + }, + callback: function(response) + { + var responseField = jQuery('#' + this.ID + ' textarea').attr('id'); + var params = { + widgetId: this.widgetId, + response: response, + responseField: responseField, + onCallback: this.onCallback + }; + var request = new Prado.CallbackRequest(this.EventTarget,this); + request.setCallbackParameter(params); + request.dispatch(); + }, + callbackExpired: function() + { + var responseField = jQuery('#' + this.ID + ' textarea').attr('id'); + var params = { + responseField: responseField, + onCallbackExpired: this.onCallbackExpired + }; + var request = new Prado.CallbackRequest(this.EventTarget,this); + request.setCallbackParameter(params); + request.dispatch(); + } +}); + +/** + * TReCaptcha2Validator client-side control. + * + * @class Prado.WebUI.TReCaptcha2Validator + * @extends Prado.WebUI.TBaseValidator + */ +Prado.WebUI.TReCaptcha2Validator = jQuery.klass(Prado.WebUI.TBaseValidator, +{ + /** + * Evaluate validation state + * @function {boolean} ? + * @return True if the captcha has validate, False otherwise. + */ + evaluateIsValid : function() + { + var a = this.getValidationValue(); + var b = this.trim(this.options.InitialValue); + return(a != b); + } +});
\ No newline at end of file diff --git a/lib/prado/framework/Web/Services/TFeedService.php b/lib/prado/framework/Web/Services/TFeedService.php index dc9c064..20ef0f3 100644 --- a/lib/prado/framework/Web/Services/TFeedService.php +++ b/lib/prado/framework/Web/Services/TFeedService.php @@ -5,7 +5,7 @@ * @author Qiang Xue <qiang.xue@gmail.com> * @author Knut Urdalen <knut.urdalen@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id$ * @package System.Web.Services diff --git a/lib/prado/framework/Web/Services/TJsonService.php b/lib/prado/framework/Web/Services/TJsonService.php index d17b330..f2d2609 100644 --- a/lib/prado/framework/Web/Services/TJsonService.php +++ b/lib/prado/framework/Web/Services/TJsonService.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.Services */ diff --git a/lib/prado/framework/Web/Services/TPageService.php b/lib/prado/framework/Web/Services/TPageService.php index 4a422c4..b20617e 100644 --- a/lib/prado/framework/Web/Services/TPageService.php +++ b/lib/prado/framework/Web/Services/TPageService.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.Services */ diff --git a/lib/prado/framework/Web/Services/TSoapService.php b/lib/prado/framework/Web/Services/TSoapService.php index 9554af2..11abe5a 100644 --- a/lib/prado/framework/Web/Services/TSoapService.php +++ b/lib/prado/framework/Web/Services/TSoapService.php @@ -5,7 +5,7 @@ * @author Knut Urdalen <knut.urdalen@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.Services */ diff --git a/lib/prado/framework/Web/TAssetManager.php b/lib/prado/framework/Web/TAssetManager.php index d84ca56..eef5fbf 100644 --- a/lib/prado/framework/Web/TAssetManager.php +++ b/lib/prado/framework/Web/TAssetManager.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web */ diff --git a/lib/prado/framework/Web/TCacheHttpSession.php b/lib/prado/framework/Web/TCacheHttpSession.php index 604eef4..a1784e0 100644 --- a/lib/prado/framework/Web/TCacheHttpSession.php +++ b/lib/prado/framework/Web/TCacheHttpSession.php @@ -5,7 +5,7 @@ * @author Carl G. Mathisen <carlgmathisen@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web * @since 3.1.1 diff --git a/lib/prado/framework/Web/THttpRequest.php b/lib/prado/framework/Web/THttpRequest.php index f89c354..926cfa4 100644 --- a/lib/prado/framework/Web/THttpRequest.php +++ b/lib/prado/framework/Web/THttpRequest.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web */ @@ -816,7 +816,7 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar */ public function getIterator() { - return new TMapIterator($this->_items); + return new ArrayIterator($this->_items); } /** diff --git a/lib/prado/framework/Web/THttpResponse.php b/lib/prado/framework/Web/THttpResponse.php index 21e6410..93d3c91 100644 --- a/lib/prado/framework/Web/THttpResponse.php +++ b/lib/prado/framework/Web/THttpResponse.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web */ diff --git a/lib/prado/framework/Web/THttpResponseAdapter.php b/lib/prado/framework/Web/THttpResponseAdapter.php index 7f87590..276dfe2 100644 --- a/lib/prado/framework/Web/THttpResponseAdapter.php +++ b/lib/prado/framework/Web/THttpResponseAdapter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id$ * @package System.Web diff --git a/lib/prado/framework/Web/THttpSession.php b/lib/prado/framework/Web/THttpSession.php index 50d11b1..35cd89b 100644 --- a/lib/prado/framework/Web/THttpSession.php +++ b/lib/prado/framework/Web/THttpSession.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web */ diff --git a/lib/prado/framework/Web/THttpUtility.php b/lib/prado/framework/Web/THttpUtility.php index 2be5fa4..8b8b9f6 100644 --- a/lib/prado/framework/Web/THttpUtility.php +++ b/lib/prado/framework/Web/THttpUtility.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web */ diff --git a/lib/prado/framework/Web/TUrlManager.php b/lib/prado/framework/Web/TUrlManager.php index 0525a7e..e392a07 100644 --- a/lib/prado/framework/Web/TUrlManager.php +++ b/lib/prado/framework/Web/TUrlManager.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id $ * @package System.Web diff --git a/lib/prado/framework/Web/TUrlMapping.php b/lib/prado/framework/Web/TUrlMapping.php index f7fdba6..5d8ab82 100644 --- a/lib/prado/framework/Web/TUrlMapping.php +++ b/lib/prado/framework/Web/TUrlMapping.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveButton.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveButton.php index ae5b7f0..cc88423 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveButton.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveButton.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -94,6 +94,9 @@ class TActiveButton extends TButton implements ICallbackEventHandler, IActiveCon */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'value', $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBox.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBox.php index 034666f..058ba70 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBox.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBox.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -88,6 +88,9 @@ class TActiveCheckBox extends TCheckBox implements ICallbackEventHandler, IActiv */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update( @@ -103,6 +106,9 @@ class TActiveCheckBox extends TCheckBox implements ICallbackEventHandler, IActiv public function setChecked($value) { $value = TPropertyValue::ensureBoolean($value); + if(parent::getChecked() === $value) + return; + parent::setChecked($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->check($this, $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php index dfcb72c..4b31d86 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveCheckBoxList.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -63,6 +63,17 @@ class TActiveCheckBoxList extends TCheckBoxList implements IActiveControl, ICall } /** + * Since at least a control with id is needed to update the content during callback, + * always force the surrounding span to be rendered, so initially empty lists can be + * updated later. + *@return boolean always true + */ + protected function getSpanNeeded () + { + return true; + } + + /** * Override parent implementation, no javascript is rendered here instead * the javascript required for active control is registered in {@link addAttributesToRender}. */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveClientScript.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveClientScript.php index 4093d8f..01a88a4 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveClientScript.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveClientScript.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveControlAdapter.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveControlAdapter.php index 0cd39c7..f68c7a3 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveControlAdapter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveControlAdapter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveCustomValidator.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveCustomValidator.php index 18f9f5f..0814c7c 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveCustomValidator.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveCustomValidator.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -104,6 +104,9 @@ class TActiveCustomValidator extends TCustomValidator */ public function setIsValid($value) { + // Always update the clientside, since the clientside's value for IsValid + // it could have been changed by the clientside validation. + parent::setIsValid($value); if($this->getActiveControl()->canUpdateClientSide()) { @@ -137,11 +140,15 @@ class TActiveCustomValidator extends TCustomValidator } /** - * Sets the text for the error message. Updates client-side erorr message. + * Sets the text for the error message. Updates client-side error message. * @param string the error message */ public function setErrorMessage($value) { + if(parent::getErrorMessage() === $value) + return; + + parent::setErrorMessage($value); if($this->getActiveControl()->canUpdateClientSide()) { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveDatePicker.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveDatePicker.php index 6328bac..72f9953 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveDatePicker.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveDatePicker.php @@ -5,7 +5,7 @@ * @author Bradley Booms <Bradley.Booms@nsighttel.com> * @author Christophe Boulain <Christophe.Boulain@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -89,6 +89,9 @@ class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, I * @param string text content for the textbox */ public function setText($value){ + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()){ $cb=$this->getPage()->getCallbackClient(); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveDropDownList.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveDropDownList.php index 3245ea6..2f09c03 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveDropDownList.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveDropDownList.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveFileUpload.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveFileUpload.php index 6f051ba..0435041 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveFileUpload.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveFileUpload.php @@ -101,8 +101,7 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback // save the file so that it will persist past the end of this return. $localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),'')); parent::saveAs($localName); - - $this->_localName = $localName; + $this->_localName = $localName; $params = new TActiveFileUploadCallbackParams; $params->localName = $localName; diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveHiddenField.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveHiddenField.php index f87ff07..fbd8eda 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveHiddenField.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveHiddenField.php @@ -4,7 +4,7 @@ * * @author Carl G. Mathisen <carlgmathisen@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id$ * @package System.Web.UI.ActiveControls @@ -55,6 +55,9 @@ class TActiveHiddenField extends THiddenField implements ICallbackEventHandler, */ public function setValue($value) { + if(parent::getValue() === $value) + return; + parent::setValue($value); if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) $this->getPage()->getCallbackClient()->setValue($this, $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveHyperLink.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveHyperLink.php index 2ffee7e..5e98250 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveHyperLink.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveHyperLink.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -50,6 +50,9 @@ class TActiveHyperLink extends THyperLink implements IActiveControl */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update($this, $value); @@ -61,6 +64,9 @@ class TActiveHyperLink extends THyperLink implements IActiveControl */ public function setImageUrl($value) { + if(parent::getImageUrl() === $value) + return; + parent::setImageUrl($value); if($this->getActiveControl()->canUpdateClientSide() && $value !== '') { @@ -77,6 +83,9 @@ class TActiveHyperLink extends THyperLink implements IActiveControl */ public function setNavigateUrl($value) { + if(parent::getNavigateUrl() === $value) + return; + parent::setNavigateUrl($value); if($this->getActiveControl()->canUpdateClientSide()) { @@ -92,6 +101,9 @@ class TActiveHyperLink extends THyperLink implements IActiveControl */ public function setTarget($value) { + if(parent::getTarget() === $value) + return; + parent::setTarget($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'target', $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveImage.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveImage.php index 13d5314..4058599 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveImage.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveImage.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -48,6 +48,9 @@ class TActiveImage extends TImage implements IActiveControl */ public function setAlternateText($value) { + if(parent::getAlternateText() === $value) + return; + parent::setAlternateText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'alt', $value); @@ -62,6 +65,9 @@ class TActiveImage extends TImage implements IActiveControl */ public function setImageAlign($value) { + if(parent::getImageAlign() === $value) + return; + parent::setImageAlign($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'align', $value); @@ -72,6 +78,9 @@ class TActiveImage extends TImage implements IActiveControl */ public function setImageUrl($value) { + if(parent::getImageUrl() === $value) + return; + parent::setImageUrl($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'src', $value); @@ -82,6 +91,9 @@ class TActiveImage extends TImage implements IActiveControl */ public function setDescriptionUrl($value) { + if(parent::getDescriptionUrl() === $value) + return; + parent::setDescriptionUrl($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'longdesc', $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveImageButton.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveImageButton.php index 351a996..6f2ceed 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveImageButton.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveImageButton.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -58,6 +58,9 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba */ public function setAlternateText($value) { + if(parent::getAlternateText() === $value) + return; + parent::setAlternateText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'alt', $value); @@ -72,6 +75,9 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba */ public function setImageAlign($value) { + if(parent::getImageAlign() === $value) + return; + parent::setImageAlign($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'align', $value); @@ -82,6 +88,9 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba */ public function setImageUrl($value) { + if(parent::getImageUrl() === $value) + return; + parent::setImageUrl($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'src', $value); @@ -92,6 +101,9 @@ class TActiveImageButton extends TImageButton implements IActiveControl, ICallba */ public function setDescriptionUrl($value) { + if(parent::getDescriptionUrl() === $value) + return; + parent::setDescriptionUrl($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->setAttribute($this, 'longdesc', $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveLabel.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveLabel.php index 70ff20e..a0825f8 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveLabel.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveLabel.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -55,6 +55,9 @@ class TActiveLabel extends TLabel implements IActiveControl */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update($this, $value); @@ -68,6 +71,9 @@ class TActiveLabel extends TLabel implements IActiveControl */ public function setForControl($value) { + if(parent::getForControl() === $value) + return; + parent::setForControl($value); if($this->getActiveControl()->canUpdateClientSide()) { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveLinkButton.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveLinkButton.php index aaf2d35..7c2159a 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveLinkButton.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveLinkButton.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -95,6 +95,9 @@ class TActiveLinkButton extends TLinkButton implements IActiveControl, ICallback */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update($this, $value); @@ -131,6 +134,9 @@ class TActiveLinkButton extends TLinkButton implements IActiveControl, ICallback */ public function setEnabled($value) { + if(parent::getEnabled() === $value) + return; + parent::setEnabled($value); if($this->getActiveControl()->canUpdateClientSide()) { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveListBox.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveListBox.php index e32a8eb..82fe662 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveListBox.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveListBox.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -85,6 +85,9 @@ class TActiveListBox extends TListBox implements IActiveControl, ICallbackEventH */ public function setSelectionMode($value) { + if(parent::getSelectionMode() === $value) + return; + parent::setSelectionMode($value); $multiple = $this->getIsMultiSelect(); $id = $this->getUniqueID(); $multi_id = $id.'[]'; diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php index 927912b..04539f3 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveListControlAdapter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php index 215706e..45c137d 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveMultiView.php @@ -92,9 +92,11 @@ class TActiveMultiView extends TMultiView implements IActiveControl */ public function setActiveViewIndex($value) { - $old=parent::getActiveViewIndex(); + if(parent::getActiveViewIndex() === $value) + return; + parent::setActiveViewIndex($value); - if($this->getActiveControl()->canUpdateClientSide() && $old!=$value) + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); } @@ -104,9 +106,11 @@ class TActiveMultiView extends TMultiView implements IActiveControl */ public function setActiveView($value) { - $old=parent::getActiveView(); + if(parent::getActiveView() === $value) + return; + parent::setActiveView($value); - if($this->getActiveControl()->canUpdateClientSide() && $old!=$value) + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); } } diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/lib/prado/framework/Web/UI/ActiveControls/TActivePageAdapter.php index 1803f44..2cdcaba 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActivePageAdapter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActivePageAdapter.php @@ -5,7 +5,7 @@ * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering) * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActivePager.php b/lib/prado/framework/Web/UI/ActiveControls/TActivePager.php index e99743f..d8d2fb6 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActivePager.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActivePager.php @@ -4,7 +4,7 @@ * * @author "gevik" (forum contributor) and Christophe Boulain (Christophe.Boulain@gmail.com) * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActivePanel.php b/lib/prado/framework/Web/UI/ActiveControls/TActivePanel.php index 5192b0d..992ccb8 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActivePanel.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActivePanel.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButton.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButton.php index 90190a1..8dd3927 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButton.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButton.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -87,6 +87,9 @@ class TActiveRadioButton extends TRadioButton implements IActiveControl, ICallba */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->update( @@ -102,6 +105,9 @@ class TActiveRadioButton extends TRadioButton implements IActiveControl, ICallba public function setChecked($value) { $value = TPropertyValue::ensureBoolean($value); + if(parent::getChecked() === $value) + return; + parent::setChecked($value); if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->check($this, $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php index 9acb672..e6b0cbb 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveRatingList.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveRatingList.php index a154eb6..9c985d5 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveRatingList.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveRatingList.php @@ -5,7 +5,7 @@ * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id$ * @package System.Web.UI.ActiveControls @@ -80,6 +80,9 @@ class TActiveRatingList extends TRatingList implements IActiveControl, ICallback */ public function setReadOnly($value) { + if(parent::getReadOnly() === $value) + return; + parent::setReadOnly($value); $value = $this->getReadOnly(); $this->callClientFunction('setReadOnly',$value); @@ -90,6 +93,9 @@ class TActiveRatingList extends TRatingList implements IActiveControl, ICallback */ public function setRating($value) { + if(parent::getRating() === $value) + return; + parent::setRating($value); $value = $this->getRating(); $this->callClientFunction('setRating',$value); @@ -115,6 +121,9 @@ class TActiveRatingList extends TRatingList implements IActiveControl, ICallback */ public function setCaption($value) { + if(parent::getCaption() === $value) + return; + parent::setCaption($value); // if it's an active control, this should not be needed. $this->callClientFunction('setCaption',$value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TActiveTextBox.php b/lib/prado/framework/Web/UI/ActiveControls/TActiveTextBox.php index f80b498..fa1740e 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TActiveTextBox.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TActiveTextBox.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -62,6 +62,9 @@ class TActiveTextBox extends TTextBox implements ICallbackEventHandler, IActiveC */ public function setText($value) { + if(parent::getText() === $value) + return; + parent::setText($value); if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) $this->getPage()->getCallbackClient()->setValue($this, $value); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TAutoComplete.php b/lib/prado/framework/Web/UI/ActiveControls/TAutoComplete.php index e396e11..744565a 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TAutoComplete.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TAutoComplete.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -18,6 +18,9 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter'); /** * TAutoComplete class. * + * Warning: this class is deprecatd and will be removed in a future release. + * We suggest you to investigate using {@link TJuiAutoComplete} instead. + * * TAutoComplete is a textbox that provides a list of suggestion on * the current partial word typed in the textbox. The suggestions are * requested using callbacks, and raises the {@link onSuggestion OnSuggestion} @@ -78,6 +81,7 @@ Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter'); * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @package System.Web.UI.ActiveControls * @since 3.1 + * @deprecated Use TJuiAutoComplete instead */ class TAutoComplete extends TActiveTextBox implements INamingContainer { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TBaseActiveControl.php b/lib/prado/framework/Web/UI/ActiveControls/TBaseActiveControl.php index 01583eb..5ac51fd 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TBaseActiveControl.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TBaseActiveControl.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TCallback.php index 1aae6ce..eb78b54 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientScript.php index 1f631f2..12309bb 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientScript.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientScript.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientSide.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientSide.php index 874aeb4..4cb482a 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientSide.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackClientSide.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -38,11 +38,8 @@ * * - <b>PostState</b> true to collect the form inputs and post them during callback, default is true. * - <b>RequestTimeOut</b> The request timeout in milliseconds. - * - <b>HasPriority</b> true to ensure that the callback request will be sent - * immediately and will abort existing prioritized requests. It does not affect - * callbacks that are not prioritized. * - <b>EnablePageStateUpdate</b> enable the callback response to enable the - * viewstate update. This will automatically set HasPriority to true when enabled. + * viewstate update. * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @package System.Web.UI.ActiveControls @@ -239,23 +236,23 @@ class TCallbackClientSide extends TClientSideOptions * @return boolean true if the callback request has priority and will abort * existing prioritized request in order to send immediately. It does not * affect callbacks that are not prioritized. Default is true. + * @deprecated since 3.3.0 */ public function getHasPriority() { - $option = $this->getOption('HasPriority'); - return ($option===null) ? true : $option; + return true; } /** * @param boolean true to ensure that the callback request will be sent * immediately and will abort existing prioritized requests. It does not * affect callbacks that are not prioritized. + * @deprecated since 3.3.0 */ public function setHasPriority($value) { - $hasPriority = TPropertyValue::ensureBoolean($value); - $this->setOption('HasPriority', $hasPriority); - if(!$hasPriority) + // mimic the old behavior + if(!$value) $this->setEnablePageStateUpdate(false); } @@ -269,8 +266,6 @@ class TCallbackClientSide extends TClientSideOptions { $enabled = TPropertyValue::ensureBoolean($value); $this->setOption('EnablePageStateUpdate', $enabled); - if($enabled) - $this->setHasPriority(true); } /** diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackEventParameter.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackEventParameter.php index 9306aec..5d585c4 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackEventParameter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackEventParameter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id$ * @package System.Web.UI.ActiveControls diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackOptions.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackOptions.php index e79561d..e307145 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackOptions.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackOptions.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php b/lib/prado/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php index 4a1c41b..115c4c6 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TCallbackResponseAdapter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TDraggable.php b/lib/prado/framework/Web/UI/ActiveControls/TDraggable.php index 3f6008b..830200e 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TDraggable.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TDraggable.php @@ -11,6 +11,9 @@ /** * TDraggable is a control which can be dragged * + * Warning: this class is deprecatd and will be removed in a future release. + * We suggest you to investigate using {@link TJuiDraggable} instead. + * * This control will make "draggable" control. * Properties : * @@ -25,6 +28,7 @@ * @copyright Copyright © 2008, PradoSoft * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls + * @deprecated Use TJuiDraggable instead */ class TDraggable extends TPanel { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TDropContainer.php b/lib/prado/framework/Web/UI/ActiveControls/TDropContainer.php index 49eb0db..216d3db 100755 --- a/lib/prado/framework/Web/UI/ActiveControls/TDropContainer.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TDropContainer.php @@ -21,6 +21,10 @@ Prado::using('System.Web.UI.ActiveControls.TActivePanel'); /** * TDropContainer is a panel where TDraggable controls can be dropped. + * + * Warning: this class is deprecatd and will be removed in a future release. + * We suggest you to investigate using {@link TJuiDroppable} instead. + * * When a TDraggable component is dropped into a TDropContainer, the {@link OnDrop OnDrop} event is raised. * The {@link TDropContainerEventParameter} param will contain the dropped control. * @@ -39,6 +43,7 @@ Prado::using('System.Web.UI.ActiveControls.TActivePanel'); * @copyright Copyright © 2008, PradoSoft * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls + * @deprecated Use TJuiDroppable instead */ class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHandler { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php index d990e09..aa00331 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TInPlaceTextBox.php b/lib/prado/framework/Web/UI/ActiveControls/TInPlaceTextBox.php index d267729..2515184 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TInPlaceTextBox.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TInPlaceTextBox.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -13,7 +13,7 @@ Prado::using('System.Web.UI.ActiveControls.TActiveTextBox'); /** * TInPlaceTextBox Class - * * + * * TInPlaceTextBox is a component rendered as a label and allows its * contents to be edited by changing the label to a textbox when * the label is clicked or when another control or html element with @@ -135,6 +135,9 @@ class TInPlaceTextBox extends TActiveTextBox */ public function setText($value) { + if(TTextBox::getText() === $value) + return; + TTextBox::setText($value); if($this->getActiveControl()->canUpdateClientSide()) { @@ -152,6 +155,9 @@ class TInPlaceTextBox extends TActiveTextBox public function setReadOnly ($value) { $value=TPropertyValue::ensureBoolean($value); + if(TTextBox::getReadOnly() === $value) + return; + TTextBox::setReadOnly($value); if ($this->getActiveControl()->canUpdateClientSide()) { diff --git a/lib/prado/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php index b643de4..038f76d 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -46,6 +46,10 @@ class TTimeTriggeredCallback extends TCallback $interval = TPropertyValue::ensureFloat($value); if($interval <= 0) throw new TConfigurationException('callback_interval_be_positive', $this->getID()); + + if($this->getInterval() === $value) + return; + $this->setViewState('Interval', $interval, 1); if ($this->getActiveControl()->canUpdateClientSide()){ $client = $this->getPage()->getCallbackClient(); diff --git a/lib/prado/framework/Web/UI/ActiveControls/TTriggeredCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TTriggeredCallback.php index 7675bc8..faebaf5 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TTriggeredCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TTriggeredCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php b/lib/prado/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php index 87a7d60..7f9a6b5 100644 --- a/lib/prado/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php +++ b/lib/prado/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ diff --git a/lib/prado/framework/Web/UI/JuiControls/TJuiAutoComplete.php b/lib/prado/framework/Web/UI/JuiControls/TJuiAutoComplete.php index be6b1b4..612d89d 100644 --- a/lib/prado/framework/Web/UI/JuiControls/TJuiAutoComplete.php +++ b/lib/prado/framework/Web/UI/JuiControls/TJuiAutoComplete.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gamil[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.ActiveControls */ @@ -364,7 +364,7 @@ class TJuiAutoComplete extends TActiveTextBox implements INamingContainer, IJuiO */ public function renderSuggestions($writer) { - if($this->getActiveControl()->canUpdateClientSide()) + if($this->getActiveControl()->canUpdateClientSide(true)) { $data=array(); $items=$this->getSuggestions()->getItems(); diff --git a/lib/prado/framework/Web/UI/JuiControls/TJuiControlOptions.php b/lib/prado/framework/Web/UI/JuiControls/TJuiControlOptions.php index 64cf710..8b0cc84 100644 --- a/lib/prado/framework/Web/UI/JuiControls/TJuiControlOptions.php +++ b/lib/prado/framework/Web/UI/JuiControls/TJuiControlOptions.php @@ -112,7 +112,7 @@ class TJuiControlOptions } } - throw new THttpException(500,'juioptions_option_invalid',$this->_control->ID, $name); + throw new TConfigurationException('juioptions_option_invalid',$this->_control->ID, $name); } /** diff --git a/lib/prado/framework/Web/UI/JuiControls/TJuiDialog.php b/lib/prado/framework/Web/UI/JuiControls/TJuiDialog.php index e02157d..cd349f1 100644 --- a/lib/prado/framework/Web/UI/JuiControls/TJuiDialog.php +++ b/lib/prado/framework/Web/UI/JuiControls/TJuiDialog.php @@ -161,7 +161,7 @@ class TJuiDialog extends TActivePanel implements IJuiOptions, ICallbackEventHand private function triggerClientMethod($method) { $cs = $this->getPage()->getClientScript(); - $code = "jQuery('#".$this->getClientId()."').dialog('".$method."');"; + $code = "jQuery(document).ready(function() { jQuery('#".$this->getClientId()."').dialog('".$method."'); })"; $cs->registerEndScript(sprintf('%08X', crc32($code)), $code); } diff --git a/lib/prado/framework/Web/UI/TCachePageStatePersister.php b/lib/prado/framework/Web/UI/TCachePageStatePersister.php index e8419e6..a428ef8 100644 --- a/lib/prado/framework/Web/UI/TCachePageStatePersister.php +++ b/lib/prado/framework/Web/UI/TCachePageStatePersister.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/TClientScriptManager.php b/lib/prado/framework/Web/UI/TClientScriptManager.php index e35a1ca..d5335b3 100644 --- a/lib/prado/framework/Web/UI/TClientScriptManager.php +++ b/lib/prado/framework/Web/UI/TClientScriptManager.php @@ -5,7 +5,7 @@ * @author Qiang Xue <qiang.xue@gmail.com> * @author Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering) * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ @@ -31,6 +31,10 @@ class TClientScriptManager extends TApplicationComponent */ const PACKAGES_FILE='Web/Javascripts/packages.php'; /** + * file containing css packages and their cross dependencies + */ + const CSS_PACKAGES_FILE='Web/Javascripts/css-packages.php'; + /** * @var TPage page who owns this manager */ private $_page; @@ -80,12 +84,27 @@ class TClientScriptManager extends TApplicationComponent * @var array */ private static $_pradoPackages; + /** + * @var array registered PRADO style libraries + */ + private $_registeredPradoStyles=array(); + /** + * Client-side style library dependencies, loads from PACKAGES_FILE; + * @var array + */ + private static $_pradoStyles; + /** + * Client-side style library packages, loads from CSS_PACKAGES_FILE; + * @var array + */ + private static $_pradoStylePackages; private $_renderedHiddenFields; private $_renderedScriptFiles=array(); private $_expandedPradoScripts; + private $_expandedPradoStyles; /** * Constructor. @@ -214,7 +233,7 @@ class TClientScriptManager extends TApplicationComponent } /** - * @param string javascript package path. + * @param string javascript or css package path. * @return array tuple($path,$url). */ protected function getPackagePathUrl($base) @@ -348,6 +367,67 @@ class TClientScriptManager extends TApplicationComponent } /** + * Registers Prado style by library name. See "Web/Javascripts/packages.php" + * for library names. + * @param string style library name. + */ + public function registerPradoStyle($name) + { + $this->registerPradoStyleInternal($name); + $params=func_get_args(); + $this->_page->registerCachingAction('Page.ClientScript','registerPradoStyle',$params); + } + + /** + * Registers a Prado style library to be loaded. + */ + protected function registerPradoStyleInternal($name) + { + // $this->checkIfNotInRender(); + if(!isset($this->_registeredPradoStyles[$name])) + { + $base = $this->getPradoScriptAssetUrl(); + + if(self::$_pradoStyles === null) + { + $packageFile = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::CSS_PACKAGES_FILE; + list($packages,$deps)= include($packageFile); + self::$_pradoStyles = $deps; + self::$_pradoStylePackages = $packages; + } + + if (isset(self::$_pradoStyles[$name])) + $this->_registeredPradoStyles[$name]=true; + else + throw new TInvalidOperationException('csmanager_pradostyle_invalid',$name); + + if(($packages=array_keys($this->_registeredPradoStyles))!==array()) + { + $base = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH; + list($path,$baseUrl)=$this->getPackagePathUrl($base); + $packagesUrl=array(); + $isDebug=$this->getApplication()->getMode()===TApplicationMode::Debug; + foreach ($packages as $p) + { + foreach (self::$_pradoStyles[$p] as $dep) + { + foreach (self::$_pradoStylePackages[$dep] as $style) + if (!isset($this->_expandedPradoStyles[$style])) + { + $this->_expandedPradoStyles[$style] = true; + // TODO minify css? + if (!in_array($url=$baseUrl.'/'.$style,$packagesUrl)) + $packagesUrl[]=$url; + } + } + } + foreach($packagesUrl as $url) + $this->registerStyleSheetFile($url,$url); + } + } + } + + /** * Registers a CSS file to be rendered in the page head * * The CSS files in themes are registered in {@link OnPreRenderComplete onPreRenderComplete} if you want to override @@ -400,9 +480,9 @@ class TClientScriptManager extends TApplicationComponent public function getStyleSheetUrls() { $stylesheets = array_values( - array_map( - create_function('$e', 'return is_array($e) ? $e[0] : $e;'), - $this->_styleSheetFiles) + array_map(function($e) { + return is_array($e) ? $e[0] : $e; + }, $this->_styleSheetFiles) ); foreach(Prado::getApplication()->getAssetManager()->getPublished() as $path=>$url) diff --git a/lib/prado/framework/Web/UI/TCompositeControl.php b/lib/prado/framework/Web/UI/TCompositeControl.php index e830351..6bde562 100644 --- a/lib/prado/framework/Web/UI/TCompositeControl.php +++ b/lib/prado/framework/Web/UI/TCompositeControl.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/TControl.php b/lib/prado/framework/Web/UI/TControl.php index 055b552..be7b118 100644 --- a/lib/prado/framework/Web/UI/TControl.php +++ b/lib/prado/framework/Web/UI/TControl.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ @@ -769,13 +769,19 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable { if($this->_trackViewState) { - $this->_viewState[$key]=$value; unset($this->_tempState[$key]); + if($value===$defaultValue) + unset($this->_viewState[$key]); + else + $this->_viewState[$key]=$value; } else { unset($this->_viewState[$key]); - $this->_tempState[$key]=$value; + if($value===$defaultValue) + unset($this->_tempState[$key]); + else + $this->_tempState[$key]=$value; } } @@ -1655,7 +1661,10 @@ class TControl extends TApplicationComponent implements IRenderable, IBindable foreach($this->_rf[self::RF_CONTROLS] as $control) { if($control instanceof TControl) - $state[$control->_id]=&$control->saveStateRecursive($needViewState); + { + if(count($tmp = &$control->saveStateRecursive($needViewState))) + $state[$control->_id]=$tmp; + } } } if($needViewState && !empty($this->_viewState)) diff --git a/lib/prado/framework/Web/UI/TControlAdapter.php b/lib/prado/framework/Web/UI/TControlAdapter.php index 3abc004..4168e40 100644 --- a/lib/prado/framework/Web/UI/TControlAdapter.php +++ b/lib/prado/framework/Web/UI/TControlAdapter.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/TForm.php b/lib/prado/framework/Web/UI/TForm.php index a6fe355..aed24b3 100644 --- a/lib/prado/framework/Web/UI/TForm.php +++ b/lib/prado/framework/Web/UI/TForm.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/THtmlWriter.php b/lib/prado/framework/Web/UI/THtmlWriter.php index 9c0c599..27b6ed4 100644 --- a/lib/prado/framework/Web/UI/THtmlWriter.php +++ b/lib/prado/framework/Web/UI/THtmlWriter.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/TPage.php b/lib/prado/framework/Web/UI/TPage.php index f1ae591..515898b 100644 --- a/lib/prado/framework/Web/UI/TPage.php +++ b/lib/prado/framework/Web/UI/TPage.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/TPageStatePersister.php b/lib/prado/framework/Web/UI/TPageStatePersister.php index 161316b..be5c013 100644 --- a/lib/prado/framework/Web/UI/TPageStatePersister.php +++ b/lib/prado/framework/Web/UI/TPageStatePersister.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/TSessionPageStatePersister.php b/lib/prado/framework/Web/UI/TSessionPageStatePersister.php index a825a7d..85053b8 100644 --- a/lib/prado/framework/Web/UI/TSessionPageStatePersister.php +++ b/lib/prado/framework/Web/UI/TSessionPageStatePersister.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/TTemplateControl.php b/lib/prado/framework/Web/UI/TTemplateControl.php index 4917d4b..e4a5980 100644 --- a/lib/prado/framework/Web/UI/TTemplateControl.php +++ b/lib/prado/framework/Web/UI/TTemplateControl.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/TTemplateManager.php b/lib/prado/framework/Web/UI/TTemplateManager.php index b065eb6..49c619f 100644 --- a/lib/prado/framework/Web/UI/TTemplateManager.php +++ b/lib/prado/framework/Web/UI/TTemplateManager.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/TThemeManager.php b/lib/prado/framework/Web/UI/TThemeManager.php index efc7268..380f255 100644 --- a/lib/prado/framework/Web/UI/TThemeManager.php +++ b/lib/prado/framework/Web/UI/TThemeManager.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/WebControls/TAccordion.php b/lib/prado/framework/Web/UI/WebControls/TAccordion.php index d193613..e0af4d9 100644 --- a/lib/prado/framework/Web/UI/WebControls/TAccordion.php +++ b/lib/prado/framework/Web/UI/WebControls/TAccordion.php @@ -4,7 +4,7 @@ * * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls * @since 3.2 diff --git a/lib/prado/framework/Web/UI/WebControls/TBaseDataList.php b/lib/prado/framework/Web/UI/WebControls/TBaseDataList.php index 4501073..8f3590c 100644 --- a/lib/prado/framework/Web/UI/WebControls/TBaseDataList.php +++ b/lib/prado/framework/Web/UI/WebControls/TBaseDataList.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TBaseValidator.php b/lib/prado/framework/Web/UI/WebControls/TBaseValidator.php index a74d4bc..9911b06 100644 --- a/lib/prado/framework/Web/UI/WebControls/TBaseValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TBaseValidator.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TBoundColumn.php b/lib/prado/framework/Web/UI/WebControls/TBoundColumn.php index 95697bd..caa6aca 100644 --- a/lib/prado/framework/Web/UI/WebControls/TBoundColumn.php +++ b/lib/prado/framework/Web/UI/WebControls/TBoundColumn.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TBulletedList.php b/lib/prado/framework/Web/UI/WebControls/TBulletedList.php index 5d4167e..00a9a50 100644 --- a/lib/prado/framework/Web/UI/WebControls/TBulletedList.php +++ b/lib/prado/framework/Web/UI/WebControls/TBulletedList.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TButton.php b/lib/prado/framework/Web/UI/WebControls/TButton.php index aed518a..ca5479a 100644 --- a/lib/prado/framework/Web/UI/WebControls/TButton.php +++ b/lib/prado/framework/Web/UI/WebControls/TButton.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TButtonColumn.php b/lib/prado/framework/Web/UI/WebControls/TButtonColumn.php index d2d0ec5..304c8fa 100644 --- a/lib/prado/framework/Web/UI/WebControls/TButtonColumn.php +++ b/lib/prado/framework/Web/UI/WebControls/TButtonColumn.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TCaptcha.php b/lib/prado/framework/Web/UI/WebControls/TCaptcha.php index cf9cc8e..863b164 100644 --- a/lib/prado/framework/Web/UI/WebControls/TCaptcha.php +++ b/lib/prado/framework/Web/UI/WebControls/TCaptcha.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TCaptchaValidator.php b/lib/prado/framework/Web/UI/WebControls/TCaptchaValidator.php index 1a08430..a9990de 100644 --- a/lib/prado/framework/Web/UI/WebControls/TCaptchaValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TCaptchaValidator.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TCheckBox.php b/lib/prado/framework/Web/UI/WebControls/TCheckBox.php index bfbfbf5..b994259 100644 --- a/lib/prado/framework/Web/UI/WebControls/TCheckBox.php +++ b/lib/prado/framework/Web/UI/WebControls/TCheckBox.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TCheckBoxColumn.php b/lib/prado/framework/Web/UI/WebControls/TCheckBoxColumn.php index 5cf0265..1eb0acc 100644 --- a/lib/prado/framework/Web/UI/WebControls/TCheckBoxColumn.php +++ b/lib/prado/framework/Web/UI/WebControls/TCheckBoxColumn.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TCheckBoxList.php b/lib/prado/framework/Web/UI/WebControls/TCheckBoxList.php index 9225e17..2950c53 100644 --- a/lib/prado/framework/Web/UI/WebControls/TCheckBoxList.php +++ b/lib/prado/framework/Web/UI/WebControls/TCheckBoxList.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -402,13 +402,13 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont */ public function render($writer) { + if ($needSpan=$this->getSpanNeeded()) + { + $writer->addAttribute('id', $this->getClientId()); + $writer->renderBeginTag('span'); + } if($this->getItemCount()>0) { - if ($needSpan=$this->getSpanNeeded()) - { - $writer->addAttribute('id', $this->getClientId()); - $writer->renderBeginTag('span'); - } $this->_isEnabled=$this->getEnabled(true); $repeatInfo=$this->getRepeatInfo(); $accessKey=$this->getAccessKey(); @@ -422,9 +422,9 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont $repeatInfo->renderRepeater($writer,$this); $this->setAccessKey($accessKey); $this->setTabIndex($tabIndex); - if ($needSpan) - $writer->renderEndTag(); } + if ($needSpan) + $writer->renderEndTag(); //checkbox skipped the client control script in addAttributesToRender if($this->getEnabled(true) diff --git a/lib/prado/framework/Web/UI/WebControls/TClientScript.php b/lib/prado/framework/Web/UI/WebControls/TClientScript.php index c931bcb..96dfb99 100644 --- a/lib/prado/framework/Web/UI/WebControls/TClientScript.php +++ b/lib/prado/framework/Web/UI/WebControls/TClientScript.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TColorPicker.php b/lib/prado/framework/Web/UI/WebControls/TColorPicker.php index fbe71c0..08ad000 100644 --- a/lib/prado/framework/Web/UI/WebControls/TColorPicker.php +++ b/lib/prado/framework/Web/UI/WebControls/TColorPicker.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TCompareValidator.php b/lib/prado/framework/Web/UI/WebControls/TCompareValidator.php index 3048895..87eeb07 100644 --- a/lib/prado/framework/Web/UI/WebControls/TCompareValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TCompareValidator.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TConditional.php b/lib/prado/framework/Web/UI/WebControls/TConditional.php index d9bc168..23e5381 100644 --- a/lib/prado/framework/Web/UI/WebControls/TConditional.php +++ b/lib/prado/framework/Web/UI/WebControls/TConditional.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TContent.php b/lib/prado/framework/Web/UI/WebControls/TContent.php index 1a0fd37..26c6b62 100644 --- a/lib/prado/framework/Web/UI/WebControls/TContent.php +++ b/lib/prado/framework/Web/UI/WebControls/TContent.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TContentPlaceHolder.php b/lib/prado/framework/Web/UI/WebControls/TContentPlaceHolder.php index 0355467..5dc824e 100644 --- a/lib/prado/framework/Web/UI/WebControls/TContentPlaceHolder.php +++ b/lib/prado/framework/Web/UI/WebControls/TContentPlaceHolder.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TCustomValidator.php b/lib/prado/framework/Web/UI/WebControls/TCustomValidator.php index ca31a2a..316afca 100644 --- a/lib/prado/framework/Web/UI/WebControls/TCustomValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TCustomValidator.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDataBoundControl.php b/lib/prado/framework/Web/UI/WebControls/TDataBoundControl.php index 8078b6f..7fe3717 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataBoundControl.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataBoundControl.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDataGrid.php b/lib/prado/framework/Web/UI/WebControls/TDataGrid.php index 109252a..2f338d2 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataGrid.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataGrid.php @@ -9,7 +9,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -1162,7 +1162,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer $param=new TDataGridItemEventParameter($item); if($dataBind) { - $item->setDataItem($dataItem); + $item->setData($dataItem); $this->onItemCreated($param); $this->getControls()->add($item); $item->dataBind(); diff --git a/lib/prado/framework/Web/UI/WebControls/TDataGridColumn.php b/lib/prado/framework/Web/UI/WebControls/TDataGridColumn.php index 2f547ff..0e3ddbe 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataGridColumn.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataGridColumn.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDataGridItemRenderer.php b/lib/prado/framework/Web/UI/WebControls/TDataGridItemRenderer.php index 23cf515..4cd12d3 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataGridItemRenderer.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataGridItemRenderer.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDataGridPagerStyle.php b/lib/prado/framework/Web/UI/WebControls/TDataGridPagerStyle.php index b96d0cd..fc5b848 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataGridPagerStyle.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataGridPagerStyle.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -33,6 +33,35 @@ class TDataGridPagerStyle extends TPanelStyle private $_buttonType=null; /** + * Returns an array with the names of all variables of this object that should NOT be serialized + * because their value is the default one or useless to be cached for the next page loads. + * Reimplement in derived classes to add new variables, but remember to also to call the parent + * implementation first. + */ + protected function _getZappableSleepProps(&$exprops) + { + parent::_getZappableSleepProps($exprops); + if ($this->_mode===null) + $exprops[] = "\0TDataGridPagerStyle\0_mode"; + if ($this->_nextText===null) + $exprops[] = "\0TDataGridPagerStyle\0_nextText"; + if ($this->_prevText===null) + $exprops[] = "\0TDataGridPagerStyle\0_prevText"; + if ($this->_firstText===null) + $exprops[] = "\0TDataGridPagerStyle\0_firstText"; + if ($this->_lastText===null) + $exprops[] = "\0TDataGridPagerStyle\0_lastText"; + if ($this->_buttonCount===null) + $exprops[] = "\0TDataGridPagerStyle\0_buttonCount"; + if ($this->_position===null) + $exprops[] = "\0TDataGridPagerStyle\0_position"; + if ($this->_visible===null) + $exprops[] = "\0TDataGridPagerStyle\0_visible"; + if ($this->_buttonType===null) + $exprops[] = "\0TDataGridPagerStyle\0_buttonType"; + } + + /** * @return TDataGridPagerMode pager mode. Defaults to TDataGridPagerMode::NextPrev. */ public function getMode() diff --git a/lib/prado/framework/Web/UI/WebControls/TDataList.php b/lib/prado/framework/Web/UI/WebControls/TDataList.php index a3cf8b6..c883ba3 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataList.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataList.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDataListItemRenderer.php b/lib/prado/framework/Web/UI/WebControls/TDataListItemRenderer.php index d7cb59c..8e62190 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataListItemRenderer.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataListItemRenderer.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDataRenderer.php b/lib/prado/framework/Web/UI/WebControls/TDataRenderer.php index 6e76013..b7155c8 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataRenderer.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataRenderer.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls * @since 3.1.2 diff --git a/lib/prado/framework/Web/UI/WebControls/TDataSourceControl.php b/lib/prado/framework/Web/UI/WebControls/TDataSourceControl.php index ff47a78..11a97c9 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataSourceControl.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataSourceControl.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDataSourceView.php b/lib/prado/framework/Web/UI/WebControls/TDataSourceView.php index ed6d868..43cc63f 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataSourceView.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataSourceView.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDataTypeValidator.php b/lib/prado/framework/Web/UI/WebControls/TDataTypeValidator.php index b78a962..886bb64 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDataTypeValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TDataTypeValidator.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDatePicker.php b/lib/prado/framework/Web/UI/WebControls/TDatePicker.php index 3f9e445..7a164dd 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDatePicker.php +++ b/lib/prado/framework/Web/UI/WebControls/TDatePicker.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDropDownList.php b/lib/prado/framework/Web/UI/WebControls/TDropDownList.php index 0598d24..1903d43 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDropDownList.php +++ b/lib/prado/framework/Web/UI/WebControls/TDropDownList.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TDropDownListColumn.php b/lib/prado/framework/Web/UI/WebControls/TDropDownListColumn.php index 507dafd..2b07a73 100644 --- a/lib/prado/framework/Web/UI/WebControls/TDropDownListColumn.php +++ b/lib/prado/framework/Web/UI/WebControls/TDropDownListColumn.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TEditCommandColumn.php b/lib/prado/framework/Web/UI/WebControls/TEditCommandColumn.php index 36e188f..c305cd7 100644 --- a/lib/prado/framework/Web/UI/WebControls/TEditCommandColumn.php +++ b/lib/prado/framework/Web/UI/WebControls/TEditCommandColumn.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TEmailAddressValidator.php b/lib/prado/framework/Web/UI/WebControls/TEmailAddressValidator.php index bb95372..2d76d67 100644 --- a/lib/prado/framework/Web/UI/WebControls/TEmailAddressValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TEmailAddressValidator.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TExpression.php b/lib/prado/framework/Web/UI/WebControls/TExpression.php index 57bbb59..6b987c9 100644 --- a/lib/prado/framework/Web/UI/WebControls/TExpression.php +++ b/lib/prado/framework/Web/UI/WebControls/TExpression.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TFileUpload.php b/lib/prado/framework/Web/UI/WebControls/TFileUpload.php index 20f3c5e..60f4670 100644 --- a/lib/prado/framework/Web/UI/WebControls/TFileUpload.php +++ b/lib/prado/framework/Web/UI/WebControls/TFileUpload.php @@ -4,7 +4,7 @@ * * @author Marcus Nyeholt <tanus@users.sourceforge.net>, Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -276,3 +276,4 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata } } + diff --git a/lib/prado/framework/Web/UI/WebControls/TFont.php b/lib/prado/framework/Web/UI/WebControls/TFont.php index 52a5db7..432532b 100644 --- a/lib/prado/framework/Web/UI/WebControls/TFont.php +++ b/lib/prado/framework/Web/UI/WebControls/TFont.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -54,6 +54,23 @@ class TFont extends TComponent private $_size=''; /** + * Returns an array with the names of all variables of this object that should NOT be serialized + * because their value is the default one or useless to be cached for the next page loads. + * Reimplement in derived classes to add new variables, but remember to also to call the parent + * implementation first. + */ + protected function _getZappableSleepProps(&$exprops) + { + parent::_getZappableSleepProps($exprops); + if ($this->_flags===0) + $exprops[] = "\0TFont\0_flags"; + if ($this->_name==='') + $exprops[] = "\0TFont\0_name"; + if ($this->_size==='') + $exprops[] = "\0TFont\0_size"; + } + + /** * @return boolean whether the font is in bold face. Defaults to false. */ public function getBold() diff --git a/lib/prado/framework/Web/UI/WebControls/THead.php b/lib/prado/framework/Web/UI/WebControls/THead.php index c7c9b57..487b4a1 100644 --- a/lib/prado/framework/Web/UI/WebControls/THead.php +++ b/lib/prado/framework/Web/UI/WebControls/THead.php @@ -4,7 +4,7 @@ * * @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI */ diff --git a/lib/prado/framework/Web/UI/WebControls/THeader1.php b/lib/prado/framework/Web/UI/WebControls/THeader1.php index 5eee499..b36cb5a 100644 --- a/lib/prado/framework/Web/UI/WebControls/THeader1.php +++ b/lib/prado/framework/Web/UI/WebControls/THeader1.php @@ -4,7 +4,7 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THeader2.php b/lib/prado/framework/Web/UI/WebControls/THeader2.php index c54b52f..e60759e 100644 --- a/lib/prado/framework/Web/UI/WebControls/THeader2.php +++ b/lib/prado/framework/Web/UI/WebControls/THeader2.php @@ -4,7 +4,7 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THeader3.php b/lib/prado/framework/Web/UI/WebControls/THeader3.php index ef89e02..2c156bd 100644 --- a/lib/prado/framework/Web/UI/WebControls/THeader3.php +++ b/lib/prado/framework/Web/UI/WebControls/THeader3.php @@ -4,7 +4,7 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THeader4.php b/lib/prado/framework/Web/UI/WebControls/THeader4.php index d2dada4..58e3721 100644 --- a/lib/prado/framework/Web/UI/WebControls/THeader4.php +++ b/lib/prado/framework/Web/UI/WebControls/THeader4.php @@ -4,7 +4,7 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THeader5.php b/lib/prado/framework/Web/UI/WebControls/THeader5.php index 582567d..440546b 100644 --- a/lib/prado/framework/Web/UI/WebControls/THeader5.php +++ b/lib/prado/framework/Web/UI/WebControls/THeader5.php @@ -4,7 +4,7 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THeader6.php b/lib/prado/framework/Web/UI/WebControls/THeader6.php index ae876f8..d2c724e 100644 --- a/lib/prado/framework/Web/UI/WebControls/THeader6.php +++ b/lib/prado/framework/Web/UI/WebControls/THeader6.php @@ -4,7 +4,7 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THiddenField.php b/lib/prado/framework/Web/UI/WebControls/THiddenField.php index 8ea1c5b..a120be0 100644 --- a/lib/prado/framework/Web/UI/WebControls/THiddenField.php +++ b/lib/prado/framework/Web/UI/WebControls/THiddenField.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.xisc.com/ - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license http://www.opensource.org/licenses/bsd-license.php BSD License * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THtmlArea.php b/lib/prado/framework/Web/UI/WebControls/THtmlArea.php index 7fc5969..679ce4a 100644 --- a/lib/prado/framework/Web/UI/WebControls/THtmlArea.php +++ b/lib/prado/framework/Web/UI/WebControls/THtmlArea.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THtmlArea4.php b/lib/prado/framework/Web/UI/WebControls/THtmlArea4.php index 9485150..ebee649 100644 --- a/lib/prado/framework/Web/UI/WebControls/THtmlArea4.php +++ b/lib/prado/framework/Web/UI/WebControls/THtmlArea4.php @@ -4,7 +4,7 @@ * * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THtmlElement.php b/lib/prado/framework/Web/UI/WebControls/THtmlElement.php index 6efd608..e40045c 100644 --- a/lib/prado/framework/Web/UI/WebControls/THtmlElement.php +++ b/lib/prado/framework/Web/UI/WebControls/THtmlElement.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THyperLink.php b/lib/prado/framework/Web/UI/WebControls/THyperLink.php index 8e8d3f5..a21dc6b 100644 --- a/lib/prado/framework/Web/UI/WebControls/THyperLink.php +++ b/lib/prado/framework/Web/UI/WebControls/THyperLink.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.xisc.com/ - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license http://www.opensource.org/licenses/bsd-license.php BSD License * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/THyperLinkColumn.php b/lib/prado/framework/Web/UI/WebControls/THyperLinkColumn.php index d24616a..2c7590e 100644 --- a/lib/prado/framework/Web/UI/WebControls/THyperLinkColumn.php +++ b/lib/prado/framework/Web/UI/WebControls/THyperLinkColumn.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TImage.php b/lib/prado/framework/Web/UI/WebControls/TImage.php index 8538545..5ec8399 100644 --- a/lib/prado/framework/Web/UI/WebControls/TImage.php +++ b/lib/prado/framework/Web/UI/WebControls/TImage.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TImageButton.php b/lib/prado/framework/Web/UI/WebControls/TImageButton.php index 288def3..04ac3b8 100644 --- a/lib/prado/framework/Web/UI/WebControls/TImageButton.php +++ b/lib/prado/framework/Web/UI/WebControls/TImageButton.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TImageMap.php b/lib/prado/framework/Web/UI/WebControls/TImageMap.php index 8775496..6c83175 100644 --- a/lib/prado/framework/Web/UI/WebControls/TImageMap.php +++ b/lib/prado/framework/Web/UI/WebControls/TImageMap.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TInlineFrame.php b/lib/prado/framework/Web/UI/WebControls/TInlineFrame.php index 3d18235..ab0fb48 100644 --- a/lib/prado/framework/Web/UI/WebControls/TInlineFrame.php +++ b/lib/prado/framework/Web/UI/WebControls/TInlineFrame.php @@ -5,7 +5,7 @@ * @author Jason Ragsdale <jrags@jasrags.net> * @author Harry Pottash <hpottash@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TItemDataRenderer.php b/lib/prado/framework/Web/UI/WebControls/TItemDataRenderer.php index 1800fa7..6765695 100644 --- a/lib/prado/framework/Web/UI/WebControls/TItemDataRenderer.php +++ b/lib/prado/framework/Web/UI/WebControls/TItemDataRenderer.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls * @since 3.1.2 diff --git a/lib/prado/framework/Web/UI/WebControls/TJavascriptLogger.php b/lib/prado/framework/Web/UI/WebControls/TJavascriptLogger.php index 83f9fcb..7164689 100644 --- a/lib/prado/framework/Web/UI/WebControls/TJavascriptLogger.php +++ b/lib/prado/framework/Web/UI/WebControls/TJavascriptLogger.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TKeyboard.php b/lib/prado/framework/Web/UI/WebControls/TKeyboard.php index 15a4aa3..3808f2e 100644 --- a/lib/prado/framework/Web/UI/WebControls/TKeyboard.php +++ b/lib/prado/framework/Web/UI/WebControls/TKeyboard.php @@ -4,7 +4,7 @@ * * @author Sergey Morkovkin <sergeymorkovkin@mail.ru> and Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls * @since 3.1.1 diff --git a/lib/prado/framework/Web/UI/WebControls/TLabel.php b/lib/prado/framework/Web/UI/WebControls/TLabel.php index bf43b4d..ba342b7 100644 --- a/lib/prado/framework/Web/UI/WebControls/TLabel.php +++ b/lib/prado/framework/Web/UI/WebControls/TLabel.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -102,7 +102,7 @@ class TLabel extends TWebControl implements IDataRenderer */ public function setText($value) { - $this->setViewState('Text',$value,''); + $this->setViewState('Text',TPropertyValue::ensureString($value),''); } /** diff --git a/lib/prado/framework/Web/UI/WebControls/TLinkButton.php b/lib/prado/framework/Web/UI/WebControls/TLinkButton.php index dadea1d..95cf5d2 100644 --- a/lib/prado/framework/Web/UI/WebControls/TLinkButton.php +++ b/lib/prado/framework/Web/UI/WebControls/TLinkButton.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TListBox.php b/lib/prado/framework/Web/UI/WebControls/TListBox.php index 520fc5e..ef8423e 100644 --- a/lib/prado/framework/Web/UI/WebControls/TListBox.php +++ b/lib/prado/framework/Web/UI/WebControls/TListBox.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TListControl.php b/lib/prado/framework/Web/UI/WebControls/TListControl.php index ff89a74..8bf1352 100644 --- a/lib/prado/framework/Web/UI/WebControls/TListControl.php +++ b/lib/prado/framework/Web/UI/WebControls/TListControl.php @@ -6,7 +6,7 @@ * @author Robin J. Rogge <rojaro@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TListControlValidator.php b/lib/prado/framework/Web/UI/WebControls/TListControlValidator.php index 76096ef..15ade02 100644 --- a/lib/prado/framework/Web/UI/WebControls/TListControlValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TListControlValidator.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TListItem.php b/lib/prado/framework/Web/UI/WebControls/TListItem.php index aec006d..0118a91 100644 --- a/lib/prado/framework/Web/UI/WebControls/TListItem.php +++ b/lib/prado/framework/Web/UI/WebControls/TListItem.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -32,19 +32,19 @@ class TListItem extends TComponent /** * @var string text of the item */ - private $_text; + private $_text=''; /** * @var string value of the item */ - private $_value; + private $_value=''; /** * @var boolean whether the item is enabled */ - private $_enabled; + private $_enabled=true; /** * @var boolean whether the item is selected */ - private $_selected; + private $_selected=false; /** * Constructor. @@ -62,6 +62,27 @@ class TListItem extends TComponent } /** + * Returns an array with the names of all variables of this object that should NOT be serialized + * because their value is the default one or useless to be cached for the next page loads. + * Reimplement in derived classes to add new variables, but remember to also to call the parent + * implementation first. + */ + protected function _getZappableSleepProps(&$exprops) + { + parent::_getZappableSleepProps($exprops); + if ($this->_attributes===null) + $exprops[] = "\0TListItem\0_attributes"; + if($this->_text==='') + $exprops[] = "\0TListItem\0_text"; + if($this->_value==='') + $exprops[] = "\0TListItem\0_value"; + if ($this->_enabled===true) + $exprops[] = "\0TListItem\0_enabled"; + if ($this->_selected===false) + $exprops[] = "\0TListItem\0_selected"; + } + + /** * @return boolean whether the item is enabled */ public function getEnabled() diff --git a/lib/prado/framework/Web/UI/WebControls/TLiteral.php b/lib/prado/framework/Web/UI/WebControls/TLiteral.php index f2306b4..d5c5b66 100644 --- a/lib/prado/framework/Web/UI/WebControls/TLiteral.php +++ b/lib/prado/framework/Web/UI/WebControls/TLiteral.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -45,7 +45,7 @@ class TLiteral extends TControl implements IDataRenderer */ public function setText($value) { - $this->setViewState('Text',$value,''); + $this->setViewState('Text',TPropertyValue::ensureString($value),''); } /** diff --git a/lib/prado/framework/Web/UI/WebControls/TLiteralColumn.php b/lib/prado/framework/Web/UI/WebControls/TLiteralColumn.php index 3cf3c3a..dae5ac9 100644 --- a/lib/prado/framework/Web/UI/WebControls/TLiteralColumn.php +++ b/lib/prado/framework/Web/UI/WebControls/TLiteralColumn.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TMarkdown.php b/lib/prado/framework/Web/UI/WebControls/TMarkdown.php index 7a99b1f..0d38f9d 100644 --- a/lib/prado/framework/Web/UI/WebControls/TMarkdown.php +++ b/lib/prado/framework/Web/UI/WebControls/TMarkdown.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TMultiView.php b/lib/prado/framework/Web/UI/WebControls/TMultiView.php index 5f338d7..169428f 100644 --- a/lib/prado/framework/Web/UI/WebControls/TMultiView.php +++ b/lib/prado/framework/Web/UI/WebControls/TMultiView.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TOutputCache.php b/lib/prado/framework/Web/UI/WebControls/TOutputCache.php index 5615418..eaa0f83 100644 --- a/lib/prado/framework/Web/UI/WebControls/TOutputCache.php +++ b/lib/prado/framework/Web/UI/WebControls/TOutputCache.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TPager.php b/lib/prado/framework/Web/UI/WebControls/TPager.php index 467c0f7..dd0a7e5 100644 --- a/lib/prado/framework/Web/UI/WebControls/TPager.php +++ b/lib/prado/framework/Web/UI/WebControls/TPager.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TPanel.php b/lib/prado/framework/Web/UI/WebControls/TPanel.php index 22d44a5..e73ba3b 100644 --- a/lib/prado/framework/Web/UI/WebControls/TPanel.php +++ b/lib/prado/framework/Web/UI/WebControls/TPanel.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TPanelStyle.php b/lib/prado/framework/Web/UI/WebControls/TPanelStyle.php index 2e0f1a2..8bb1354 100644 --- a/lib/prado/framework/Web/UI/WebControls/TPanelStyle.php +++ b/lib/prado/framework/Web/UI/WebControls/TPanelStyle.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -46,6 +46,27 @@ class TPanelStyle extends TStyle private $_wrap=null; /** + * Returns an array with the names of all variables of this object that should NOT be serialized + * because their value is the default one or useless to be cached for the next page loads. + * Reimplement in derived classes to add new variables, but remember to also to call the parent + * implementation first. + */ + protected function _getZappableSleepProps(&$exprops) + { + parent::_getZappableSleepProps($exprops); + if ($this->_backImageUrl===null) + $exprops[] = "\0TPanelStyle\0_backImageUrl"; + if ($this->_direction===null) + $exprops[] = "\0TPanelStyle\0_direction"; + if ($this->_horizontalAlign===null) + $exprops[] = "\0TPanelStyle\0_horizontalAlign"; + if ($this->_scrollBars===null) + $exprops[] = "\0TPanelStyle\0_scrollBars"; + if ($this->_wrap===null) + $exprops[] = "\0TPanelStyle\0_wrap"; + } + + /** * Adds attributes related to CSS styles to renderer. * This method overrides the parent implementation. * @param THtmlWriter the writer used for the rendering purpose diff --git a/lib/prado/framework/Web/UI/WebControls/TPlaceHolder.php b/lib/prado/framework/Web/UI/WebControls/TPlaceHolder.php index 65f5ba2..8fee46f 100644 --- a/lib/prado/framework/Web/UI/WebControls/TPlaceHolder.php +++ b/lib/prado/framework/Web/UI/WebControls/TPlaceHolder.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TRadioButton.php b/lib/prado/framework/Web/UI/WebControls/TRadioButton.php index cfdb795..d10fe1d 100644 --- a/lib/prado/framework/Web/UI/WebControls/TRadioButton.php +++ b/lib/prado/framework/Web/UI/WebControls/TRadioButton.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TRadioButtonList.php b/lib/prado/framework/Web/UI/WebControls/TRadioButtonList.php index dc9e2da..ef9c040 100644 --- a/lib/prado/framework/Web/UI/WebControls/TRadioButtonList.php +++ b/lib/prado/framework/Web/UI/WebControls/TRadioButtonList.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TRangeValidator.php b/lib/prado/framework/Web/UI/WebControls/TRangeValidator.php index a6668f4..2556e07 100644 --- a/lib/prado/framework/Web/UI/WebControls/TRangeValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TRangeValidator.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TRatingList.php b/lib/prado/framework/Web/UI/WebControls/TRatingList.php index 0f1f364..94f9da1 100644 --- a/lib/prado/framework/Web/UI/WebControls/TRatingList.php +++ b/lib/prado/framework/Web/UI/WebControls/TRatingList.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TReCaptcha2.php b/lib/prado/framework/Web/UI/WebControls/TReCaptcha2.php new file mode 100644 index 0000000..a4a9e83 --- /dev/null +++ b/lib/prado/framework/Web/UI/WebControls/TReCaptcha2.php @@ -0,0 +1,364 @@ +<?php + +/** + * TReCaptcha2 class file + * + * @author Cristian Camilo Naranjo Valencia + * @link http://icolectiva.co + * @copyright Copyright © 2005-2016 The PRADO Group + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT + * @package System.Web.UI.WebControls + */ + +Prado::using('System.Web.UI.ActiveControls.TCallbackEventParameter'); +Prado::using('System.Web.UI.ActiveControls.TActivePanel'); + +/** + * TReCaptcha2 class. + * + * TReCaptcha2 displays a reCAPTCHA (a token displayed as an image) that can be used + * to determine if the input is entered by a real user instead of some program. It can + * also prevent multiple submits of the same form either by accident, or on purpose (ie. spamming). + * + * The reCAPTCHA to solve (a string consisting of two separate words) displayed is automatically + * generated by the reCAPTCHA system at recaptcha.net. However, in order to use the services + * of the site you will need to register and get a public and a private API key pair, and + * supply those to the reCAPTCHA control through setting the {@link setSecretKey SecretKey} + * and {@link setSiteKey SiteKey} properties. + * + * Currently the reCAPTCHA API supports only one reCAPTCHA field per page, so you MUST make sure that all + * your input is protected and validated by a single reCAPTCHA control. Placing more than one reCAPTCHA + * control on the page will lead to unpredictable results, and the user will most likely unable to solve + * any of them successfully. + * + * Upon postback, user input can be validated by calling {@link validate()}. + * The {@link TReCaptcha2Validator} control can also be used to do validation, which provides + * server-side validation. Calling (@link validate()) will invalidate the token supplied, so all consecutive + * calls to the method - without solving a new captcha - will return false. Therefore if implementing a multi-stage + * input process, you must make sure that you call validate() only once, either at the end of the input process, or + * you store the result till the end of the processing. + * + * The following template shows a typical use of TReCaptcha control: + * <code> + * <com:TReCaptcha2 ID="Captcha" + * SiteKey="..." + * SecretKey="..." + * /> + * <com:TReCaptcha2Validator ControlToValidate="Captcha" + * ErrorMessage="You are challenged!" /> + * </code> + * + * @author Cristian Camilo Naranjo Valencia + * @package System.Web.UI.WebControls + * @since 3.3.1 + */ + +class TReCaptcha2 extends TActivePanel implements ICallbackEventHandler, IValidatable +{ + const ChallengeFieldName = 'g-recaptcha-response'; + private $_widgetId=0; + private $_isValid=true; + + public function __construct() + { + parent::__construct(); + $this->setAdapter(new TActiveControlAdapter($this)); + } + public function getActiveControl() + { + return $this->getAdapter()->getBaseActiveControl(); + } + public function getClientSide() + { + return $this->getAdapter()->getBaseActiveControl()->getClientSide(); + } + public function getClientClassName() + { + return 'Prado.WebUI.TReCaptcha2'; + } + public function getTagName() + { + return 'div'; + } + /** + * Returns true if this control validated successfully. + * Defaults to true. + * @return bool wether this control validated successfully. + */ + public function getIsValid() + { + return $this->_isValid; + } + /** + * @param bool wether this control is valid. + */ + public function setIsValid($value) + { + $this->_isValid=TPropertyValue::ensureBoolean($value); + } + public function getValidationPropertyValue() + { + return $this->Request[$this->getResponseFieldName()]; + } + public function getResponseFieldName() + { + $captchas = $this->Page->findControlsByType('TReCaptcha2'); + $cont = 0; + $responseFieldName = self::ChallengeFieldName; + foreach ($captchas as $captcha) + { + if ($this->getClientID() == $captcha->ClientID) + { + $responseFieldName .= ($cont > 0) ? '-'.$cont : ''; + } + $cont++; + } + return $responseFieldName; + } + /** + * Returns your site key. + * @return string. + */ + public function getSiteKey() + { + return $this->getViewState('SiteKey'); + } + /** + * @param string your site key. + */ + public function setSiteKey($value) + { + $this->setViewState('SiteKey', TPropertyValue::ensureString($value)); + } + /** + * Returns your secret key. + * @return string. + */ + public function getSecretKey() + { + return $this->getViewState('SecretKey'); + } + /** + * @param string your secret key. + */ + public function setSecretKey($value) + { + $this->setViewState('SecretKey', TPropertyValue::ensureString($value)); + } + /** + * Returns your language. + * @return string. + */ + public function getLanguage() + { + return $this->getViewState('Language', 'en'); + } + /** + * @param string your language. + */ + public function setLanguage($value) + { + $this->setViewState('Language', TPropertyValue::ensureString($value), 'en'); + } + /** + * Returns the color theme of the widget. + * @return string. + */ + public function getTheme() + { + return $this->getViewState('Theme', 'light'); + } + /** + * The color theme of the widget. + * Default: light + * @param string the color theme of the widget. + */ + public function setTheme($value) + { + $this->setViewState('Theme', TPropertyValue::ensureString($value), 'light'); + } + /** + * Returns the type of CAPTCHA to serve. + * @return string. + */ + public function getType() + { + return $this->getViewState('Type', 'image'); + } + /** + * The type of CAPTCHA to serve. + * Default: image + * @param string the type of CAPTCHA to serve. + */ + public function setType($value) + { + $this->setViewState('Type', TPropertyValue::ensureString($value), 'image'); + } + /** + * Returns the size of the widget. + * @return string. + */ + public function getSize() + { + return $this->getViewState('Size', 'normal'); + } + /** + * The size of the widget. + * Default: normal + * @param string the size of the widget. + */ + public function setSize($value) + { + $this->setViewState('Size', TPropertyValue::ensureString($value), 'normal'); + } + /** + * Returns the tabindex of the widget and challenge. + * If other elements in your page use tabindex, it should be set to make user navigation easier. + * @return string. + */ + public function getTabIndex() + { + return $this->getViewState('TabIndex', 0); + } + /** + * The tabindex of the widget and challenge. + * If other elements in your page use tabindex, it should be set to make user navigation easier. + * Default: 0 + * @param string the tabindex of the widget and challenge. + */ + public function setTabIndex($value) + { + $this->setViewState('TabIndex', TPropertyValue::ensureInteger($value), 0); + } + /** + * Resets the reCAPTCHA widget. + * Optional widget ID, defaults to the first widget created if unspecified. + */ + public function reset() + { + $this->Page->CallbackClient->callClientFunction('grecaptcha.reset',array(array($this->WidgetId))); + } + /** + * Gets the response for the reCAPTCHA widget. + */ + public function getResponse() + { + return $this->getViewState('Response', ''); + } + public function setResponse($value) + { + $this->setViewState('Response', TPropertyValue::ensureString($value), ''); + } + public function getWidgetId() + { + return $this->getViewState('WidgetId', 0); + } + public function setWidgetId($value) + { + $this->setViewState('WidgetId', TPropertyValue::ensureInteger($value), 0); + } + protected function getClientOptions() + { + $options['ID'] = $this->getClientID(); + $options['EventTarget'] = $this->getUniqueID(); + $options['FormID'] = $this->Page->getForm()->getClientID(); + $options['onCallback'] = $this->hasEventHandler('OnCallback'); + $options['onCallbackExpired'] = $this->hasEventHandler('OnCallbackExpired'); + $options['options']['sitekey'] = $this->getSiteKey(); + if ($theme = $this->getTheme()) $options['options']['theme'] = $theme; + if ($type = $this->getType()) $options['options']['type'] = $type; + if ($size = $this->getSize()) $options['options']['size'] = $size; + if ($tabIndex = $this->getTabIndex()) $options['options']['tabindex'] = $tabIndex; + + return $options; + } + protected function registerClientScript() + { + $id = $this->getClientID(); + $options = TJavaScript::encode($this->getClientOptions()); + $className = $this->getClientClassName(); + $cs = $this->Page->ClientScript; + $code = "new $className($options);"; + + $cs->registerPradoScript('ajax'); + $cs->registerEndScript("grecaptcha:$id", $code); + } + public function validate() + { + $value = $this->getValidationPropertyValue(); + if($value === null || empty($value)) + return false; + + return true; + } + /** + * Checks for API keys + * @param mixed event parameter + */ + public function onPreRender($param) + { + parent::onPreRender($param); + + if("" == $this->getSiteKey()) + throw new TConfigurationException('recaptcha_publickey_unknown'); + if("" == $this->getSecretKey()) + throw new TConfigurationException('recaptcha_privatekey_unknown'); + + // need to register captcha fields so they will be sent postback + $this->Page->registerRequiresPostData($this->getResponseFieldName()); + $this->Page->ClientScript->registerHeadScriptFile('grecaptcha2', 'https://www.google.com/recaptcha/api.js?onload=TReCaptcha2_onloadCallback&render=explicit&hl=' . $this->getLanguage()); + } + protected function addAttributesToRender($writer) + { + $writer->addAttribute('id',$this->getClientID()); + parent::addAttributesToRender($writer); + } + public function raiseCallbackEvent($param) + { + $params = $param->getCallbackParameter(); + if ($params instanceof stdClass) + { + $callback = property_exists($params, 'onCallback'); + $callbackExpired = property_exists($params, 'onCallbackExpired'); + + if ($callback) + { + $this->WidgetId = $params->widgetId; + $this->Response = $params->response; + $this->Page->CallbackClient->jQuery($params->responseField, 'text',array($params->response)); + + if ($params->onCallback) + { + $this->onCallback($param); + } + } + + if ($callbackExpired) + { + $this->Response = ''; + $this->reset(); + + if ($params->onCallbackExpired) + { + $this->onCallbackExpired($param); + } + } + } + } + + public function onCallback($param) + { + $this->raiseEvent('OnCallback', $this, $param); + } + + public function onCallbackExpired($param) + { + $this->raiseEvent('OnCallbackExpired', $this, $param); + } + + public function render($writer) + { + $this->registerClientScript(); + parent::render($writer); + } +} diff --git a/lib/prado/framework/Web/UI/WebControls/TReCaptcha2Validator.php b/lib/prado/framework/Web/UI/WebControls/TReCaptcha2Validator.php new file mode 100644 index 0000000..2cd4b6d --- /dev/null +++ b/lib/prado/framework/Web/UI/WebControls/TReCaptcha2Validator.php @@ -0,0 +1,110 @@ +<?php + +/** + * TReCaptcha2Validator class file + * + * @author Cristian Camilo Naranjo Valencia + * @link http://icolectiva.co + * @copyright Copyright © 2005-2016 The PRADO Group + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT + * @package System.Web.UI.WebControls + */ + +Prado::using('System.Web.UI.WebControls.TBaseValidator'); +Prado::using('System.Web.UI.WebControls.TReCaptcha2'); + +/** + * TReCaptcha2Validator class + * + * TReCaptcha2Validator validates a reCAPTCHA represented by a {@link TReCaptcha} control. + * The input control fails validation if th user did not pass the humanity test. + * + * To use TReCaptcha2Validator, specify the {@link setCaptchaControl CaptchaControl} + * to be the ID path of the {@link TReCaptcha} control. + * + * @author Cristian Camilo Naranjo Valencia + * @package System.Web.UI.WebControls + * @since 3.3.1 + */ + +class TReCaptcha2Validator extends TBaseValidator +{ + protected $_isvalid = null; + + protected function getClientClassName() + { + return 'Prado.WebUI.TReCaptcha2Validator'; + } + public function getEnableClientScript() + { + return true; + } + protected function getCaptchaControl() + { + $control = $this->getValidationTarget(); + if (!$control) + throw new Exception('No target control specified for TReCaptcha2Validator'); + if (!($control instanceof TReCaptcha2)) + throw new Exception('TReCaptcha2Validator only works with TReCaptcha2 controls'); + return $control; + } + public function getClientScriptOptions() + { + $options = parent::getClientScriptOptions(); + $options['ResponseFieldName'] = $this->getCaptchaControl()->getResponseFieldName(); + return $options; + } + /** + * This method overrides the parent's implementation. + * The validation succeeds if the input control has the same value + * as the one displayed in the corresponding RECAPTCHA control. + * + * @return boolean whether the validation succeeds + */ + protected function evaluateIsValid() + { + // check validity only once (if trying to evaulate multiple times, all redundant checks would fail) + if (is_null($this->_isvalid)) + { + $control = $this->getCaptchaControl(); + $this->_isvalid = $control->validate(); + } + return ($this->_isvalid==true); + } + public function onPreRender($param) + { + parent::onPreRender($param); + + $cs = $this->Page->getClientScript(); + $cs->registerPradoScript('validator'); + + // communicate validation status to the client side + $value = $this->_isvalid===false ? '0' : '1'; + $cs->registerHiddenField($this->getClientID().'_1',$value); + + // update validator display + if ($control = $this->getValidationTarget()) + { + $fn = 'captchaUpdateValidatorStatus_'.$this->getClientID(); + + $cs->registerEndScript($this->getClientID().'::validate', implode(' ',array( + // this function will be used to update the validator + 'function '.$fn.'(valid)', + '{', + ' jQuery('.TJavaScript::quoteString('#'.$this->getClientID().'_1').').val(valid);', + ' Prado.Validation.validateControl('.TJavaScript::quoteString($control->ClientID).'); ', + '}', + '', + // update the validator to the result if we're in a callback + // (if we're in initial rendering or a postback then the result will be rendered directly to the page html anyway) + $this->Page->IsCallback ? $fn.'('.$value.');' : '', + '', + // install event handler that clears the validation error when user changes the captcha response field + 'jQuery("#'.$control->getClientID().'").on("change", '.TJavaScript::quoteString('#'.$control->getResponseFieldName()).', function() { ', + $fn.'("1");', + '});', + ))); + } + } +} + diff --git a/lib/prado/framework/Web/UI/WebControls/TReCaptchaValidator.php b/lib/prado/framework/Web/UI/WebControls/TReCaptchaValidator.php index de3b42a..9078354 100644 --- a/lib/prado/framework/Web/UI/WebControls/TReCaptchaValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TReCaptchaValidator.php @@ -21,7 +21,7 @@ Prado::using('System.Web.UI.WebControls.TReCaptcha'); * is not the same as the token displayed in reCAPTCHA. Note, if the user does * not enter any thing, it is still considered as failing the validation. * - * To use TReCaptchaValidator, specify the {@link setControlToValidate ControlToValidate} + * To use TReCaptchaValidator, specify the {@link setCaptchaControl CaptchaControl} * to be the ID path of the {@link TReCaptcha} control. * * @author Bérczi Gábor <gabor.berczi@devworx.hu> diff --git a/lib/prado/framework/Web/UI/WebControls/TRegularExpressionValidator.php b/lib/prado/framework/Web/UI/WebControls/TRegularExpressionValidator.php index 1cdff8b..426dc83 100644 --- a/lib/prado/framework/Web/UI/WebControls/TRegularExpressionValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TRegularExpressionValidator.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TRepeatInfo.php b/lib/prado/framework/Web/UI/WebControls/TRepeatInfo.php index f5823d7..acafe3a 100644 --- a/lib/prado/framework/Web/UI/WebControls/TRepeatInfo.php +++ b/lib/prado/framework/Web/UI/WebControls/TRepeatInfo.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TRepeater.php b/lib/prado/framework/Web/UI/WebControls/TRepeater.php index 3d295a2..132a436 100644 --- a/lib/prado/framework/Web/UI/WebControls/TRepeater.php +++ b/lib/prado/framework/Web/UI/WebControls/TRepeater.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TRepeaterItemRenderer.php b/lib/prado/framework/Web/UI/WebControls/TRepeaterItemRenderer.php index 1ea799c..35e659b 100644 --- a/lib/prado/framework/Web/UI/WebControls/TRepeaterItemRenderer.php +++ b/lib/prado/framework/Web/UI/WebControls/TRepeaterItemRenderer.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TRequiredFieldValidator.php b/lib/prado/framework/Web/UI/WebControls/TRequiredFieldValidator.php index 4587db8..7cb439b 100644 --- a/lib/prado/framework/Web/UI/WebControls/TRequiredFieldValidator.php +++ b/lib/prado/framework/Web/UI/WebControls/TRequiredFieldValidator.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TSafeHtml.php b/lib/prado/framework/Web/UI/WebControls/TSafeHtml.php index 16743f9..9fb44f5 100644 --- a/lib/prado/framework/Web/UI/WebControls/TSafeHtml.php +++ b/lib/prado/framework/Web/UI/WebControls/TSafeHtml.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TSlider.php b/lib/prado/framework/Web/UI/WebControls/TSlider.php index 593cd2c..db1044f 100644 --- a/lib/prado/framework/Web/UI/WebControls/TSlider.php +++ b/lib/prado/framework/Web/UI/WebControls/TSlider.php @@ -4,7 +4,7 @@ * * @author Christophe Boulain <Christophe.Boulain@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls * @since 3.1.1 diff --git a/lib/prado/framework/Web/UI/WebControls/TStatements.php b/lib/prado/framework/Web/UI/WebControls/TStatements.php index e9cbeb3..b84b5bb 100644 --- a/lib/prado/framework/Web/UI/WebControls/TStatements.php +++ b/lib/prado/framework/Web/UI/WebControls/TStatements.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TStyle.php b/lib/prado/framework/Web/UI/WebControls/TStyle.php index eb47f2f..f6d91e9 100644 --- a/lib/prado/framework/Web/UI/WebControls/TStyle.php +++ b/lib/prado/framework/Web/UI/WebControls/TStyle.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -47,6 +47,27 @@ class TStyle extends TComponent private $_displayStyle='Fixed'; /** + * Returns an array with the names of all variables of this object that should NOT be serialized + * because their value is the default one or useless to be cached for the next page loads. + * Reimplement in derived classes to add new variables, but remember to also to call the parent + * implementation first. + */ + protected function _getZappableSleepProps(&$exprops) + { + parent::_getZappableSleepProps($exprops); + if ($this->_fields===array()) + $exprops[] = "\0TStyle\0_fields"; + if($this->_font===null) + $exprops[] = "\0TStyle\0_font"; + if($this->_class===null) + $exprops[] = "\0TStyle\0_class"; + if ($this->_customStyle===null) + $exprops[] = "\0TStyle\0_customStyle"; + if ($this->_displayStyle==='Fixed') + $exprops[] = "\0TStyle\0_displayStyle"; + } + + /** * Constructor. * @param TStyle style to copy from */ @@ -463,6 +484,29 @@ class TTableStyle extends TStyle private $_borderCollapse=null; /** + * Returns an array with the names of all variables of this object that should NOT be serialized + * because their value is the default one or useless to be cached for the next page loads. + * Reimplement in derived classes to add new variables, but remember to also to call the parent + * implementation first. + */ + protected function _getZappableSleepProps(&$exprops) + { + parent::_getZappableSleepProps($exprops); + if ($this->_backImageUrl===null) + $exprops[] = "\0TTableStyle\0_backImageUrl"; + if ($this->_horizontalAlign===null) + $exprops[] = "\0TTableStyle\0_horizontalAlign"; + if ($this->_cellPadding===null) + $exprops[] = "\0TTableStyle\0_cellPadding"; + if ($this->_cellSpacing===null) + $exprops[] = "\0TTableStyle\0_cellSpacing"; + if ($this->_gridLines===null) + $exprops[] = "\0TTableStyle\0_gridLines"; + if ($this->_borderCollapse===null) + $exprops[] = "\0TTableStyle\0_borderCollapse"; + } + + /** * Sets the style attributes to default values. * This method overrides the parent implementation by * resetting additional TTableStyle specific attributes. @@ -691,6 +735,23 @@ class TTableItemStyle extends TStyle private $_wrap=null; /** + * Returns an array with the names of all variables of this object that should NOT be serialized + * because their value is the default one or useless to be cached for the next page loads. + * Reimplement in derived classes to add new variables, but remember to also to call the parent + * implementation first. + */ + protected function _getZappableSleepProps(&$exprops) + { + parent::_getZappableSleepProps($exprops); + if ($this->_horizontalAlign===null) + $exprops[] = "\0TTableItemStyle\0_horizontalAlign"; + if ($this->_verticalAlign===null) + $exprops[] = "\0TTableItemStyle\0_verticalAlign"; + if ($this->_wrap===null) + $exprops[] = "\0TTableItemStyle\0_wrap"; + } + + /** * Sets the style attributes to default values. * This method overrides the parent implementation by * resetting additional TTableItemStyle specific attributes. diff --git a/lib/prado/framework/Web/UI/WebControls/TStyleSheet.php b/lib/prado/framework/Web/UI/WebControls/TStyleSheet.php index ae5692d..021b911 100644 --- a/lib/prado/framework/Web/UI/WebControls/TStyleSheet.php +++ b/lib/prado/framework/Web/UI/WebControls/TStyleSheet.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo <weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -13,7 +13,17 @@ * TStyleSheet class. * * TStyleSheet represents the link to a stylesheet file and/or a piece of - * stylesheet code. To specify the link to a CSS file, set {@link setStyleSheetUrl StyleSheetUrl}. + * stylesheet code. To specify the link to a CSS file, set {@link setStyleSheetUrl + * StyleSheetUrl}. + * Since Prado 3.3.1, it' possible to import css libraries bundled with + * Prado from template via the {@link setPradoStyles PradoStyles} property. + * Multiple Prado libraries can be specified using comma delimited string of the + * css library to include on the page. For example, + * + * <code> + * <com:TStyleSheet PradoStyles="bootstrap, jquery.ui.progressbar" /> + * </code> + * * The child rendering result of TStyleSheet is treated as CSS code and * is rendered within an appropriate style HTML element. * Therefore, if the child content is not empty, you should place the TStyleSheet @@ -29,6 +39,29 @@ class TStyleSheet extends TControl { /** + * @return string comma delimited list of css libraries to include + * on the page. + * @since 3.3.1 + */ + public function getPradoStyles() + { + return $this->getViewState('PradoStyles', ''); + } + + /** + * Include css library to the current page. The current supported + * libraries are: "jquery-ui", "bootstrap" and all the split + * jquery.ui.componentname libraries. + * + * @param string comma delimited list of css libraries to include. + * @since 3.3.1 + */ + public function setPradoStyles($value) + { + $this->setViewState('PradoStyles', $value, ''); + } + + /** * @param string URL to the stylesheet file */ public function setStyleSheetUrl($value) @@ -67,8 +100,17 @@ class TStyleSheet extends TControl */ public function onPreRender($param) { + $cs = $this->getPage()->getClientScript(); + + $styles = preg_split('/,|\s+/', $this->getPradoStyles()); + foreach($styles as $style) + { + if(($style = trim($style))!=='') + $cs->registerPradoStyle($style); + } + if(($url=$this->getStyleSheetUrl())!=='') - $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url,$this->getMediaType()); + $cs->registerStyleSheetFile($url,$url,$this->getMediaType()); } /** diff --git a/lib/prado/framework/Web/UI/WebControls/TTabPanel.php b/lib/prado/framework/Web/UI/WebControls/TTabPanel.php index 29baefd..5a84cfb 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTabPanel.php +++ b/lib/prado/framework/Web/UI/WebControls/TTabPanel.php @@ -4,7 +4,7 @@ * * @author Tomasz Wolny <tomasz.wolny@polecam.to.pl> and Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls * @since 3.1.1 diff --git a/lib/prado/framework/Web/UI/WebControls/TTable.php b/lib/prado/framework/Web/UI/WebControls/TTable.php index 98dc74e..42f41c3 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTable.php +++ b/lib/prado/framework/Web/UI/WebControls/TTable.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TTableCell.php b/lib/prado/framework/Web/UI/WebControls/TTableCell.php index b0398d2..2642e29 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTableCell.php +++ b/lib/prado/framework/Web/UI/WebControls/TTableCell.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TTableFooterRow.php b/lib/prado/framework/Web/UI/WebControls/TTableFooterRow.php index c3e8fe9..15d51d3 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTableFooterRow.php +++ b/lib/prado/framework/Web/UI/WebControls/TTableFooterRow.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TTableHeaderCell.php b/lib/prado/framework/Web/UI/WebControls/TTableHeaderCell.php index bb2953b..ec42fbc 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTableHeaderCell.php +++ b/lib/prado/framework/Web/UI/WebControls/TTableHeaderCell.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TTableHeaderRow.php b/lib/prado/framework/Web/UI/WebControls/TTableHeaderRow.php index 7eaedc3..c2731b5 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTableHeaderRow.php +++ b/lib/prado/framework/Web/UI/WebControls/TTableHeaderRow.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TTableRow.php b/lib/prado/framework/Web/UI/WebControls/TTableRow.php index ebbe9df..740dbca 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTableRow.php +++ b/lib/prado/framework/Web/UI/WebControls/TTableRow.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TTemplateColumn.php b/lib/prado/framework/Web/UI/WebControls/TTemplateColumn.php index b97b61f..283fc92 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTemplateColumn.php +++ b/lib/prado/framework/Web/UI/WebControls/TTemplateColumn.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TTextBox.php b/lib/prado/framework/Web/UI/WebControls/TTextBox.php index f3a0c16..2f3ea3e 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTextBox.php +++ b/lib/prado/framework/Web/UI/WebControls/TTextBox.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ @@ -478,7 +478,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable */ public function setText($value) { - $this->setViewState('Text',$value,''); + $this->setViewState('Text',TPropertyValue::ensureString($value),''); $this->_safeText = null; } diff --git a/lib/prado/framework/Web/UI/WebControls/TTextHighlighter.php b/lib/prado/framework/Web/UI/WebControls/TTextHighlighter.php index 6183851..d272549 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTextHighlighter.php +++ b/lib/prado/framework/Web/UI/WebControls/TTextHighlighter.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo<weizhuo[at]gmail[dot]com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TTextProcessor.php b/lib/prado/framework/Web/UI/WebControls/TTextProcessor.php index c213a96..1962c51 100644 --- a/lib/prado/framework/Web/UI/WebControls/TTextProcessor.php +++ b/lib/prado/framework/Web/UI/WebControls/TTextProcessor.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TValidationSummary.php b/lib/prado/framework/Web/UI/WebControls/TValidationSummary.php index 2fbdba7..aa9d08e 100644 --- a/lib/prado/framework/Web/UI/WebControls/TValidationSummary.php +++ b/lib/prado/framework/Web/UI/WebControls/TValidationSummary.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TWebControl.php b/lib/prado/framework/Web/UI/WebControls/TWebControl.php index 619cdd9..9ee6b72 100644 --- a/lib/prado/framework/Web/UI/WebControls/TWebControl.php +++ b/lib/prado/framework/Web/UI/WebControls/TWebControl.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TWebControlAdapter.php b/lib/prado/framework/Web/UI/WebControls/TWebControlAdapter.php index 50da857..2ec976b 100644 --- a/lib/prado/framework/Web/UI/WebControls/TWebControlAdapter.php +++ b/lib/prado/framework/Web/UI/WebControls/TWebControlAdapter.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TWebControlDecorator.php b/lib/prado/framework/Web/UI/WebControls/TWebControlDecorator.php index 07c7836..db918b3 100644 --- a/lib/prado/framework/Web/UI/WebControls/TWebControlDecorator.php +++ b/lib/prado/framework/Web/UI/WebControls/TWebControlDecorator.php @@ -4,7 +4,7 @@ * * @author Brad Anderson <javalizard@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TWizard.php b/lib/prado/framework/Web/UI/WebControls/TWizard.php index bacb637..d9de183 100644 --- a/lib/prado/framework/Web/UI/WebControls/TWizard.php +++ b/lib/prado/framework/Web/UI/WebControls/TWizard.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php b/lib/prado/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php index de94fc5..9292276 100644 --- a/lib/prado/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php +++ b/lib/prado/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @version $Id $ * @package System.Web.UI.WebControls diff --git a/lib/prado/framework/Web/UI/WebControls/TXmlTransform.php b/lib/prado/framework/Web/UI/WebControls/TXmlTransform.php index e3c206f..b92efff 100644 --- a/lib/prado/framework/Web/UI/WebControls/TXmlTransform.php +++ b/lib/prado/framework/Web/UI/WebControls/TXmlTransform.php @@ -5,7 +5,7 @@ * @author Knut Urdalen <knut.urdalen@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls */ diff --git a/lib/prado/framework/Web/UI/WebControls/assets/captcha.php b/lib/prado/framework/Web/UI/WebControls/assets/captcha.php index bc20a57..7c064d9 100644 --- a/lib/prado/framework/Web/UI/WebControls/assets/captcha.php +++ b/lib/prado/framework/Web/UI/WebControls/assets/captcha.php @@ -4,7 +4,7 @@ * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado - * @copyright Copyright © 2005-2015 The PRADO Group + * @copyright Copyright © 2005-2016 The PRADO Group * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT * @package System.Web.UI.WebControls.assets */ |