Completed
Push — master ( 85f0a8...b535d8 )
by Jean-Christophe
9s
created
Ajax/bootstrap/html/HtmlInputgroup.php 1 patch
Braces   +17 added lines, -13 removed lines patch added patch discarded remove patch
@@ -28,10 +28,11 @@  discard block
 block discarded – undo
28 28
 		$this->setProperty("aria-describedby", $id);
29 29
 		$span->setContent($text);
30 30
 		$span->setClass("input-group-addon");
31
-		if (strtolower($position)==="left")
32
-			$this->addonLeft=$span;
33
-		else
34
-			$this->addonRight=$span;
31
+		if (strtolower($position)==="left") {
32
+					$this->addonLeft=$span;
33
+		} else {
34
+					$this->addonRight=$span;
35
+		}
35 36
 		return $span;
36 37
 	}
37 38
 
@@ -74,7 +75,7 @@  discard block
 block discarded – undo
74 75
 			$bt=NULL;
75 76
 			if(is_string($item)){
76 77
 				$bt=new HtmlButton($this->identifier."-bt-".$i++,$item);
77
-			}elseif ($item instanceof HtmlButton){
78
+			} elseif ($item instanceof HtmlButton){
78 79
 				$bt=$item;
79 80
 			}
80 81
 			if(isset($bt)){
@@ -88,10 +89,11 @@  discard block
 block discarded – undo
88 89
 		$dropdown->setBtnCaption($caption);
89 90
 		$dropdown->fromArray($items);
90 91
 
91
-		if (strtolower($position)==="left")
92
-			$this->addonLeft=$dropdown;
93
-		else
94
-			$this->addonRight=$dropdown;
92
+		if (strtolower($position)==="left") {
93
+					$this->addonLeft=$dropdown;
94
+		} else {
95
+					$this->addonRight=$dropdown;
96
+		}
95 97
 		return $dropdown;
96 98
 	}
97 99
 
@@ -126,10 +128,12 @@  discard block
 block discarded – undo
126 128
 
127 129
 	public function run(JsUtils $js) {
128 130
 		parent::run($js);
129
-		if (isset($this->addonLeft))
130
-			$this->addonLeft->run($js);
131
-		if (isset($this->addonRight))
132
-			$this->addonRight->run($js);
131
+		if (isset($this->addonLeft)) {
132
+					$this->addonLeft->run($js);
133
+		}
134
+		if (isset($this->addonRight)) {
135
+					$this->addonRight->run($js);
136
+		}
133 137
 	}
134 138
 
135 139
 }
136 140
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlListgroup.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,14 +48,16 @@
 block discarded – undo
48 48
 		foreach ( $items as $item ) {
49 49
 			if (is_string($item)) {
50 50
 				$this->addItem($item);
51
-			} else
52
-				$this->content []=$item;
51
+			} else {
52
+							$this->content []=$item;
53
+			}
53 54
 		}
54 55
 	}
55 56
 
56 57
 	public function getItem($index) {
57
-		if ($index<sizeof($this->content))
58
-			return $this->content [$index];
58
+		if ($index<sizeof($this->content)) {
59
+					return $this->content [$index];
60
+		}
59 61
 	}
60 62
 
