@@ -64,8 +64,7 @@ discard block |
||
64 | 64 | * Associate an ajax get to the breadcrumb elements, displayed in $targetSelector |
65 | 65 | * $attr member is used to build each element url |
66 | 66 | * @param string $targetSelector the target of the get |
67 | - * @param string $attr the html attribute used to build the elements url |
|
68 | - * @return HtmlBreadcrumbs |
|
67 | + * @return HtmlBreadcrumb |
|
69 | 68 | */ |
70 | 69 | public function autoGetOnClick($targetSelector) { |
71 | 70 | return $this->getOnClick($this->root, $targetSelector, array ("attr" => $this->attr )); |
@@ -91,7 +90,7 @@ discard block |
||
91 | 90 | * Add new elements in breadcrumbs corresponding to request dispatcher : controllerName, actionName, parameters |
92 | 91 | * @param JsUtils $js |
93 | 92 | * @param Dispatcher $dispatcher the request dispatcher |
94 | - * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
|
93 | + * @return HtmlBreadcrumb |
|
95 | 94 | */ |
96 | 95 | public function fromDispatcher(JsUtils $js,$dispatcher, $startIndex=0) { |
97 | 96 | return $this->addItems($js->fromDispatcher($dispatcher)); |
@@ -120,7 +119,7 @@ discard block |
||
120 | 119 | * sets the function who generates the href elements. |
121 | 120 | * default : function($element){return $element->getContent()} |
122 | 121 | * @param function $_hrefFunction |
123 | - * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
|
122 | + * @return HtmlBreadcrumb |
|
124 | 123 | */ |
125 | 124 | public function setHrefFunction($_hrefFunction) { |
126 | 125 | $this->_hrefFunction=$_hrefFunction; |
@@ -181,9 +181,9 @@ |
||
181 | 181 | protected function createItem($value) { |
182 | 182 | $count=$this->count(); |
183 | 183 | $itemO=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section"); |
184 | - if (\is_array($value)) |
|
185 | - $itemO->fromArray($value); |
|
186 | - else { |
|
184 | + if (\is_array($value)) { |
|
185 | + $itemO->fromArray($value); |
|
186 | + } else { |
|
187 | 187 | $itemO->setContent($value); |
188 | 188 | } |
189 | 189 | return $itemO; |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ajax\semantic\html\base\HtmlSemDoubleElement; |
6 | 6 | use Ajax\JsUtils; |
7 | 7 | use Ajax\service\JArray; |
8 | - |
|
9 | 8 | use Ajax\semantic\html\base\constants\State; |
10 | 9 | |
11 | 10 | class HtmlProgress extends HtmlSemDoubleElement { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $this->startIndex=$startIndex; |
52 | 52 | $this->autoActive=$autoActive; |
53 | 53 | $this->_contentSeparator="<div class='divider'> / </div>"; |
54 | - $this->_hrefFunction=function ($e) { |
|
54 | + $this->_hrefFunction=function($e) { |
|
55 | 55 | return $e->getContent(); |
56 | 56 | }; |
57 | 57 | if (isset($hrefFunction)) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return HtmlBreadcrumbs |
69 | 69 | */ |
70 | 70 | public function autoGetOnClick($targetSelector) { |
71 | - return $this->getOnClick($this->root, $targetSelector, array ("attr" => $this->attr )); |
|
71 | + return $this->getOnClick($this->root, $targetSelector, array("attr" => $this->attr)); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function contentAsString() { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | public function setActive($index=null) { |
82 | 82 | if (!isset($index)) { |
83 | - $index=sizeof($this->content) - 1; |
|
83 | + $index=sizeof($this->content)-1; |
|
84 | 84 | } |
85 | 85 | $activeItem=$this->content[$index]; |
86 | 86 | $activeItem->addToProperty("class", "active"); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @param Dispatcher $dispatcher the request dispatcher |
94 | 94 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
95 | 95 | */ |
96 | - public function fromDispatcher(JsUtils $js,$dispatcher, $startIndex=0) { |
|
96 | + public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) { |
|
97 | 97 | return $this->addItems($js->fromDispatcher($dispatcher)); |
98 | 98 | } |
99 | 99 | |
@@ -107,12 +107,12 @@ discard block |
||
107 | 107 | if (!isset($index)) { |
108 | 108 | $index=sizeof($this->content); |
109 | 109 | } |
110 | - if ($this->absolutePaths === true) { |
|
110 | + if ($this->absolutePaths===true) { |
|
111 | 111 | return $this->_hrefFunction($this->content[$index]); |
112 | 112 | } else { |
113 | - return $this->root . implode($separator, array_slice(array_map(function ($e) { |
|
113 | + return $this->root.implode($separator, array_slice(array_map(function($e) { |
|
114 | 114 | return $this->_hrefFunction($e); |
115 | - }, $this->content), $this->startIndex, $index + 1)); |
|
115 | + }, $this->content), $this->startIndex, $index+1)); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | $this->setActive(); |
147 | 147 | } |
148 | 148 | $count=$this->count(); |
149 | - for($i=1; $i < $count; $i++) { |
|
150 | - $this->content[$i]->wrap($this->getContentDivider($i - 1)); |
|
149 | + for ($i=1; $i<$count; $i++) { |
|
150 | + $this->content[$i]->wrap($this->getContentDivider($i-1)); |
|
151 | 151 | } |
152 | 152 | return parent::compile($js, $view); |
153 | 153 | } |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
158 | 158 | */ |
159 | 159 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
160 | - foreach ( $this->content as $element ) { |
|
160 | + foreach ($this->content as $element) { |
|
161 | 161 | $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
162 | 162 | } |
163 | 163 | return $this; |
164 | 164 | } |
165 | 165 | |
166 | 166 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
167 | - foreach ( $this->content as $element ) { |
|
168 | - if ($element->getProperty($this->attr) != NULL){ |
|
167 | + foreach ($this->content as $element) { |
|
168 | + if ($element->getProperty($this->attr)!=NULL) { |
|
169 | 169 | $element->_ajaxOn($operation, $event, $url, $responseElement, $parameters); |
170 | 170 | } |
171 | 171 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | protected function createItem($value) { |
182 | 182 | $count=$this->count(); |
183 | - $itemO=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section"); |
|
183 | + $itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section"); |
|
184 | 184 | if (\is_array($value)) |
185 | 185 | $itemO->fromArray($value); |
186 | 186 | else { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | public function addIconAt($icon, $index) { |
193 | 193 | $item=$this->getItem($index); |
194 | 194 | if (isset($item)) { |
195 | - $icon=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
195 | + $icon=new HtmlIcon("icon-".$this->identifier, $icon); |
|
196 | 196 | $item->wrapContent($icon); |
197 | 197 | } |
198 | 198 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | public function addItem($item) { |
201 | 201 | $count=$this->count(); |
202 | 202 | $itemO=parent::addItem($item); |
203 | - $this->addToPropertyCtrl("class", "section", array ("section" )); |
|
203 | + $this->addToPropertyCtrl("class", "section", array("section")); |
|
204 | 204 | $itemO->setProperty($this->attr, $this->getHref($count)); |
205 | 205 | return $itemO; |
206 | 206 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | public function setAbsolutePaths($absolutePaths) { |
217 | 217 | $this->absolutePaths=$absolutePaths; |
218 | 218 | $size=\sizeof($this->content); |
219 | - for($i=0;$i<$size;$i++){ |
|
219 | + for ($i=0; $i<$size; $i++) { |
|
220 | 220 | $this->content[$i]->setProperty($this->attr, $this->getHref($i)); |
221 | 221 | } |
222 | 222 | return $this; |
@@ -22,6 +22,9 @@ discard block |
||
22 | 22 | private $_colSizing=true; |
23 | 23 | private $_implicitRows=false; |
24 | 24 | |
25 | + /** |
|
26 | + * @param string $identifier |
|
27 | + */ |
|
25 | 28 | public function __construct($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) { |
26 | 29 | parent::__construct($identifier, "div", "ui grid"); |
27 | 30 | $this->_implicitRows=$implicitRows; |
@@ -158,7 +161,7 @@ discard block |
||
158 | 161 | /** |
159 | 162 | * return the row at $index |
160 | 163 | * @param int $index |
161 | - * @return \Ajax\semantic\html\collections\HtmlGridRow |
|
164 | + * @return \Ajax\common\html\HtmlDoubleElement |
|
162 | 165 | */ |
163 | 166 | public function getRow($index) { |
164 | 167 | return $this->getItem($index); |
@@ -297,7 +300,7 @@ discard block |
||
297 | 300 | |
298 | 301 | /** |
299 | 302 | * stretch the row contents to take up the entire column height |
300 | - * @return \Ajax\semantic\html\content\HtmlGridRow |
|
303 | + * @return HtmlGrid |
|
301 | 304 | */ |
302 | 305 | public function setStretched() { |
303 | 306 | return $this->addToProperty("class", "stretched"); |
@@ -81,8 +81,9 @@ discard block |
||
81 | 81 | public function addCol($width=NULL) { |
82 | 82 | $colCount=$this->colCount() + 1; |
83 | 83 | $this->setColsCount($colCount, true, $width); |
84 | - if ($this->hasOnlyCols($this->count())) |
|
85 | - return $this->content[$colCount - 1]; |
|
84 | + if ($this->hasOnlyCols($this->count())) { |
|
85 | + return $this->content[$colCount - 1]; |
|
86 | + } |
|
86 | 87 | return $this; |
87 | 88 | } |
88 | 89 | |
@@ -170,8 +171,9 @@ discard block |
||
170 | 171 | */ |
171 | 172 | public function rowCount() { |
172 | 173 | $count=$this->count(); |
173 | - if ($this->hasOnlyCols($count)) |
|
174 | - return 0; |
|
174 | + if ($this->hasOnlyCols($count)) { |
|
175 | + return 0; |
|
176 | + } |
|
175 | 177 | return $count; |
176 | 178 | } |
177 | 179 | |
@@ -181,10 +183,12 @@ discard block |
||
181 | 183 | */ |
182 | 184 | public function colCount() { |
183 | 185 | $count=$this->count(); |
184 | - if ($this->hasOnlyCols($count)) |
|
185 | - return $count; |
|
186 | - if ($count > 0) |
|
187 | - return $this->getItem(0)->count(); |
|
186 | + if ($this->hasOnlyCols($count)) { |
|
187 | + return $count; |
|
188 | + } |
|
189 | + if ($count > 0) { |
|
190 | + return $this->getItem(0)->count(); |
|
191 | + } |
|
188 | 192 | return 0; |
189 | 193 | } |
190 | 194 | |
@@ -195,8 +199,9 @@ discard block |
||
195 | 199 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
196 | 200 | */ |
197 | 201 | public function getCell($row, $col) { |
198 | - if ($row < 2 && $this->hasOnlyCols($this->count())) |
|
199 | - return $this->getItem($col); |
|
202 | + if ($row < 2 && $this->hasOnlyCols($this->count())) { |
|
203 | + return $this->getItem($col); |
|
204 | + } |
|
200 | 205 | $row=$this->getItem($row); |
201 | 206 | if (isset($row)) { |
202 | 207 | $col=$row->getItem($col); |
@@ -245,8 +250,9 @@ discard block |
||
245 | 250 | * @return \Ajax\semantic\html\collections\HtmlGrid |
246 | 251 | */ |
247 | 252 | public function setPadded($value=NULL) { |
248 | - if (isset($value)) |
|
249 | - $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
253 | + if (isset($value)) { |
|
254 | + $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
255 | + } |
|
250 | 256 | return $this->addToProperty("class", "padded"); |
251 | 257 | } |
252 | 258 | |
@@ -271,8 +277,9 @@ discard block |
||
271 | 277 | * @see \Ajax\common\html\HtmlCollection::createItem() |
272 | 278 | */ |
273 | 279 | protected function createItem($value) { |
274 | - if ($this->_createCols === false) |
|
275 | - $value=null; |
|
280 | + if ($this->_createCols === false) { |
|
281 | + $value=null; |
|
282 | + } |
|
276 | 283 | $item=new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $value, $this->_colSizing, $this->_implicitRows); |
277 | 284 | return $item; |
278 | 285 | } |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | public function asSegment() { |
39 | - return $this->addToPropertyCtrl("class", "segment", array ("segment" )); |
|
39 | + return $this->addToPropertyCtrl("class", "segment", array("segment")); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function asContainer() { |
43 | - return $this->addToPropertyCtrl("class", "container", array ("container" )); |
|
43 | + return $this->addToPropertyCtrl("class", "container", array("container")); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | * @param int $wide |
49 | 49 | */ |
50 | 50 | public function setWide($wide) { |
51 | - if(isset(Wide::getConstants()["W" . $wide])){ |
|
52 | - $wide=Wide::getConstants()["W" . $wide]; |
|
51 | + if (isset(Wide::getConstants()["W".$wide])) { |
|
52 | + $wide=Wide::getConstants()["W".$wide]; |
|
53 | 53 | $this->addToPropertyCtrl("class", $wide, Wide::getConstants()); |
54 | - return $this->addToPropertyCtrl("class", "column", array ("column" )); |
|
54 | + return $this->addToPropertyCtrl("class", "column", array("column")); |
|
55 | 55 | } |
56 | 56 | return $this; |
57 | 57 | } |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | * @return mixed |
72 | 72 | */ |
73 | 73 | public function addRow($colsCount=NULL) { |
74 | - $rowCount=$this->rowCount() + 1; |
|
74 | + $rowCount=$this->rowCount()+1; |
|
75 | 75 | $this->setRowsCount($rowCount, $colsCount, true); |
76 | - return $this->content[$rowCount - 1]; |
|
76 | + return $this->content[$rowCount-1]; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | * @return mixed|\Ajax\semantic\html\collections\HtmlGrid |
83 | 83 | */ |
84 | 84 | public function addCol($width=NULL) { |
85 | - $colCount=$this->colCount() + 1; |
|
85 | + $colCount=$this->colCount()+1; |
|
86 | 86 | $this->setColsCount($colCount, true, $width); |
87 | 87 | if ($this->hasOnlyCols($this->count())) |
88 | - return $this->content[$colCount - 1]; |
|
88 | + return $this->content[$colCount-1]; |
|
89 | 89 | return $this; |
90 | 90 | } |
91 | 91 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @return \Ajax\semantic\html\collections\HtmlGrid |
96 | 96 | */ |
97 | 97 | public function addCols($sizes=array()) { |
98 | - foreach ( $sizes as $size ) { |
|
98 | + foreach ($sizes as $size) { |
|
99 | 99 | $this->addCol($size); |
100 | 100 | } |
101 | 101 | return $this; |
@@ -109,19 +109,19 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function setRowsCount($rowsCount, $colsCount=NULL, $force=false) { |
111 | 111 | $count=$this->count(); |
112 | - if ($rowsCount < 2 && $force === false) { |
|
113 | - for($i=$count; $i < $colsCount; $i++) { |
|
114 | - $this->addItem(new HtmlGridCol("col-" . $this->identifier . "-" . $i)); |
|
112 | + if ($rowsCount<2 && $force===false) { |
|
113 | + for ($i=$count; $i<$colsCount; $i++) { |
|
114 | + $this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i)); |
|
115 | 115 | } |
116 | 116 | } else { |
117 | 117 | if ($this->hasOnlyCols($count)) { |
118 | 118 | $tmpContent=$this->content; |
119 | 119 | $item=$this->addItem($colsCount); |
120 | 120 | $item->setContent($tmpContent); |
121 | - $this->content=array (); |
|
121 | + $this->content=array(); |
|
122 | 122 | $count=1; |
123 | 123 | } |
124 | - for($i=$count; $i < $rowsCount; $i++) { |
|
124 | + for ($i=$count; $i<$rowsCount; $i++) { |
|
125 | 125 | $this->addItem($colsCount); |
126 | 126 | } |
127 | 127 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | protected function hasOnlyCols($count) { |
132 | - return $count > 0 && $this->content[0] instanceof HtmlGridCol; |
|
132 | + return $count>0 && $this->content[0] instanceof HtmlGridCol; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -143,14 +143,14 @@ discard block |
||
143 | 143 | if (isset($width)==false) { |
144 | 144 | $this->setWide($numCols); |
145 | 145 | } |
146 | - if ($toCreate == true) { |
|
146 | + if ($toCreate==true) { |
|
147 | 147 | $count=$this->count(); |
148 | - if ($count == 0 || $this->hasOnlyCols($count)) { |
|
149 | - for($i=$count; $i < $numCols; $i++) { |
|
150 | - $this->addItem(new HtmlGridCol("col-" . $this->identifier . "-" . $i, $width)); |
|
148 | + if ($count==0 || $this->hasOnlyCols($count)) { |
|
149 | + for ($i=$count; $i<$numCols; $i++) { |
|
150 | + $this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i, $width)); |
|
151 | 151 | } |
152 | 152 | } else { |
153 | - for($i=0; $i < $count; $i++) { |
|
153 | + for ($i=0; $i<$count; $i++) { |
|
154 | 154 | $this->getItem($i)->setColsCount($numCols); |
155 | 155 | } |
156 | 156 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $count=$this->count(); |
187 | 187 | if ($this->hasOnlyCols($count)) |
188 | 188 | return $count; |
189 | - if ($count > 0) |
|
189 | + if ($count>0) |
|
190 | 190 | return $this->getItem(0)->count(); |
191 | 191 | return 0; |
192 | 192 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
199 | 199 | */ |
200 | 200 | public function getCell($row, $col) { |
201 | - if ($row < 2 && $this->hasOnlyCols($this->count())) |
|
201 | + if ($row<2 && $this->hasOnlyCols($this->count())) |
|
202 | 202 | return $this->getItem($col); |
203 | 203 | $row=$this->getItem($row); |
204 | 204 | if (isset($row)) { |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | * @return \Ajax\semantic\html\collections\HtmlGrid |
214 | 214 | */ |
215 | 215 | public function setDivided($vertically=false) { |
216 | - $value=($vertically === true) ? "vertically divided" : "divided"; |
|
217 | - return $this->addToPropertyCtrl("class", $value, array ("divided" )); |
|
216 | + $value=($vertically===true) ? "vertically divided" : "divided"; |
|
217 | + return $this->addToPropertyCtrl("class", $value, array("divided")); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | /** |
@@ -223,15 +223,15 @@ discard block |
||
223 | 223 | * @return \Ajax\semantic\html\collections\HtmlGrid |
224 | 224 | */ |
225 | 225 | public function setCelled($internally=false) { |
226 | - $value=($internally === true) ? "internally celled" : "celled"; |
|
227 | - return $this->addToPropertyCtrl("class", $value, array ("celled","internally celled" )); |
|
226 | + $value=($internally===true) ? "internally celled" : "celled"; |
|
227 | + return $this->addToPropertyCtrl("class", $value, array("celled", "internally celled")); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
231 | 231 | * A grid can have its columns centered |
232 | 232 | */ |
233 | 233 | public function setCentered() { |
234 | - return $this->addToPropertyCtrl("class", "centered", array ("centered" )); |
|
234 | + return $this->addToPropertyCtrl("class", "centered", array("centered")); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | */ |
250 | 250 | public function setPadded($value=NULL) { |
251 | 251 | if (isset($value)) |
252 | - $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
252 | + $this->addToPropertyCtrl("class", $value, array("vertically", "horizontally")); |
|
253 | 253 | return $this->addToProperty("class", "padded"); |
254 | 254 | } |
255 | 255 | |
@@ -259,12 +259,12 @@ discard block |
||
259 | 259 | * @return \Ajax\semantic\html\collections\HtmlGrid |
260 | 260 | */ |
261 | 261 | public function setRelaxed($very=false) { |
262 | - $value=($very === true) ? "very relaxed" : "relaxed"; |
|
263 | - return $this->addToPropertyCtrl("class", $value, array ("relaxed","very relaxed" )); |
|
262 | + $value=($very===true) ? "very relaxed" : "relaxed"; |
|
263 | + return $this->addToPropertyCtrl("class", $value, array("relaxed", "very relaxed")); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | public function setVerticalAlignment($value=VerticalAlignment::MIDDLE) { |
267 | - return $this->addToPropertyCtrl("class", $value . " aligned", VerticalAlignment::getConstantValues("aligned")); |
|
267 | + return $this->addToPropertyCtrl("class", $value." aligned", VerticalAlignment::getConstantValues("aligned")); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | /** |
@@ -274,9 +274,9 @@ discard block |
||
274 | 274 | * @see \Ajax\common\html\HtmlCollection::createItem() |
275 | 275 | */ |
276 | 276 | protected function createItem($value) { |
277 | - if ($this->_createCols === false) |
|
277 | + if ($this->_createCols===false) |
|
278 | 278 | $value=null; |
279 | - $item=new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $value, $this->_colSizing, $this->_implicitRows); |
|
279 | + $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1), $value, $this->_colSizing, $this->_implicitRows); |
|
280 | 280 | return $item; |
281 | 281 | } |
282 | 282 | |
@@ -286,15 +286,15 @@ discard block |
||
286 | 286 | */ |
287 | 287 | public function setValues($values, $force=true) { |
288 | 288 | $count=$this->count(); |
289 | - if ($this->_createCols === false || $force === true) { |
|
290 | - for($i=$count; $i < \sizeof($values); $i++) { |
|
289 | + if ($this->_createCols===false || $force===true) { |
|
290 | + for ($i=$count; $i<\sizeof($values); $i++) { |
|
291 | 291 | $colSize=\sizeof($values[$i]); |
292 | - $this->addItem(new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $colSize, $this->_colSizing, $this->_implicitRows)); |
|
292 | + $this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1), $colSize, $this->_colSizing, $this->_implicitRows)); |
|
293 | 293 | } |
294 | 294 | } |
295 | - $count=\min(array ($this->count(),\sizeof($values) )); |
|
296 | - for($i=0; $i < $count; $i++) { |
|
297 | - $this->content[$i]->setValues($values[$i], $this->_createCols === false); |
|
295 | + $count=\min(array($this->count(), \sizeof($values))); |
|
296 | + for ($i=0; $i<$count; $i++) { |
|
297 | + $this->content[$i]->setValues($values[$i], $this->_createCols===false); |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * Sets the menu type |
35 | 35 | * @param string $type one of text,item |
36 | - * @return \Ajax\semantic\html\collections\HtmlMenu |
|
36 | + * @return HtmlMenu |
|
37 | 37 | */ |
38 | 38 | public function setType($type="") { |
39 | 39 | return $this->addToPropertyCtrl("class", $type, array ("","item","text" )); |
@@ -81,6 +81,7 @@ discard block |
||
81 | 81 | * {@inheritDoc} |
82 | 82 | * |
83 | 83 | * @see \Ajax\common\html\HtmlCollection::insertItem() |
84 | + * @param HtmlIcon $item |
|
84 | 85 | */ |
85 | 86 | public function insertItem($item, $position=0) { |
86 | 87 | $item=parent::insertItem($this->getItemToInsert($item), $position); |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | * @return \Ajax\semantic\html\collections\HtmlMenu |
39 | 39 | */ |
40 | 40 | public function setType($type="") { |
41 | - return $this->addToPropertyCtrl("class", $type, array ("","item","text" )); |
|
41 | + return $this->addToPropertyCtrl("class", $type, array("", "item", "text")); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public function setActiveItem($index) { |
45 | 45 | $item=$this->getItem($index); |
46 | - if ($item !== null) { |
|
46 | + if ($item!==null) { |
|
47 | 47 | $item->addToProperty("class", "active"); |
48 | 48 | } |
49 | 49 | return $this; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | private function getItemToInsert($item) { |
53 | 53 | if ($item instanceof HtmlInput || $item instanceof HtmlImg || $item instanceof HtmlIcon || $item instanceof HtmlButton || ($item instanceof HtmlDropdown && $this->propertyContains("class", "vertical")===false)) { |
54 | - $itemO=new HtmlMenuItem("item-" . $this->identifier . "-" . \sizeof($this->content) , $item); |
|
54 | + $itemO=new HtmlMenuItem("item-".$this->identifier."-".\sizeof($this->content), $item); |
|
55 | 55 | $item=$itemO; |
56 | 56 | } |
57 | 57 | return $item; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function afterInsert($item) { |
61 | 61 | if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
62 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
62 | + $item->addToPropertyCtrl("class", "item", array("item")); |
|
63 | 63 | else { |
64 | 64 | $this->setSecondary(); |
65 | 65 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function addItem($item) { |
76 | 76 | $number=$item; |
77 | 77 | $item=parent::addItem($this->getItemToInsert($item)); |
78 | - if(\is_int($number)) |
|
78 | + if (\is_int($number)) |
|
79 | 79 | $item->setProperty("data-page", $number); |
80 | 80 | return $this->afterInsert($item); |
81 | 81 | } |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | |
94 | 94 | public function generateMenuAsItem($menu, $header=null) { |
95 | 95 | $count=$this->count(); |
96 | - $item=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "div"); |
|
96 | + $item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div"); |
|
97 | 97 | if (isset($header)) { |
98 | - $headerItem=new HtmlSemDoubleElement("item-header-" . $this->identifier . "-" . $count, "div", "header"); |
|
98 | + $headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header"); |
|
99 | 99 | $headerItem->setContent($header); |
100 | 100 | $item->addContent($headerItem); |
101 | 101 | $this->_itemHeader=$headerItem; |
102 | 102 | } |
103 | - if(\is_array($menu)){ |
|
104 | - $menu=new HtmlMenu("menu-" . $this->identifier . "-" . $count,$menu); |
|
103 | + if (\is_array($menu)) { |
|
104 | + $menu=new HtmlMenu("menu-".$this->identifier."-".$count, $menu); |
|
105 | 105 | } |
106 | 106 | $menu->setClass("menu"); |
107 | 107 | $item->addContent($menu); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value); |
117 | 117 | $value->addContent(new HtmlIcon("", "dropdown")); |
118 | 118 | $value=$this->addItem($value); |
119 | - $popup=new HtmlPopup($value, "popup-" . $this->identifier . "-" . $this->count(), $content); |
|
119 | + $popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content); |
|
120 | 120 | $popup->setFlowing()->setPosition("bottom left")->setOn("click"); |
121 | 121 | $this->wrap("", $popup); |
122 | 122 | return $popup; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function addDropdownAsItem($value, $items=NULL) { |
126 | 126 | $dd=$value; |
127 | 127 | if (\is_string($value)) { |
128 | - $dd=new HtmlDropdown("dropdown-" . $this->identifier . "-" . $this->count(), $value, $items); |
|
128 | + $dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items); |
|
129 | 129 | } |
130 | 130 | $this->addItem($dd); |
131 | 131 | return $dd; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * @see \Ajax\common\html\html5\HtmlCollection::createItem() |
139 | 139 | */ |
140 | 140 | protected function createItem($value) { |
141 | - $itemO=new HtmlMenuItem($this->identifier."-item-" . \sizeof($this->content),""); |
|
141 | + $itemO=new HtmlMenuItem($this->identifier."-item-".\sizeof($this->content), ""); |
|
142 | 142 | $itemO->setTagName("a"); |
143 | 143 | $itemO->setContent($value); |
144 | 144 | return $itemO; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | public function setSecondary($value=true) { |
152 | - if($value) |
|
152 | + if ($value) |
|
153 | 153 | $this->addToProperty("class", "secondary"); |
154 | 154 | else |
155 | 155 | $this->removePropertyValue("class", "secondary"); |
@@ -157,28 +157,28 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | public function setVertical() { |
160 | - return $this->addToPropertyCtrl("class", "vertical", array ("vertical" )); |
|
160 | + return $this->addToPropertyCtrl("class", "vertical", array("vertical")); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | public function setPosition($value="right") { |
164 | - return $this->addToPropertyCtrl("class", $value, array ("right","left" )); |
|
164 | + return $this->addToPropertyCtrl("class", $value, array("right", "left")); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | public function setPointing($value=Direction::NONE) { |
168 | - return $this->addToPropertyCtrl("class", $value . " pointing", Direction::getConstantValues("pointing")); |
|
168 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | public function asTab($vertical=false) { |
172 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
172 | + $this->apply(function(HtmlDoubleElement&$item) { |
|
173 | 173 | $item->setTagName("a"); |
174 | 174 | }); |
175 | - if ($vertical === true) |
|
175 | + if ($vertical===true) |
|
176 | 176 | $this->setVertical(); |
177 | 177 | return $this->addToProperty("class", "tabular"); |
178 | 178 | } |
179 | 179 | |
180 | 180 | public function asPagination() { |
181 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
181 | + $this->apply(function(HtmlDoubleElement&$item) { |
|
182 | 182 | $item->setTagName("a"); |
183 | 183 | }); |
184 | 184 | return $this->addToProperty("class", "pagination"); |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function setWidth($width) { |
217 | 217 | if (\is_int($width)) { |
218 | - $width=Wide::getConstants()["W" . $width]; |
|
218 | + $width=Wide::getConstants()["W".$width]; |
|
219 | 219 | } |
220 | 220 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
221 | - return $this->addToPropertyCtrl("class", "item", array ("item" )); |
|
221 | + return $this->addToPropertyCtrl("class", "item", array("item")); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | public function addImage($identifier, $src="", $alt="") { |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | return $this->_itemHeader; |
234 | 234 | } |
235 | 235 | |
236 | - public function run(JsUtils $js){ |
|
237 | - $result= parent::run($js); |
|
236 | + public function run(JsUtils $js) { |
|
237 | + $result=parent::run($js); |
|
238 | 238 | return $result->setItemSelector(".item"); |
239 | 239 | } |
240 | 240 | } |
241 | 241 | \ No newline at end of file |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | private function afterInsert($item) { |
61 | - if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
|
62 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
63 | - else { |
|
61 | + if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) { |
|
62 | + $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
63 | + } else { |
|
64 | 64 | $this->setSecondary(); |
65 | 65 | } |
66 | 66 | return $item; |
@@ -75,8 +75,9 @@ discard block |
||
75 | 75 | public function addItem($item) { |
76 | 76 | $number=$item; |
77 | 77 | $item=parent::addItem($this->getItemToInsert($item)); |
78 | - if(\is_int($number)) |
|
79 | - $item->setProperty("data-page", $number); |
|
78 | + if(\is_int($number)) { |
|
79 | + $item->setProperty("data-page", $number); |
|
80 | + } |
|
80 | 81 | return $this->afterInsert($item); |
81 | 82 | } |
82 | 83 | |
@@ -149,10 +150,11 @@ discard block |
||
149 | 150 | } |
150 | 151 | |
151 | 152 | public function setSecondary($value=true) { |
152 | - if($value) |
|
153 | - $this->addToProperty("class", "secondary"); |
|
154 | - else |
|
155 | - $this->removePropertyValue("class", "secondary"); |
|
153 | + if($value) { |
|
154 | + $this->addToProperty("class", "secondary"); |
|
155 | + } else { |
|
156 | + $this->removePropertyValue("class", "secondary"); |
|
157 | + } |
|
156 | 158 | return $this; |
157 | 159 | } |
158 | 160 | |
@@ -172,8 +174,9 @@ discard block |
||
172 | 174 | $this->apply(function (HtmlDoubleElement &$item) { |
173 | 175 | $item->setTagName("a"); |
174 | 176 | }); |
175 | - if ($vertical === true) |
|
176 | - $this->setVertical(); |
|
177 | + if ($vertical === true) { |
|
178 | + $this->setVertical(); |
|
179 | + } |
|
177 | 180 | return $this->addToProperty("class", "tabular"); |
178 | 181 | } |
179 | 182 | |
@@ -202,10 +205,11 @@ discard block |
||
202 | 205 | */ |
203 | 206 | public function fromDatabaseObject($object, $function) { |
204 | 207 | $return=$function($object); |
205 | - if (\is_array($return)) |
|
206 | - $this->addItems($return); |
|
207 | - else |
|
208 | - $this->addItem($return); |
|
208 | + if (\is_array($return)) { |
|
209 | + $this->addItems($return); |
|
210 | + } else { |
|
211 | + $this->addItem($return); |
|
212 | + } |
|
209 | 213 | } |
210 | 214 | |
211 | 215 | /** |
@@ -11,6 +11,9 @@ |
||
11 | 11 | |
12 | 12 | abstract class HtmlAbsractItem extends HtmlSemDoubleElement { |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $baseClass |
|
16 | + */ |
|
14 | 17 | public function __construct($identifier, $baseClass,$content=NULL) { |
15 | 18 | parent::__construct($identifier, "div", $baseClass); |
16 | 19 | $this->content=array(); |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ajax\semantic\html\base\HtmlSemDoubleElement; |
6 | 6 | use Ajax\JsUtils; |
7 | 7 | use Ajax\service\JArray; |
8 | - |
|
9 | 8 | use Ajax\semantic\html\base\constants\State; |
10 | 9 | |
11 | 10 | class HtmlProgress extends HtmlSemDoubleElement { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | abstract class HtmlAbsractItem extends HtmlSemDoubleElement { |
13 | 13 | |
14 | - public function __construct($identifier, $baseClass,$content=NULL) { |
|
14 | + public function __construct($identifier, $baseClass, $content=NULL) { |
|
15 | 15 | parent::__construct($identifier, "div", $baseClass); |
16 | 16 | $this->content=array(); |
17 | 17 | $this->initContent($content); |
@@ -19,53 +19,53 @@ discard block |
||
19 | 19 | |
20 | 20 | protected abstract function initContent($content); |
21 | 21 | |
22 | - public function setIcon($icon){ |
|
22 | + public function setIcon($icon) { |
|
23 | 23 | $this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon); |
24 | 24 | } |
25 | 25 | |
26 | - public function setImage($image){ |
|
26 | + public function setImage($image) { |
|
27 | 27 | $image=new HtmlImg("icon-".$this->identifier, $image); |
28 | 28 | $image->asAvatar(); |
29 | 29 | $this->content["image"]=$image; |
30 | 30 | } |
31 | 31 | |
32 | - private function createContent(){ |
|
33 | - $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content"); |
|
32 | + private function createContent() { |
|
33 | + $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content"); |
|
34 | 34 | return $this->content["content"]; |
35 | 35 | } |
36 | 36 | |
37 | - public function setTitle($title,$description=NULL,$baseClass="title"){ |
|
38 | - $title=new HtmlSemDoubleElement("","div",$baseClass,$title); |
|
39 | - if(\array_key_exists("content", $this->content)===false){ |
|
37 | + public function setTitle($title, $description=NULL, $baseClass="title") { |
|
38 | + $title=new HtmlSemDoubleElement("", "div", $baseClass, $title); |
|
39 | + if (\array_key_exists("content", $this->content)===false) { |
|
40 | 40 | $this->createContent(); |
41 | 41 | } |
42 | 42 | $this->content["content"]->addContent($title); |
43 | - if(isset($description)){ |
|
44 | - $description=new HtmlSemDoubleElement("","div","description",$description); |
|
43 | + if (isset($description)) { |
|
44 | + $description=new HtmlSemDoubleElement("", "div", "description", $description); |
|
45 | 45 | $this->content["content"]->addContent($description); |
46 | 46 | } |
47 | 47 | return $this; |
48 | 48 | } |
49 | 49 | |
50 | - public function getPart($partName="header"){ |
|
51 | - $content=\array_merge($this->content["content"]->getContent(),array(@$this->content["icon"],@$this->content["image"])); |
|
50 | + public function getPart($partName="header") { |
|
51 | + $content=\array_merge($this->content["content"]->getContent(), array(@$this->content["icon"], @$this->content["image"])); |
|
52 | 52 | return $this->getElementByPropertyValue("class", $partName, $content); |
53 | 53 | } |
54 | 54 | |
55 | - public function setActive($value=true){ |
|
56 | - if($value){ |
|
55 | + public function setActive($value=true) { |
|
56 | + if ($value) { |
|
57 | 57 | $this->setTagName("div"); |
58 | 58 | $this->removeProperty("href"); |
59 | 59 | $this->addToPropertyCtrl("class", "active", array("active")); |
60 | - }else{ |
|
60 | + } else { |
|
61 | 61 | $this->removePropertyValue("class", "active"); |
62 | 62 | } |
63 | 63 | return $this; |
64 | 64 | } |
65 | 65 | |
66 | - public function asLink($href=NULL,$part=NULL){ |
|
66 | + public function asLink($href=NULL, $part=NULL) { |
|
67 | 67 | $this->setTagName("a"); |
68 | - if(isset($href)) |
|
68 | + if (isset($href)) |
|
69 | 69 | $this->setProperty("href", $href); |
70 | 70 | return $this; |
71 | 71 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
78 | 78 | */ |
79 | 79 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
80 | - if(\is_array($this->content)) |
|
81 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
80 | + if (\is_array($this->content)) |
|
81 | + $this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]); |
|
82 | 82 | return parent::compile($js, $view); |
83 | 83 | } |
84 | 84 | } |
85 | 85 | \ No newline at end of file |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $this->setTagName("div"); |
58 | 58 | $this->removeProperty("href"); |
59 | 59 | $this->addToPropertyCtrl("class", "active", array("active")); |
60 | - }else{ |
|
60 | + } else{ |
|
61 | 61 | $this->removePropertyValue("class", "active"); |
62 | 62 | } |
63 | 63 | return $this; |
@@ -65,8 +65,9 @@ discard block |
||
65 | 65 | |
66 | 66 | public function asLink($href=NULL,$part=NULL){ |
67 | 67 | $this->setTagName("a"); |
68 | - if(isset($href)) |
|
69 | - $this->setProperty("href", $href); |
|
68 | + if(isset($href)) { |
|
69 | + $this->setProperty("href", $href); |
|
70 | + } |
|
70 | 71 | return $this; |
71 | 72 | } |
72 | 73 | |
@@ -77,8 +78,9 @@ discard block |
||
77 | 78 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
78 | 79 | */ |
79 | 80 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
80 | - if(\is_array($this->content)) |
|
81 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
81 | + if(\is_array($this->content)) { |
|
82 | + $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
83 | + } |
|
82 | 84 | return parent::compile($js, $view); |
83 | 85 | } |
84 | 86 | } |
85 | 87 | \ No newline at end of file |
@@ -22,6 +22,9 @@ discard block |
||
22 | 22 | private $_colSize; |
23 | 23 | private $_implicite=false; |
24 | 24 | |
25 | + /** |
|
26 | + * @param string $identifier |
|
27 | + */ |
|
25 | 28 | public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){ |
26 | 29 | parent::__construct( $identifier,"div","row"); |
27 | 30 | $this->_implicite=$implicite; |
@@ -55,7 +58,7 @@ discard block |
||
55 | 58 | /** |
56 | 59 | * return the col at $index |
57 | 60 | * @param int $index |
58 | - * @return \Ajax\semantic\html\collections\HtmlGridCol |
|
61 | + * @return \Ajax\common\html\HtmlDoubleElement |
|
59 | 62 | */ |
60 | 63 | public function getCol($index){ |
61 | 64 | return $this->getItem($index); |
@@ -16,24 +16,24 @@ discard block |
||
16 | 16 | * @author jc |
17 | 17 | * @version 1.001 |
18 | 18 | */ |
19 | -class HtmlGridRow extends HtmlSemCollection{ |
|
19 | +class HtmlGridRow extends HtmlSemCollection { |
|
20 | 20 | use TextAlignmentTrait; |
21 | 21 | |
22 | 22 | private $_colSize; |
23 | 23 | private $_implicite=false; |
24 | 24 | |
25 | - public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){ |
|
26 | - parent::__construct( $identifier,"div","row"); |
|
25 | + public function __construct($identifier, $numCols=NULL, $colSizing=false, $implicite=false) { |
|
26 | + parent::__construct($identifier, "div", "row"); |
|
27 | 27 | $this->_implicite=$implicite; |
28 | 28 | $width=null; |
29 | - if(isset($numCols)){ |
|
30 | - $numCols=min(16,$numCols); |
|
31 | - $numCols=max(1,$numCols); |
|
32 | - if($colSizing) |
|
29 | + if (isset($numCols)) { |
|
30 | + $numCols=min(16, $numCols); |
|
31 | + $numCols=max(1, $numCols); |
|
32 | + if ($colSizing) |
|
33 | 33 | $width=(int)(16/$numCols); |
34 | 34 | else |
35 | 35 | $this->_colSize=16/$numCols; |
36 | - for ($i=0;$i<$numCols;$i++){ |
|
36 | + for ($i=0; $i<$numCols; $i++) { |
|
37 | 37 | $this->addItem($width); |
38 | 38 | } |
39 | 39 | } |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | * @param int $width |
45 | 45 | * @return \Ajax\semantic\html\content\HtmlGridRow |
46 | 46 | */ |
47 | - public function setWidth($width){ |
|
48 | - if(\is_int($width)){ |
|
47 | + public function setWidth($width) { |
|
48 | + if (\is_int($width)) { |
|
49 | 49 | $width=Wide::getConstants()["W".$width]; |
50 | 50 | } |
51 | 51 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
52 | - return $this->addToPropertyCtrl("class", "column",array("column")); |
|
52 | + return $this->addToPropertyCtrl("class", "column", array("column")); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -57,29 +57,29 @@ discard block |
||
57 | 57 | * @param int $index |
58 | 58 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
59 | 59 | */ |
60 | - public function getCol($index){ |
|
60 | + public function getCol($index) { |
|
61 | 61 | return $this->getItem($index); |
62 | 62 | } |
63 | 63 | |
64 | - public function setColsCount($colsCount,$toCreate=true){ |
|
64 | + public function setColsCount($colsCount, $toCreate=true) { |
|
65 | 65 | $this->setWidth($colsCount); |
66 | - if($toCreate===true){ |
|
66 | + if ($toCreate===true) { |
|
67 | 67 | $count=$this->count(); |
68 | - for($i=$count;$i<$colsCount;$i++){ |
|
68 | + for ($i=$count; $i<$colsCount; $i++) { |
|
69 | 69 | $this->addItem(null); |
70 | 70 | } |
71 | 71 | } |
72 | 72 | return $this; |
73 | 73 | } |
74 | 74 | |
75 | - public function addCols($colCount){ |
|
76 | - for($i=0;$i<$colCount;$i++){ |
|
75 | + public function addCols($colCount) { |
|
76 | + for ($i=0; $i<$colCount; $i++) { |
|
77 | 77 | $this->addItem(null); |
78 | 78 | } |
79 | 79 | return $this; |
80 | 80 | } |
81 | 81 | |
82 | - public function addCol($width=NULL){ |
|
82 | + public function addCol($width=NULL) { |
|
83 | 83 | return $this->addItem($width); |
84 | 84 | } |
85 | 85 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * stretch the row contents to take up the entire column height |
88 | 88 | * @return \Ajax\semantic\html\content\HtmlGridRow |
89 | 89 | */ |
90 | - public function setStretched(){ |
|
90 | + public function setStretched() { |
|
91 | 91 | return $this->addToProperty("class", "stretched"); |
92 | 92 | } |
93 | 93 | |
@@ -95,19 +95,19 @@ discard block |
||
95 | 95 | * @param string $color |
96 | 96 | * @return \Ajax\semantic\html\content\HtmlGridRow |
97 | 97 | */ |
98 | - public function setColor($color){ |
|
99 | - return $this->addToPropertyCtrl("class", $color,Color::getConstants()); |
|
98 | + public function setColor($color) { |
|
99 | + return $this->addToPropertyCtrl("class", $color, Color::getConstants()); |
|
100 | 100 | } |
101 | 101 | |
102 | - public function setValues($values,$force=false){ |
|
102 | + public function setValues($values, $force=false) { |
|
103 | 103 | $count=$this->count(); |
104 | - if($force===true){ |
|
105 | - for($i=$count;$i<\sizeof($values);$i++){ |
|
106 | - $this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1),null)); |
|
104 | + if ($force===true) { |
|
105 | + for ($i=$count; $i<\sizeof($values); $i++) { |
|
106 | + $this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1), null)); |
|
107 | 107 | } |
108 | 108 | } |
109 | - $count=\min(array($this->count(),\sizeof($values))); |
|
110 | - for($i=0;$i<$count;$i++){ |
|
109 | + $count=\min(array($this->count(), \sizeof($values))); |
|
110 | + for ($i=0; $i<$count; $i++) { |
|
111 | 111 | $this->content[$i]->setValue($values[$i]); |
112 | 112 | } |
113 | 113 | return $this; |
@@ -117,15 +117,15 @@ discard block |
||
117 | 117 | * {@inheritDoc} |
118 | 118 | * @see \Ajax\common\html\HtmlCollection::createItem() |
119 | 119 | */ |
120 | - protected function createItem($value){ |
|
121 | - $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value); |
|
120 | + protected function createItem($value) { |
|
121 | + $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value); |
|
122 | 122 | return $col; |
123 | 123 | } |
124 | 124 | |
125 | - public function compile(JsUtils $js=NULL,&$view=NULL){ |
|
126 | - if($this->_implicite===true){ |
|
125 | + public function compile(JsUtils $js=NULL, &$view=NULL) { |
|
126 | + if ($this->_implicite===true) { |
|
127 | 127 | $this->_template="%wrapContentBefore%%content%%wrapContentAfter%"; |
128 | 128 | } |
129 | - return parent::compile($js,$view); |
|
129 | + return parent::compile($js, $view); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | \ No newline at end of file |
@@ -29,10 +29,11 @@ |
||
29 | 29 | if(isset($numCols)){ |
30 | 30 | $numCols=min(16,$numCols); |
31 | 31 | $numCols=max(1,$numCols); |
32 | - if($colSizing) |
|
33 | - $width=(int)(16/$numCols); |
|
34 | - else |
|
35 | - $this->_colSize=16/$numCols; |
|
32 | + if($colSizing) { |
|
33 | + $width=(int)(16/$numCols); |
|
34 | + } else { |
|
35 | + $this->_colSize=16/$numCols; |
|
36 | + } |
|
36 | 37 | for ($i=0;$i<$numCols;$i++){ |
37 | 38 | $this->addItem($width); |
38 | 39 | } |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ajax\semantic\html\base\HtmlSemDoubleElement; |
6 | 6 | use Ajax\JsUtils; |
7 | 7 | use Ajax\service\JArray; |
8 | - |
|
9 | 8 | use Ajax\semantic\html\base\constants\State; |
10 | 9 | |
11 | 10 | class HtmlProgress extends HtmlSemDoubleElement { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * Set the button value |
40 | 40 | * @param string $value |
41 | - * @return \Ajax\semantic\html\HtmlButton |
|
41 | + * @return HtmlButton |
|
42 | 42 | */ |
43 | 43 | public function setValue($value) { |
44 | 44 | $this->content=$value; |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | |
48 | 48 | /** |
49 | 49 | * define the button style |
50 | - * @param string|int $cssStyle |
|
51 | - * @return \Ajax\semantic\html\HtmlButton default : "" |
|
50 | + * @param string $cssStyle |
|
51 | + * @return HtmlButton default : "" |
|
52 | 52 | */ |
53 | 53 | public function setStyle($cssStyle) { |
54 | 54 | return $this->addToProperty("class", $cssStyle); |
@@ -98,7 +98,6 @@ discard block |
||
98 | 98 | |
99 | 99 | /** |
100 | 100 | * Add and return a button label |
101 | - * @param string $caption |
|
102 | 101 | * @param string $before |
103 | 102 | * @param string $icon |
104 | 103 | * @return \Ajax\semantic\html\elements\HtmlLabel |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | public function setFocusable($value=true) { |
58 | - if ($value === true) |
|
58 | + if ($value===true) |
|
59 | 59 | $this->setProperty("tabindex", "0"); |
60 | 60 | else { |
61 | 61 | $this->removeProperty("tabindex"); |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | |
66 | 66 | public function setAnimated($content, $animation="") { |
67 | 67 | $this->setTagName("div"); |
68 | - $this->addToProperty("class", "animated " . $animation); |
|
69 | - $visible=new HtmlSemDoubleElement("visible-" . $this->identifier, "div"); |
|
68 | + $this->addToProperty("class", "animated ".$animation); |
|
69 | + $visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div"); |
|
70 | 70 | $visible->setClass("visible content"); |
71 | 71 | $visible->setContent($this->content); |
72 | - $hidden=new HtmlSemDoubleElement("hidden-" . $this->identifier, "div"); |
|
72 | + $hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div"); |
|
73 | 73 | $hidden->setClass("hidden content"); |
74 | 74 | $hidden->setContent($content); |
75 | - $this->content=array ($visible,$hidden ); |
|
75 | + $this->content=array($visible, $hidden); |
|
76 | 76 | return $hidden; |
77 | 77 | } |
78 | 78 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public function asIcon($icon) { |
85 | 85 | $iconO=$icon; |
86 | 86 | if (\is_string($icon)) { |
87 | - $iconO=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
87 | + $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
|
88 | 88 | } |
89 | 89 | $this->addToProperty("class", "icon"); |
90 | 90 | $this->content=$iconO; |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | public function addLabel($label, $before=false, $icon=NULL) { |
107 | 107 | $this->tagName="div"; |
108 | 108 | $this->addToProperty("class", "labeled"); |
109 | - $this->content=new HtmlButton("button-" . $this->identifier, $this->content); |
|
109 | + $this->content=new HtmlButton("button-".$this->identifier, $this->content); |
|
110 | 110 | $this->content->setTagName("div"); |
111 | - $label=new HtmlLabel("label-" . $this->identifier, $label, $icon,"a"); |
|
111 | + $label=new HtmlLabel("label-".$this->identifier, $label, $icon, "a"); |
|
112 | 112 | $label->setBasic(); |
113 | 113 | $this->addContent($label, $before); |
114 | 114 | return $label; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function fromArray($array) { |
122 | 122 | $array=parent::fromArray($array); |
123 | - foreach ( $array as $key => $value ) { |
|
123 | + foreach ($array as $key => $value) { |
|
124 | 124 | $this->setProperty($key, $value); |
125 | 125 | } |
126 | 126 | return $array; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | public static function social($identifier, $social, $value=NULL) { |
178 | - if ($value === NULL) |
|
178 | + if ($value===NULL) |
|
179 | 179 | $value=\ucfirst($social); |
180 | 180 | $return=new HtmlButton($identifier, $value); |
181 | 181 | $return->addIcon($social); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | public function asLink($href=NULL) { |
198 | - $lnk=new HtmlLink("lnk-".$this->identifier,$href,$this->content); |
|
198 | + $lnk=new HtmlLink("lnk-".$this->identifier, $href, $this->content); |
|
199 | 199 | $this->content=$lnk; |
200 | 200 | return $this; |
201 | 201 | } |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | public function setFocusable($value=true) { |
58 | - if ($value === true) |
|
59 | - $this->setProperty("tabindex", "0"); |
|
60 | - else { |
|
58 | + if ($value === true) { |
|
59 | + $this->setProperty("tabindex", "0"); |
|
60 | + } else { |
|
61 | 61 | $this->removeProperty("tabindex"); |
62 | 62 | } |
63 | 63 | return $this; |
@@ -175,8 +175,9 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | public static function social($identifier, $social, $value=NULL) { |
178 | - if ($value === NULL) |
|
179 | - $value=\ucfirst($social); |
|
178 | + if ($value === NULL) { |
|
179 | + $value=\ucfirst($social); |
|
180 | + } |
|
180 | 181 | $return=new HtmlButton($identifier, $value); |
181 | 182 | $return->addIcon($social); |
182 | 183 | return $return->addToPropertyCtrl("class", $social, Social::getConstants()); |
@@ -13,6 +13,9 @@ |
||
13 | 13 | */ |
14 | 14 | class HtmlIconGroups extends HtmlSemCollection { |
15 | 15 | |
16 | + /** |
|
17 | + * @param string $identifier |
|
18 | + */ |
|
16 | 19 | public function __construct($identifier, $icons=array(), $size="") { |
17 | 20 | parent::__construct($identifier, "i", "icons"); |
18 | 21 | $this->addItems($icons); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $icon=JArray::getValue($value, "icon", 0); |
26 | 26 | $size=JArray::getValue($value, "size", 1); |
27 | 27 | } |
28 | - $iconO=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
28 | + $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
|
29 | 29 | if (isset($size)) { |
30 | 30 | $iconO->setSize($size); |
31 | 31 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | protected function createCondition($value) { |
36 | - return ($value instanceof HtmlIcon) === false; |
|
36 | + return ($value instanceof HtmlIcon)===false; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function getIcon($index) { |
@@ -20,7 +20,6 @@ |
||
20 | 20 | |
21 | 21 | /** |
22 | 22 | * |
23 | - * @param string $side |
|
24 | 23 | * @return \Ajax\semantic\html\elements\HtmlLabel |
25 | 24 | */ |
26 | 25 | public function setPointing($value=Direction::NONE) { |
@@ -91,12 +91,12 @@ |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * Adds an image |
|
95 | - * @param string $src |
|
96 | - * @param string $alt |
|
97 | - * @param boolean $before |
|
98 | - * @return \Ajax\semantic\html\elements\html5\HtmlImg |
|
99 | - */ |
|
94 | + * Adds an image |
|
95 | + * @param string $src |
|
96 | + * @param string $alt |
|
97 | + * @param boolean $before |
|
98 | + * @return \Ajax\semantic\html\elements\html5\HtmlImg |
|
99 | + */ |
|
100 | 100 | public function addImage($src, $alt="", $before=true) { |
101 | 101 | $img=new HtmlImg("image-" . $this->identifier, $src, $alt); |
102 | 102 | $img->setClass(""); |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | * @return \Ajax\semantic\html\elements\HtmlLabel |
25 | 25 | */ |
26 | 26 | public function setPointing($value=Direction::NONE) { |
27 | - if($value==="left" || $value==="right") |
|
27 | + if ($value==="left" || $value==="right") |
|
28 | 28 | return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
29 | 29 | else |
30 | - return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
30 | + return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing", true)); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -36,15 +36,15 @@ discard block |
||
36 | 36 | * @return \Ajax\semantic\html\elements\HtmlLabel |
37 | 37 | */ |
38 | 38 | public function toCorner($side="left") { |
39 | - return $this->addToPropertyCtrl("class", $side . " corner", array ("right corner","left corner" )); |
|
39 | + return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner")); |
|
40 | 40 | } |
41 | 41 | |
42 | - public function setHorizontal(){ |
|
43 | - return $this->addToPropertyCtrl("class", "hozizontal",array("horizontal")); |
|
42 | + public function setHorizontal() { |
|
43 | + return $this->addToPropertyCtrl("class", "hozizontal", array("horizontal")); |
|
44 | 44 | } |
45 | 45 | |
46 | - public function setFloating(){ |
|
47 | - return $this->addToPropertyCtrl("class", "floating",array("floating")); |
|
46 | + public function setFloating() { |
|
47 | + return $this->addToPropertyCtrl("class", "floating", array("floating")); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | return $this->addToProperty("class", "tag"); |
56 | 56 | } |
57 | 57 | |
58 | - public function setEmpty(){ |
|
58 | + public function setEmpty() { |
|
59 | 59 | $this->content=NULL; |
60 | - return $this->addToPropertyCtrl("class", "empty",array("empty")); |
|
60 | + return $this->addToPropertyCtrl("class", "empty", array("empty")); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public function setBasic() { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function addEmphasisImage($src, $alt="", $before=true) { |
75 | 75 | $this->addToProperty("class", "image"); |
76 | - return $this->addImage($src,$alt,$before); |
|
76 | + return $this->addImage($src, $alt, $before); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @return \Ajax\semantic\html\elements\html5\HtmlImg |
85 | 85 | */ |
86 | 86 | public function addAvatarImage($src, $alt="", $before=true) { |
87 | - $img=$this->addImage($src,$alt,$before); |
|
87 | + $img=$this->addImage($src, $alt, $before); |
|
88 | 88 | $img->setClass("ui image"); |
89 | 89 | $img->asAvatar(); |
90 | 90 | return $img; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @return \Ajax\semantic\html\elements\html5\HtmlImg |
99 | 99 | */ |
100 | 100 | public function addImage($src, $alt="", $before=true) { |
101 | - $img=new HtmlImg("image-" . $this->identifier, $src, $alt); |
|
101 | + $img=new HtmlImg("image-".$this->identifier, $src, $alt); |
|
102 | 102 | $img->setClass(""); |
103 | 103 | $this->addContent($img, $before); |
104 | 104 | return $img; |
@@ -110,21 +110,21 @@ discard block |
||
110 | 110 | * @return \Ajax\common\html\HtmlDoubleElement |
111 | 111 | */ |
112 | 112 | public function addDetail($detail) { |
113 | - $div=new HtmlSemDoubleElement("detail-" . $this->identifier, $this->tagName,"detail"); |
|
113 | + $div=new HtmlSemDoubleElement("detail-".$this->identifier, $this->tagName, "detail"); |
|
114 | 114 | $div->setContent($detail); |
115 | 115 | $this->addContent($div); |
116 | 116 | return $div; |
117 | 117 | } |
118 | 118 | |
119 | 119 | public function asRibbon($direction=Direction::NONE) { |
120 | - return $this->addToPropertyCtrl("class", $direction." ribbon", array ("ribbon","right ribbon","left ribbon" )); |
|
120 | + return $this->addToPropertyCtrl("class", $direction." ribbon", array("ribbon", "right ribbon", "left ribbon")); |
|
121 | 121 | } |
122 | 122 | |
123 | - public function setAttached($side=Side::TOP,$direction=Direction::NONE){ |
|
124 | - if($direction!==Direction::NONE) |
|
125 | - return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
123 | + public function setAttached($side=Side::TOP, $direction=Direction::NONE) { |
|
124 | + if ($direction!==Direction::NONE) |
|
125 | + return $this->addToPropertyCtrl("class", $side." ".$direction." attached", Side::getConstantValues($direction." attached")); |
|
126 | 126 | else |
127 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
127 | + return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached")); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | public static function ribbon($identifier, $caption) { |
@@ -14,8 +14,9 @@ discard block |
||
14 | 14 | public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") { |
15 | 15 | parent::__construct($identifier, $tagName, "ui label"); |
16 | 16 | $this->content=$caption; |
17 | - if (isset($icon)===true) |
|
18 | - $this->addIcon($icon); |
|
17 | + if (isset($icon)===true) { |
|
18 | + $this->addIcon($icon); |
|
19 | + } |
|
19 | 20 | } |
20 | 21 | |
21 | 22 | /** |
@@ -24,10 +25,11 @@ discard block |
||
24 | 25 | * @return \Ajax\semantic\html\elements\HtmlLabel |
25 | 26 | */ |
26 | 27 | public function setPointing($value=Direction::NONE) { |
27 | - if($value==="left" || $value==="right") |
|
28 | - return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
29 | - else |
|
30 | - return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
28 | + if($value==="left" || $value==="right") { |
|
29 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
30 | + } else { |
|
31 | + return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
32 | + } |
|
31 | 33 | } |
32 | 34 | |
33 | 35 | /** |
@@ -121,10 +123,11 @@ discard block |
||
121 | 123 | } |
122 | 124 | |
123 | 125 | public function setAttached($side=Side::TOP,$direction=Direction::NONE){ |
124 | - if($direction!==Direction::NONE) |
|
125 | - return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
126 | - else |
|
127 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
126 | + if($direction!==Direction::NONE) { |
|
127 | + return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
128 | + } else { |
|
129 | + return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
130 | + } |
|
128 | 131 | } |
129 | 132 | |
130 | 133 | public static function ribbon($identifier, $caption) { |
@@ -10,6 +10,9 @@ discard block |
||
10 | 10 | class HtmlList extends HtmlSemCollection { |
11 | 11 | protected $_hasCheckedList; |
12 | 12 | |
13 | + /** |
|
14 | + * @param string $identifier |
|
15 | + */ |
|
13 | 16 | public function __construct($identifier, $items=array()) { |
14 | 17 | parent::__construct($identifier, "div", "ui list"); |
15 | 18 | $this->addItems($items); |
@@ -22,6 +25,9 @@ discard block |
||
22 | 25 | return $item; |
23 | 26 | } |
24 | 27 | |
28 | + /** |
|
29 | + * @param integer $niveau |
|
30 | + */ |
|
25 | 31 | public function addHeader($niveau, $content) { |
26 | 32 | $header=new HtmlHeader("header-" . $this->identifier, $niveau, $content, "page"); |
27 | 33 | $this->wrap($header); |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | |
19 | 19 | protected function createItem($value) { |
20 | 20 | $count=$this->count(); |
21 | - $item=new HtmlListItem("item-" . $this->identifier . "-" . $count, $value); |
|
21 | + $item=new HtmlListItem("item-".$this->identifier."-".$count, $value); |
|
22 | 22 | return $item; |
23 | 23 | } |
24 | 24 | |
25 | 25 | public function addHeader($niveau, $content) { |
26 | - $header=new HtmlHeader("header-" . $this->identifier, $niveau, $content, "page"); |
|
26 | + $header=new HtmlHeader("header-".$this->identifier, $niveau, $content, "page"); |
|
27 | 27 | $this->wrap($header); |
28 | 28 | return $header; |
29 | 29 | } |
30 | 30 | |
31 | - public function getItemPart($index,$partName="header"){ |
|
31 | + public function getItemPart($index, $partName="header") { |
|
32 | 32 | return $this->getItem($index)->getPart($partName); |
33 | 33 | } |
34 | 34 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | public function asLink() { |
40 | - $this->addToPropertyCtrl("class", "link", array ("link" )); |
|
40 | + $this->addToPropertyCtrl("class", "link", array("link")); |
|
41 | 41 | return $this->contentAs("a"); |
42 | 42 | } |
43 | 43 | |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | public function run(JsUtils $js) { |
63 | - if ($this->_hasCheckedList === true) { |
|
64 | - $jsCode=include dirname(__FILE__) . '/../../components/jsTemplates/tplCheckedList.php'; |
|
65 | - $jsCode=\str_replace("%identifier%", "#" . $this->identifier, $jsCode); |
|
63 | + if ($this->_hasCheckedList===true) { |
|
64 | + $jsCode=include dirname(__FILE__).'/../../components/jsTemplates/tplCheckedList.php'; |
|
65 | + $jsCode=\str_replace("%identifier%", "#".$this->identifier, $jsCode); |
|
66 | 66 | $this->executeOnRun($jsCode); |
67 | 67 | } |
68 | 68 | return parent::run($js); |
@@ -86,24 +86,24 @@ discard block |
||
86 | 86 | |
87 | 87 | public function addCheckedList($items=array(), $masterItem=NULL, $values=array()) { |
88 | 88 | $count=$this->count(); |
89 | - $identifier=$this->identifier . "-" . $count; |
|
89 | + $identifier=$this->identifier."-".$count; |
|
90 | 90 | if (isset($masterItem)) { |
91 | - $masterO=new HtmlFormCheckbox("master-" . $identifier, $masterItem); |
|
91 | + $masterO=new HtmlFormCheckbox("master-".$identifier, $masterItem); |
|
92 | 92 | $masterO->getField()->addToProperty("class", "master"); |
93 | 93 | $masterO->setClass("item"); |
94 | 94 | $this->addItem($masterO); |
95 | 95 | } |
96 | - $fields=array (); |
|
96 | + $fields=array(); |
|
97 | 97 | $i=0; |
98 | - foreach ( $items as $val => $caption ) { |
|
99 | - $itemO=new HtmlFormCheckbox($identifier . "-" . $i++, $caption, $val, "child"); |
|
100 | - if (\array_search($val, $values) !== false) { |
|
98 | + foreach ($items as $val => $caption) { |
|
99 | + $itemO=new HtmlFormCheckbox($identifier."-".$i++, $caption, $val, "child"); |
|
100 | + if (\array_search($val, $values)!==false) { |
|
101 | 101 | $itemO->getField()->getField()->setProperty("checked", ""); |
102 | 102 | } |
103 | 103 | $itemO->setClass("item"); |
104 | 104 | $fields[]=$itemO; |
105 | 105 | } |
106 | - if (isset($masterO) === true) { |
|
106 | + if (isset($masterO)===true) { |
|
107 | 107 | $list=new HtmlList("", $fields); |
108 | 108 | $list->setClass("list"); |
109 | 109 | $masterO->addContent($list); |