Completed
Push — master ( 5f7aee...f5f495 )
by Jean-Christophe
03:30
created
Ajax/semantic/widgets/datatable/HasCheckboxesTrait.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -11,29 +11,29 @@  discard block
 block discarded – undo
11 11
  * @property string identifier
12 12
  * @property array $_compileParts
13 13
  */
14
-trait HasCheckboxesTrait{
14
+trait HasCheckboxesTrait {
15 15
 	protected $_hasCheckboxes;
16 16
 	protected $_hasCheckedMessage=false;
17 17
 	protected $_checkedMessage;
18 18
 	protected $_checkedClass;
19 19
 
20
-	abstract public function addInToolbar($element,$callback=NULL);
20
+	abstract public function addInToolbar($element, $callback=NULL);
21 21
 
22
-	protected function _runCheckboxes(JsUtils $js){
22
+	protected function _runCheckboxes(JsUtils $js) {
23 23
 		$js->execOn("change", "#".$this->identifier." [name='selection[]']:not(._jsonArrayChecked)", $this->_getCheckedChange($js));
24
-		if(\sizeof($this->_compileParts)<3){
25
-			$js->trigger("#".$this->identifier." [name='selection[]']","change",true);
24
+		if (\sizeof($this->_compileParts)<3) {
25
+			$js->trigger("#".$this->identifier." [name='selection[]']", "change", true);
26 26
 		}
27 27
 	}
28 28
 
29
-	protected function _getCheckedChange(JsUtils $js=NULL){
29
+	protected function _getCheckedChange(JsUtils $js=NULL) {
30 30
 		$callback="var \$parentCheckbox=\$('#ck-main-ck-{$this->identifier}'),\$checkbox=\$('#{$this->identifier} [name=\"selection[]\"]'),allChecked=true,allUnchecked=true;
31 31
 				\$checkbox.each(function() {if($(this).prop('checked')){allUnchecked = false;}else{allChecked = false;}});
32 32
 				if(allChecked) {\$parentCheckbox.checkbox('set checked');}else if(allUnchecked){\$parentCheckbox.checkbox('set unchecked');}else{\$parentCheckbox.checkbox('set indeterminate');};".$this->_getCheckedMessageCall($js);
33 33
 		return $callback;
34 34
 	}
35 35
 
36
-	protected function _getCheckedMessageFunction(){
36
+	protected function _getCheckedMessageFunction() {
37 37
 		$msg=$this->getCheckedMessage();
38 38
 		$checkedMessageFunction="$('#{$this->identifier}').bind('updateChecked',function() {var msg='".$msg[0]."',count=\$('#{$this->identifier} [name=\"selection[]\"]:checked').length,all=\$('#{$this->identifier} [name=\"selection[]\"]').length;
39 39
 		if(count==1) msg='".$msg[1]."';
@@ -43,23 +43,23 @@  discard block
 block discarded – undo
43 43
 		return $checkedMessageFunction;
44 44
 	}
45 45
 
46
-	protected function _getCheckedMessageCall(JsUtils $js=NULL){
46
+	protected function _getCheckedMessageCall(JsUtils $js=NULL) {
47 47
 		$checkedMessageCall="";
48
-		if($this->_hasCheckedMessage){
48
+		if ($this->_hasCheckedMessage) {
49 49
 			$checkedMessageCall="$('#{$this->identifier}').trigger('updateChecked');";
50
-			if(isset($this->_checkedClass)){
50
+			if (isset($this->_checkedClass)) {
51 51
 				$checkedMessageCall.="$(this).closest('tr').toggleClass('".$this->_checkedClass."',$(this).prop('checked'));";
52 52
 			}
53
-			if(isset($js))
54
-				$js->exec($this->_getCheckedMessageFunction(),true);
53
+			if (isset($js))
54
+				$js->exec($this->_getCheckedMessageFunction(), true);
55 55
 		}
56 56
 		return $checkedMessageCall;
57 57
 	}
58 58
 
59
-	protected function _generateMainCheckbox(&$captions){
60
-		$ck=new HtmlCheckbox("main-ck-".$this->identifier,"");
59
+	protected function _generateMainCheckbox(&$captions) {
60
+		$ck=new HtmlCheckbox("main-ck-".$this->identifier, "");
61 61
 		$checkedMessageCall="";
62
-		if($this->_hasCheckedMessage)
62
+		if ($this->_hasCheckedMessage)
63 63
 			$checkedMessageCall="$('#{$this->identifier}').trigger('updateChecked');";
64 64
 
65 65
 			$ck->setOnChecked($this->_setAllChecked("true").$checkedMessageCall);
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
 			\array_unshift($captions, $ck);
68 68
 	}
69 69
 
70
-	protected function _setAllChecked($checked){
70
+	protected function _setAllChecked($checked) {
71 71
 		$result="$('#".$this->identifier." [name=%quote%selection[]%quote%]:not(._jsonArrayChecked)').prop('checked',".$checked.");";
72
-		if(isset($this->_checkedClass)){
72
+		if (isset($this->_checkedClass)) {
73 73
 			$result.="$('#".$this->identifier." tr').toggleClass('".$this->_checkedClass."',".$checked.");";
74 74
 		}
75 75
 		return $result;
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 	}
86 86
 
87 87
 	protected function getCheckedMessage() {
88
-		$result= $this->_checkedMessage;
89
-		if(!isset($result)){
90
-			$result=[0=>"none selected",1=>"one item selected","other"=>"{count} items selected"];
88
+		$result=$this->_checkedMessage;
89
+		if (!isset($result)) {
90
+			$result=[0=>"none selected", 1=>"one item selected", "other"=>"{count} items selected"];
91 91
 		}
92 92
 		return $result;
93 93
 	}
@@ -107,14 +107,14 @@  discard block
 block discarded – undo
107 107
 	 * @param array $checkedMessage
108 108
 	 * @param callable $callback
109 109
 	 */
110
-	public function addCountCheckedInToolbar(array $checkedMessage=null,$callback=null){
111
-		if(isset($checkedMessage))
110
+	public function addCountCheckedInToolbar(array $checkedMessage=null, $callback=null) {
111
+		if (isset($checkedMessage))
112 112
 			$this->_checkedMessage=$checkedMessage;
113 113
 			$checkedMessage=$this->getCheckedMessage();
114 114
 			$this->_hasCheckboxes=true;
115 115
 			$this->_hasCheckedMessage=true;
116
-			$element=new HtmlLabel("checked-count-".$this->identifier,$checkedMessage[0]);
117
-			$this->addInToolbar($element,$callback);
116
+			$element=new HtmlLabel("checked-count-".$this->identifier, $checkedMessage[0]);
117
+			$this->addInToolbar($element, $callback);
118 118
 	}
119 119
 
120 120
 	public function setCheckedClass($_checkedClass) {
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlIcon.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @return \Ajax\semantic\html\HtmlIcon
69 69
 	 */
70 70
 	public function setFlipped($sens="horizontally") {
71
-		return $this->addToProperty("class", "flipped " . $sens);
71
+		return $this->addToProperty("class", "flipped ".$sens);
72 72
 	}
73 73
 
74 74
 	/**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @return \Ajax\semantic\html\HtmlIcon
78 78
 	 */
79 79
 	public function setRotated($sens="clockwise") {
80
-		return $this->addToProperty("class", "rotated " . $sens);
80
+		return $this->addToProperty("class", "rotated ".$sens);
81 81
 	}
82 82
 
83 83
 	/**
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 	 * @param string target
87 87
 	 * @return HtmlIcon
88 88
 	 */
89
-	public function asLink($href=NULL,$target=NULL) {
89
+	public function asLink($href=NULL, $target=NULL) {
90 90
 		if (isset($href)) {
91 91
 			$_target="";
92
-			if(isset($target))
92
+			if (isset($target))
93 93
 				$_target="target='{$target}'";
94
-			$this->wrap("<a href='" . $href . "' {$_target}>", "</a>");
94
+			$this->wrap("<a href='".$href."' {$_target}>", "</a>");
95 95
 		}
96 96
 		return $this->addToProperty("class", "link");
97 97
 	}
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
 	 */
108 108
 	public function setBordered($inverted=false) {
109 109
 		$invertedStr="";
110
-		if ($inverted !== false)
110
+		if ($inverted!==false)
111 111
 			$invertedStr=" inverted";
112
-		return $this->addToProperty("class", "bordered" . $invertedStr);
112
+		return $this->addToProperty("class", "bordered".$invertedStr);
113 113
 	}
114 114
 
115 115
 	/**
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
 	}
122 122
 
123 123
 	public function addLabel($label, $before=false, $icon=NULL) {
124
-		if($before)
124
+		if ($before)
125 125
 			$this->wrap($label);
126 126
 		else
127 127
 			$this->wrap("", $label);
128
-		if(isset($icon))
128
+		if (isset($icon))
129 129
 			$this->addToIcon($icon);
130 130
 		return $this;
131 131
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButton.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	public function setFocusable($value=true) {
59
-		if ($value === true)
59
+		if ($value===true)
60 60
 			$this->setProperty("tabindex", "0");
61 61
 		else {
62 62
 			$this->removeProperty("tabindex");
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
 
67 67
 	public function setAnimated($content, $animation="") {
68 68
 		$this->setTagName("div");
69
-		$this->addToProperty("class", "animated " . $animation);
70
-		$visible=new HtmlSemDoubleElement("visible-" . $this->identifier, "div");
69
+		$this->addToProperty("class", "animated ".$animation);
70
+		$visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div");
71 71
 		$visible->setClass("visible content");
72 72
 		$visible->setContent($this->content);
73
-		$hidden=new HtmlSemDoubleElement("hidden-" . $this->identifier, "div");
73
+		$hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div");
74 74
 		$hidden->setClass("hidden content");
75 75
 		$hidden->setContent($content);
76
-		$this->content=array ($visible,$hidden );
76
+		$this->content=array($visible, $hidden);
77 77
 		return $hidden;
78 78
 	}
79 79
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	public function asIcon($icon) {
86 86
 		$iconO=$icon;
87 87
 		if (\is_string($icon)) {
88
-			$iconO=new HtmlIcon("icon-" . $this->identifier, $icon);
88
+			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
89 89
 		}
90 90
 		$this->addToProperty("class", "icon");
91 91
 		$this->content=$iconO;
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
 	public function addLabel($label, $before=false, $icon=NULL) {
108 108
 		$this->tagName="div";
109 109
 		$this->addToProperty("class", "labeled");
110
-		$this->content=new HtmlButton("button-" . $this->identifier, $this->content);
110
+		$this->content=new HtmlButton("button-".$this->identifier, $this->content);
111 111
 		$this->content->setTagName("div");
112
-		$label=new HtmlLabel("label-" . $this->identifier, $label, $icon,"a");
112
+		$label=new HtmlLabel("label-".$this->identifier, $label, $icon, "a");
113 113
 		$label->setBasic();
114 114
 		$this->addContent($label, $before);
115 115
 		return $label;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function fromArray($array) {
123 123
 		$array=parent::fromArray($array);
124
-		foreach ( $array as $key => $value ) {
124
+		foreach ($array as $key => $value) {
125 125
 			$this->setProperty($key, $value);
126 126
 		}
127 127
 		return $array;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 * @return HtmlButton
185 185
 	 */
186 186
 	public static function social($identifier, $social, $value=NULL) {
187
-		if ($value === NULL)
187
+		if ($value===NULL)
188 188
 			$value=\ucfirst($social);
189 189
 		$return=new HtmlButton($identifier, $value);
190 190
 		$return->addIcon($social);
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	 * {@inheritDoc}
222 222
 	 * @see HtmlSemDoubleElement::asLink()
223 223
 	 */
224
-	public function asLink($href=NULL,$target=NULL) {
225
-		$lnk=new HtmlLink("lnk-".$this->identifier,$href,$this->content,$target);
224
+	public function asLink($href=NULL, $target=NULL) {
225
+		$lnk=new HtmlLink("lnk-".$this->identifier, $href, $this->content, $target);
226 226
 		$this->content=$lnk;
227 227
 		return $this;
228 228
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/base/HtmlSemDoubleElement.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	use BaseTrait;
23 23
 	protected $_popup=NULL;
24 24
 	protected $_dimmer=NULL;
25
-	protected $_params=array ();
25
+	protected $_params=array();
26 26
 
27 27
 
28 28
 	public function __construct($identifier, $tagName="p", $baseClass="ui", $content=NULL) {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 * @return HtmlDimmer
79 79
 	 */
80 80
 	public function addDimmer($params=array(), $content=NULL) {
81
-		$dimmer=new HtmlDimmer("dimmer-" . $this->identifier, $content);
81
+		$dimmer=new HtmlDimmer("dimmer-".$this->identifier, $content);
82 82
 		$dimmer->setParams($params);
83 83
 		$dimmer->setContainer($this);
84 84
 		$this->addContent($dimmer);
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function addLabel($label, $before=false, $icon=NULL) {
96 96
 		$labelO=$label;
97
-		if (\is_object($label) === false) {
98
-			$labelO=new HtmlLabel("label-" . $this->identifier, $label);
97
+		if (\is_object($label)===false) {
98
+			$labelO=new HtmlLabel("label-".$this->identifier, $label);
99 99
 			if (isset($icon))
100 100
 				$labelO->addIcon($icon);
101 101
 		} else {
102
-			$labelO->addToPropertyCtrl("class", "label", array ("label" ));
102
+			$labelO->addToPropertyCtrl("class", "label", array("label"));
103 103
 		}
104 104
 		$this->addContent($labelO, $before);
105 105
 		return $labelO;
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 	 * @param string $icon
114 114
 	 * @return HtmlSemDoubleElement
115 115
 	 */
116
-	public function attachLabel($label,$side=Side::TOP,$direction=Direction::NONE,$icon=NULL){
117
-		$label=$this->addLabel($label,true,$icon);
118
-		$label->setAttached($side,$direction);
116
+	public function attachLabel($label, $side=Side::TOP, $direction=Direction::NONE, $icon=NULL) {
117
+		$label=$this->addLabel($label, true, $icon);
118
+		$label->setAttached($side, $direction);
119 119
 		return $this;
120 120
 	}
121 121
 
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
 	 * Transforms the element into a link
124 124
 	 * @return HtmlSemDoubleElement
125 125
 	 */
126
-	public function asLink($href=NULL,$target=NULL) {
126
+	public function asLink($href=NULL, $target=NULL) {
127 127
 		if (isset($href))
128 128
 			$this->setProperty("href", $href);
129
-		if(isset($target))
129
+		if (isset($target))
130 130
 			$this->setProperty("target", $target);
131 131
 		return $this->setTagName("a");
132 132
 	}
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function jsShowDimmer($show=true) {
140 140
 		$status="hide";
141
-		if ($show === true)
141
+		if ($show===true)
142 142
 			$status="show";
143
-		return '$("#.' . $this->identifier . ').dimmer("' . $status . '");';
143
+		return '$("#.'.$this->identifier.').dimmer("'.$status.'");';
144 144
 	}
145 145
 
146 146
 	/**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @see HtmlDoubleElement::run()
159 159
 	 */
160 160
 	public function run(JsUtils $js) {
161
-		$this->_bsComponent=$js->semantic()->generic("#" . $this->identifier);
161
+		$this->_bsComponent=$js->semantic()->generic("#".$this->identifier);
162 162
 		parent::run($js);
163 163
 		$this->addEventsOnRun($js);
164 164
 		if (isset($this->_popup)) {
Please login to merge, or discard this patch.
Ajax/semantic/html/views/HtmlCard.php 1 patch
Spacing   +14 added lines, -14 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 boolean $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 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
-	public function asLink($href="",$target=NULL) {
139
+	public function asLink($href="", $target=NULL) {
140 140
 		$this->addToProperty("class", "link");
141
-		if ($href !== "") {
141
+		if ($href!=="") {
142 142
 			$this->setProperty("href", $href);
143 143
 			if (isset($target))
144 144
 				$this->setProperty("target", $target);
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataform/DataForm.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -19,80 +19,80 @@  discard block
 block discarded – undo
19 19
 class DataForm extends Widget {
20 20
 
21 21
 	public function __construct($identifier, $modelInstance=NULL) {
22
-		parent::__construct($identifier, null,$modelInstance);
22
+		parent::__construct($identifier, null, $modelInstance);
23 23
 		$this->_form=new HtmlForm($identifier);
24 24
 		$this->_init(new FormInstanceViewer($identifier), "form", $this->_form, true);
25 25
 	}
26 26
 
27
-	protected function _getFieldIdentifier($prefix,$name=""){
27
+	protected function _getFieldIdentifier($prefix, $name="") {
28 28
 		return $this->identifier."-{$name}-".$this->_instanceViewer->getIdentifier();
29 29
 	}
30 30
 
31
-	public function compile(JsUtils $js=NULL,&$view=NULL){
32
-		if(!$this->_generated){
31
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
32
+		if (!$this->_generated) {
33 33
 			$this->_instanceViewer->setInstance($this->_modelInstance);
34 34
 
35 35
 			$form=$this->content["form"];
36 36
 			$this->_generateContent($form);
37 37
 
38
-			if(isset($this->_toolbar)){
38
+			if (isset($this->_toolbar)) {
39 39
 				$this->_setToolbarPosition($form);
40 40
 			}
41
-			$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE,"form",PositionInTable::AFTERTABLE]);
41
+			$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE, "form", PositionInTable::AFTERTABLE]);
42 42
 			$this->_generated=true;
43 43
 		}
44
-		return parent::compile($js,$view);
44
+		return parent::compile($js, $view);
45 45
 	}
46 46
 
47 47
 	/**
48 48
 	 * @param HtmlForm $form
49 49
 	 */
50
-	protected function _generateContent($form){
51
-		$values= $this->_instanceViewer->getValues();
50
+	protected function _generateContent($form) {
51
+		$values=$this->_instanceViewer->getValues();
52 52
 		$count=$this->_instanceViewer->count();
53 53
 		$separators=$this->_instanceViewer->getSeparators();
54 54
 		$headers=$this->_instanceViewer->getHeaders();
55 55
 		$wrappers=$this->_instanceViewer->getWrappers();
56 56
 		\sort($separators);
57 57
 		$size=\sizeof($separators);
58
-		if($size===1){
59
-			foreach ($values as $v){
58
+		if ($size===1) {
59
+			foreach ($values as $v) {
60 60
 				$form->addField($v);
61 61
 			}
62
-		}else{
62
+		} else {
63 63
 			$separators[]=$count;
64
-			for($i=0;$i<$size;$i++){
64
+			for ($i=0; $i<$size; $i++) {
65 65
 				$this->_generateFields($form, $values, $headers, $separators[$i], $separators[$i+1], $wrappers);
66 66
 			}
67 67
 		}
68 68
 	}
69 69
 
70
-	protected function _generateFields($form,$values,$headers,$sepFirst,$sepLast,$wrappers){
70
+	protected function _generateFields($form, $values, $headers, $sepFirst, $sepLast, $wrappers) {
71 71
 		$wrapper=null;
72
-		$fields=\array_slice($values, $sepFirst+1,$sepLast-$sepFirst);
73
-		if(isset($headers[$sepFirst+1]))
74
-			$form->addHeader($headers[$sepFirst+1],4,true);
75
-			if(isset($wrappers[$sepFirst+1])){
72
+		$fields=\array_slice($values, $sepFirst+1, $sepLast-$sepFirst);
73
+		if (isset($headers[$sepFirst+1]))
74
+			$form->addHeader($headers[$sepFirst+1], 4, true);
75
+			if (isset($wrappers[$sepFirst+1])) {
76 76
 				$wrapper=$wrappers[$sepFirst+1];
77 77
 			}
78
-			if(\sizeof($fields)===1){
78
+			if (\sizeof($fields)===1) {
79 79
 				$added=$form->addField($fields[0]);
80
-			}elseif(\sizeof($fields)>1){
80
+			}elseif (\sizeof($fields)>1) {
81 81
 				$added=$form->addFields($fields);
82 82
 			}
83
-			if(isset($wrapper))
84
-				$added->wrap($wrapper[0],$wrapper[1]);
83
+			if (isset($wrapper))
84
+				$added->wrap($wrapper[0], $wrapper[1]);
85 85
 	}
86 86
 
87 87
 	/**
88 88
 	 * {@inheritDoc}
89 89
 	 * @see \Ajax\common\Widget::getForm()
90 90
 	 */
91
-	public function getForm(){
91
+	public function getForm() {
92 92
 		return $this->content["form"];
93 93
 	}
94 94
 
95
-	public function addSeparatorAfter($fieldNum){
95
+	public function addSeparatorAfter($fieldNum) {
96 96
 		$fieldNum=$this->_getIndex($fieldNum);
97 97
 		$this->_instanceViewer->addSeparatorAfter($fieldNum);
98 98
 		return $this;
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
 		return $this;
108 108
 	}
109 109
 
110
-	public function fieldAsReset($index,$cssStyle=NULL,$attributes=NULL){
111
-		return $this->_fieldAs(function($id,$name,$value,$caption) use ($cssStyle){
112
-			$button=new HtmlButton($id,$value,$cssStyle);
110
+	public function fieldAsReset($index, $cssStyle=NULL, $attributes=NULL) {
111
+		return $this->_fieldAs(function($id, $name, $value, $caption) use ($cssStyle){
112
+			$button=new HtmlButton($id, $value, $cssStyle);
113 113
 			$button->setProperty("type", "reset");
114 114
 			return $button;
115
-		}, $index,$attributes);
115
+		}, $index, $attributes);
116 116
 	}
117 117
 
118 118
 	/**
@@ -131,19 +131,19 @@  discard block
 block discarded – undo
131 131
 		$this->content[$this->_toolbarPosition]=$this->_toolbar;
132 132
 	}
133 133
 
134
-	public function addDividerBefore($index,$title){
134
+	public function addDividerBefore($index, $title) {
135 135
 		$index=$this->_getIndex($index);
136 136
 		$this->_instanceViewer->addHeaderDividerBefore($index, $title);
137 137
 		return $this;
138 138
 	}
139 139
 
140
-	public function addWrapper($index,$contentBefore,$contentAfter=null){
140
+	public function addWrapper($index, $contentBefore, $contentAfter=null) {
141 141
 		$index=$this->_getIndex($index);
142
-		$this->_instanceViewer->addWrapper($index, $contentBefore,$contentAfter);
142
+		$this->_instanceViewer->addWrapper($index, $contentBefore, $contentAfter);
143 143
 		return $this;
144 144
 	}
145 145
 
146
-	public function run(JsUtils $js){
146
+	public function run(JsUtils $js) {
147 147
 		return parent::run($js);
148 148
 	}
149 149
 }
150 150
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/components/Checkbox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 		$this->params["onUnchecked"]="%function(){".$value."}%";
21 21
 	}
22 22
 
23
-	public function setOnChange($value){
23
+	public function setOnChange($value) {
24 24
 		$this->params["onChange"]="%function(){".$value."}%";
25 25
 	}
26 26
 	//TODO other events implementation
Please login to merge, or discard this patch.
Ajax/common/components/SimpleComponent.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,28 +19,28 @@  discard block
 block discarded – undo
19 19
 
20 20
 	public function __construct(JsUtils $js=NULL) {
21 21
 		parent::__construct($js);
22
-		$this->events=array ();
22
+		$this->events=array();
23 23
 	}
24 24
 
25 25
 	protected function compileEvents() {
26
-		foreach ( $this->events as $event => $jsCode ) {
26
+		foreach ($this->events as $event => $jsCode) {
27 27
 			$itemSelector=JString::getValueBetween($event);
28 28
 			//echo $itemSelector.":::".$jsCode."<br>";
29
-			if($event=="execute"){
29
+			if ($event=="execute") {
30 30
 				$this->jquery_code_for_compile []=$jsCode;
31
-			}else if($event=="beforeExecute"){
31
+			} else if ($event=="beforeExecute") {
32 32
 				\array_unshift($this->jquery_code_for_compile, $jsCode);
33
-			}else{
33
+			} else {
34 34
 				$selector=$this->_createSelector($itemSelector, $this->attachTo);
35 35
 				$this->jquery_code_for_compile []="$( \"".$selector."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
36 36
 			}
37 37
 		}
38 38
 	}
39 39
 
40
-	protected function _createSelector($itemSelector,$selector){
41
-		if(!isset($itemSelector))
40
+	protected function _createSelector($itemSelector, $selector) {
41
+		if (!isset($itemSelector))
42 42
 			$itemSelector=$this->itemSelector;
43
-		if(isset($itemSelector) && $itemSelector!=="")
43
+		if (isset($itemSelector) && $itemSelector!=="")
44 44
 			$selector.=" ".$itemSelector;
45 45
 		return $selector;
46 46
 	}
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$result=implode("\n", $this->jquery_code_for_compile);
50 50
 		$result=str_ireplace("\"%", "", $result);
51 51
 		$result=str_ireplace("%\"", "", $result);
52
-		$result=str_replace(array (
52
+		$result=str_replace(array(
53 53
 				"\\n",
54 54
 				"\\r",
55 55
 				"\\t"
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 	public function getScript() {
61 61
 		$allParams=$this->params;
62
-		$this->jquery_code_for_compile=array ();
62
+		$this->jquery_code_for_compile=array();
63 63
 		$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");";
64 64
 		$this->compileEvents();
65 65
 		return $this->compileJQueryCode();
Please login to merge, or discard this patch.
Ajax/service/JString.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -2,63 +2,63 @@
 block discarded – undo
2 2
 namespace Ajax\service;
3 3
 class JString {
4 4
 
5
-	public static function contains($hay,$needle){
6
-		return strpos($hay, $needle) !== false;
5
+	public static function contains($hay, $needle) {
6
+		return strpos($hay, $needle)!==false;
7 7
 	}
8 8
 	public static function startswith($hay, $needle) {
9
-		return substr($hay, 0, strlen($needle)) === $needle;
9
+		return substr($hay, 0, strlen($needle))===$needle;
10 10
 	}
11 11
 
12 12
 	public static function endswith($hay, $needle) {
13
-		return substr($hay, -strlen($needle)) === $needle;
13
+		return substr($hay, -strlen($needle))===$needle;
14 14
 	}
15 15
 
16
-	public static function isNull($s){
16
+	public static function isNull($s) {
17 17
 		return (!isset($s) || NULL===$s || ""===$s);
18 18
 	}
19
-	public static function isNotNull($s){
19
+	public static function isNotNull($s) {
20 20
 		return (isset($s) && NULL!==$s && ""!==$s);
21 21
 	}
22 22
 
23
-	public static function isBoolean($value){
23
+	public static function isBoolean($value) {
24 24
 		return \is_bool($value) || $value==1 || $value==0;
25 25
 	}
26 26
 
27
-	public static function isBooleanTrue($value){
27
+	public static function isBooleanTrue($value) {
28 28
 		return $value==1 || $value;
29 29
 	}
30 30
 
31
-	public static function isBooleanFalse($value){
31
+	public static function isBooleanFalse($value) {
32 32
 		return $value==0 || !$value;
33 33
 	}
34 34
 
35
-	public static function camelCaseToSeparated($input,$separator=" "){
35
+	public static function camelCaseToSeparated($input, $separator=" ") {
36 36
 		return strtolower(preg_replace('/(?<!^)[A-Z]/', $separator.'$0', $input));
37 37
 	}
38 38
 
39
-	public static function replaceAtFirst($subject,$from, $to){
40
-		$from = '/\A'.preg_quote($from, '/').'/';
39
+	public static function replaceAtFirst($subject, $from, $to) {
40
+		$from='/\A'.preg_quote($from, '/').'/';
41 41
 		return \preg_replace($from, $to, $subject, 1);
42 42
 	}
43 43
 
44
-	public static function replaceAtLast($subject,$from, $to){
45
-		$from = '/'.preg_quote($from, '/').'\z/';
44
+	public static function replaceAtLast($subject, $from, $to) {
45
+		$from='/'.preg_quote($from, '/').'\z/';
46 46
 		return \preg_replace($from, $to, $subject, 1);
47 47
 	}
48 48
 
49
-	public static function replaceAtFirstAndLast($subject,$fromFirst,$toFirst,$fromLast,$toLast){
49
+	public static function replaceAtFirstAndLast($subject, $fromFirst, $toFirst, $fromLast, $toLast) {
50 50
 		$s=self::replaceAtFirst($subject, $fromFirst, $toFirst);
51 51
 		return self::replaceAtLast($s, $fromLast, $toLast);
52 52
 	}
53 53
 
54
-	public static function getValueBetween(&$str,$before="{{",$after="}}"){
54
+	public static function getValueBetween(&$str, $before="{{", $after="}}") {
55 55
 		$matches=[];
56 56
 		$result=null;
57 57
 		$_before=\preg_quote($before);
58 58
 		$_after=\preg_quote($after);
59
-		if(\preg_match('/'.$_before.'(.*?)'.$_after.'/s', $str, $matches)===1){
59
+		if (\preg_match('/'.$_before.'(.*?)'.$_after.'/s', $str, $matches)===1) {
60 60
 			$result=$matches[1];
61
-			$str=\str_replace($before.$result.$after,"", $str);
61
+			$str=\str_replace($before.$result.$after, "", $str);
62 62
 		}
63 63
 		return $result;
64 64
 	}
Please login to merge, or discard this patch.