From 0f332e6564ed67ef7eb4d715ce3bcb5ff54c50cf Mon Sep 17 00:00:00 2001 From: Ciro Mattia Gonano Date: Wed, 24 Jul 2013 12:22:49 +0200 Subject: Upgrade to newly released 3.2.2 --- .../Web/UI/ActiveControls/TActiveLinkButton.php | 37 +++++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'framework/Web/UI/ActiveControls/TActiveLinkButton.php') diff --git a/framework/Web/UI/ActiveControls/TActiveLinkButton.php b/framework/Web/UI/ActiveControls/TActiveLinkButton.php index b95dad88..d8a8ffcb 100644 --- a/framework/Web/UI/ActiveControls/TActiveLinkButton.php +++ b/framework/Web/UI/ActiveControls/TActiveLinkButton.php @@ -6,7 +6,7 @@ * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2013 PradoSoft * @license http://www.pradosoft.com/license/ - * @version $Id: TActiveLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $ * @package System.Web.UI.ActiveControls */ @@ -29,7 +29,7 @@ Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter'); * will update the link text upon callback response completion. * * @author Wei Zhuo - * @version $Id: TActiveLinkButton.php 3245 2013-01-07 20:23:32Z ctrlaltca $ + * @version $Id: TActiveLinkButton.php 3292 2013-05-31 08:51:42Z ctrlaltca $ * @package System.Web.UI.ActiveControls * @since 3.1 */ @@ -118,9 +118,36 @@ class TActiveLinkButton extends TLinkButton implements IActiveControl, ICallback { parent::addAttributesToRender($writer); $writer->addAttribute('id',$this->getClientID()); - $this->renderLinkButtonHref($writer); - $this->getActiveControl()->registerCallbackClientScript( - $this->getClientClassName(), $this->getPostBackOptions()); + + if($this->getEnabled(true)) + { + $this->getActiveControl()->registerCallbackClientScript( + $this->getClientClassName(), $this->getPostBackOptions()); + } + } + + /** + * Ensures that the anchor is rendered correctly when its Enabled property + * changes in a callback + * @param bool enabled + */ + public function setEnabled($value) + { + parent::setEnabled($value); + if($this->getActiveControl()->canUpdateClientSide()) + { + if($this->getEnabled(true)) + { + $nop = "javascript:;//".$this->getClientID(); + $this->getPage()->getCallbackClient()->setAttribute($this, 'href', $nop); + + $this->getActiveControl()->registerCallbackClientScript( + $this->getClientClassName(), $this->getPostBackOptions()); + + } else { + $this->getPage()->getCallbackClient()->setAttribute($this, 'href', false); + } + } } /** -- cgit v1.2.3