@@ -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 | } |
@@ -194,8 +194,9 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | public function setBasic($very=false) { |
| 197 | - if ($very) |
|
| 198 | - $this->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 197 | + if ($very) { |
|
| 198 | + $this->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 199 | + } |
|
| 199 | 200 | return $this->addToPropertyCtrl("class", "basic", array ("basic" )); |
| 200 | 201 | } |
| 201 | 202 | |
@@ -260,7 +261,7 @@ discard block |
||
| 260 | 261 | if(\sizeof($this->_compileParts)<3){ |
| 261 | 262 | $this->_template="%content%"; |
| 262 | 263 | $this->refresh(); |
| 263 | - }else{ |
|
| 264 | + } else{ |
|
| 264 | 265 | if ($this->propertyContains("class", "sortable")) { |
| 265 | 266 | $this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();"); |
| 266 | 267 | } |
@@ -300,8 +301,9 @@ discard block |
||
| 300 | 301 | |
| 301 | 302 | public function run(JsUtils $js){ |
| 302 | 303 | $result= parent::run($js); |
| 303 | - if(isset($this->_footer)) |
|
| 304 | - $this->_footer->run($js); |
|
| 304 | + if(isset($this->_footer)) { |
|
| 305 | + $this->_footer->run($js); |
|
| 306 | + } |
|
| 305 | 307 | return $result; |
| 306 | 308 | } |
| 307 | 309 | |
@@ -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 |