@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | |
22 | 22 | public function __construct($identifier, $rowCount, $colCount) { |
23 | 23 | parent::__construct($identifier, "table", "ui table"); |
24 | - $this->content=array (); |
|
24 | + $this->content=array(); |
|
25 | 25 | $this->setRowCount($rowCount, $colCount); |
26 | - $this->_variations=[ Variation::CELLED,Variation::PADDED,Variation::COMPACT ]; |
|
27 | - $this->_compileParts=["thead","tbody","tfoot"]; |
|
26 | + $this->_variations=[Variation::CELLED, Variation::PADDED, Variation::COMPACT]; |
|
27 | + $this->_compileParts=["thead", "tbody", "tfoot"]; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | * @return HtmlTableContent |
34 | 34 | */ |
35 | 35 | public function getPart($key) { |
36 | - if (\array_key_exists($key, $this->content) === false) { |
|
36 | + if (\array_key_exists($key, $this->content)===false) { |
|
37 | 37 | $this->content[$key]=new HtmlTableContent("", $key); |
38 | - if ($key !== "tbody") { |
|
38 | + if ($key!=="tbody") { |
|
39 | 39 | $this->content[$key]->setRowCount(1, $this->_colCount); |
40 | 40 | } |
41 | 41 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @return boolean |
73 | 73 | */ |
74 | 74 | public function hasPart($key) { |
75 | - return \array_key_exists($key, $this->content) === true; |
|
75 | + return \array_key_exists($key, $this->content)===true; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | private function colAlign($colIndex, $function) { |
179 | 179 | if (\is_array($colIndex)) { |
180 | - foreach ( $colIndex as $cIndex ) { |
|
180 | + foreach ($colIndex as $cIndex) { |
|
181 | 181 | $this->colAlign($cIndex, $function); |
182 | 182 | } |
183 | 183 | } else { |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | |
196 | 196 | public function setBasic($very=false) { |
197 | 197 | if ($very) |
198 | - $this->addToPropertyCtrl("class", "very", array ("very" )); |
|
199 | - return $this->addToPropertyCtrl("class", "basic", array ("basic" )); |
|
198 | + $this->addToPropertyCtrl("class", "very", array("very")); |
|
199 | + return $this->addToPropertyCtrl("class", "basic", array("basic")); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | public function setCollapsing() { |
@@ -257,12 +257,12 @@ discard block |
||
257 | 257 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
258 | 258 | */ |
259 | 259 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
260 | - if(\sizeof($this->_compileParts)<3){ |
|
260 | + if (\sizeof($this->_compileParts)<3) { |
|
261 | 261 | $this->_template="%content%"; |
262 | 262 | $this->refresh(); |
263 | - }else{ |
|
263 | + } else { |
|
264 | 264 | if ($this->propertyContains("class", "sortable")) { |
265 | - $this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();"); |
|
265 | + $this->addEvent("execute", "$('#".$this->identifier."').tablesort();"); |
|
266 | 266 | } |
267 | 267 | } |
268 | 268 | $this->content=JArray::sortAssociative($this->content, $this->_compileParts); |
@@ -293,14 +293,14 @@ discard block |
||
293 | 293 | return $this; |
294 | 294 | } |
295 | 295 | |
296 | - public function refresh(){ |
|
296 | + public function refresh() { |
|
297 | 297 | $this->_footer=$this->getFooter(); |
298 | 298 | $this->addEvent("execute", '$("#'.$this->identifier.' tfoot").replaceWith("'.\addslashes($this->_footer).'");'); |
299 | 299 | } |
300 | 300 | |
301 | - public function run(JsUtils $js){ |
|
302 | - $result= parent::run($js); |
|
303 | - if(isset($this->_footer)) |
|
301 | + public function run(JsUtils $js) { |
|
302 | + $result=parent::run($js); |
|
303 | + if (isset($this->_footer)) |
|
304 | 304 | $this->_footer->run($js); |
305 | 305 | return $result; |
306 | 306 | } |
@@ -10,13 +10,13 @@ discard block |
||
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 |
||
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 |
@@ -8,16 +8,16 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -7,7 +7,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |