Completed
Push — master ( aa0ebb...030ef0 )
by Jean-Christophe
03:09
created
Ajax/semantic/html/collections/menus/HtmlPaginationMenu.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,20 +7,20 @@
 block discarded – undo
7 7
 
8 8
 use Ajax\semantic\html\elements\HtmlIcon;
9 9
 
10
-class HtmlPaginationMenu extends HtmlMenu{
10
+class HtmlPaginationMenu extends HtmlMenu {
11 11
 	private $_page;
12
-	public function __construct( $identifier, $items=array() ){
13
-		parent::__construct( $identifier,$items);
12
+	public function __construct($identifier, $items=array()) {
13
+		parent::__construct($identifier, $items);
14 14
 	}
15 15
 	/**
16 16
 	 * {@inheritDoc}
17 17
 	 * @see \Ajax\common\html\BaseHtml::compile()
18 18
 	 */
19
-	public function compile(JsUtils $js=NULL,&$view=NULL){
20
-		$this->insertItem(new HtmlIcon("", "left chevron"))->setProperty("data-page", \max([1,$this->_page-1]));
21
-		$this->addItem(new HtmlIcon("", "right chevron"))->setProperty("data-page", \min([\sizeof($this->content)-2,$this->_page+1]));
19
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
20
+		$this->insertItem(new HtmlIcon("", "left chevron"))->setProperty("data-page", \max([1, $this->_page-1]));
21
+		$this->addItem(new HtmlIcon("", "right chevron"))->setProperty("data-page", \min([\sizeof($this->content)-2, $this->_page+1]));
22 22
 		$this->asPagination();
23
-		return parent::compile($js,$view);
23
+		return parent::compile($js, $view);
24 24
 	}
25 25
 
26 26
 	public function setActiveItem($index) {
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlMenu.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 	 * @return \Ajax\semantic\html\collections\HtmlMenu
39 39
 	 */
40 40
 	public function setType($type="") {
41
-		return $this->addToPropertyCtrl("class", $type, array ("","item","text" ));
41
+		return $this->addToPropertyCtrl("class", $type, array("", "item", "text"));
42 42
 	}
43 43
 
44 44
 	public function setActiveItem($index) {
45 45
 		$item=$this->getItem($index);
46
-		if ($item !== null) {
46
+		if ($item!==null) {
47 47
 			$item->addToProperty("class", "active");
48 48
 		}
49 49
 		return $this;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 	private function getItemToInsert($item) {
53 53
 		if ($item instanceof HtmlInput || $item instanceof HtmlImg || $item instanceof HtmlIcon || $item instanceof HtmlButton || ($item instanceof HtmlDropdown && $this->propertyContains("class", "vertical")===false)) {
54
-			$itemO=new HtmlMenuItem("item-" . $this->identifier . "-" . \sizeof($this->content) , $item);
54
+			$itemO=new HtmlMenuItem("item-".$this->identifier."-".\sizeof($this->content), $item);
55 55
 			$item=$itemO;
56 56
 		}
57 57
 		return $item;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 	private function afterInsert($item) {
61 61
 		if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false)
62
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
62
+			$item->addToPropertyCtrl("class", "item", array("item"));
63 63
 		else {
64 64
 			$this->setSecondary();
65 65
 		}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	public function addItem($item) {
76 76
 		$number=$item;
77 77
 		$item=parent::addItem($this->getItemToInsert($item));
78
-		if(\is_int($number))
78
+		if (\is_int($number))
79 79
 			$item->setProperty("data-page", $number);
80 80
 		return $this->afterInsert($item);
81 81
 	}
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 
94 94
 	public function generateMenuAsItem($menu, $header=null) {
95 95
 		$count=$this->count();
96
-		$item=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "div");
96
+		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div");
97 97
 		if (isset($header)) {
98
-			$headerItem=new HtmlSemDoubleElement("item-header-" . $this->identifier . "-" . $count, "div", "header");
98
+			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header");
99 99
 			$headerItem->setContent($header);
100 100
 			$item->addContent($headerItem);
101 101
 			$this->_itemHeader=$headerItem;
102 102
 		}
103
-		if(\is_array($menu)){
104
-			$menu=new HtmlMenu("menu-" . $this->identifier . "-" . $count,$menu);
103
+		if (\is_array($menu)) {
104
+			$menu=new HtmlMenu("menu-".$this->identifier."-".$count, $menu);
105 105
 		}
106 106
 		$menu->setClass("menu");
107 107
 		$item->addContent($menu);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		$value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value);
117 117
 		$value->addContent(new HtmlIcon("", "dropdown"));
118 118
 		$value=$this->addItem($value);
119
-		$popup=new HtmlPopup($value, "popup-" . $this->identifier . "-" . $this->count(), $content);
119
+		$popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content);
120 120
 		$popup->setFlowing()->setPosition("bottom left")->setOn("click");
121 121
 		$this->wrap("", $popup);
122 122
 		return $popup;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	public function addDropdownAsItem($value, $items=NULL) {
126 126
 		$dd=$value;
127 127
 		if (\is_string($value)) {
128
-			$dd=new HtmlDropdown("dropdown-" . $this->identifier . "-" . $this->count(), $value, $items);
128
+			$dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items);
129 129
 		}
130 130
 		$this->addItem($dd);
131 131
 		return $dd;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
139 139
 	 */
140 140
 	protected function createItem($value) {
141
-		$itemO=new HtmlMenuItem($this->identifier."-item-" . \sizeof($this->content),"");
141
+		$itemO=new HtmlMenuItem($this->identifier."-item-".\sizeof($this->content), "");
142 142
 		$itemO->setTagName("a");
143 143
 		$itemO->setContent($value);
144 144
 		return $itemO;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	}
150 150
 
151 151
 	public function setSecondary($value=true) {
152
-		if($value)
152
+		if ($value)
153 153
 			$this->addToProperty("class", "secondary");
154 154
 		else
155 155
 			$this->removePropertyValue("class", "secondary");
@@ -157,28 +157,28 @@  discard block
 block discarded – undo
157 157
 	}
158 158
 
159 159
 	public function setVertical() {
160
-		return $this->addToPropertyCtrl("class", "vertical", array ("vertical" ));
160
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
161 161
 	}
162 162
 
163 163
 	public function setPosition($value="right") {
164
-		return $this->addToPropertyCtrl("class", $value, array ("right","left" ));
164
+		return $this->addToPropertyCtrl("class", $value, array("right", "left"));
165 165
 	}
166 166
 
167 167
 	public function setPointing($value=Direction::NONE) {
168
-		return $this->addToPropertyCtrl("class", $value . " pointing", Direction::getConstantValues("pointing"));
168
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
169 169
 	}
170 170
 
171 171
 	public function asTab($vertical=false) {
172
-		$this->apply(function (HtmlDoubleElement &$item) {
172
+		$this->apply(function(HtmlDoubleElement&$item) {
173 173
 			$item->setTagName("a");
174 174
 		});
175
-		if ($vertical === true)
175
+		if ($vertical===true)
176 176
 			$this->setVertical();
177 177
 		return $this->addToProperty("class", "tabular");
178 178
 	}
179 179
 
180 180
 	public function asPagination() {
181
-		$this->apply(function (HtmlDoubleElement &$item) {
181
+		$this->apply(function(HtmlDoubleElement&$item) {
182 182
 			$item->setTagName("a");
183 183
 		});
184 184
 		return $this->addToProperty("class", "pagination");
@@ -215,10 +215,10 @@  discard block
 block discarded – undo
215 215
 	 */
216 216
 	public function setWidth($width) {
217 217
 		if (\is_int($width)) {
218
-			$width=Wide::getConstants()["W" . $width];
218
+			$width=Wide::getConstants()["W".$width];
219 219
 		}
220 220
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
221
-		return $this->addToPropertyCtrl("class", "item", array ("item" ));
221
+		return $this->addToPropertyCtrl("class", "item", array("item"));
222 222
 	}
223 223
 
224 224
 	public function addImage($identifier, $src="", $alt="") {
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
 		return $this->_itemHeader;
234 234
 	}
235 235
 
236
-	public function run(JsUtils $js){
237
-		$result= parent::run($js);
236
+	public function run(JsUtils $js) {
237
+		$result=parent::run($js);
238 238
 		return $result->setItemSelector(".item");
239 239
 	}
240 240
 }
241 241
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlInput.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 use Ajax\JsUtils;
11 11
 
12 12
 class HtmlInput extends HtmlSemDoubleElement {
13
-	use IconTrait,TextFieldsTrait,FieldTrait;
13
+	use IconTrait, TextFieldsTrait, FieldTrait;
14 14
 
15 15
 	public function __construct($identifier, $type="text", $value="", $placeholder="") {
16
-		parent::__construct("div-" . $identifier, "div", "ui input");
17
-		$this->content=[ "field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder) ];
18
-		$this->_states=[ State::DISABLED,State::FOCUS,State::ERROR ];
19
-		$this->_variations=[ Variation::TRANSPARENT ];
16
+		parent::__construct("div-".$identifier, "div", "ui input");
17
+		$this->content=["field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder)];
18
+		$this->_states=[State::DISABLED, State::FOCUS, State::ERROR];
19
+		$this->_variations=[Variation::TRANSPARENT];
20 20
 	}
21 21
 
22 22
 	public function getField() {
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
 
37 37
 	public function run(JsUtils $js) {
38 38
 		$result=parent::run($js);
39
-		$result->attach("#" . $this->getDataField()->getIdentifier());
39
+		$result->attach("#".$this->getDataField()->getIdentifier());
40 40
 		return $result;
41 41
 	}
42 42
 
43
-	public function setTransparent(){
43
+	public function setTransparent() {
44 44
 		return $this->addToProperty("class", "transparent");
45 45
 	}
46 46
 }
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/MenuItemTrait.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@  discard block
 block discarded – undo
8 8
 
9 9
 trait MenuItemTrait {
10 10
 
11
-	public function setContent($content){
12
-		if($content==="-"){
11
+	public function setContent($content) {
12
+		if ($content==="-") {
13 13
 			$this->asDivider();
14
-		}elseif($content==="-search-"){
15
-			$values=\explode(",",$content,-1);
16
-			$this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search"));
17
-		}elseif(JString::startswith($content, "-")){
18
-			$content=\ltrim($content,"-");
14
+		}elseif ($content==="-search-") {
15
+			$values=\explode(",", $content, -1);
16
+			$this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."), JArray::getDefaultValue($values, 1, "search"));
17
+		}elseif (JString::startswith($content, "-")) {
18
+			$content=\ltrim($content, "-");
19 19
 			$this->asHeader($content);
20
-		}else
20
+		} else
21 21
 			parent::setContent($content);
22 22
 		return $this;
23 23
 	}
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	 * @param string $icon
28 28
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|\Ajax\semantic\html\content\HtmlMenuItem
29 29
 	 */
30
-	public function asSearchInput($placeholder=NULL,$icon=NULL){
30
+	public function asSearchInput($placeholder=NULL, $icon=NULL) {
31 31
 		$this->setClass("ui icon search input");
32 32
 		$input=new HtmlInput("search-".$this->identifier);
33
-		if(isset($placeholder))
33
+		if (isset($placeholder))
34 34
 			$input->setProperty("placeholder", $placeholder);
35 35
 			$this->content=$input;
36
-			if(isset($icon))
36
+			if (isset($icon))
37 37
 				$this->addIcon($icon);
38 38
 				return $this;
39 39
 	}
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|\Ajax\semantic\html\content\HtmlMenuItem
43 43
 	 */
44
-	public function asDivider(){
44
+	public function asDivider() {
45 45
 		$this->content=NULL;
46 46
 		$this->tagName="div";
47 47
 		$this->setClass("divider");
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
 	 * @param string $icon
54 54
 	 * @return \Ajax\semantic\html\content\HtmlDropdownItem|\Ajax\semantic\html\content\HtmlMenuItem
55 55
 	 */
56
-	public function asHeader($caption=NULL,$icon=NULL){
56
+	public function asHeader($caption=NULL, $icon=NULL) {
57 57
 		$this->setClass("header");
58 58
 		$this->tagName="div";
59 59
 		$this->content=$caption;
60
-		if(isset($icon))
61
-			$this->addIcon($icon,Direction::LEFT);
60
+		if (isset($icon))
61
+			$this->addIcon($icon, Direction::LEFT);
62 62
 			return $this;
63 63
 	}
64 64
 
65
-	public function setPosition($direction){
66
-		$this->addToProperty("class",$direction);
65
+	public function setPosition($direction) {
66
+		$this->addToProperty("class", $direction);
67 67
 	}
68 68
 }
69 69
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/checkbox/AbstractCheckbox.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Ajax\JsUtils;
8 8
 
9 9
 abstract class AbstractCheckbox extends HtmlSemDoubleElement {
10
-	protected $_params=array ();
10
+	protected $_params=array();
11 11
 
12 12
 	public function __construct($identifier, $name=NULL, $label=NULL, $value=NULL, $inputType="checkbox", $type="checkbox") {
13 13
 		parent::__construct("ck-".$identifier, "div", "ui ".$type);
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 			$this->setLabel($label);
19 19
 	}
20 20
 
21
-	public function setChecked($value=true){
22
-		if($value===true){
21
+	public function setChecked($value=true) {
22
+		if ($value===true) {
23 23
 			$this->getField()->setProperty("checked", "checked");
24
-		}else{
24
+		} else {
25 25
 			$this->getField()->removeProperty("checked");
26 26
 		}
27 27
 		return $this;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox
84 84
 	 */
85 85
 	public function attachEvent($selector, $action=NULL) {
86
-		if (isset($action)!==false||\is_numeric($action)===true) {
86
+		if (isset($action)!==false || \is_numeric($action)===true) {
87 87
 			$js='$("#%identifier%").checkbox("attach events", "'.$selector.'", "'.$action.'");';
88 88
 		} else {
89 89
 			$js='$("#%identifier%").checkbox("attach events", "'.$selector.'");';
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	public function attachEvents($events=array()) {
101 101
 		if (\is_array($events)) {
102
-			foreach ( $events as $action => $selector ) {
102
+			foreach ($events as $action => $selector) {
103 103
 				$this->attachEvent($selector, $action);
104 104
 			}
105 105
 		}
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
 		return $this->addToProperty("class", "fitted");
111 111
 	}
112 112
 
113
-	public function setOnChecked($jsCode){
113
+	public function setOnChecked($jsCode) {
114 114
 		$this->_params["onChecked"]=$jsCode;
115 115
 	}
116 116
 
117
-	public function setOnUnchecked($jsCode){
117
+	public function setOnUnchecked($jsCode) {
118 118
 		$this->_params["onUnchecked"]=$jsCode;
119 119
 	}
120 120
 
121 121
 	public function run(JsUtils $js) {
122
-			$this->_bsComponent=$js->semantic()->checkbox("#" . $this->identifier, $this->_params);
122
+			$this->_bsComponent=$js->semantic()->checkbox("#".$this->identifier, $this->_params);
123 123
 			return parent::run($js);
124 124
 	}
125 125
 }
126 126
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/service/JString.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,33 +2,33 @@
 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 35
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/PositionInTable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,5 +3,5 @@
 block discarded – undo
3 3
 use Ajax\common\BaseEnum;
4 4
 
5 5
 abstract class PositionInTable extends BaseEnum {
6
-	const BEFORETABLE="beforeTable",AFTERTABLE="afterTable",HEADER="thead",FOOTER="tfoot",BODY="tbody";
6
+	const BEFORETABLE="beforeTable", AFTERTABLE="afterTable", HEADER="thead", FOOTER="tfoot", BODY="tbody";
7 7
 }
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlTable.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
 
24 24
 	public function __construct($identifier, $rowCount, $colCount) {
25 25
 		parent::__construct($identifier, "table", "ui table");
26
-		$this->content=array ();
26
+		$this->content=array();
27 27
 		$this->setRowCount($rowCount, $colCount);
28
-		$this->_variations=[ Variation::CELLED,Variation::PADDED,Variation::COMPACT ];
29
-		$this->_compileParts=["thead","tbody","tfoot"];
28
+		$this->_variations=[Variation::CELLED, Variation::PADDED, Variation::COMPACT];
29
+		$this->_compileParts=["thead", "tbody", "tfoot"];
30 30
 		$this->_afterCompileEvents=[];
31 31
 	}
32 32
 
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	 * @return HtmlTableContent
37 37
 	 */
38 38
 	public function getPart($key) {
39
-		if (\array_key_exists($key, $this->content) === false) {
39
+		if (\array_key_exists($key, $this->content)===false) {
40 40
 			$this->content[$key]=new HtmlTableContent("", $key);
41
-			if ($key !== "tbody") {
41
+			if ($key!=="tbody") {
42 42
 				$this->content[$key]->setRowCount(1, $this->_colCount);
43 43
 			}
44 44
 		}
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @return boolean
76 76
 	 */
77 77
 	public function hasPart($key) {
78
-		return \array_key_exists($key, $this->content) === true;
78
+		return \array_key_exists($key, $this->content)===true;
79 79
 	}
80 80
 
81 81
 	/**
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
 	private function colAlign($colIndex, $function) {
182 182
 		if (\is_array($colIndex)) {
183
-			foreach ( $colIndex as $cIndex ) {
183
+			foreach ($colIndex as $cIndex) {
184 184
 				$this->colAlign($cIndex, $function);
185 185
 			}
186 186
 		} else {
@@ -198,8 +198,8 @@  discard block
 block discarded – undo
198 198
 
199 199
 	public function setBasic($very=false) {
200 200
 		if ($very)
201
-			$this->addToPropertyCtrl("class", "very", array ("very" ));
202
-		return $this->addToPropertyCtrl("class", "basic", array ("basic" ));
201
+			$this->addToPropertyCtrl("class", "very", array("very"));
202
+		return $this->addToPropertyCtrl("class", "basic", array("basic"));
203 203
 	}
204 204
 
205 205
 	public function setCollapsing() {
@@ -260,12 +260,12 @@  discard block
 block discarded – undo
260 260
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
261 261
 	 */
262 262
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
263
-		if(\sizeof($this->_compileParts)<3){
263
+		if (\sizeof($this->_compileParts)<3) {
264 264
 			$this->_template="%content%";
265 265
 			$this->refresh();
266
-		}else{
266
+		} else {
267 267
 			if ($this->propertyContains("class", "sortable")) {
268
-				$this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();");
268
+				$this->addEvent("execute", "$('#".$this->identifier."').tablesort();");
269 269
 			}
270 270
 		}
271 271
 		$this->content=JArray::sortAssociative($this->content, $this->_compileParts);
@@ -281,13 +281,13 @@  discard block
 block discarded – undo
281 281
 	public function fromDatabaseObject($object, $function) {
282 282
 		$result=$function($object);
283 283
 		if (\is_array($result)) {
284
-			$result= $this->addRow($function($object));
284
+			$result=$this->addRow($function($object));
285 285
 		} else {
286
-			$result= $this->getBody()->_addRow($result);
286
+			$result=$this->getBody()->_addRow($result);
287 287
 		}
288
-		if(isset($this->_afterCompileEvents["onNewRow"])){
289
-			if(\is_callable($this->_afterCompileEvents["onNewRow"]))
290
-				$this->_afterCompileEvents["onNewRow"]($result,$object);
288
+		if (isset($this->_afterCompileEvents["onNewRow"])) {
289
+			if (\is_callable($this->_afterCompileEvents["onNewRow"]))
290
+				$this->_afterCompileEvents["onNewRow"]($result, $object);
291 291
 		}
292 292
 		return $result;
293 293
 	}
@@ -301,14 +301,14 @@  discard block
 block discarded – undo
301 301
 		return $this;
302 302
 	}
303 303
 
304
-	public function refresh(){
304
+	public function refresh() {
305 305
 		$this->_footer=$this->getFooter();
306 306
 		$this->addEvent("execute", '$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");');
307 307
 	}
308 308
 
309
-	public function run(JsUtils $js){
310
-		$result= parent::run($js);
311
-		if(isset($this->_footer))
309
+	public function run(JsUtils $js) {
310
+		$result=parent::run($js);
311
+		if (isset($this->_footer))
312 312
 			$this->_footer->run($js);
313 313
 		return $result;
314 314
 	}
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataelement/DataElement.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,35 +19,35 @@
 block discarded – undo
19 19
 class DataElement 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->_instanceViewer=new InstanceViewer();
24
-		$this->content=["table"=>new HtmlTable($identifier, 0,2)];
24
+		$this->content=["table"=>new HtmlTable($identifier, 0, 2)];
25 25
 		$this->content["table"]->setDefinition();
26 26
 		$this->_toolbarPosition=PositionInTable::BEFORETABLE;
27 27
 	}
28 28
 
29
-	public function compile(JsUtils $js=NULL,&$view=NULL){
29
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
30 30
 		$this->_instanceViewer->setInstance($this->_modelInstance);
31 31
 
32 32
 		$table=$this->content["table"];
33 33
 		$this->_generateContent($table);
34 34
 
35
-		if(isset($this->_toolbar)){
35
+		if (isset($this->_toolbar)) {
36 36
 			$this->_setToolbarPosition($table);
37 37
 		}
38
-		$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE,"table",PositionInTable::AFTERTABLE]);
39
-		return parent::compile($js,$view);
38
+		$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE, "table", PositionInTable::AFTERTABLE]);
39
+		return parent::compile($js, $view);
40 40
 	}
41 41
 
42 42
 	/**
43 43
 	 * @param HtmlTable $table
44 44
 	 */
45
-	protected function _generateContent($table){
45
+	protected function _generateContent($table) {
46 46
 		$captions=$this->_instanceViewer->getCaptions();
47
-		$values= $this->_instanceViewer->getValues();
47
+		$values=$this->_instanceViewer->getValues();
48 48
 		$count=$this->_instanceViewer->count();
49
-		for($i=0;$i<$count;$i++){
50
-			$table->addRow([$captions[$i],$values[$i]]);
49
+		for ($i=0; $i<$count; $i++) {
50
+			$table->addRow([$captions[$i], $values[$i]]);
51 51
 		}
52 52
 	}
53 53
 
Please login to merge, or discard this patch.