61 63
 	/* (non-PHPdoc)
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlModal.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -151,18 +151,20 @@  discard block
 block discarded – undo
151 151
 		$this->_bsComponent=$js->bootstrap()->modal("#".$this->identifier, array (
152 152
 				"show" => $this->showOnStartup
153 153
 		));
154
-		if ($this->draggable)
155
-			$this->_bsComponent->setDraggable(true);
154
+		if ($this->draggable) {
155
+					$this->_bsComponent->setDraggable(true);
156
+		}
156 157
 		$this->_bsComponent->setBackdrop($this->backdrop);
157 158
 		$this->addEventsOnRun($js);
158 159
 		return $this->_bsComponent;
159 160
 	}
160 161
 
161 162
 	public function getButton($index) {
162
-		if (is_int($index))
163
-			return $this->buttons [$index];
164
-		else
165
-			return $this->getElementById($index, $this->buttons);
163
+		if (is_int($index)) {
164
+					return $this->buttons [$index];
165
+		} else {
166
+					return $this->getElementById($index, $this->buttons);
167
+		}
166 168
 	}
167 169
 
168 170
 	public function showOnCreate() {
@@ -188,8 +190,9 @@  discard block
 block discarded – undo
188 190
 
189 191
 	public function jsHideButton($index) {
190 192
 		$btn=$this->getButton($index);
191
-		if ($btn)
192
-			return "$('#".$btn->getIdentifier()."').hide();";
193
+		if ($btn) {
194
+					return "$('#".$btn->getIdentifier()."').hide();";
195
+		}
193 196
 	}
194 197
 
195 198
 	/**
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlNavbar.php 1 patch
Braces   +17 added lines, -13 removed lines patch added patch discarded remove patch
@@ -86,8 +86,9 @@  discard block
 block discarded – undo
86 86
 
87 87
 	public function addElement($element, HtmlNavzone $zone=NULL) {
88 88
 		$zone=$this->getZoneToInsertIn($zone);
89
-		if ($element instanceof HtmlDropdown)
90
-			$element->setMTagName("li");
89
+		if ($element instanceof HtmlDropdown) {
90
+					$element->setMTagName("li");
91
+		}
91 92
 		$zone->addElement($element);
92 93
 	}
93 94
 
@@ -111,10 +112,11 @@  discard block
 block discarded – undo
111 112
 				if (is_string($zoneType)) {
112 113
 					$zone=$this->addZone($zoneType);
113 114
 					$zone->fromArray($zoneArray);
114
-				} else if (is_string($zoneArray))
115
-					$this->addElement($zoneArray);
116
-				else
117
-					$this->addElements($zoneArray);
115
+				} else if (is_string($zoneArray)) {
116
+									$this->addElement($zoneArray);
117
+				} else {
118
+									$this->addElements($zoneArray);
119
+				}
118 120
 			}
119 121
 		}
120 122
 	}
@@ -127,10 +129,11 @@  discard block
 block discarded – undo
127 129
 	public function getZoneToInsertIn($zone=NULL) {
128 130
 		if (!isset($zone)) {
129 131
 			$nb=sizeof($this->navZones);
130
-			if ($nb<1)
131
-				$zone=$this->addZone();
132
-			else
133
-				$zone=$this->navZones [$nb-1];
132
+			if ($nb<1) {
133
+							$zone=$this->addZone();
134
+			} else {
135
+							$zone=$this->navZones [$nb-1];
136
+			}
134 137
 		}
135 138
 		return $zone;
136 139
 	}
@@ -144,8 +147,9 @@  discard block
 block discarded – undo
144 147
 		$zone=null;
145 148
 		$nb=sizeof($this->navZones);
146 149
 		if (is_int($index)) {
147
-			if ($index<$nb)
148
-				$zone=$this->navZones [$index];
150
+			if ($index<$nb) {
151
+							$zone=$this->navZones [$index];
152
+			}
149 153
 		} else {
150 154
 			for($i=0; $i<$nb; $i++) {
151 155
 				if ($this->navZones [$i]->getIdentifier()===$index) {
@@ -182,7 +186,7 @@  discard block
 block discarded – undo
182 186
 	public function setFluid($fluid) {
183 187
 		if($fluid===true){
184 188
 			$this->fluid="container-fluid";
185
-		}else{
189
+		} else{
186 190
 			$this->fluid="container";
187 191
 		}
188 192
 		return $this;
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlPanel.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@  discard block
 block discarded – undo
89 89
 	 * @return \Ajax\bootstrap\html\HtmlPanel default : "panel-default"
90 90
 	 */
91 91
 	public function setStyle($cssStyle) {
92
-		if (!PhalconUtils::startsWith($cssStyle, "panel"))
93
-			$cssStyle="panel".$cssStyle;
92
+		if (!PhalconUtils::startsWith($cssStyle, "panel")) {
93
+					$cssStyle="panel".$cssStyle;
94
+		}
94 95
 		return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel"));
95 96
 	}
96 97
 
@@ -132,7 +133,8 @@  discard block
 block discarded – undo
132 133
 	 * @return $this default : false
133 134
 	 */
