@@ -7,19 +7,19 @@ |
||
7 | 7 | use Phalcon\Mvc\View; |
8 | 8 | use Ajax\semantic\html\elements\HtmlIcon; |
9 | 9 | |
10 | -class HtmlPaginationMenu extends HtmlMenu{ |
|
10 | +class HtmlPaginationMenu extends HtmlMenu { |
|
11 | 11 | |
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 $view=NULL){ |
|
19 | + public function compile(JsUtils $js=NULL, View $view=NULL) { |
|
20 | 20 | $this->insertItem(new HtmlIcon("", "left chevron")); |
21 | 21 | $this->addItem(new HtmlIcon("", "right chevron")); |
22 | 22 | $this->asPagination(); |
23 | - return parent::compile($js,$view); |
|
23 | + return parent::compile($js, $view); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -8,42 +8,42 @@ |
||
8 | 8 | private $_container; |
9 | 9 | private $_row; |
10 | 10 | private $_col; |
11 | - public function __construct($identifier,$content=NULL,$tagName="td") { |
|
11 | + public function __construct($identifier, $content=NULL, $tagName="td") { |
|
12 | 12 | parent::__construct($identifier, $tagName, "", $content); |
13 | 13 | } |
14 | 14 | |
15 | - public function setContainer($container,$row,$col){ |
|
15 | + public function setContainer($container, $row, $col) { |
|
16 | 16 | $this->_container=$container; |
17 | 17 | $this->_row=$row; |
18 | 18 | $this->_col=$col; |
19 | 19 | } |
20 | 20 | |
21 | - public function setValue($value){ |
|
21 | + public function setValue($value) { |
|
22 | 22 | $this->content=$value; |
23 | 23 | return $this; |
24 | 24 | } |
25 | 25 | |
26 | - public function setRowspan($rowspan){ |
|
27 | - $to=min($this->_container->count(),$this->_row+$rowspan-1); |
|
28 | - for($i=$to;$i>$this->_row;$i--){ |
|
29 | - $this->_container->delete($this->_row+1,$this->_col); |
|
26 | + public function setRowspan($rowspan) { |
|
27 | + $to=min($this->_container->count(), $this->_row+$rowspan-1); |
|
28 | + for ($i=$to; $i>$this->_row; $i--) { |
|
29 | + $this->_container->delete($this->_row+1, $this->_col); |
|
30 | 30 | } |
31 | 31 | $this->setProperty("rowspan", $rowspan); |
32 | 32 | return $this->_container; |
33 | 33 | } |
34 | 34 | |
35 | - public function rowMerge(){ |
|
35 | + public function rowMerge() { |
|
36 | 36 | return $this->setRowspan($this->_container->count()); |
37 | 37 | } |
38 | 38 | |
39 | - public function colMerge(){ |
|
39 | + public function colMerge() { |
|
40 | 40 | return $this->setColspan($this->_container->getRow($this->_row)->count()); |
41 | 41 | } |
42 | 42 | |
43 | - public function setColspan($colspan){ |
|
44 | - $to=min($this->_container->getRow($this->_row)->count(),$this->_col+$colspan-1); |
|
45 | - for($i=$to;$i>$this->_col;$i--){ |
|
46 | - $this->_container->delete($this->_row,$this->_col+1); |
|
43 | + public function setColspan($colspan) { |
|
44 | + $to=min($this->_container->getRow($this->_row)->count(), $this->_col+$colspan-1); |
|
45 | + for ($i=$to; $i>$this->_col; $i--) { |
|
46 | + $this->_container->delete($this->_row, $this->_col+1); |
|
47 | 47 | } |
48 | 48 | $this->setProperty("colspan", $colspan); |
49 | 49 | return $this->_container; |
@@ -10,8 +10,9 @@ discard block |
||
10 | 10 | |
11 | 11 | public function __construct( $identifier,$tagName="tbody",$rowCount=NULL,$colCount=NULL){ |
12 | 12 | parent::__construct( $identifier, $tagName, ""); |
13 | - if(isset($rowCount) && isset($colCount)) |
|
14 | - $this->setRowCount($rowCount, $colCount); |
|
13 | + if(isset($rowCount) && isset($colCount)) { |
|
14 | + $this->setRowCount($rowCount, $colCount); |
|
15 | + } |
|
15 | 16 | } |
16 | 17 | |
17 | 18 | public function setRowCount($rowCount,$colCount){ |
@@ -79,8 +80,9 @@ discard block |
||
79 | 80 | |
80 | 81 | public function getColCount(){ |
81 | 82 | $result=0; |
82 | - if($this->count()>0) |
|
83 | - $result=$this->getItem(0)->getColCount(); |
|
83 | + if($this->count()>0) { |
|
84 | + $result=$this->getItem(0)->getColCount(); |
|
85 | + } |
|
84 | 86 | return $result; |
85 | 87 | } |
86 | 88 | |
@@ -90,7 +92,7 @@ discard block |
||
90 | 92 | if(isset($row)===true){ |
91 | 93 | $row->delete($colIndex); |
92 | 94 | } |
93 | - }else{ |
|
95 | + } else{ |
|
94 | 96 | $this->removeItem($rowIndex); |
95 | 97 | } |
96 | 98 | return $this; |
@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @param int $index |
73 | - * @return \Ajax\semantic\html\content\HtmlTR |
|
73 | + * @return \Ajax\common\html\HtmlDoubleElement |
|
74 | 74 | */ |
75 | 75 | public function getRow($index){ |
76 | 76 | return $this->getItem($index); |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | * @author jc |
10 | 10 | * |
11 | 11 | */ |
12 | -class HtmlTableContent extends HtmlSemCollection{ |
|
12 | +class HtmlTableContent extends HtmlSemCollection { |
|
13 | 13 | |
14 | - protected $_tdTagNames=["thead"=>"th","tbody"=>"td","tfoot"=>"th"]; |
|
14 | + protected $_tdTagNames=["thead"=>"th", "tbody"=>"td", "tfoot"=>"th"]; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * @param string $identifier |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | * @param int $rowCount |
20 | 20 | * @param int $colCount |
21 | 21 | */ |
22 | - public function __construct( $identifier,$tagName="tbody",$rowCount=NULL,$colCount=NULL){ |
|
23 | - parent::__construct( $identifier, $tagName, ""); |
|
24 | - if(isset($rowCount) && isset($colCount)) |
|
22 | + public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) { |
|
23 | + parent::__construct($identifier, $tagName, ""); |
|
24 | + if (isset($rowCount) && isset($colCount)) |
|
25 | 25 | $this->setRowCount($rowCount, $colCount); |
26 | 26 | } |
27 | 27 | |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | * @param int $colCount |
31 | 31 | * @return \Ajax\semantic\html\content\table\HtmlTableContent |
32 | 32 | */ |
33 | - public function setRowCount($rowCount,$colCount){ |
|
33 | + public function setRowCount($rowCount, $colCount) { |
|
34 | 34 | $count=$this->count(); |
35 | - for($i=$count;$i<$rowCount;$i++){ |
|
35 | + for ($i=$count; $i<$rowCount; $i++) { |
|
36 | 36 | $this->addItem($colCount); |
37 | 37 | } |
38 | - for($i=0;$i<$rowCount;$i++){ |
|
38 | + for ($i=0; $i<$rowCount; $i++) { |
|
39 | 39 | $item=$this->content[$i]; |
40 | 40 | $item->setTdTagName($this->_tdTagNames[$this->tagName]); |
41 | 41 | $this->content[$i]->setColCount($colCount); |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | * {@inheritDoc} |
48 | 48 | * @see \Ajax\common\html\HtmlCollection::createItem() |
49 | 49 | */ |
50 | - protected function createItem($value){ |
|
50 | + protected function createItem($value) { |
|
51 | 51 | $count=$this->count(); |
52 | - $tr= new HtmlTR("", $value); |
|
52 | + $tr=new HtmlTR("", $value); |
|
53 | 53 | $tr->setContainer($this, $count); |
54 | 54 | return $tr; |
55 | 55 | } |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | * @param int $col |
61 | 61 | * @return \Ajax\semantic\html\content\HtmlTD |
62 | 62 | */ |
63 | - public function getCell($row,$col){ |
|
63 | + public function getCell($row, $col) { |
|
64 | 64 | $row=$this->getItem($row); |
65 | - if(isset($row)){ |
|
65 | + if (isset($row)) { |
|
66 | 66 | $col=$row->getItem($col); |
67 | 67 | } |
68 | 68 | return $col; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * @param int $index |
73 | 73 | * @return \Ajax\semantic\html\content\HtmlTR |
74 | 74 | */ |
75 | - public function getRow($index){ |
|
75 | + public function getRow($index) { |
|
76 | 76 | return $this->getItem($index); |
77 | 77 | } |
78 | 78 | |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | * @param mixed $value |
83 | 83 | * @return \Ajax\semantic\html\content\table\HtmlTableContent |
84 | 84 | */ |
85 | - public function setCellValue($row,$col,$value=""){ |
|
85 | + public function setCellValue($row, $col, $value="") { |
|
86 | 86 | $cell=$this->getCell($row, $col); |
87 | - if(isset($cell)===true){ |
|
87 | + if (isset($cell)===true) { |
|
88 | 88 | $cell->setValue($value); |
89 | 89 | } |
90 | 90 | return $this; |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | * Sets the cells values |
95 | 95 | * @param mixed $values |
96 | 96 | */ |
97 | - public function setValues($values=array()){ |
|
97 | + public function setValues($values=array()) { |
|
98 | 98 | $count=$this->count(); |
99 | - if(\is_array($values)===false){ |
|
99 | + if (\is_array($values)===false) { |
|
100 | 100 | $values=\array_fill(0, $count, $values); |
101 | 101 | } |
102 | - $count=\min(\sizeof($values),$count); |
|
102 | + $count=\min(\sizeof($values), $count); |
|
103 | 103 | |
104 | - for ($i=0;$i<$count;$i++){ |
|
104 | + for ($i=0; $i<$count; $i++) { |
|
105 | 105 | $row=$this->content[$i]; |
106 | 106 | $row->setValues($values[$i]); |
107 | 107 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * Returns the number of rows (TR) |
112 | 112 | * @return int |
113 | 113 | */ |
114 | - public function getRowCount(){ |
|
114 | + public function getRowCount() { |
|
115 | 115 | return $this->count(); |
116 | 116 | } |
117 | 117 | |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | * Returns the number of columns (TD) |
120 | 120 | * @return int |
121 | 121 | */ |
122 | - public function getColCount(){ |
|
122 | + public function getColCount() { |
|
123 | 123 | $result=0; |
124 | - if($this->count()>0) |
|
124 | + if ($this->count()>0) |
|
125 | 125 | $result=$this->getItem(0)->getColCount(); |
126 | 126 | return $result; |
127 | 127 | } |
@@ -132,13 +132,13 @@ discard block |
||
132 | 132 | * @param int $colIndex |
133 | 133 | * @return \Ajax\semantic\html\content\table\HtmlTableContent |
134 | 134 | */ |
135 | - public function delete($rowIndex,$colIndex=NULL){ |
|
136 | - if(isset($colIndex)){ |
|
135 | + public function delete($rowIndex, $colIndex=NULL) { |
|
136 | + if (isset($colIndex)) { |
|
137 | 137 | $row=$this->getItem($rowIndex); |
138 | - if(isset($row)===true){ |
|
138 | + if (isset($row)===true) { |
|
139 | 139 | $row->delete($colIndex); |
140 | 140 | } |
141 | - }else{ |
|
141 | + }else { |
|
142 | 142 | $this->removeItem($rowIndex); |
143 | 143 | } |
144 | 144 | return $this; |
@@ -4,19 +4,19 @@ discard block |
||
4 | 4 | |
5 | 5 | use Ajax\semantic\html\base\HtmlSemCollection; |
6 | 6 | |
7 | -class HtmlTR extends HtmlSemCollection{ |
|
7 | +class HtmlTR extends HtmlSemCollection { |
|
8 | 8 | |
9 | 9 | private $_tdTagName; |
10 | 10 | private $_container; |
11 | 11 | private $_row; |
12 | 12 | |
13 | - public function __construct( $identifier, $colCount){ |
|
14 | - parent::__construct( $identifier, "tr", ""); |
|
13 | + public function __construct($identifier, $colCount) { |
|
14 | + parent::__construct($identifier, "tr", ""); |
|
15 | 15 | } |
16 | 16 | |
17 | - public function setColCount($colCount){ |
|
17 | + public function setColCount($colCount) { |
|
18 | 18 | $count=$this->count(); |
19 | - for($i=$count;$i<$colCount;$i++){ |
|
19 | + for ($i=$count; $i<$colCount; $i++) { |
|
20 | 20 | $item=$this->addItem(NULL); |
21 | 21 | $item->setTagName($this->_tdTagName); |
22 | 22 | } |
@@ -24,36 +24,36 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | - protected function createItem($value){ |
|
27 | + protected function createItem($value) { |
|
28 | 28 | $count=$this->count(); |
29 | - $td=new HtmlTD("",$this->_container,$value,$this->_tdTagName); |
|
29 | + $td=new HtmlTD("", $this->_container, $value, $this->_tdTagName); |
|
30 | 30 | $td->setContainer($this->_container, $this->_row, $count); |
31 | 31 | return $td; |
32 | 32 | } |
33 | 33 | |
34 | - public function setTdTagName($tagName="td"){ |
|
34 | + public function setTdTagName($tagName="td") { |
|
35 | 35 | $this->_tdTagName=$tagName; |
36 | 36 | } |
37 | 37 | |
38 | - public function setContainer($container,$row){ |
|
38 | + public function setContainer($container, $row) { |
|
39 | 39 | $this->_container=$container; |
40 | 40 | $this->_row=$row; |
41 | 41 | } |
42 | 42 | |
43 | - public function setValues($values=array()){ |
|
43 | + public function setValues($values=array()) { |
|
44 | 44 | $count=$this->count(); |
45 | - if(\is_array($values)===false){ |
|
45 | + if (\is_array($values)===false) { |
|
46 | 46 | $values=\array_fill(0, $count, $values); |
47 | 47 | } |
48 | - $count=\min(\sizeof($values),$count); |
|
48 | + $count=\min(\sizeof($values), $count); |
|
49 | 49 | |
50 | - for ($i=0;$i<$count;$i++){ |
|
50 | + for ($i=0; $i<$count; $i++) { |
|
51 | 51 | $cell=$this->content[$i]; |
52 | 52 | $cell->setValue($values[$i]); |
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | - public function delete($index){ |
|
56 | + public function delete($index) { |
|
57 | 57 | $this->removeItem($index); |
58 | 58 | return $this; |
59 | 59 | } |
@@ -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%"; |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | * @param mixed $value |
18 | 18 | * @param CheckboxType $type |
19 | 19 | */ |
20 | - public function htmlCheckbox($identifier, $label=NULL,$value=NULL,$type=NULL){ |
|
21 | - return $this->addHtmlComponent(new HtmlFormCheckbox($identifier,$label,$value,$type)); |
|
20 | + public function htmlCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) { |
|
21 | + return $this->addHtmlComponent(new HtmlFormCheckbox($identifier, $label, $value, $type)); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @param int $rowCount |
27 | 27 | * @param int $colCount |
28 | 28 | */ |
29 | - public function htmlTable($identifier, $rowCount, $colCount){ |
|
29 | + public function htmlTable($identifier, $rowCount, $colCount) { |
|
30 | 30 | return $this->addHtmlComponent(new HtmlTable($identifier, $rowCount, $colCount)); |
31 | 31 | } |
32 | 32 | } |
33 | 33 | \ No newline at end of file |