Completed
Push — master ( ef9455...966ba4 )
by Jean-Christophe
02:39
created
Ajax/semantic/html/collections/form/HtmlFormFields.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		}
36 36
 		if (isset($label))
37 37
 			$this->setLabel($label);
38
-		foreach ( $fields as $field ) {
38
+		foreach ($fields as $field) {
39 39
 			$this->addItem($field);
40 40
 		}
41 41
 		return $this;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function addItem($item) {
59 59
 		$item=parent::addItem($item);
60
-		if($item instanceof HtmlFormField)
60
+		if ($item instanceof HtmlFormField)
61 61
 			$item->setContainer($this);
62 62
 		return $item;
63 63
 	}
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
 
100 100
 	public static function radios($name, $items=array(), $label=NULL, $value=null, $type=NULL) {
101
-		$fields=array ();
101
+		$fields=array();
102 102
 		$i=0;
103
-		foreach ( $items as $val => $caption ) {
103
+		foreach ($items as $val => $caption) {
104 104
 			$itemO=new HtmlFormRadio($name."-".$i++, $name, $caption, $val, $type);
105 105
 			if ($val===$value) {
106 106
 				$itemO->getDataField()->setProperty("checked", "");
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	}
115 115
 
116 116
 	public static function checkeds($name, $items=array(), $label=NULL, $values=array(), $type=NULL) {
117
-		$fields=array ();
117
+		$fields=array();
118 118
 		$i=0;
119
-		foreach ( $items as $val => $caption ) {
119
+		foreach ($items as $val => $caption) {
120 120
 			$itemO=new HtmlFormCheckbox($name."-".$i++, $caption, $val, $type);
121 121
 			$itemO->setName($name);
122 122
 			if (\array_search($val, $values)!==false) {
Please login to merge, or discard this patch.
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.
Ajax/common/traits/JsUtilsEventsTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 trait JsUtilsEventsTrait {
12 12
 
13 13
 
14
-	protected $jquery_events=array (
15
-			"bind","blur","change","click","dblclick","delegate","die","error","focus","focusin","focusout","hover","keydown","keypress","keyup","live","load","mousedown","mousseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","off","on","one","ready","resize","scroll","select","submit","toggle","trigger","triggerHandler","undind","undelegate","unload"
14
+	protected $jquery_events=array(
15
+			"bind", "blur", "change", "click", "dblclick", "delegate", "die", "error", "focus", "focusin", "focusout", "hover", "keydown", "keypress", "keyup", "live", "load", "mousedown", "mousseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "off", "on", "one", "ready", "resize", "scroll", "select", "submit", "toggle", "trigger", "triggerHandler", "undind", "undelegate", "unload"
16 16
 	);
17 17
 
18
-	abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true);
18
+	abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true);
19 19
 
20 20
 	/**
21 21
 	 * Outputs a javascript library blur event
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 	 * @param boolean $stopPropagation
50 50
 	 * @return string
51 51
 	 */
52
-	public function click($element='this', $js='', $ret_false=TRUE,$preventDefault=false,$stopPropagation=false) {
52
+	public function click($element='this', $js='', $ret_false=TRUE, $preventDefault=false, $stopPropagation=false) {
53 53
 		if (!is_array($js)) {
54
-			$js=array (
54
+			$js=array(
55 55
 					$js
56 56
 			);
57 57
 		}
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			$js[]="return false;";
61 61
 		}
62 62
 
63
-		return $this->_add_event($element, $js, 'click',$preventDefault,$stopPropagation);
63
+		return $this->_add_event($element, $js, 'click', $preventDefault, $stopPropagation);
64 64
 	}
65 65
 
66 66
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDropdown.php 1 patch
Spacing   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -13,29 +13,29 @@  discard block
 block discarded – undo
13 13
 use Ajax\semantic\html\collections\form\traits\FieldTrait;
14 14
 
15 15
 class HtmlDropdown extends HtmlSemDoubleElement {
16
-	use FieldTrait,LabeledIconTrait {
16
+	use FieldTrait, LabeledIconTrait {
17 17
 		addIcon as addIconP;
18 18
 	}
19 19
 	protected $mClass="menu";
20 20
 	protected $mTagName="div";
21
-	protected $items=array ();
22
-	protected $_params=array("action"=>"nothing","on"=>"hover");
21
+	protected $items=array();
22
+	protected $_params=array("action"=>"nothing", "on"=>"hover");
23 23
 	protected $input;
24 24
 	protected $value;
25 25
 	protected $_associative;
26 26
 	protected $_multiple;
27 27
 
28
-	public function __construct($identifier, $value="", $items=array(),$associative=true) {
28
+	public function __construct($identifier, $value="", $items=array(), $associative=true) {
29 29
 		parent::__construct($identifier, "div");
30 30
 		$this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php';
31 31
 		$this->setProperty("class", "ui dropdown");
32 32
 		$this->_multiple=false;
33 33
 		$content=[];
34
-		if(isset($value)){
35
-			if($value instanceof HtmlSemDoubleElement){
34
+		if (isset($value)) {
35
+			if ($value instanceof HtmlSemDoubleElement) {
36 36
 				$text=$value;
37
-			}else{
38
-				$text=new HtmlSemDoubleElement("text-".$this->identifier,"div");
37
+			} else {
38
+				$text=new HtmlSemDoubleElement("text-".$this->identifier, "div");
39 39
 				$text->setClass("text");
40 40
 				$this->setValue($value);
41 41
 			}
@@ -48,29 +48,29 @@  discard block
 block discarded – undo
48 48
 		$this->addItems($items);
49 49
 	}
50 50
 
51
-	public function getField(){
51
+	public function getField() {
52 52
 		return $this->input;
53 53
 	}
54 54
 
55
-	public function getDataField(){
55
+	public function getDataField() {
56 56
 		return $this->input;
57 57
 	}
58 58
 
59
-	public function addItem($item,$value=NULL,$image=NULL,$description=NULL){
60
-		$itemO=$this->beforeAddItem($item,$value,$image,$description);
59
+	public function addItem($item, $value=NULL, $image=NULL, $description=NULL) {
60
+		$itemO=$this->beforeAddItem($item, $value, $image, $description);
61 61
 		$this->items[]=$itemO;
62 62
 		return $itemO;
63 63
 	}
64 64
 
65
-	public function addIcon($icon,$before=true,$labeled=false){
65
+	public function addIcon($icon, $before=true, $labeled=false) {
66 66
 		$this->removeArrow();
67
-		$this->addIconP($icon,$before,$labeled);
67
+		$this->addIconP($icon, $before, $labeled);
68 68
 		return $this->getElementById("text-".$this->identifier, $this->content)->setWrapAfter("");
69 69
 	}
70 70
 
71
-	public function addIcons($icons){
71
+	public function addIcons($icons) {
72 72
 		$count=$this->count();
73
-		for ($i=0;$i<\sizeof($icons) && $i<$count;$i++){
73
+		for ($i=0; $i<\sizeof($icons) && $i<$count; $i++) {
74 74
 			$this->getItem($i)->addIcon($icons[$i]);
75 75
 		}
76 76
 	}
@@ -81,33 +81,33 @@  discard block
 block discarded – undo
81 81
 	 * @param number $position
82 82
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown
83 83
 	 */
84
-	public function insertItem($item,$position=0){
84
+	public function insertItem($item, $position=0) {
85 85
 		$itemO=$this->beforeAddItem($item);
86
-		 $start = array_slice($this->items, 0, $position);
87
-		 $end = array_slice($this->items, $position);
88
-		 $start[] = $item;
86
+		 $start=array_slice($this->items, 0, $position);
87
+		 $end=array_slice($this->items, $position);
88
+		 $start[]=$item;
89 89
 		 $this->items=array_merge($start, $end);
90 90
 		 return $itemO;
91 91
 	}
92 92
 
93
-	protected function removeArrow(){
94
-		if(\sizeof($this->content)>1){
93
+	protected function removeArrow() {
94
+		if (\sizeof($this->content)>1) {
95 95
 			unset($this->content["arrow"]);
96 96
 			$this->content=\array_values($this->content);
97 97
 		}
98 98
 	}
99 99
 
100
-	protected function beforeAddItem($item,$value=NULL,$image=NULL,$description=NULL){
100
+	protected function beforeAddItem($item, $value=NULL, $image=NULL, $description=NULL) {
101 101
 		$itemO=$item;
102
-		if(\is_array($item)){
102
+		if (\is_array($item)) {
103 103
 			$description=JArray::getValue($item, "description", 3);
104 104
 			$value=JArray::getValue($item, "value", 1);
105 105
 			$image=JArray::getValue($item, "image", 2);
106 106
 			$item=JArray::getValue($item, "item", 0);
107 107
 		}
108
-		if(!$item instanceof HtmlDropdownItem){
109
-			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image,$description);
110
-		}elseif($itemO instanceof HtmlDropdownItem){
108
+		if (!$item instanceof HtmlDropdownItem) {
109
+			$itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items), $item, $value, $image, $description);
110
+		}elseif ($itemO instanceof HtmlDropdownItem) {
111 111
 			$this->addToProperty("class", "vertical");
112 112
 		}
113 113
 		return $itemO;
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 		$this->addItem($function($object));
121 121
 	}
122 122
 
123
-	public function addInput($name){
124
-		if(!isset($name))
123
+	public function addInput($name) {
124
+		if (!isset($name))
125 125
 			$name="input-".$this->identifier;
126 126
 		$this->setAction("activate");
127
-		$this->input=new HtmlInput($name,"hidden");
127
+		$this->input=new HtmlInput($name, "hidden");
128 128
 	}
129 129
 
130 130
 	/**
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
 	 * @param string $icon
134 134
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
135 135
 	 */
136
-	public function addSearchInputItem($placeHolder=NULL,$icon=NULL){
137
-		return $this->addItem(HtmlDropdownItem::searchInput($placeHolder,$icon));
136
+	public function addSearchInputItem($placeHolder=NULL, $icon=NULL) {
137
+		return $this->addItem(HtmlDropdownItem::searchInput($placeHolder, $icon));
138 138
 	}
139 139
 
140 140
 	/**
141 141
 	 * Adds a divider item
142 142
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
143 143
 	 */
144
-	public function addDividerItem(){
144
+	public function addDividerItem() {
145 145
 		return $this->addItem(HtmlDropdownItem::divider());
146 146
 	}
147 147
 
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
 	 * @param string $icon
152 152
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown
153 153
 	 */
154
-	public function addHeaderItem($caption=NULL,$icon=NULL){
155
-		return $this->addItem(HtmlDropdownItem::header($caption,$icon));
154
+	public function addHeaderItem($caption=NULL, $icon=NULL) {
155
+		return $this->addItem(HtmlDropdownItem::header($caption, $icon));
156 156
 	}
157 157
 
158 158
 	/**
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 * @param string $color
162 162
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown
163 163
 	 */
164
-	public function addCircularLabelItem($caption,$color){
164
+	public function addCircularLabelItem($caption, $color) {
165 165
 		return $this->addItem(HtmlDropdownItem::circular($caption, $color));
166 166
 	}
167 167
 
@@ -170,17 +170,17 @@  discard block
 block discarded – undo
170 170
 	 * @param string $image
171 171
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem
172 172
 	 */
173
-	public function addMiniAvatarImageItem($caption,$image){
173
+	public function addMiniAvatarImageItem($caption, $image) {
174 174
 		return $this->addItem(HtmlDropdownItem::avatar($caption, $image));
175 175
 	}
176 176
 
177
-	public function addItems($items){
178
-		if(\is_array($items) && $this->_associative){
179
-			foreach ($items as $k=>$v){
177
+	public function addItems($items) {
178
+		if (\is_array($items) && $this->_associative) {
179
+			foreach ($items as $k=>$v) {
180 180
 				$this->addItem($v)->setData($k);
181 181
 			}
182
-		}else{
183
-			foreach ($items as $item){
182
+		} else {
183
+			foreach ($items as $item) {
184 184
 				$this->addItem($item);
185 185
 			}
186 186
 		}
@@ -192,98 +192,98 @@  discard block
 block discarded – undo
192 192
 	 * @param array $values
193 193
 	 * @return HtmlCollection
194 194
 	 */
195
-	public function setPropertyValues($property,$values){
195
+	public function setPropertyValues($property, $values) {
196 196
 		$i=0;
197
-		if(\is_array($values)===false){
198
-			$values=\array_fill(0, $this->count(),$values);
197
+		if (\is_array($values)===false) {
198
+			$values=\array_fill(0, $this->count(), $values);
199 199
 		}
200
-		foreach ($values as $value){
200
+		foreach ($values as $value) {
201 201
 			$c=$this->items[$i++];
202
-			if(isset($c)){
203
-				$c->setProperty($property,$value);
202
+			if (isset($c)) {
203
+				$c->setProperty($property, $value);
204 204
 			}
205
-			else{
205
+			else {
206 206
 				return $this;
207 207
 			}
208 208
 		}
209 209
 		return $this;
210 210
 	}
211 211
 
212
-	public function each($callBack){
213
-		foreach ($this->items as $index=>$value){
214
-			$callBack($index,$value);
212
+	public function each($callBack) {
213
+		foreach ($this->items as $index=>$value) {
214
+			$callBack($index, $value);
215 215
 		}
216 216
 		return $this;
217 217
 	}
218 218
 
219
-	public function getItem($index){
219
+	public function getItem($index) {
220 220
 		return $this->items[$index];
221 221
 	}
222 222
 
223 223
 	/**
224 224
 	 * @return int
225 225
 	 */
226
-	public function count(){
226
+	public function count() {
227 227
 		return \sizeof($this->items);
228 228
 	}
229 229
 	/**
230 230
 	 * @param boolean $dropdown
231 231
 	 */
232
-	public function asDropdown($dropdown){
233
-		if($dropdown===false){
232
+	public function asDropdown($dropdown) {
233
+		if ($dropdown===false) {
234 234
 			$this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php';
235 235
 			$dropdown="menu";
236
-		}else{
236
+		} else {
237 237
 			$dropdown="dropdown";
238 238
 			$this->mClass="menu";
239 239
 		}
240
-		return $this->addToPropertyCtrl("class", $dropdown,array("menu","dropdown"));
240
+		return $this->addToPropertyCtrl("class", $dropdown, array("menu", "dropdown"));
241 241
 	}
242 242
 
243
-	public function setVertical(){
244
-		return $this->addToPropertyCtrl("class", "vertical",array("vertical"));
243
+	public function setVertical() {
244
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
245 245
 	}
246 246
 
247
-	public function setInline(){
248
-		return $this->addToPropertyCtrl("class", "inline",["inline"]);
247
+	public function setInline() {
248
+		return $this->addToPropertyCtrl("class", "inline", ["inline"]);
249 249
 	}
250 250
 
251
-	public function setSimple(){
252
-		return $this->addToPropertyCtrl("class", "simple",array("simple"));
251
+	public function setSimple() {
252
+		return $this->addToPropertyCtrl("class", "simple", array("simple"));
253 253
 	}
254 254
 
255
-	public function asButton($floating=false){
255
+	public function asButton($floating=false) {
256 256
 		$this->removeArrow();
257
-		if($floating)
257
+		if ($floating)
258 258
 			$this->addToProperty("class", "floating");
259 259
 		$this->removePropertyValue("class", "selection");
260 260
 		return $this->addToProperty("class", "button");
261 261
 	}
262 262
 
263
-	public function asSelect($name=NULL,$multiple=false,$selection=true){
263
+	public function asSelect($name=NULL, $multiple=false, $selection=true) {
264 264
 		$this->_multiple=$multiple;
265
-		if(isset($name))
265
+		if (isset($name))
266 266
 			$this->addInput($name);
267
-		if($multiple){
267
+		if ($multiple) {
268 268
 			$this->addToProperty("class", "multiple");
269 269
 		}
270
-		if ($selection){
271
-			if($this->propertyContains("class", "button")===false)
272
-				$this->addToPropertyCtrl("class", "selection",array("selection"));
270
+		if ($selection) {
271
+			if ($this->propertyContains("class", "button")===false)
272
+				$this->addToPropertyCtrl("class", "selection", array("selection"));
273 273
 		}
274 274
 		return $this;
275 275
 	}
276 276
 
277
-	public function asSearch($name=NULL,$multiple=false,$selection=true){
278
-		$this->asSelect($name,$multiple,$selection);
277
+	public function asSearch($name=NULL, $multiple=false, $selection=true) {
278
+		$this->asSelect($name, $multiple, $selection);
279 279
 		return $this->addToProperty("class", "search");
280 280
 	}
281 281
 
282
-	public function setSelect($name=NULL,$multiple=false){
283
-		if(!isset($name))
282
+	public function setSelect($name=NULL, $multiple=false) {
283
+		if (!isset($name))
284 284
 			$name="select-".$this->identifier;
285 285
 		$this->input=null;
286
-		if($multiple){
286
+		if ($multiple) {
287 287
 			$this->setProperty("multiple", true);
288 288
 			$this->addToProperty("class", "multiple");
289 289
 		}
@@ -291,37 +291,37 @@  discard block
 block discarded – undo
291 291
 		$this->tagName="select";
292 292
 		$this->setProperty("name", $name);
293 293
 		$this->content=null;
294
-		foreach ($this->items as $item){
294
+		foreach ($this->items as $item) {
295 295
 			$item->asOption();
296 296
 		}
297 297
 		return $this;
298 298
 	}
299 299
 
300
-	public function asSubmenu($pointing=NULL){
300
+	public function asSubmenu($pointing=NULL) {
301 301
 		$this->setClass("ui dropdown link item");
302
-		if(isset($pointing)){
302
+		if (isset($pointing)) {
303 303
 			$this->setPointing($pointing);
304 304
 		}
305 305
 		return $this;
306 306
 	}
307 307
 
308
-	public function setPointing($value=Direction::NONE){
309
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
308
+	public function setPointing($value=Direction::NONE) {
309
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
310 310
 	}
311 311
 
312
-	public function setValue($value){
312
+	public function setValue($value) {
313 313
 		$this->value=$value;
314 314
 		return $this;
315 315
 	}
316
-	private function applyValue(){
316
+	private function applyValue() {
317 317
 		$value=$this->value;
318
-		if(isset($this->input) && isset($value)){
318
+		if (isset($this->input) && isset($value)) {
319 319
 			$this->input->setProperty("value", $value);
320
-		}else{
320
+		} else {
321 321
 			$this->setProperty("value", $value);
322 322
 		}
323 323
 			$textElement=$this->getElementById("text-".$this->identifier, $this->content);
324
-			if(isset($textElement) && !$this->_multiple)
324
+			if (isset($textElement) && !$this->_multiple)
325 325
 				$textElement->setContent($value);
326 326
 		return $this;
327 327
 	}
@@ -331,9 +331,9 @@  discard block
 block discarded – undo
331 331
 	 * @see BaseHtml::run()
332 332
 	 */
333 333
 	public function run(JsUtils $js) {
334
-		if($this->propertyContains("class", "simple")===false){
335
-			if(isset($this->_bsComponent)===false){
336
-				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params);
334
+		if ($this->propertyContains("class", "simple")===false) {
335
+			if (isset($this->_bsComponent)===false) {
336
+				$this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier, $this->_params);
337 337
 				$this->_bsComponent->setItemSelector(".item");
338 338
 			}
339 339
 			$this->addEventsOnRun($js);
@@ -341,36 +341,36 @@  discard block
 block discarded – undo
341 341
 		}
342 342
 	}
343 343
 
344
-	public function setCompact(){
344
+	public function setCompact() {
345 345
 		return $this->addToPropertyCtrl("class", "compact", array("compact"));
346 346
 	}
347 347
 
348
-	public function setAction($action){
348
+	public function setAction($action) {
349 349
 		$this->_params["action"]=$action;
350 350
 	}
351 351
 
352
-	public function setFullTextSearch($value){
352
+	public function setFullTextSearch($value) {
353 353
 		$this->_params["fullTextSearch"]=$value;
354 354
 	}
355 355
 
356 356
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
357 357
 		$this->applyValue();
358
-		return parent::compile($js,$view);
358
+		return parent::compile($js, $view);
359 359
 	}
360 360
 
361 361
 	public function getInput() {
362 362
 		return $this->input;
363 363
 	}
364 364
 	public function addAction($action, $direction=Direction::RIGHT, $icon=NULL, $labeled=false) {
365
-		return $this->_addAction($this, $action,$direction,$icon,$labeled);
365
+		return $this->_addAction($this, $action, $direction, $icon, $labeled);
366 366
 	}
367 367
 
368
-	public function setIcon($icon="dropdown"){
368
+	public function setIcon($icon="dropdown") {
369 369
 		$this->content["arrow"]=new HtmlIcon($this->identifier."-icon", $icon);
370 370
 		return $this;
371 371
 	}
372 372
 
373
-	public function jsAddItem($caption){
373
+	public function jsAddItem($caption) {
374 374
 		$js="var first=$('#{$this->identifier} .item').first();if(first!=undefined){var new =first.clone();first.parent().append(new);first.html('{$caption}};')";
375 375
 		return $js;
376 376
 	}
Please login to merge, or discard this patch.
Ajax/common/traits/JsUtilsInternalTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@  discard block
 block discarded – undo
2 2
 namespace Ajax\common\traits;
3 3
 use Ajax\common\BaseGui;
4 4
 
5
-trait JsUtilsInternalTrait{
5
+trait JsUtilsInternalTrait {
6 6
 
7
-	protected $jquery_code_for_compile=array ();
8
-	protected $jquery_code_for_compile_at_last=array ();
7
+	protected $jquery_code_for_compile=array();
8
+	protected $jquery_code_for_compile_at_last=array();
9 9
 
10 10
 	protected function _addToCompile($jsScript) {
11 11
 		$this->jquery_code_for_compile[]=$jsScript;
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 	 * @param BaseGui $library
16 16
 	 * @param mixed $view
17 17
 	 */
18
-	protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL){
18
+	protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL) {
19 19
 		if ($library!=NULL) {
20
-			if(isset($view))
20
+			if (isset($view))
21 21
 				$library->compileHtml($this, $view);
22 22
 			if ($library->isAutoCompile()) {
23 23
 				$library->compile(true);
@@ -25,20 +25,20 @@  discard block
 block discarded – undo
25 25
 		}
26 26
 	}
27 27
 
28
-	protected function defer($script){
28
+	protected function defer($script) {
29 29
 		$result="window.defer=function (method) {if (window.jQuery) method(); else setTimeout(function() { defer(method) }, 50);};";
30 30
 		$result.="window.defer(function(){".$script."})";
31 31
 		return $result;
32 32
 	}
33 33
 
34
-	protected function ready($script){
34
+	protected function ready($script) {
35 35
 		$result='$(document).ready(function() {'."\n";
36 36
 		$result.=$script.'})';
37 37
 		return $result;
38 38
 	}
39 39
 
40 40
 	protected function minify($input) {
41
-		if(trim($input) === "") return $input;
41
+		if (trim($input)==="") return $input;
42 42
 		return preg_replace(
43 43
 				array(
44 44
 						// Remove comment(s)
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAbsractItem.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 abstract class HtmlAbsractItem extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier, $baseClass,$content=NULL) {
14
+	public function __construct($identifier, $baseClass, $content=NULL) {
15 15
 		parent::__construct($identifier, "div", $baseClass);
16 16
 		$this->content=array();
17 17
 		$this->initContent($content);
@@ -19,59 +19,59 @@  discard block
 block discarded – undo
19 19
 
20 20
 	abstract protected function initContent($content);
21 21
 
22
-	public function setIcon($icon){
22
+	public function setIcon($icon) {
23 23
 		$this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon);
24 24
 	}
25 25
 
26
-	public function removeIcon(){
27
-		if(isset($this->content["icon"]))
26
+	public function removeIcon() {
27
+		if (isset($this->content["icon"]))
28 28
 			unset($this->content["icon"]);
29 29
 		return $this;
30 30
 	}
31 31
 
32
-	public function setImage($image){
32
+	public function setImage($image) {
33 33
 		$image=new HtmlImg("icon-".$this->identifier, $image);
34 34
 		$image->asAvatar();
35 35
 		$this->content["image"]=$image;
36 36
 	}
37 37
 
38
-	private function createContent(){
39
-		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
38
+	private function createContent() {
39
+		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
40 40
 		return $this->content["content"];
41 41
 	}
42 42
 
43
-	public function setTitle($title,$description=NULL,$baseClass="title"){
44
-		$title=new HtmlSemDoubleElement("","div",$baseClass,$title);
45
-		if(\array_key_exists("content", $this->content)===false){
43
+	public function setTitle($title, $description=NULL, $baseClass="title") {
44
+		$title=new HtmlSemDoubleElement("", "div", $baseClass, $title);
45
+		if (\array_key_exists("content", $this->content)===false) {
46 46
 			$this->createContent();
47 47
 		}
48 48
 		$this->content["content"]->addContent($title);
49
-		if(isset($description)){
50
-			$description=new HtmlSemDoubleElement("","div","description",$description);
49
+		if (isset($description)) {
50
+			$description=new HtmlSemDoubleElement("", "div", "description", $description);
51 51
 			$this->content["content"]->addContent($description);
52 52
 		}
53 53
 		return $this;
54 54
 	}
55 55
 
56
-	public function getPart($partName="header"){
57
-		$content=\array_merge($this->content["content"]->getContent(),array(@$this->content["icon"],@$this->content["image"]));
56
+	public function getPart($partName="header") {
57
+		$content=\array_merge($this->content["content"]->getContent(), array(@$this->content["icon"], @$this->content["image"]));
58 58
 		return $this->getElementByPropertyValue("class", $partName, $content);
59 59
 	}
60 60
 
61
-	public function setActive($value=true){
62
-		if($value){
61
+	public function setActive($value=true) {
62
+		if ($value) {
63 63
 			$this->setTagName("div");
64 64
 			$this->removeProperty("href");
65 65
 			$this->addToPropertyCtrl("class", "active", array("active"));
66
-		}else{
66
+		} else {
67 67
 			$this->removePropertyValue("class", "active");
68 68
 		}
69 69
 		return $this;
70 70
 	}
71 71
 
72
-	public function asLink($href=NULL,$part=NULL){
72
+	public function asLink($href=NULL, $part=NULL) {
73 73
 		$this->setTagName("a");
74
-		if(isset($href))
74
+		if (isset($href))
75 75
 			$this->setProperty("href", $href);
76 76
 		return $this;
77 77
 	}
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
84 84
 	 */
85 85
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
86
-		if(\is_array($this->content) && JArray::isAssociative($this->content))
87
-			$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
86
+		if (\is_array($this->content) && JArray::isAssociative($this->content))
87
+			$this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]);
88 88
 		return parent::compile($js, $view);
89 89
 	}
90 90
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlStepItem.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,53 +8,53 @@
 block discarded – undo
8 8
 class HtmlStepItem extends HtmlAbsractItem {
9 9
 
10 10
 	public function __construct($identifier, $content) {
11
-		parent::__construct($identifier,"step",$content);
11
+		parent::__construct($identifier, "step", $content);
12 12
 	}
13
-	protected function initContent($content){
14
-		if(\is_array($content)){
15
-			if(JArray::isAssociative($content)===false){
13
+	protected function initContent($content) {
14
+		if (\is_array($content)) {
15
+			if (JArray::isAssociative($content)===false) {
16 16
 				$icon=@$content[0];
17 17
 				$title=@$content[1];
18 18
 				$desc=@$content[2];
19 19
 				$status=@$content[3];
20
-			}else{
20
+			} else {
21 21
 				$icon=@$content["icon"];
22 22
 				$title=@$content["title"];
23 23
 				$desc=@$content["description"];
24 24
 				$status=@$content["status"];
25 25
 			}
26
-			if(isset($icon)){
26
+			if (isset($icon)) {
27 27
 				$this->setIcon($icon);
28 28
 			}
29
-			if(isset($status)){
29
+			if (isset($status)) {
30 30
 				$this->setStatus($status);
31 31
 			}
32
-			if(isset($title)){
33
-				$this->setTitle($title,$desc);
32
+			if (isset($title)) {
33
+				$this->setTitle($title, $desc);
34 34
 			}
35
-		}else{
35
+		} else {
36 36
 			$this->setContent($content);
37 37
 		}
38 38
 	}
39 39
 
40
-	public function setActive($value=true){
41
-		if($value)
40
+	public function setActive($value=true) {
41
+		if ($value)
42 42
 			$this->setStatus(StepStatus::ACTIVE);
43 43
 		else
44 44
 			$this->setStatus(StepStatus::NONE);
45 45
 		return $this;
46 46
 	}
47 47
 
48
-	public function setCompleted(){
49
-		$this->removePropertyValues("class", [StepStatus::COMPLETED,StepStatus::DISABLED]);
48
+	public function setCompleted() {
49
+		$this->removePropertyValues("class", [StepStatus::COMPLETED, StepStatus::DISABLED]);
50 50
 		return $this->setStatus(StepStatus::COMPLETED);
51 51
 	}
52 52
 
53
-	public function setStatus($status){
53
+	public function setStatus($status) {
54 54
 		return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants());
55 55
 	}
56 56
 
57
-	public function removeStatus(){
57
+	public function removeStatus() {
58 58
 		$this->removePropertyValues("class", StepStatus::getConstants());
59 59
 	}
60 60
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlStep.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 use Ajax\common\html\HtmlDoubleElement;
10 10
 use Ajax\semantic\html\base\constants\Side;
11 11
 
12
-class HtmlStep extends HtmlSemCollection{
12
+class HtmlStep extends HtmlSemCollection {
13 13
 	protected $_activeStep;
14 14
 	protected $_startStep;
15 15
 
16
-	public function __construct( $identifier,$steps=array()){
17
-		parent::__construct( $identifier,"div", "ui steps");
16
+	public function __construct($identifier, $steps=array()) {
17
+		parent::__construct($identifier, "div", "ui steps");
18 18
 		$this->addItems($steps);
19 19
 	}
20 20
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
25 25
 	 */
26 26
 	protected function createItem($value) {
27
-		$itemO=new HtmlStepItem("item-".\sizeof($this->content),$value);
27
+		$itemO=new HtmlStepItem("item-".\sizeof($this->content), $value);
28 28
 		return $itemO;
29 29
 	}
30 30
 
@@ -32,50 +32,50 @@  discard block
 block discarded – undo
32 32
 	 * @param string|array $step
33 33
 	 * @return HtmlStepItem
34 34
 	 */
35
-	public function addStep($step){
35
+	public function addStep($step) {
36 36
 		return $this->addItem($step);
37 37
 	}
38 38
 
39
-	public function setOrdered(){
39
+	public function setOrdered() {
40 40
 		return $this->addToProperty("class", "ordered");
41 41
 	}
42 42
 
43
-	public function isOrdered(){
43
+	public function isOrdered() {
44 44
 		return $this->propertyContains("class", "ordered");
45 45
 	}
46 46
 
47
-	public function setVertical(){
47
+	public function setVertical() {
48 48
 		return $this->addToProperty("class", "vertical");
49 49
 	}
50 50
 
51
-	protected function defineActiveStep(){
51
+	protected function defineActiveStep() {
52 52
 		$activestep=$this->_activeStep;
53 53
 		$count=$this->count();
54
-		if(!$this->isOrdered()){
55
-			for($i=$this->_startStep;$i<$count;$i++){
54
+		if (!$this->isOrdered()) {
55
+			for ($i=$this->_startStep; $i<$count; $i++) {
56 56
 				$step=$this->content[$i];
57 57
 				$step->removeStatus();
58
-				if($i<$activestep)
58
+				if ($i<$activestep)
59 59
 					$step->setCompleted();
60 60
 				elseif ($i===$activestep)
61 61
 					$step->setActive();
62 62
 				else
63 63
 					$step->setDisabled();
64 64
 			}
65
-		}else{
66
-			foreach ($this->content as $step){
65
+		} else {
66
+			foreach ($this->content as $step) {
67 67
 				$step->removeStatus();
68 68
 			}
69
-			if($activestep<$count)
69
+			if ($activestep<$count)
70 70
 				$this->content[$activestep]->setActive();
71 71
 		}
72 72
 		return $this;
73 73
 	}
74 74
 
75 75
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
76
-		if(isset($this->_activeStep) && \is_numeric($this->_activeStep))
76
+		if (isset($this->_activeStep) && \is_numeric($this->_activeStep))
77 77
 			$this->defineActiveStep();
78
-		return parent::compile($js,$view);
78
+		return parent::compile($js, $view);
79 79
 	}
80 80
 
81 81
 	public function setActiveStep($_activeStep) {
@@ -83,15 +83,15 @@  discard block
 block discarded – undo
83 83
 		return $this;
84 84
 	}
85 85
 
86
-	public function setAttached($side="",HtmlDoubleElement $toElement=NULL){
87
-		if(isset($toElement)){
88
-			$toElement->addToPropertyCtrl("class", "attached",array("attached"));
86
+	public function setAttached($side="", HtmlDoubleElement $toElement=NULL) {
87
+		if (isset($toElement)) {
88
+			$toElement->addToPropertyCtrl("class", "attached", array("attached"));
89 89
 		}
90
-		return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
90
+		return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached"));
91 91
 	}
92 92
 
93
-	public function asLink(){
94
-		foreach ($this->content as $step){
93
+	public function asLink() {
94
+		foreach ($this->content as $step) {
95 95
 			$step->asLink();
96 96
 		}
97 97
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlListItem.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@  discard block
 block discarded – undo
9 9
 	protected $image;
10 10
 
11 11
 	public function __construct($identifier, $content=NULL) {
12
-		parent::__construct($identifier,"item",$content);
12
+		parent::__construct($identifier, "item", $content);
13 13
 	}
14
-	protected function initContent($content){
15
-		if(\is_array($content)){
16
-			if(JArray::isAssociative($content)===false){
14
+	protected function initContent($content) {
15
+		if (\is_array($content)) {
16
+			if (JArray::isAssociative($content)===false) {
17 17
 				$icon=@$content[0];
18 18
 				$title=@$content[1];
19 19
 				$desc=@$content[2];
20
-			}else{
20
+			} else {
21 21
 				$icon=@$content["icon"];
22 22
 				$image=@$content["image"];
23 23
 				$title=@$content["title"];
@@ -25,38 +25,38 @@  discard block
 block discarded – undo
25 25
 				$desc=@$content["description"];
26 26
 				$items=@$content["items"];
27 27
 			}
28
-			if(isset($icon)){
28
+			if (isset($icon)) {
29 29
 				$this->setIcon($icon);
30 30
 			}
31
-			if(isset($image)){
31
+			if (isset($image)) {
32 32
 				$this->setImage($image);
33 33
 			}
34
-			if(isset($title)){
35
-				$this->setTitle($title,$desc);
36
-			}elseif (isset($header)){
37
-				$this->setTitle($header,$desc,"header");
34
+			if (isset($title)) {
35
+				$this->setTitle($title, $desc);
36
+			}elseif (isset($header)) {
37
+				$this->setTitle($header, $desc, "header");
38 38
 			}
39
-			if(isset($items)){
39
+			if (isset($items)) {
40 40
 				$this->addList($items);
41 41
 			}
42
-		}else{
42
+		} else {
43 43
 			$this->setContent($content);
44 44
 		}
45 45
 	}
46
-	public function addList($items=array(),$ordered=false) {
46
+	public function addList($items=array(), $ordered=false) {
47 47
 		$list=new HtmlList("", $items);
48
-		if($ordered)
48
+		if ($ordered)
49 49
 			$list->setOrdered();
50 50
 		$list->setClass("list");
51 51
 		$this->content["list"]=$list;
52 52
 		return $list;
53 53
 	}
54 54
 
55
-	public function getList(){
55
+	public function getList() {
56 56
 		return $this->content["list"];
57 57
 	}
58 58
 
59
-	public function getItem($index){
59
+	public function getItem($index) {
60 60
 		return $this->getList()->getItem($index);
61 61
 	}
62 62
 }
Please login to merge, or discard this patch.