134 135
 	public function show($value) {
135
-		if ($this->_collapsable)
136
-			$this->_showOnStartup=$value;
136
+		if ($this->_collapsable) {
137
+					$this->_showOnStartup=$value;
138
+		}
137 139
 	}
138 140
 }
139 141
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlProgressbar.php 1 patch
Braces   +18 added lines, -15 removed lines patch added patch discarded remove patch
@@ -31,11 +31,12 @@  discard block
 block discarded – undo
31 31
 			foreach ($this->content as $pb){
32 32
 				$pb->setActive($value);
33 33
 			}
34
-		}else{
35
-			if ($value===true)
36
-				$this->active="active";
37
-			else
38
-				$this->active="";
34
+		} else{
35
+			if ($value===true) {
36
+							$this->active="active";
37
+			} else {
38
+							$this->active="";
39
+			}
39 40
 		}
40 41
 		return $this;
41 42
 	}
@@ -45,11 +46,12 @@  discard block
 block discarded – undo
45 46
 			foreach ($this->content as $pb){
46 47
 				$pb->setStriped($value);
47 48
 			}
48
-		}else{
49
-			if ($value===true)
50
-				$this->striped="progress-bar-striped";
51
-			else
52
-				$this->striped="";
49
+		} else{
50
+			if ($value===true) {
51
+							$this->striped="progress-bar-striped";
52
+			} else {
53
+							$this->striped="";
54
+			}
53 55
 		}
54 56
 		return $this;
55 57
 	}
@@ -59,11 +61,12 @@  discard block
 block discarded – undo
59 61
 			foreach ($this->content as $pb){
60 62
 				$pb->showCaption($value);
61 63
 			}
62
-		}else{
63
-			if ($value===true)
64
-				$this->caption="%value%%";
65
-			else
66
-				$this->caption='<span class="sr-only">%value%% Complete (%style%)</span>';
64
+		} else{
65
+			if ($value===true) {
66
+							$this->caption="%value%%";
67
+			} else {
68
+							$this->caption='<span class="sr-only">%value%% Complete (%style%)</span>';
69
+			}
67 70
 		}
68 71
 		return $this;
69 72
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlTabs.php 1 patch
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@  discard block
 block discarded – undo
35 35
 					$tab
36 36
 			);
37 37
 			array_splice($this->tabs, $index, 0, $inserted);
38
-		} else
39
-			$this->tabs []=$tab;
38
+		} else {
39
+					$this->tabs []=$tab;
40
+		}
40 41
 	}
41 42
 
