diff options
| author | Fabio Bas <ctrlaltca@gmail.com> | 2014-02-08 09:18:23 +0100 | 
|---|---|---|
| committer | Fabio Bas <ctrlaltca@gmail.com> | 2014-02-08 09:18:23 +0100 | 
| commit | 5283d8624a974e73019e1dc1626de2bc3b1a9ff3 (patch) | |
| tree | 1639a3f5d8e97bc65556cc205615ddc5aba3f82e | |
| parent | 2c1d9d453404ec2e3344ef477bf834a2a3c065af (diff) | |
Misc TJuiControlAdapter fixes
| -rw-r--r-- | framework/Web/UI/JuiControls/TJuiControlAdapter.php | 17 | 
1 files changed, 10 insertions, 7 deletions
diff --git a/framework/Web/UI/JuiControls/TJuiControlAdapter.php b/framework/Web/UI/JuiControls/TJuiControlAdapter.php index a9722a74..6ae3f5e5 100644 --- a/framework/Web/UI/JuiControls/TJuiControlAdapter.php +++ b/framework/Web/UI/JuiControls/TJuiControlAdapter.php @@ -142,17 +142,16 @@ class TJuiControlOptions  		if($this->_options===null)  			$this->_options=array(); -		$tmpname=strtolower($name);  		foreach($this->_control->getValidOptions() as $option)  		{ -			if($tmpname == $option) +			if(0 == strcasecmp($name, $option))  			{  				$this->_options[$option] = $value;  				return;  			}  		} -		throw new THttpException(500,'juioptions_option_invalid',$control->ID, $name); +		throw new THttpException(500,'juioptions_option_invalid',$this->_control->ID, $name);  	}  	/** @@ -166,9 +165,13 @@ class TJuiControlOptions  		if($this->_options===null)  			$this->_options=array(); -		$tmpname=strtolower($name); -		if(isset($this->_options[$tmpname])) -			return $this->_options[$tmpname]; +		foreach($this->_control->getValidOptions() as $option) +		{ +			if(0 == strcasecmp($name, $option) && isset($this->_options[$option])) +			{ +				return $this->_options[$option]; +			} +		}  		return null;  	} @@ -178,7 +181,7 @@ class TJuiControlOptions  	 */  	public function toArray()  	{ -		$ret= ($this->_options===null) ? $this->_options : array(); +		$ret= ($this->_options===null) ? array() : $this->_options;  		foreach($this->_control->getValidEvents() as $event)  			if($this->_control->hasEventHandler('on'.$event))  | 
