@@ -20,6 +20,9 @@ |
||
20 | 20 | protected $_tabsType="tabs"; |
21 | 21 | protected $stacked=""; |
22 | 22 | |
23 | + /** |
|
24 | + * @param string $identifier |
|
25 | + */ |
|
23 | 26 | public function __construct($identifier, $tagName="ul") { |
24 | 27 | parent::__construct($identifier, $tagName); |
25 | 28 | $this->_template="<%tagName% %properties%>%tabs%</%tagName%>%content%"; |
@@ -8,19 +8,19 @@ discard block |
||
8 | 8 | * @author jc |
9 | 9 | * |
10 | 10 | */ |
11 | -class HtmlTR extends HtmlSemCollection{ |
|
11 | +class HtmlTR extends HtmlSemCollection { |
|
12 | 12 | |
13 | 13 | private $_tdTagName; |
14 | 14 | private $_container; |
15 | 15 | private $_row; |
16 | 16 | |
17 | - public function __construct( $identifier, $colCount){ |
|
18 | - parent::__construct( $identifier, "tr", ""); |
|
17 | + public function __construct($identifier, $colCount) { |
|
18 | + parent::__construct($identifier, "tr", ""); |
|
19 | 19 | } |
20 | 20 | |
21 | - public function setColCount($colCount){ |
|
21 | + public function setColCount($colCount) { |
|
22 | 22 | $count=$this->count(); |
23 | - for($i=$count;$i<$colCount;$i++){ |
|
23 | + for ($i=$count; $i<$colCount; $i++) { |
|
24 | 24 | $item=$this->addItem(NULL); |
25 | 25 | $item->setTagName($this->_tdTagName); |
26 | 26 | } |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | * {@inheritDoc} |
33 | 33 | * @see \Ajax\common\html\HtmlCollection::createItem() |
34 | 34 | */ |
35 | - protected function createItem($value){ |
|
35 | + protected function createItem($value) { |
|
36 | 36 | $count=$this->count(); |
37 | - $td=new HtmlTD("",$this->_container,$value,$this->_tdTagName); |
|
37 | + $td=new HtmlTD("", $this->_container, $value, $this->_tdTagName); |
|
38 | 38 | $td->setContainer($this->_container, $this->_row, $count); |
39 | 39 | return $td; |
40 | 40 | } |
41 | 41 | |
42 | - public function setTdTagName($tagName="td"){ |
|
42 | + public function setTdTagName($tagName="td") { |
|
43 | 43 | $this->_tdTagName=$tagName; |
44 | 44 | } |
45 | 45 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param HtmlTableContent $container |
49 | 49 | * @param int $row |
50 | 50 | */ |
51 | - public function setContainer($container,$row){ |
|
51 | + public function setContainer($container, $row) { |
|
52 | 52 | $this->_container=$container; |
53 | 53 | $this->_row=$row; |
54 | 54 | } |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | * Sets values to the row cols |
58 | 58 | * @param mixed $values |
59 | 59 | */ |
60 | - public function setValues($values=array()){ |
|
60 | + public function setValues($values=array()) { |
|
61 | 61 | $count=$this->count(); |
62 | - if(\is_array($values)===false){ |
|
62 | + if (\is_array($values)===false) { |
|
63 | 63 | $values=\array_fill(0, $count, $values); |
64 | 64 | } |
65 | - $count=\min(\sizeof($values),$count); |
|
65 | + $count=\min(\sizeof($values), $count); |
|
66 | 66 | |
67 | - for ($i=0;$i<$count;$i++){ |
|
67 | + for ($i=0; $i<$count; $i++) { |
|
68 | 68 | $cell=$this->content[$i]; |
69 | 69 | $cell->setValue($values[$i]); |
70 | 70 | } |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | * @param int $index the index of the col to remove |
76 | 76 | * @return \Ajax\semantic\html\content\table\HtmlTR |
77 | 77 | */ |
78 | - public function delete($index){ |
|
78 | + public function delete($index) { |
|
79 | 79 | $this->removeItem($index); |
80 | 80 | return $this; |
81 | 81 | } |
82 | 82 | |
83 | - public function mergeCol($colIndex=0){ |
|
83 | + public function mergeCol($colIndex=0) { |
|
84 | 84 | return $this->getItem($colIndex)->mergeCol(); |
85 | 85 | } |
86 | 86 | |
87 | - public function mergeRow($colIndex=0){ |
|
87 | + public function mergeRow($colIndex=0) { |
|
88 | 88 | return $this->getItem($colIndex)->mergeRow(); |
89 | 89 | } |
90 | 90 | } |
91 | 91 | \ No newline at end of file |
@@ -4,6 +4,9 @@ |
||
4 | 4 | |
5 | 5 | trait HtmlLinkTrait { |
6 | 6 | |
7 | + /** |
|
8 | + * @param string $value |
|
9 | + */ |
|
7 | 10 | public function setHref($value) { |
8 | 11 | $this->setProperty("href", $value); |
9 | 12 | } |
@@ -15,42 +15,42 @@ |
||
15 | 15 | * @param mixed $content |
16 | 16 | * @param string $tagName |
17 | 17 | */ |
18 | - public function __construct($identifier,$content=NULL,$tagName="td") { |
|
18 | + public function __construct($identifier, $content=NULL, $tagName="td") { |
|
19 | 19 | parent::__construct($identifier, $tagName, "", $content); |
20 | 20 | } |
21 | 21 | |
22 | - public function setContainer($container,$row,$col){ |
|
22 | + public function setContainer($container, $row, $col) { |
|
23 | 23 | $this->_container=$container; |
24 | 24 | $this->_row=$row; |
25 | 25 | $this->_col=$col; |
26 | 26 | } |
27 | 27 | |
28 | - public function setValue($value){ |
|
28 | + public function setValue($value) { |
|
29 | 29 | $this->content=$value; |
30 | 30 | return $this; |
31 | 31 | } |
32 | 32 | |
33 | - public function setRowspan($rowspan){ |
|
34 | - $to=min($this->_container->count(),$this->_row+$rowspan-1); |
|
35 | - for($i=$to;$i>$this->_row;$i--){ |
|
36 | - $this->_container->delete($this->_row+1,$this->_col); |
|
33 | + public function setRowspan($rowspan) { |
|
34 | + $to=min($this->_container->count(), $this->_row+$rowspan-1); |
|
35 | + for ($i=$to; $i>$this->_row; $i--) { |
|
36 | + $this->_container->delete($this->_row+1, $this->_col); |
|
37 | 37 | } |
38 | 38 | $this->setProperty("rowspan", $rowspan); |
39 | 39 | return $this->_container; |
40 | 40 | } |
41 | 41 | |
42 | - public function mergeRow(){ |
|
42 | + public function mergeRow() { |
|
43 | 43 | return $this->setRowspan($this->_container->count()); |
44 | 44 | } |
45 | 45 | |
46 | - public function mergeCol(){ |
|
46 | + public function mergeCol() { |
|
47 | 47 | return $this->setColspan($this->_container->getRow($this->_row)->count()); |
48 | 48 | } |
49 | 49 | |
50 | - public function setColspan($colspan){ |
|
51 | - $to=min($this->_container->getRow($this->_row)->count(),$this->_col+$colspan-1); |
|
52 | - for($i=$to;$i>$this->_col;$i--){ |
|
53 | - $this->_container->delete($this->_row,$this->_col+1); |
|
50 | + public function setColspan($colspan) { |
|
51 | + $to=min($this->_container->getRow($this->_row)->count(), $this->_col+$colspan-1); |
|
52 | + for ($i=$to; $i>$this->_col; $i--) { |
|
53 | + $this->_container->delete($this->_row, $this->_col+1); |
|
54 | 54 | } |
55 | 55 | $this->setProperty("colspan", $colspan); |
56 | 56 | return $this->_container; |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | abstract class Variation extends BaseEnum { |
8 | - const ANIMATED="animated",AVATAR="avatar",CELLED="celled",COMPACT="compact",FLUID="fluid",INVERTED="inverted",PADDED="padded",TRANSPARENT="transparent"; |
|
8 | + const ANIMATED="animated", AVATAR="avatar", CELLED="celled", COMPACT="compact", FLUID="fluid", INVERTED="inverted", PADDED="padded", TRANSPARENT="transparent"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -10,23 +10,23 @@ |
||
10 | 10 | * @param string $value |
11 | 11 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
12 | 12 | */ |
13 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
14 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
13 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
14 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
15 | 15 | } |
16 | 16 | |
17 | - public function textCenterAligned(){ |
|
17 | + public function textCenterAligned() { |
|
18 | 18 | return $this->setTextAlignment(TextAlignment::CENTER); |
19 | 19 | } |
20 | 20 | |
21 | - public function textJustified(){ |
|
21 | + public function textJustified() { |
|
22 | 22 | return $this->setTextAlignment(TextAlignment::JUSTIFIED); |
23 | 23 | } |
24 | 24 | |
25 | - public function textRightAligned(){ |
|
25 | + public function textRightAligned() { |
|
26 | 26 | return $this->setTextAlignment(TextAlignment::RIGHT); |
27 | 27 | } |
28 | 28 | |
29 | - public function textLeftAligned(){ |
|
29 | + public function textLeftAligned() { |
|
30 | 30 | return $this->setTextAlignment(); |
31 | 31 | } |
32 | 32 | } |
33 | 33 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | parent::__construct($identifier, "table", "ui table"); |
18 | 18 | $this->content=array(); |
19 | 19 | $this->setRowCount($rowCount, $colCount); |
20 | - $this->_variations=[Variation::CELLED,Variation::PADDED]; |
|
20 | + $this->_variations=[Variation::CELLED, Variation::PADDED]; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | * @param string $key |
26 | 26 | * @return HtmlTableContent |
27 | 27 | */ |
28 | - private function getPart($key){ |
|
29 | - if(\array_key_exists($key, $this->content)===false){ |
|
30 | - $this->content[$key]=new HtmlTableContent("",$key); |
|
31 | - if($key!=="tbody"){ |
|
28 | + private function getPart($key) { |
|
29 | + if (\array_key_exists($key, $this->content)===false) { |
|
30 | + $this->content[$key]=new HtmlTableContent("", $key); |
|
31 | + if ($key!=="tbody") { |
|
32 | 32 | $this->content[$key]->setRowCount(1, $this->_colCount); |
33 | 33 | } |
34 | 34 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * Returns/create eventually the body of the table |
40 | 40 | * @return \Ajax\semantic\html\content\table\HtmlTableContent |
41 | 41 | */ |
42 | - public function getBody(){ |
|
42 | + public function getBody() { |
|
43 | 43 | return $this->getPart("tbody"); |
44 | 44 | } |
45 | 45 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * Returns/create eventually the header of the table |
48 | 48 | * @return \Ajax\semantic\html\content\table\HtmlTableContent |
49 | 49 | */ |
50 | - public function getHeader(){ |
|
50 | + public function getHeader() { |
|
51 | 51 | return $this->getPart("thead"); |
52 | 52 | } |
53 | 53 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * Returns/create eventually the footer of the table |
56 | 56 | * @return \Ajax\semantic\html\content\table\HtmlTableContent |
57 | 57 | */ |
58 | - public function getFooter(){ |
|
58 | + public function getFooter() { |
|
59 | 59 | return $this->getPart("tfoot"); |
60 | 60 | } |
61 | 61 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param string $key |
65 | 65 | * @return boolean |
66 | 66 | */ |
67 | - public function hasPart($key){ |
|
67 | + public function hasPart($key) { |
|
68 | 68 | return \array_key_exists($key, $this->content)===true; |
69 | 69 | } |
70 | 70 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function setRowCount($rowCount, $colCount) { |
77 | 77 | $this->_colCount=$colCount; |
78 | - return $this->getBody()->setRowCount($rowCount,$colCount); |
|
78 | + return $this->getBody()->setRowCount($rowCount, $colCount); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -84,28 +84,28 @@ discard block |
||
84 | 84 | * @param int $col |
85 | 85 | * @return \Ajax\semantic\html\content\HtmlTD |
86 | 86 | */ |
87 | - public function getCell($row,$col){ |
|
88 | - return $this->getBody()->getCell($row,$col); |
|
87 | + public function getCell($row, $col) { |
|
88 | + return $this->getBody()->getCell($row, $col); |
|
89 | 89 | } |
90 | 90 | |
91 | - public function setValues($values=array()){ |
|
91 | + public function setValues($values=array()) { |
|
92 | 92 | $this->getBody()->setValues($values); |
93 | 93 | return $this; |
94 | 94 | } |
95 | 95 | |
96 | - public function setColValues($colIndex,$values=array()){ |
|
97 | - $this->getBody()->setColValues($colIndex,$values); |
|
96 | + public function setColValues($colIndex, $values=array()) { |
|
97 | + $this->getBody()->setColValues($colIndex, $values); |
|
98 | 98 | return $this; |
99 | 99 | } |
100 | 100 | |
101 | - public function colCenter($colIndex){ |
|
102 | - if($this->hasPart("thead")) |
|
101 | + public function colCenter($colIndex) { |
|
102 | + if ($this->hasPart("thead")) |
|
103 | 103 | $this->getHeader()->colCenter($colIndex); |
104 | 104 | $this->getBody()->colCenter($colIndex); |
105 | 105 | return $this; |
106 | 106 | } |
107 | 107 | |
108 | - public function setCelled(){ |
|
108 | + public function setCelled() { |
|
109 | 109 | return $this->addToProperty("class", "celled"); |
110 | 110 | } |
111 | 111 | } |
112 | 112 | \ No newline at end of file |
@@ -99,8 +99,9 @@ |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | public function colCenter($colIndex){ |
102 | - if($this->hasPart("thead")) |
|
103 | - $this->getHeader()->colCenter($colIndex); |
|
102 | + if($this->hasPart("thead")) { |
|
103 | + $this->getHeader()->colCenter($colIndex); |
|
104 | + } |
|
104 | 105 | $this->getBody()->colCenter($colIndex); |
105 | 106 | return $this; |
106 | 107 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class HtmlRating extends HtmlSemDoubleElement { |
9 | 9 | protected $_params=array(); |
10 | - public function __construct($identifier, $value,$max=5,$icon="star") { |
|
10 | + public function __construct($identifier, $value, $max=5, $icon="star") { |
|
11 | 11 | parent::__construct($identifier, "div", "ui {$icon} rating"); |
12 | 12 | $this->setValue($value); |
13 | 13 | $this->setMax($max); |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | * {@inheritDoc} |
18 | 18 | * @see \Ajax\common\html\HtmlDoubleElement::setValue() |
19 | 19 | */ |
20 | - public function setValue($value){ |
|
20 | + public function setValue($value) { |
|
21 | 21 | $this->setProperty("data-rating", $value); |
22 | 22 | } |
23 | 23 | |
24 | - public function setMax($max){ |
|
24 | + public function setMax($max) { |
|
25 | 25 | $this->setProperty("data-max-rating", $max); |
26 | 26 | } |
27 | 27 | |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | * {@inheritDoc} |
30 | 30 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
31 | 31 | */ |
32 | - public function run(JsUtils $js){ |
|
32 | + public function run(JsUtils $js) { |
|
33 | 33 | parent::run($js); |
34 | - return $js->semantic()->rating("#".$this->identifier,$this->_params); |
|
34 | + return $js->semantic()->rating("#".$this->identifier, $this->_params); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |