Completed
Push — master ( 7ebf5f...c286d3 )
by Jean-Christophe
02:51
created
Ajax/semantic/html/elements/HtmlButton.php 1 patch
Braces   +17 added lines, -13 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	public function setFocusable($value=true) {
58
-		if ($value === true)
59
-			$this->setProperty("tabindex", "0");
60
-		else {
58
+		if ($value === true) {
59
+					$this->setProperty("tabindex", "0");
60
+		} else {
61 61
 			$this->removeProperty("tabindex");
62 62
 		}
63 63
 		return $this;
@@ -105,8 +105,9 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function addLabel($label, $before=false, $icon=NULL) {
107 107
 		$this->tagName="div";$prefix="";
108
-		if($before)
109
-			$prefix="left ";
108
+		if($before) {
109
+					$prefix="left ";
110
+		}
110 111
 		$this->addToProperty("class", $prefix."labeled");
111 112
 		$isIcon=(isset($this->content[0]) && $this->content[0] instanceof HtmlIcon);
112 113
 		$this->content=new HtmlButton("button-" . $this->identifier, $this->content);
@@ -143,12 +144,13 @@  discard block
 block discarded – undo
143 144
 	public function setColor($color){
144 145
 		if(\is_array($this->content)){
145 146
 			foreach ($this->content as $content){
146
-				if($content instanceof HtmlButton)
147
-					$content->setColor($color);
147
+				if($content instanceof HtmlButton) {
148
+									$content->setColor($color);
149
+				}
148 150
 			}
151
+		} else {
152
+					parent::setColor($color);
149 153
 		}
150
-		else
151
-			parent::setColor($color);
152 154
 		return $this;
153 155
 	}
154 156
 
@@ -201,8 +203,9 @@  discard block
 block discarded – undo
201 203
 	 * @return HtmlButton
202 204
 	 */
203 205
 	public static function social($identifier, $social, $value=NULL) {
204
-		if ($value === NULL)
205
-			$value=\ucfirst($social);
206
+		if ($value === NULL) {
207
+					$value=\ucfirst($social);
208
+		}
206 209
 		$return=new HtmlButton($identifier, $value);
207 210
 		$return->addIcon($social);
208 211
 		return $return->addToPropertyCtrl("class", $social, Social::getConstants());
@@ -255,8 +258,9 @@  discard block
 block discarded – undo
255 258
 	public static function dropdown($identifier,$value,$items=[],$asCombo=false,$icon=null){
256 259
 		$result=new HtmlButtonGroups($identifier,[$value]);
257 260
 		$result->addDropdown($items,$asCombo);
258
-		if(isset($icon))
259
-			$result->setIcon($icon);
261
+		if(isset($icon)) {
262
+					$result->setIcon($icon);
263
+		}
260 264
 		return $result;
261 265
 	}
262 266
 }
Please login to merge, or discard this patch.