@@ -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%"; |
@@ -105,17 +105,20 @@ discard block |
||
105 | 105 | $max=\min($colIndex, $rows[$i]->count()); |
106 | 106 | for($j=0; $j < $max; $j++) { |
107 | 107 | $rowspan=$rows[$i]->getItem($j)->getRowspan(); |
108 | - if ($rowspan + $i > $this->_row) |
|
109 | - $pos++; |
|
108 | + if ($rowspan + $i > $this->_row) { |
|
109 | + $pos++; |
|
110 | + } |
|
110 | 111 | } |
111 | 112 | } |
112 | - if ($pos > $colIndex) |
|
113 | - return NULL; |
|
113 | + if ($pos > $colIndex) { |
|
114 | + return NULL; |
|
115 | + } |
|
114 | 116 | $count=$this->count(); |
115 | 117 | for($i=0; $i < $count; $i++) { |
116 | 118 | $pos+=$this->content[$i]->getColspan(); |
117 | - if ($pos >= $colIndex + 1) |
|
118 | - return $i; |
|
119 | + if ($pos >= $colIndex + 1) { |
|
120 | + return $i; |
|
121 | + } |
|
119 | 122 | } |
120 | 123 | return null; |
121 | 124 | } |
@@ -138,8 +141,9 @@ discard block |
||
138 | 141 | public function containsStr($needle) { |
139 | 142 | $cells=$this->content; |
140 | 143 | foreach ( $cells as $cell ) { |
141 | - if (\strpos($cell->getContent(), $needle) !== false) |
|
142 | - return true; |
|
144 | + if (\strpos($cell->getContent(), $needle) !== false) { |
|
145 | + return true; |
|
146 | + } |
|
143 | 147 | } |
144 | 148 | return false; |
145 | 149 | } |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | |
21 | 21 | public function __construct($identifier) { |
22 | 22 | parent::__construct($identifier, "tr", ""); |
23 | - self::$_states=[ State::ACTIVE,State::POSITIVE,State::NEGATIVE,State::WARNING,State::ERROR,State::DISABLED ]; |
|
23 | + self::$_states=[State::ACTIVE, State::POSITIVE, State::NEGATIVE, State::WARNING, State::ERROR, State::DISABLED]; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function setColCount($colCount) { |
27 | 27 | $count=$this->count(); |
28 | - for($i=$count; $i < $colCount; $i++) { |
|
28 | + for ($i=$count; $i<$colCount; $i++) { |
|
29 | 29 | $item=$this->addItem(NULL); |
30 | 30 | $item->setTagName($this->_tdTagName); |
31 | 31 | } |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function setValues($values=array()) { |
67 | 67 | $count=$this->count(); |
68 | - if (\is_array($values) === false) { |
|
68 | + if (\is_array($values)===false) { |
|
69 | 69 | $values=\array_fill(0, $count, $values); |
70 | - } else { |
|
71 | - if (JArray::isAssociative($values) === true) { |
|
70 | + }else { |
|
71 | + if (JArray::isAssociative($values)===true) { |
|
72 | 72 | $values=\array_values($values); |
73 | 73 | } |
74 | 74 | } |
75 | 75 | $count=\min(\sizeof($values), $count); |
76 | 76 | |
77 | - for($i=0; $i < $count; $i++) { |
|
77 | + for ($i=0; $i<$count; $i++) { |
|
78 | 78 | $cell=$this->content[$i]; |
79 | 79 | $cell->setValue($values[$i]); |
80 | 80 | } |
@@ -101,20 +101,20 @@ discard block |
||
101 | 101 | public function getColPosition($colIndex) { |
102 | 102 | $pos=0; |
103 | 103 | $rows=$this->_container->getContent(); |
104 | - for($i=0; $i < $this->_row; $i++) { |
|
104 | + for ($i=0; $i<$this->_row; $i++) { |
|
105 | 105 | $max=\min($colIndex, $rows[$i]->count()); |
106 | - for($j=0; $j < $max; $j++) { |
|
106 | + for ($j=0; $j<$max; $j++) { |
|
107 | 107 | $rowspan=$rows[$i]->getItem($j)->getRowspan(); |
108 | - if ($rowspan + $i > $this->_row) |
|
108 | + if ($rowspan+$i>$this->_row) |
|
109 | 109 | $pos++; |
110 | 110 | } |
111 | 111 | } |
112 | - if ($pos > $colIndex) |
|
112 | + if ($pos>$colIndex) |
|
113 | 113 | return NULL; |
114 | 114 | $count=$this->count(); |
115 | - for($i=0; $i < $count; $i++) { |
|
115 | + for ($i=0; $i<$count; $i++) { |
|
116 | 116 | $pos+=$this->content[$i]->getColspan(); |
117 | - if ($pos >= $colIndex + 1) |
|
117 | + if ($pos>=$colIndex+1) |
|
118 | 118 | return $i; |
119 | 119 | } |
120 | 120 | return null; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | public function conditionalCellFormat($callback, $format) { |
124 | 124 | $cells=$this->content; |
125 | - foreach ( $cells as $cell ) { |
|
125 | + foreach ($cells as $cell) { |
|
126 | 126 | $cell->conditionalCellFormat($callback, $format); |
127 | 127 | } |
128 | 128 | return $this; |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | |
138 | 138 | public function containsStr($needle) { |
139 | 139 | $cells=$this->content; |
140 | - foreach ( $cells as $cell ) { |
|
141 | - if (\strpos($cell->getContent(), $needle) !== false) |
|
140 | + foreach ($cells as $cell) { |
|
141 | + if (\strpos($cell->getContent(), $needle)!==false) |
|
142 | 142 | return true; |
143 | 143 | } |
144 | 144 | return false; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | public function applyCells($callback) { |
153 | 153 | $cells=$this->content; |
154 | - foreach ( $cells as $cell ) { |
|
154 | + foreach ($cells as $cell) { |
|
155 | 155 | $cell->apply($callback); |
156 | 156 | } |
157 | 157 | return $this; |
@@ -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 | } |
@@ -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 |
@@ -23,8 +23,6 @@ |
||
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @param string $identifier |
26 | - * @param int $rowCount |
|
27 | - * @param int $colCount |
|
28 | 26 | */ |
29 | 27 | public function htmlRating($identifier, $value, $max,$icon=""){ |
30 | 28 | return $this->addHtmlComponent(new HtmlRating($identifier, $value, $max,$icon)); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * @param int $max |
14 | 14 | * @param string $icon star or heart |
15 | 15 | */ |
16 | - public function __construct($identifier, $value,$max=5,$icon="") { |
|
16 | + public function __construct($identifier, $value, $max=5, $icon="") { |
|
17 | 17 | parent::__construct($identifier, "div", "ui {$icon} rating"); |
18 | 18 | $this->setValue($value); |
19 | 19 | $this->setMax($max); |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | * {@inheritDoc} |
24 | 24 | * @see \Ajax\common\html\HtmlDoubleElement::setValue() |
25 | 25 | */ |
26 | - public function setValue($value){ |
|
26 | + public function setValue($value) { |
|
27 | 27 | $this->setProperty("data-rating", $value); |
28 | 28 | } |
29 | 29 | |
30 | - public function setMax($max){ |
|
30 | + public function setMax($max) { |
|
31 | 31 | $this->setProperty("data-max-rating", $max); |
32 | 32 | } |
33 | 33 | |
@@ -35,20 +35,20 @@ discard block |
||
35 | 35 | * {@inheritDoc} |
36 | 36 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
37 | 37 | */ |
38 | - public function run(JsUtils $js){ |
|
38 | + public function run(JsUtils $js) { |
|
39 | 39 | parent::run($js); |
40 | - return $js->semantic()->rating("#".$this->identifier,$this->_params); |
|
40 | + return $js->semantic()->rating("#".$this->identifier, $this->_params); |
|
41 | 41 | } |
42 | 42 | |
43 | - public function asStar(){ |
|
43 | + public function asStar() { |
|
44 | 44 | return $this->setIcon(); |
45 | 45 | } |
46 | 46 | |
47 | - public function asHeart(){ |
|
47 | + public function asHeart() { |
|
48 | 48 | return $this->setIcon("heart"); |
49 | 49 | } |
50 | 50 | |
51 | - public function setIcon($icon="star"){ |
|
52 | - return $this->addToPropertyCtrl("class", $icon, ["star","heart",""]); |
|
51 | + public function setIcon($icon="star") { |
|
52 | + return $this->addToPropertyCtrl("class", $icon, ["star", "heart", ""]); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | \ No newline at end of file |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | if (isset($type)) { |
19 | 19 | if ($type=="page") { |
20 | 20 | $this->asPageHeader($niveau); |
21 | - } else |
|
21 | + }else |
|
22 | 22 | $this->asContentHeader($niveau); |
23 | 23 | } |
24 | 24 | $this->content=$content; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | if (!\is_object($title)) { |
53 | 53 | $this->content=new HtmlDoubleElement("content-".$this->identifier, "div"); |
54 | 54 | $this->content->setContent($title); |
55 | - } else { |
|
55 | + }else { |
|
56 | 56 | $this->content=$title; |
57 | 57 | } |
58 | 58 | $this->content->setClass("content"); |
@@ -18,8 +18,9 @@ |
||
18 | 18 | if (isset($type)) { |
19 | 19 | if ($type=="page") { |
20 | 20 | $this->asPageHeader($niveau); |
21 | - } else |
|
22 | - $this->asContentHeader($niveau); |
|
21 | + } else { |
|
22 | + $this->asContentHeader($niveau); |
|
23 | + } |
|
23 | 24 | } |
24 | 25 | $this->content=$content; |
25 | 26 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * @param int $rowCount |
14 | 14 | * @param int $colCount |
15 | 15 | */ |
16 | - public function htmlTable($identifier, $rowCount, $colCount){ |
|
16 | + public function htmlTable($identifier, $rowCount, $colCount) { |
|
17 | 17 | return $this->addHtmlComponent(new HtmlTable($identifier, $rowCount, $colCount)); |
18 | 18 | } |
19 | 19 | } |
20 | 20 | \ No newline at end of file |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | use Ajax\semantic\traits\SemanticHtmlModulesTrait; |
24 | 24 | |
25 | 25 | class Semantic extends BaseGui { |
26 | - use SemanticComponentsTrait,SemanticHtmlElementsTrait,SemanticHtmlCollectionsTrait, |
|
26 | + use SemanticComponentsTrait, SemanticHtmlElementsTrait, SemanticHtmlCollectionsTrait, |
|
27 | 27 | SemanticHtmlModulesTrait; |
28 | 28 | |
29 | 29 | public function __construct($autoCompile=true) { |
@@ -36,24 +36,24 @@ discard block |
||
36 | 36 | * @param array $items |
37 | 37 | * @return Ajax\semantic\html\collections\HtmlMenu |
38 | 38 | */ |
39 | - public function htmlMenu($identifier,$items=array()){ |
|
40 | - return $this->addHtmlComponent(new HtmlMenu($identifier,$items)); |
|
39 | + public function htmlMenu($identifier, $items=array()) { |
|
40 | + return $this->addHtmlComponent(new HtmlMenu($identifier, $items)); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /**Adds an icon menu |
44 | 44 | * @param string $identifier |
45 | 45 | * @param array $items icons |
46 | 46 | */ |
47 | - public function htmlIconMenu($identifier,$items=array()){ |
|
48 | - return $this->addHtmlComponent(new HtmlIconMenu($identifier,$items)); |
|
47 | + public function htmlIconMenu($identifier, $items=array()) { |
|
48 | + return $this->addHtmlComponent(new HtmlIconMenu($identifier, $items)); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /**Adds an labeled icon menu |
52 | 52 | * @param string $identifier |
53 | 53 | * @param array $items icons |
54 | 54 | */ |
55 | - public function htmlLabeledIconMenu($identifier,$items=array()){ |
|
56 | - return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier,$items)); |
|
55 | + public function htmlLabeledIconMenu($identifier, $items=array()) { |
|
56 | + return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier, $items)); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | * @param string $value |
62 | 62 | * @param array $items |
63 | 63 | */ |
64 | - public function htmlDropdown($identifier, $value="", $items=array()){ |
|
65 | - return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items)); |
|
64 | + public function htmlDropdown($identifier, $value="", $items=array()) { |
|
65 | + return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items)); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -70,16 +70,16 @@ discard block |
||
70 | 70 | * @param string $identifier |
71 | 71 | * @param string $content |
72 | 72 | */ |
73 | - public function htmlMessage($identifier, $content=""){ |
|
74 | - return $this->addHtmlComponent(new HtmlMessage($identifier,$content)); |
|
73 | + public function htmlMessage($identifier, $content="") { |
|
74 | + return $this->addHtmlComponent(new HtmlMessage($identifier, $content)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
78 | 78 | * @param string $identifier |
79 | 79 | * @param mixed $content |
80 | 80 | */ |
81 | - public function htmlPopup(BaseHtml $container,$identifier,$content){ |
|
82 | - return $this->addHtmlComponent(new HtmlPopup($container,$identifier,$content)); |
|
81 | + public function htmlPopup(BaseHtml $container, $identifier, $content) { |
|
82 | + return $this->addHtmlComponent(new HtmlPopup($container, $identifier, $content)); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | * @param boolean $createCols |
90 | 90 | * @param boolean $implicitRows |
91 | 91 | */ |
92 | - public function htmlGrid($identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){ |
|
93 | - return $this->addHtmlComponent(new HtmlGrid($identifier,$numRows,$numCols,$createCols,$implicitRows)); |
|
92 | + public function htmlGrid($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) { |
|
93 | + return $this->addHtmlComponent(new HtmlGrid($identifier, $numRows, $numCols, $createCols, $implicitRows)); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()} |
104 | 104 | * @return HtmlBreadcrumb |
105 | 105 | */ |
106 | - public function htmlBreadcrumb( $identifier,$items=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){ |
|
107 | - return $this->addHtmlComponent(new HtmlBreadcrumb($identifier,$items,$autoActive,$startIndex,$hrefFunction)); |
|
106 | + public function htmlBreadcrumb($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) { |
|
107 | + return $this->addHtmlComponent(new HtmlBreadcrumb($identifier, $items, $autoActive, $startIndex, $hrefFunction)); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | * @param string $identifier |
122 | 122 | * @return HtmlAccordion |
123 | 123 | */ |
124 | - public function htmlAccordionMenu($identifier,$items=array()) { |
|
125 | - return $this->addHtmlComponent(new HtmlAccordionMenu($identifier,$items)); |
|
124 | + public function htmlAccordionMenu($identifier, $items=array()) { |
|
125 | + return $this->addHtmlComponent(new HtmlAccordionMenu($identifier, $items)); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | * @param string $identifier |
131 | 131 | * @param array $elements |
132 | 132 | */ |
133 | - public function htmlForm($identifier,$elements=array()) { |
|
134 | - return $this->addHtmlComponent(new HtmlForm($identifier,$elements)); |
|
133 | + public function htmlForm($identifier, $elements=array()) { |
|
134 | + return $this->addHtmlComponent(new HtmlForm($identifier, $elements)); |
|
135 | 135 | } |
136 | 136 | |
137 | - public function htmlSticky($identifier,$content=array()) { |
|
138 | - return $this->addHtmlComponent(new HtmlSticky($identifier,$content)); |
|
137 | + public function htmlSticky($identifier, $content=array()) { |
|
138 | + return $this->addHtmlComponent(new HtmlSticky($identifier, $content)); |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 | \ No newline at end of file |
@@ -6,6 +6,9 @@ |
||
6 | 6 | |
7 | 7 | trait CheckboxTrait { |
8 | 8 | |
9 | + /** |
|
10 | + * @param string $name |
|
11 | + */ |
|
9 | 12 | public abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
10 | 13 | |
11 | 14 | public function setType($checkboxType) { |