Completed
Push — master ( 030ef0...22ba15 )
by Jean-Christophe
03:09
created
Ajax/semantic/html/content/HtmlGridCol.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public function setWidth($width) {
33 33
 		if (\is_int($width)) {
34
-			$width=Wide::getConstants()["W" . $width];
34
+			$width=Wide::getConstants()["W".$width];
35 35
 		}
36 36
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
37
-		return $this->addToPropertyCtrl("class", "wide", array ("wide" ));
37
+		return $this->addToPropertyCtrl("class", "wide", array("wide"));
38 38
 	}
39 39
 
40 40
 	public function setValue($value) {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			$divider->setVertical();
53 53
 		else
54 54
 			$divider->setHorizontal();
55
-		$this->wrap($divider,"");
55
+		$this->wrap($divider, "");
56 56
 		return $divider;
57 57
 	}
58 58
 }
59 59
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/components/Popup.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 	 * @return $this
28 28
 	 */
29 29
 	public function setOnShow($jsCode) {
30
-		$jsCode=str_ireplace("\"","%quote%", $jsCode);
30
+		$jsCode=str_ireplace("\"", "%quote%", $jsCode);
31 31
 		return $this->setParam("onShow", "%function(){".$jsCode."}%");
32 32
 	}
33 33
 
34
-	public function setExclusive($value){
34
+	public function setExclusive($value) {
35 35
 		return $this->setParam("exclusive", $value);
36 36
 	}
37 37
 
@@ -40,15 +40,15 @@  discard block
 block discarded – undo
40 40
 	 * @param string $popup the css selector of the popup
41 41
 	 * @return \Ajax\semantic\components\Popup
42 42
 	 */
43
-	public function setPopup($popup){
43
+	public function setPopup($popup) {
44 44
 		return $this->setParam("popup", $popup);
45 45
 	}
46 46
 
47
-	public function setInline($value){
47
+	public function setInline($value) {
48 48
 		return $this->setParam("inline", $value);
49 49
 	}
50 50
 
51
-	public function setPosition($value){
51
+	public function setPosition($value) {
52 52
 		return $this->setParam("position", $value);
53 53
 	}
54 54
 	//TODO other events implementation
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/IconTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,18 +15,18 @@  discard block
 block discarded – undo
15 15
 	private $_hasIcon=false;
16 16
 
17 17
 	protected abstract function addToPropertyCtrl($name, $value, $typeCtrl);
18
-	public abstract function addContent($content,$before=false);
18
+	public abstract function addContent($content, $before=false);
19 19
 
20
-	public function addIcon($icon,$direction=Direction::LEFT){
21
-		if($this->_hasIcon===false){
20
+	public function addIcon($icon, $direction=Direction::LEFT) {
21
+		if ($this->_hasIcon===false) {
22 22
 			$iconO=$icon;
23
-			if(\is_string($icon)){
23
+			if (\is_string($icon)) {
24 24
 				$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
25 25
 			}
26 26
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
27
-			$this->addContent($iconO,$direction===Direction::LEFT);
27
+			$this->addContent($iconO, $direction===Direction::LEFT);
28 28
 			$this->_hasIcon=true;
29
-		}else{
29
+		} else {
30 30
 			$iconO=$this->getIcon();
31 31
 			$iconO->setIcon($icon);
32 32
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 		return $iconO;
35 35
 	}
36 36
 
37
-	public function getIcon(){
38
-		if(\is_array($this->content)){
39
-			foreach ($this->content as $item){
40
-				if($item instanceof HtmlIcon)
37
+	public function getIcon() {
38
+		if (\is_array($this->content)) {
39
+			foreach ($this->content as $item) {
40
+				if ($item instanceof HtmlIcon)
41 41
 					return $item;
42 42
 			}
43 43
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDropdown.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 	}
18 18
 	protected $mClass="menu";
19 19
 	protected $mTagName="div";
20
-	protected $items=array ();
21
-	protected $_params=array("action"=>"nothing","on"=>"hover");
20
+	protected $items=array();
21
+	protected $_params=array("action"=>"nothing", "on"=>"hover");
22 22
 	protected $input;
23 23
 	protected $value;
24 24
 
@@ -26,23 +26,23 @@  discard block
 block discarded – undo
26 26
 		parent::__construct($identifier, "div");
27 27
 		$this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php';
28 28
 		$this->setProperty("class", "ui dropdown");
29
-		$content=new HtmlSemDoubleElement("text-".$this->identifier,"div");
29
+		$content=new HtmlSemDoubleElement("text-".$this->identifier, "div");
30 30
 		$content->setClass("text");
31 31
 		$this->setValue($value);
32
-		$content->wrap("",new HtmlIcon("", "dropdown"));
32
+		$content->wrap("", new HtmlIcon("", "dropdown"));
33 33
 		$this->content=array($content);
34 34
 		$this->tagName="div";
35 35
 		$this->addItems($items);
36 36
 	}
37 37
 
38
-	public function addItem($item,$value=NULL,$image=NULL,$description=NULL){
39
-		$itemO=$this->beforeAddItem($item,$value,$image,$description);
38
+	public function addItem($item, $value=NULL, $image=NULL, $description=NULL) {
39
+		$itemO=$this->beforeAddItem($item, $value, $image, $description);
40 40
 		$this->items[]=$itemO;
41 41
 		return $itemO;
42 42
 	}
43 43
 
44
-	public function addIcon($icon,$before=true,$labeled=false){
45
-		$this->addIconP($icon,$before,$labeled);
44
+	public function addIcon($icon, $before=true, $labeled=false) {
45
+		$this->addIconP($icon, $before, $labeled);
46 46
 		return $this->getElementById("text-".$this->identifier, $this->content)->setWrapAfter("");
47 47
 	}
48 48
 
@@ -52,26 +52,26 @@  discard block
 block discarded – undo
52 52
 	 * @param number $position
53 53
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown
54 54
 	 */
55
-	public function insertItem($item,$position=0){
55
+	public function insertItem($item, $position=0) {
56 56
 		$itemO=$this->beforeAddItem($item);
57
-		 $start = array_slice($this->items, 0, $position);
58
-		 $end = array_slice($this->items, $position);
59
-		 $start[] = $item;
57
+		 $start=array_slice($this->items, 0, $position);
58
+		 $end=array_slice($this->items, $position);
59
+		 $start[]=$item;
60 60
 		 $this->items=array_merge($start, $end);
61 61
 		 return $itemO;
62 62
 	}
63 63
 
64
-	protected function beforeAddItem($item,$value=NULL,$image=NULL,$description=NULL){
64
+	protected function beforeAddItem($item, $value=NULL, $image=NULL, $description=NULL) {
65 65
 		$itemO=$item;
66
-		if(\is_array($item)){
66
+		if (\is_array($item)) {
67 67
 			$description=JArray::getValue($item, "description", 3);
68 68
 			$value=JArray::getValue($item, "value", 1);
69 69
 			$image=JArray::getValue($item, "image", 2);
70 70
 			$item=JArray::getValue($item, "item", 0);
71 71
 		}
72
-		if(!$item instanceof HtmlDropdownItem){
73
-			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image,$description);
74
-		}elseif($itemO instanceof HtmlDropdownItem){
72
+		if (!$item instanceof HtmlDropdownItem) {
73
+			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items), $item, $value, $image, $description);
74
+		}elseif ($itemO instanceof HtmlDropdownItem) {
75 75
 			$this->addToProperty("class", "vertical");
76 76
 		}
77 77
 		return $itemO;
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 		$this->addItem($function($object));
85 85
 	}
86 86
 
87
-	public function addInput($name){
88
-		if(!isset($name))
87
+	public function addInput($name) {
88
+		if (!isset($name))
89 89
 			$name="input-".$this->identifier;
90 90
 		$this->setAction("activate");
91
-		$this->input=new HtmlInput($name,"hidden");
91
+		$this->input=new HtmlInput($name, "hidden");
92 92
 	}
93 93
 
94 94
 	/**
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
 	 * @param string $icon
98 98
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
99 99
 	 */
100
-	public function addSearchInputItem($placeHolder=NULL,$icon=NULL){
101
-		return $this->addItem(HtmlDropdownItem::searchInput($placeHolder,$icon));
100
+	public function addSearchInputItem($placeHolder=NULL, $icon=NULL) {
101
+		return $this->addItem(HtmlDropdownItem::searchInput($placeHolder, $icon));
102 102
 	}
103 103
 
104 104
 	/**
105 105
 	 * Adds a divider item
106 106
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
107 107
 	 */
108
-	public function addDividerItem(){
108
+	public function addDividerItem() {
109 109
 		return $this->addItem(HtmlDropdownItem::divider());
110 110
 	}
111 111
 
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 	 * @param string $icon
116 116
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown
117 117
 	 */
118
-	public function addHeaderItem($caption=NULL,$icon=NULL){
119
-		return $this->addItem(HtmlDropdownItem::header($caption,$icon));
118
+	public function addHeaderItem($caption=NULL, $icon=NULL) {
119
+		return $this->addItem(HtmlDropdownItem::header($caption, $icon));
120 120
 	}
121 121
 
122 122
 	/**
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 * @param string $color
126 126
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown
127 127
 	 */
128
-	public function addCircularLabelItem($caption,$color){
128
+	public function addCircularLabelItem($caption, $color) {
129 129
 		return $this->addItem(HtmlDropdownItem::circular($caption, $color));
130 130
 	}
131 131
 
@@ -134,87 +134,87 @@  discard block
 block discarded – undo
134 134
 	 * @param string $image
135 135
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
136 136
 	 */
137
-	public function addMiniAvatarImageItem($caption,$image){
137
+	public function addMiniAvatarImageItem($caption, $image) {
138 138
 		return $this->addItem(HtmlDropdownItem::avatar($caption, $image));
139 139
 	}
140 140
 
141
-	public function addItems($items){
142
-		if(JArray::isAssociative($items)){
143
-			foreach ($items as $k=>$v){
141
+	public function addItems($items) {
142
+		if (JArray::isAssociative($items)) {
143
+			foreach ($items as $k=>$v) {
144 144
 				$this->addItem($v)->setData($k);
145 145
 			}
146
-		}else{
147
-			foreach ($items as $item){
146
+		} else {
147
+			foreach ($items as $item) {
148 148
 				$this->addItem($item);
149 149
 			}
150 150
 		}
151 151
 	}
152 152
 
153
-	public function getItem($index){
153
+	public function getItem($index) {
154 154
 		return $this->items[$index];
155 155
 	}
156 156
 
157 157
 	/**
158 158
 	 * @return int
159 159
 	 */
160
-	public function count(){
160
+	public function count() {
161 161
 		return \sizeof($this->items);
162 162
 	}
163 163
 	/**
164 164
 	 * @param boolean $dropdown
165 165
 	 */
166
-	public function asDropdown($dropdown){
167
-		if($dropdown===false){
166
+	public function asDropdown($dropdown) {
167
+		if ($dropdown===false) {
168 168
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
169 169
 			$dropdown="menu";
170
-		}else{
170
+		} else {
171 171
 			$dropdown="dropdown";
172 172
 			$this->mClass="menu";
173 173
 		}
174
-		return $this->addToPropertyCtrl("class", $dropdown,array("menu","dropdown"));
174
+		return $this->addToPropertyCtrl("class", $dropdown, array("menu", "dropdown"));
175 175
 	}
176 176
 
177
-	public function setVertical(){
178
-		return $this->addToPropertyCtrl("class", "vertical",array("vertical"));
177
+	public function setVertical() {
178
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
179 179
 	}
180 180
 
181
-	public function setInline(){
182
-		return $this->addToPropertyCtrl("class", "inline",["inline"]);
181
+	public function setInline() {
182
+		return $this->addToPropertyCtrl("class", "inline", ["inline"]);
183 183
 	}
184 184
 
185
-	public function setSimple(){
186
-		return $this->addToPropertyCtrl("class", "simple",array("simple"));
185
+	public function setSimple() {
186
+		return $this->addToPropertyCtrl("class", "simple", array("simple"));
187 187
 	}
188 188
 
189
-	public function asButton($floating=false){
190
-		if($floating)
189
+	public function asButton($floating=false) {
190
+		if ($floating)
191 191
 			$this->addToProperty("class", "floating");
192 192
 		$this->removePropertyValue("class", "selection");
193 193
 		return $this->addToProperty("class", "button");
194 194
 	}
195 195
 
196
-	public function asSelect($name=NULL,$multiple=false,$selection=true){
197
-		if(isset($name))
196
+	public function asSelect($name=NULL, $multiple=false, $selection=true) {
197
+		if (isset($name))
198 198
 			$this->addInput($name);
199
-		if($multiple)
199
+		if ($multiple)
200 200
 			$this->addToProperty("class", "multiple");
201
-		if ($selection){
202
-			if($this->propertyContains("class", "button")===false)
203
-				$this->addToPropertyCtrl("class", "selection",array("selection"));
201
+		if ($selection) {
202
+			if ($this->propertyContains("class", "button")===false)
203
+				$this->addToPropertyCtrl("class", "selection", array("selection"));
204 204
 		}
205 205
 		return $this;
206 206
 	}
207 207
 
208
-	public function asSearch($name=NULL,$multiple=false,$selection=true){
209
-		$this->asSelect($name,$multiple,$selection);
208
+	public function asSearch($name=NULL, $multiple=false, $selection=true) {
209
+		$this->asSelect($name, $multiple, $selection);
210 210
 		return $this->addToProperty("class", "search");
211 211
 	}
212 212
 
213
-	public function setSelect($name=NULL,$multiple=false){
214
-		if(!isset($name))
213
+	public function setSelect($name=NULL, $multiple=false) {
214
+		if (!isset($name))
215 215
 			$name="select-".$this->identifier;
216 216
 		$this->input=null;
217
-		if($multiple){
217
+		if ($multiple) {
218 218
 			$this->setProperty("multiple", true);
219 219
 			$this->addToProperty("class", "multiple");
220 220
 		}
@@ -222,37 +222,37 @@  discard block
 block discarded – undo
222 222
 		$this->tagName="select";
223 223
 		$this->setProperty("name", $name);
224 224
 		$this->content=null;
225
-		foreach ($this->items as $item){
225
+		foreach ($this->items as $item) {
226 226
 			$item->asOption();
227 227
 		}
228 228
 		return $this;
229 229
 	}
230 230
 
231
-	public function asSubmenu($pointing=NULL){
231
+	public function asSubmenu($pointing=NULL) {
232 232
 		$this->setClass("ui dropdown link item");
233
-		if(isset($pointing)){
233
+		if (isset($pointing)) {
234 234
 			$this->setPointing($pointing);
235 235
 		}
236 236
 		return $this;
237 237
 	}
238 238
 
239
-	public function setPointing($value=Direction::NONE){
240
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
239
+	public function setPointing($value=Direction::NONE) {
240
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
241 241
 	}
242 242
 
243
-	public function setValue($value){
243
+	public function setValue($value) {
244 244
 		$this->value=$value;
245 245
 		return $this;
246 246
 	}
247
-	private function applyValue(){
247
+	private function applyValue() {
248 248
 		$value=$this->value;
249
-		if(isset($this->input) && isset($value)){
249
+		if (isset($this->input) && isset($value)) {
250 250
 			$this->input->setProperty("value", $value);
251
-		}else{
251
+		} else {
252 252
 			$this->setProperty("value", $value);
253 253
 		}
254 254
 			$textElement=$this->getElementById("text-".$this->identifier, $this->content);
255
-			if(isset($textElement))
255
+			if (isset($textElement))
256 256
 				$textElement->setContent($value);
257 257
 		return $this;
258 258
 	}
@@ -262,28 +262,28 @@  discard block
 block discarded – undo
262 262
 	 * @see BaseHtml::run()
263 263
 	 */
264 264
 	public function run(JsUtils $js) {
265
-		if($this->propertyContains("class", "simple")===false){
266
-			if(isset($this->_bsComponent)===false)
267
-				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params);
265
+		if ($this->propertyContains("class", "simple")===false) {
266
+			if (isset($this->_bsComponent)===false)
267
+				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier, $this->_params);
268 268
 			$this->addEventsOnRun($js);
269 269
 			return $this->_bsComponent;
270 270
 		}
271 271
 	}
272 272
 
273
-	public function setCompact(){
273
+	public function setCompact() {
274 274
 		return $this->addToPropertyCtrl("class", "compact", array("compact"));
275 275
 	}
276 276
 
277
-	public function setAction($action){
277
+	public function setAction($action) {
278 278
 		$this->_params["action"]=$action;
279 279
 	}
280 280
 
281
-	public function setFullTextSearch($value){
281
+	public function setFullTextSearch($value) {
282 282
 		$this->_params["fullTextSearch"]=$value;
283 283
 	}
284 284
 
285 285
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
286 286
 		$this->applyValue();
287
-		return parent::compile($js,$view);
287
+		return parent::compile($js, $view);
288 288
 	}
289 289
 }
290 290
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlDropdownItem.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -12,34 +12,34 @@  discard block
 block discarded – undo
12 12
 use Ajax\semantic\html\base\traits\MenuItemTrait;
13 13
 
14 14
 class HtmlDropdownItem extends HtmlSemDoubleElement {
15
-	use IconTrait,MenuItemTrait;
16
-	public function __construct($identifier, $content="",$value=NULL,$image=NULL,$description=NULL) {
15
+	use IconTrait, MenuItemTrait;
16
+	public function __construct($identifier, $content="", $value=NULL, $image=NULL, $description=NULL) {
17 17
 		parent::__construct($identifier, "a");
18 18
 		$this->setClass("item");
19 19
 		$this->setContent($content);
20
-		if($value!==NULL)
20
+		if ($value!==NULL)
21 21
 			$this->setData($value);
22
-		if($image!==NULL)
22
+		if ($image!==NULL)
23 23
 			$this->asMiniAvatar($image);
24
-		if($description!==NULL)
24
+		if ($description!==NULL)
25 25
 			$this->setDescription($description);
26 26
 	}
27 27
 
28
-	public function setDescription($description){
29
-		$descO=new HtmlDoubleElement("desc-".$this->identifier,"span");
28
+	public function setDescription($description) {
29
+		$descO=new HtmlDoubleElement("desc-".$this->identifier, "span");
30 30
 		$descO->setClass("description");
31 31
 		$descO->setContent($description);
32
-		return $this->addContent($descO,true);
32
+		return $this->addContent($descO, true);
33 33
 	}
34 34
 
35
-	public function setData($value){
35
+	public function setData($value) {
36 36
 		$this->setProperty("data-value", $value);
37 37
 		return $this;
38 38
 	}
39 39
 
40
-	public function asOption(){
40
+	public function asOption() {
41 41
 		$this->tagName="option";
42
-		if($this->getProperty("data-value")!==null)
42
+		if ($this->getProperty("data-value")!==null)
43 43
 			$this->setProperty("value", $this->getProperty("data-value"));
44 44
 	}
45 45
 
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 	 * @param string $image the image src
48 48
 	 * @return \Ajax\common\html\html5\HtmlImg
49 49
 	 */
50
-	public function asMiniAvatar($image){
50
+	public function asMiniAvatar($image) {
51 51
 		$this->tagName="div";
52
-		$img=new HtmlImg("image-".$this->identifier,$image);
52
+		$img=new HtmlImg("image-".$this->identifier, $image);
53 53
 		$img->setClass("ui mini avatar image");
54
-		$this->addContent($img,true);
54
+		$this->addContent($img, true);
55 55
 		return $this;
56 56
 	}
57 57
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 * @param string $icon
61 61
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
62 62
 	 */
63
-	public function asIcon($caption,$icon){
63
+	public function asIcon($caption, $icon) {
64 64
 		$this->setContent($caption);
65
-		$this->addContent(new HtmlIcon("", $icon),true);
65
+		$this->addContent(new HtmlIcon("", $icon), true);
66 66
 		return $this;
67 67
 	}
68 68
 
@@ -71,23 +71,23 @@  discard block
 block discarded – undo
71 71
 	 * @param string $color
72 72
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
73 73
 	 */
74
-	public function asCircularLabel($caption,$color){
74
+	public function asCircularLabel($caption, $color) {
75 75
 		$this->setContent($caption);
76 76
 		$lbl=new HtmlLabel("");
77 77
 		$lbl->setCircular()->setColor($color)->setEmpty();
78
-		$this->addContent($lbl,true);
78
+		$this->addContent($lbl, true);
79 79
 		return $this;
80 80
 	}
81 81
 
82 82
 
83 83
 
84 84
 	public function addMenuItem($items) {
85
-		$menu=new HtmlMenu("menu-" . $this->identifier, $items);
85
+		$menu=new HtmlMenu("menu-".$this->identifier, $items);
86 86
 		$content=$this->content;
87 87
 		$this->setTagName("div");
88 88
 		$this->setProperty("class", "item");
89 89
 		$icon=new HtmlIcon("", "dropdown");
90
-		$this->content=[$icon,new HtmlSemDoubleElement("","span","text",$content),$menu];
90
+		$this->content=[$icon, new HtmlSemDoubleElement("", "span", "text", $content), $menu];
91 91
 		return $menu;
92 92
 	}
93 93
 
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
 	 * @param string $icon
97 97
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
98 98
 	 */
99
-	public static function searchInput($placeholder=NULL,$icon=NULL){
100
-		return (new HtmlDropdownItem(""))->asSearchInput($placeholder,$icon);
99
+	public static function searchInput($placeholder=NULL, $icon=NULL) {
100
+		return (new HtmlDropdownItem(""))->asSearchInput($placeholder, $icon);
101 101
 	}
102 102
 
103 103
 	/**
104 104
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
105 105
 	 */
106
-	public static function divider(){
106
+	public static function divider() {
107 107
 		return (new HtmlDropdownItem(""))->asDivider();
108 108
 	}
109 109
 
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 	 * @param string $icon
113 113
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
114 114
 	 */
115
-	public static function header($caption=NULL,$icon=NULL){
116
-		return (new HtmlDropdownItem(""))->asHeader($caption,$icon);
115
+	public static function header($caption=NULL, $icon=NULL) {
116
+		return (new HtmlDropdownItem(""))->asHeader($caption, $icon);
117 117
 	}
118 118
 
119 119
 	/**
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 	 * @param string $color
122 122
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
123 123
 	 */
124
-	public static function circular($caption,$color){
125
-		return (new HtmlDropdownItem(""))->asCircularLabel($caption,$color);
124
+	public static function circular($caption, $color) {
125
+		return (new HtmlDropdownItem(""))->asCircularLabel($caption, $color);
126 126
 	}
127 127
 
128 128
 	/**
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
 	 * @param string $icon
131 131
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
132 132
 	 */
133
-	public static function icon($caption,$icon){
134
-		return (new HtmlDropdownItem(""))->asIcon($caption,$icon);
133
+	public static function icon($caption, $icon) {
134
+		return (new HtmlDropdownItem(""))->asIcon($caption, $icon);
135 135
 	}
136 136
 
137 137
 	/**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 * @param unknown $image
140 140
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
141 141
 	 */
142
-	public static function avatar($caption,$image){
143
-		return (new HtmlDropdownItem("",$caption))->asMiniAvatar($image);
142
+	public static function avatar($caption, $image) {
143
+		return (new HtmlDropdownItem("", $caption))->asMiniAvatar($image);
144 144
 	}
145 145
 }
146 146
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/InternalPopup.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -12,58 +12,58 @@
 block discarded – undo
12 12
 	protected $variation;
13 13
 	protected $params;
14 14
 	protected $semElement;
15
-	public function __construct($semElement,$title="",$content="",$variation=NULL,$params=array()){
15
+	public function __construct($semElement, $title="", $content="", $variation=NULL, $params=array()) {
16 16
 		$this->semElement=$semElement;
17 17
 		$this->title=$title;
18 18
 		$this->content=$content;
19
-		$this->setAttributes($variation,$params);
19
+		$this->setAttributes($variation, $params);
20 20
 	}
21 21
 
22 22
 	public function setHtml($html) {
23
-		$this->html= $html;
23
+		$this->html=$html;
24 24
 		return $this;
25 25
 	}
26 26
 
27
-	public function setAttributes($variation=NULL,$params=array()){
27
+	public function setAttributes($variation=NULL, $params=array()) {
28 28
 		$this->variation=$variation;
29 29
 		$this->params=$params;
30 30
 	}
31 31
 
32
-	public function onShow($jsCode){
32
+	public function onShow($jsCode) {
33 33
 		$this->params["onShow"]=$jsCode;
34 34
 	}
35 35
 
36
-	public function compile(JsUtils $js=NULL){
37
-		if(JString::isNotNull($this->title)){
36
+	public function compile(JsUtils $js=NULL) {
37
+		if (JString::isNotNull($this->title)) {
38 38
 			$this->semElement->addToProperty("data-title", $this->title);
39 39
 		}
40
-		if(JString::isNotNull($this->content)){
40
+		if (JString::isNotNull($this->content)) {
41 41
 			$this->semElement->addToProperty("data-content", $this->content);
42 42
 		}
43
-		if(JString::isNotNull($this->html)){
43
+		if (JString::isNotNull($this->html)) {
44 44
 			$html=$this->html;
45
-			if(\is_array($html)){
45
+			if (\is_array($html)) {
46 46
 				\array_walk($html, function(&$item) use($js){
47
-					if($item instanceof HtmlSemDoubleElement){
47
+					if ($item instanceof HtmlSemDoubleElement) {
48 48
 						$comp=$item->compile($js);
49 49
 						$bs=$item->run($js);
50
-						if(isset($bs))
50
+						if (isset($bs))
51 51
 							$this->params['onShow']=$bs->getScript();
52 52
 						$item=$comp;
53 53
 					}
54 54
 				});
55
-				$html=\implode("",$html);
55
+				$html=\implode("", $html);
56 56
 			}
57 57
 			$html=\str_replace("\"", "'", $html);
58 58
 			$this->semElement->addToProperty("data-html", $html);
59 59
 		}
60
-		if(JString::isNotNull($this->variation)){
60
+		if (JString::isNotNull($this->variation)) {
61 61
 			$this->semElement->addToProperty("data-variation", $this->variation);
62 62
 		}
63 63
 	}
64 64
 
65
-	public function run(JsUtils $js){
66
-		$js->semantic()->popup("#".$this->semElement->getIdentifier(),$this->params);
65
+	public function run(JsUtils $js) {
66
+		$js->semantic()->popup("#".$this->semElement->getIdentifier(), $this->params);
67 67
 	}
68 68
 
69 69
 }
70 70
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlMenuItem.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,27 +9,27 @@
 block discarded – undo
9 9
 class HtmlMenuItem extends HtmlSemDoubleElement {
10 10
 	use MenuItemTrait;
11 11
 	public function __construct($identifier, $content) {
12
-		parent::__construct($identifier,"div","item",$content);
12
+		parent::__construct($identifier, "div", "item", $content);
13 13
 	}
14 14
 
15
-	protected function initContent($content){
16
-		if(\is_array($content)){
17
-			if(JArray::isAssociative($content)===false){
15
+	protected function initContent($content) {
16
+		if (\is_array($content)) {
17
+			if (JArray::isAssociative($content)===false) {
18 18
 				$icon=@$content[0];
19 19
 				$title=@$content[1];
20 20
 				$desc=@$content[2];
21
-			}else{
21
+			} else {
22 22
 				$icon=@$content["icon"];
23 23
 				$title=@$content["title"];
24 24
 				$desc=@$content["description"];
25 25
 			}
26
-			if(isset($icon)===true){
26
+			if (isset($icon)===true) {
27 27
 				$this->setIcon($icon);
28 28
 			}
29
-			if(isset($title)===true){
30
-				$this->setTitle($title,$desc);
29
+			if (isset($title)===true) {
30
+				$this->setTitle($title, $desc);
31 31
 			}
32
-		}else{
32
+		} else {
33 33
 			$this->setContent($content);
34 34
 		}
35 35
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/views/HtmlCard.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,19 +17,19 @@  discard block
 block discarded – undo
17 17
 class HtmlCard extends HtmlSemDoubleElement {
18 18
 
19 19
 	public function __construct($identifier) {
20
-		parent::__construct($identifier, "div", "ui card", array ());
20
+		parent::__construct($identifier, "div", "ui card", array());
21 21
 	}
22 22
 
23 23
 	private function createContent($content, $baseClass="content") {
24 24
 		$count=\sizeof($this->content);
25
-		$result=new HtmlCardContent("content-" . $count . "-" . $this->identifier, $content);
25
+		$result=new HtmlCardContent("content-".$count."-".$this->identifier, $content);
26 26
 		$result->setClass($baseClass);
27 27
 		return $result;
28 28
 	}
29 29
 
30 30
 	private function addElementInContent($key, $element) {
31
-		if (\array_key_exists($key, $this->content) === false) {
32
-			$this->content[$key]=array ();
31
+		if (\array_key_exists($key, $this->content)===false) {
32
+			$this->content[$key]=array();
33 33
 		}
34 34
 		$this->content[$key][]=$element;
35 35
 		return $element;
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 
47 47
 	public function addHeader($header, $niveau=4, $type="page") {
48 48
 		if (!$header instanceof HtmlHeader) {
49
-			$header=new HtmlHeader("header-" . $this->identifier, $niveau, $header, $type);
49
+			$header=new HtmlHeader("header-".$this->identifier, $niveau, $header, $type);
50 50
 		}
51 51
 		$this->content["header"]=$this->createContent($header);
52 52
 	}
53 53
 
54 54
 	public function addImage($image, $title="") {
55 55
 		if (!$image instanceof HtmlImage) {
56
-			$image=new HtmlImage("image-" . $this->identifier, $image, $title);
56
+			$image=new HtmlImage("image-".$this->identifier, $image, $title);
57 57
 		}
58 58
 		$image->setClass("image");
59 59
 		return $this->addElementInContent("content", $image);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL) {
63 63
 		$reveal=$visibleContent;
64 64
 		if (!$visibleContent instanceof HtmlReveal) {
65
-			$reveal=new HtmlReveal("reveral-" . $this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
65
+			$reveal=new HtmlReveal("reveral-".$this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
66 66
 		}
67 67
 		return $this->addElementInContent("content", $reveal);
68 68
 	}
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 	 * @param string $asIcons
92 92
 	 * @return \Ajax\semantic\html\elements\HtmlButtonGroups
93 93
 	 */
94
-	public function addButtons($elements=array(), $asIcons=false){
95
-		$buttons=new HtmlButtonGroups("buttons-".$this->identifier,$elements,$asIcons);
94
+	public function addButtons($elements=array(), $asIcons=false) {
95
+		$buttons=new HtmlButtonGroups("buttons-".$this->identifier, $elements, $asIcons);
96 96
 		$this->addElementInContent("content", $buttons);
97 97
 		return $buttons;
98 98
 	}
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
 
102 102
 	public function addCardHeaderContent($header, $metas=array(), $description=NULL) {
103 103
 		$count=\sizeof($this->content);
104
-		return $this->addElementInContent("content", new HtmlCardHeaderContent("content-" . $count . "-" . $this->identifier, $header, $metas, $description));
104
+		return $this->addElementInContent("content", new HtmlCardHeaderContent("content-".$count."-".$this->identifier, $header, $metas, $description));
105 105
 	}
106 106
 
107 107
 	public function addCardContent($content=array()) {
108 108
 		$count=\sizeof($this->content);
109
-		return $this->addElementInContent("content", new HtmlCardContent("content-" . $count . "-" . $this->identifier, $content));
109
+		return $this->addElementInContent("content", new HtmlCardContent("content-".$count."-".$this->identifier, $content));
110 110
 	}
111 111
 
112 112
 	public function getCardContent($index=NULL) {
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
133 133
 	 */
134 134
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
135
-		$this->content=JArray::sortAssociative($this->content, [ "header","image","content","extra-content" ]);
135
+		$this->content=JArray::sortAssociative($this->content, ["header", "image", "content", "extra-content"]);
136 136
 		return parent::compile($js, $view);
137 137
 	}
138 138
 
139 139
 	public function asLink($href="") {
140 140
 		$this->addToProperty("class", "link");
141
-		if ($href !== "") {
141
+		if ($href!=="") {
142 142
 			$this->setProperty("href", $href);
143 143
 		}
144 144
 		return $this;
Please login to merge, or discard this patch.
Ajax/common/html/HtmlCollection.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -12,36 +12,36 @@  discard block
 block discarded – undo
12 12
  */
13 13
 abstract class HtmlCollection extends HtmlDoubleElement {
14 14
 
15
-	public function __construct($identifier,$tagName="div"){
16
-		parent::__construct($identifier,$tagName);
15
+	public function __construct($identifier, $tagName="div") {
16
+		parent::__construct($identifier, $tagName);
17 17
 		$this->content=array();
18 18
 	}
19 19
 
20
-	public function addItems($items){
21
-		if(JArray::isAssociative($items)){
22
-			foreach ($items as $k=>$v){
23
-				$this->addItem([$k,$v]);
20
+	public function addItems($items) {
21
+		if (JArray::isAssociative($items)) {
22
+			foreach ($items as $k=>$v) {
23
+				$this->addItem([$k, $v]);
24 24
 			}
25
-		}else{
26
-			foreach ($items as $item){
25
+		} else {
26
+			foreach ($items as $item) {
27 27
 				$this->addItem($item);
28 28
 			}
29 29
 		}
30 30
 		return $this;
31 31
 	}
32 32
 
33
-	public function setItems($items){
33
+	public function setItems($items) {
34 34
 		$this->content=$items;
35 35
 		return $this;
36 36
 	}
37 37
 
38
-	public function getItems(){
38
+	public function getItems() {
39 39
 		return $this->content;
40 40
 	}
41 41
 
42
-	protected function getItemToAdd($item){
42
+	protected function getItemToAdd($item) {
43 43
 		$itemO=$item;
44
-		if($this->createCondition($item)===true){
44
+		if ($this->createCondition($item)===true) {
45 45
 			$itemO=$this->createItem($item);
46 46
 		}
47 47
 		return $itemO;
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
 	 * @param HtmlDoubleElement|string $item
53 53
 	 * @return \Ajax\common\html\HtmlDoubleElement
54 54
 	 */
55
-	public function addItem($item){
55
+	public function addItem($item) {
56 56
 		$itemO=$this->getItemToAdd($item);
57 57
 		$this->addContent($itemO);
58 58
 		return $itemO;
59 59
 	}
60 60
 
61
-	public function insertItem($item,$position=0){
61
+	public function insertItem($item, $position=0) {
62 62
 		$itemO=$this->getItemToAdd($item);
63
-		\array_splice( $this->content, $position, 0, array($itemO));
63
+		\array_splice($this->content, $position, 0, array($itemO));
64 64
 		return $itemO;
65 65
 	}
66 66
 
@@ -83,11 +83,11 @@  discard block
 block discarded – undo
83 83
 		return $this;
84 84
 	}
85 85
 
86
-	public function removeItem($index){
86
+	public function removeItem($index) {
87 87
 		return array_splice($this->content, $index, 1);
88 88
 	}
89 89
 
90
-	public function count(){
90
+	public function count() {
91 91
 		return \sizeof($this->content);
92 92
 	}
93 93
 
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 		return $this->addItem($function($object));
99 99
 	}
100 100
 
101
-	public function apply($callBack){
102
-		foreach ($this->content as $item){
101
+	public function apply($callBack) {
102
+		foreach ($this->content as $item) {
103 103
 			$callBack($item);
104 104
 		}
105 105
 		return $this;
@@ -119,40 +119,40 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	protected abstract function createItem($value);
121 121
 
122
-	protected function createCondition($value){
122
+	protected function createCondition($value) {
123 123
 		return \is_object($value)===false;
124 124
 	}
125 125
 
126
-	protected function contentAs($tagName){
127
-		foreach ($this->content as $item){
126
+	protected function contentAs($tagName) {
127
+		foreach ($this->content as $item) {
128 128
 			$item->setTagName($tagName);
129 129
 		}
130 130
 		return $this;
131 131
 	}
132 132
 
133
-	public function setProperties($properties){
133
+	public function setProperties($properties) {
134 134
 		$i=0;
135
-		foreach ($properties as $k=>$v){
135
+		foreach ($properties as $k=>$v) {
136 136
 			$c=$this->content[$i++];
137
-			if(isset($c))
138
-				$c->setProperty($k,$v);
137
+			if (isset($c))
138
+				$c->setProperty($k, $v);
139 139
 			else
140 140
 				return $this;
141 141
 		}
142 142
 		return $this;
143 143
 	}
144 144
 
145
-	public function setPropertyValues($property,$values){
145
+	public function setPropertyValues($property, $values) {
146 146
 		$i=0;
147
-		if(\is_array($values)===false){
148
-			$values=\array_fill(0, $this->count(),$values);
147
+		if (\is_array($values)===false) {
148
+			$values=\array_fill(0, $this->count(), $values);
149 149
 		}
150
-		foreach ($values as $value){
150
+		foreach ($values as $value) {
151 151
 			$c=$this->content[$i++];
152
-			if(isset($c)===true){
153
-				$c->setProperty($property,$value);
152
+			if (isset($c)===true) {
153
+				$c->setProperty($property, $value);
154 154
 			}
155
-			else{
155
+			else {
156 156
 				return $this;
157 157
 			}
158 158
 		}
Please login to merge, or discard this patch.