Completed
Push — master ( 7ebf5f...c286d3 )
by Jean-Christophe
02:51
created
Ajax/semantic/html/elements/HtmlButton.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	public function setFocusable($value=true) {
58
-		if ($value === true)
58
+		if ($value===true)
59 59
 			$this->setProperty("tabindex", "0");
60 60
 		else {
61 61
 			$this->removeProperty("tabindex");
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 
66 66
 	public function setAnimated($content, $animation="") {
67 67
 		$this->setTagName("div");
68
-		$this->addToProperty("class", "animated " . $animation);
69
-		$visible=new HtmlSemDoubleElement("visible-" . $this->identifier, "div");
68
+		$this->addToProperty("class", "animated ".$animation);
69
+		$visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div");
70 70
 		$visible->setClass("visible content");
71 71
 		$visible->setContent($this->content);
72
-		$hidden=new HtmlSemDoubleElement("hidden-" . $this->identifier, "div");
72
+		$hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div");
73 73
 		$hidden->setClass("hidden content");
74 74
 		$hidden->setContent($content);
75
-		$this->content=array ($visible,$hidden );
75
+		$this->content=array($visible, $hidden);
76 76
 		return $hidden;
77 77
 	}
78 78
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	public function asIcon($icon) {
85 85
 		$iconO=$icon;
86 86
 		if (\is_string($icon)) {
87
-			$iconO=new HtmlIcon("icon-" . $this->identifier, $icon);
87
+			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
88 88
 		}
89 89
 		$this->addToProperty("class", "icon");
90 90
 		$this->content=$iconO;
@@ -104,17 +104,17 @@  discard block
 block discarded – undo
104 104
 	 * @return HtmlLabel
105 105
 	 */
106 106
 	public function addLabel($label, $before=false, $icon=NULL) {
107
-		$this->tagName="div";$prefix="";
108
-		if($before)
107
+		$this->tagName="div"; $prefix="";
108
+		if ($before)
109 109
 			$prefix="left ";
110 110
 		$this->addToProperty("class", $prefix."labeled");
111 111
 		$isIcon=(isset($this->content[0]) && $this->content[0] instanceof HtmlIcon);
112
-		$this->content=new HtmlButton("button-" . $this->identifier, $this->content);
113
-		if($isIcon){
112
+		$this->content=new HtmlButton("button-".$this->identifier, $this->content);
113
+		if ($isIcon) {
114 114
 			$this->content->addClass("icon");
115 115
 		}
116 116
 		$this->content->setTagName("div");
117
-		$label=new HtmlLabel("label-" . $this->identifier, $label, $icon,"a");
117
+		$label=new HtmlLabel("label-".$this->identifier, $label, $icon, "a");
118 118
 		$label->setBasic();
119 119
 		$this->addContent($label, $before);
120 120
 		return $label;
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public function fromArray($array) {
128 128
 		$array=parent::fromArray($array);
129
-		foreach ( $array as $key => $value ) {
129
+		foreach ($array as $key => $value) {
130 130
 			$this->setProperty($key, $value);
131 131
 		}
132 132
 		return $array;
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 		return $this->addToProperty("class", "positive");
141 141
 	}
142 142
 
143
-	public function setColor($color){
144
-		if(\is_array($this->content)){
145
-			foreach ($this->content as $content){
146
-				if($content instanceof HtmlButton)
143
+	public function setColor($color) {
144
+		if (\is_array($this->content)) {
145
+			foreach ($this->content as $content) {
146
+				if ($content instanceof HtmlButton)
147 147
 					$content->setColor($color);
148 148
 			}
149 149
 		}
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * @return HtmlButton
202 202
 	 */
203 203
 	public static function social($identifier, $social, $value=NULL) {
204
-		if ($value === NULL)
204
+		if ($value===NULL)
205 205
 			$value=\ucfirst($social);
206 206
 		$return=new HtmlButton($identifier, $value);
207 207
 		$return->addIcon($social);
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
 	 * {@inheritDoc}
239 239
 	 * @see HtmlSemDoubleElement::asLink()
240 240
 	 */
241
-	public function asLink($href=NULL,$target=NULL) {
242
-		parent::asLink($href,$target);
241
+	public function asLink($href=NULL, $target=NULL) {
242
+		parent::asLink($href, $target);
243 243
 		return $this;
244 244
 	}
245 245
 
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
 	 * @param string $icon
253 253
 	 * @return HtmlButtonGroups
254 254
 	 */
255
-	public static function dropdown($identifier,$value,$items=[],$asCombo=false,$icon=null){
256
-		$result=new HtmlButtonGroups($identifier,[$value]);
257
-		$result->addDropdown($items,$asCombo);
258
-		if(isset($icon))
255
+	public static function dropdown($identifier, $value, $items=[], $asCombo=false, $icon=null) {
256
+		$result=new HtmlButtonGroups($identifier, [$value]);
257
+		$result->addDropdown($items, $asCombo);
258
+		if (isset($icon))
259 259
 			$result->setIcon($icon);
260 260
 		return $result;
261 261
 	}
Please login to merge, or discard this patch.