42 43
 	public function setActive($index){
@@ -116,9 +117,9 @@  discard block
 block discarded – undo
116 117
 	public function createTabContents() {
117 118
 		$tabContent=new HtmlTabContent("tabcontent-".$this->identifier);
118 119
 		foreach ( $this->tabs as $tab ) {
119
-			if ($tab instanceof HtmlTabItem)
120
-				$tabContent->addTabItem($tab->getHref());
121
-			elseif ($tab instanceof HtmlDropdown) {
120
+			if ($tab instanceof HtmlTabItem) {
121
+							$tabContent->addTabItem($tab->getHref());
122
+			} elseif ($tab instanceof HtmlDropdown) {
122 123
 				foreach ( $tab->getItems() as $dropdownItem ) {
123 124
 					$tabContent->addTabItem($dropdownItem->getHref());
124 125
 				}
@@ -137,8 +138,9 @@  discard block
 block discarded – undo
137 138
 
138 139
 	public function setContentToTab($index, $text) {
139 140
 		$tabContentItem=$this->content->getTabItem($index);
140
-		if (isset($tabContentItem))
141
-			$tabContentItem->setContent($text);
141
+		if (isset($tabContentItem)) {
142
+					$tabContentItem->setContent($text);
143
+		}
142 144
 	}
143 145
 
144 146
 	public function countTabs() {
@@ -146,8 +148,9 @@  discard block
 block discarded – undo
146 148
 	}
147 149
 
148 150
 	public function getTabItem($index) {
149
-		if ($index<sizeof($this->content->get))
150
-			return $this->content;
151
+		if ($index<sizeof($this->content->get)) {
152
+					return $this->content;
153
+		}
151 154
 	}
152 155
 
153 156
 	public function fadeEffect() {
@@ -168,9 +171,11 @@  discard block
 block discarded – undo
168 171
 	}
169 172
 
170 173
 	public function setStacked($stacked=true){
171
-		if($stacked)
172
-			$this->stacked="nav-stacked";
173
-		else $this->stacked="";
174
+		if($stacked) {
175
+					$this->stacked="nav-stacked";
176
+		} else {
177
+			$this->stacked="";
178
+		}
174 179
 	}
175 180
 
176 181
 	/* (non-PHPdoc)
Please login to merge, or discard this patch.
Ajax/bootstrap/html/base/BaseHtml.php 1 patch
Braces   +23 added lines, -16 removed lines patch added patch discarded remove patch
@@ -49,16 +49,18 @@  discard block
 block discarded – undo
49 49
 	}
50 50
 
51 51
 	public function getProperty($name) {
52
-		if (array_key_exists($name, $this->properties))
53
-			return $this->properties [$name];
52
+		if (array_key_exists($name, $this->properties)) {
53
+					return $this->properties [$name];
54
+		}
54 55
 	}
55 56
 
56 57
 	public function addToProperty($name, $value, $separator=" ") {
57 58
 		$v=$this->properties [$name];
58
-		if (isset($v)&&$v!=="")
59
-			$v=$v.$separator.$value;
60
-		else
61
-			$v=$value;
59
+		if (isset($v)&&$v!=="") {
60
+					$v=$v.$separator.$value;
61
+		} else {
62
+					$v=$value;
63
+		}
62 64
 
63 65
 		return $this->setProperty($name, $v);
64 66
 	}
@@ -108,8 +110,9 @@  discard block
 block discarded – undo
108 110
 	}
109 111
 
110 112
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
111
-		if ($this->ctrl($name, $value, $typeCtrl)===true)
112
-			return $this->setProperty($name, $value);
113
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
114
+					return $this->setProperty($name, $value);
115
+		}
113 116
 		return $this;
114 117
 	}
115 118
 
@@ -144,8 +147,9 @@  discard block
 block discarded – undo
144 147
 	}
145 148
 
146 149
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
147
-		if (@class_exists($typeCtrl, true))
148
-			$typeCtrl=$typeCtrl::getConstants();
150
+		if (@class_exists($typeCtrl, true)) {
151
+					$typeCtrl=$typeCtrl::getConstants();
152
+		}
149 153
 		if (is_array($typeCtrl)) {
150 154
 			$this->removeOldValues($this->properties [$name], $typeCtrl);
151 155
 		}
@@ -326,15 +330,18 @@  discard block
 block discarded – undo
326 330
 			$flag=false;
327 331
 			$index=0;
328 332
 			while ( !$flag&&$index<sizeof($elements) ) {
329
-				if ($elements [$index] instanceof BaseHtml)
330
-					$flag=($elements [$index]->getIdentifier()===$identifier);
333
+				if ($elements [$index] instanceof BaseHtml) {
334
+									$flag=($elements [$index]->getIdentifier()===$identifier);
335
+				}
331 336
 				$index++;
332 337
 			}
333
-			if ($flag===true)
334
-				return $elements [$index-1];
338
+			if ($flag===true) {
339
+							return $elements [$index-1];
340
+			}
335 341
 		} elseif ($elements instanceof BaseHtml) {
336
-			if ($elements->getIdentifier()===$identifier)
337
-				return $elements;
342
+			if ($elements->getIdentifier()===$identifier) {
343
+							return $elements;
344
+			}
338 345
 		}
339 346
 		return null;
340 347
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/base/HtmlDoubleElement.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@
 block discarded – undo
34 34
 	public function addContent($content) {
35 35
 		if (is_array($this->content)===false) {
36 36
 			$newContent=array ();
37
-			if (isset($this->content))
38
-				$newContent []=$this->content;
37
+			if (isset($this->content)) {
38
+							$newContent []=$this->content;
39
+			}
39 40
 			$newContent []=$content;
40 41
 			$this->content=$newContent;
41 42
 		} else {
Please login to merge, or discard this patch.