From d860219f366a8fbe63b03d26c69525d4e6bd4f3a Mon Sep 17 00:00:00 2001 From: "Christophe.Boulain" <> Date: Mon, 15 Feb 2010 09:20:35 +0000 Subject: Merge from r2765 (and some others) 3.1 Added TActiveTableRow QST page Corrected an uninitialized array in TScaffoldBase --- framework/Web/UI/WebControls/TFileUpload.php | 43 +++++++++++++++------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'framework/Web/UI/WebControls/TFileUpload.php') diff --git a/framework/Web/UI/WebControls/TFileUpload.php b/framework/Web/UI/WebControls/TFileUpload.php index 6658e93d..fbd14703 100644 --- a/framework/Web/UI/WebControls/TFileUpload.php +++ b/framework/Web/UI/WebControls/TFileUpload.php @@ -4,7 +4,7 @@ * * @author Marcus Nyeholt , Qiang Xue * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.WebControls @@ -59,7 +59,7 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata */ private $_errorCode=UPLOAD_ERR_NO_FILE; private $_dataChanged=false; - private $_isValid=true; + private $_isValid=true; /** * @return string tag name of the file upload control @@ -80,6 +80,9 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata parent::addAttributesToRender($writer); $writer->addAttribute('type','file'); $writer->addAttribute('name',$this->getUniqueID()); + $isEnabled=$this->getEnabled(true); + if(!$isEnabled && $this->getEnabled()) // in this case parent will not render 'disabled' + $writer->addAttribute('disabled','disabled'); } /** @@ -256,23 +259,23 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata { return $this->getFileName(); } - - /** - * 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); - } - + + /** + * 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); + } + } -- cgit v1.2.3