@@ -21,8 +21,9 @@ |
||
21 | 21 | $label->setProperty("tabindex",0); |
22 | 22 | } |
23 | 23 | $this->setClass("ui checkbox"); |
24 | - if(isset($type)) |
|
25 | - $this->setType($type); |
|
24 | + if(isset($type)) { |
|
25 | + $this->setType($type); |
|
26 | + } |
|
26 | 27 | $this->wrap("<div class='field'>","</div>"); |
27 | 28 | } |
28 | 29 |
@@ -10,18 +10,18 @@ |
||
10 | 10 | * @version 1.001 |
11 | 11 | */ |
12 | 12 | class HtmlFormCheckbox extends AbstractHtmlFormRadioCheckbox { |
13 | - public function __construct($identifier, $label=NULL,$value=NULL,$type=NULL) { |
|
14 | - parent::__construct($identifier, NULL,$label,$value,$type); |
|
13 | + public function __construct($identifier, $label=NULL, $value=NULL, $type=NULL) { |
|
14 | + parent::__construct($identifier, NULL, $label, $value, $type); |
|
15 | 15 | $this->_input->setClass("ui checkbox"); |
16 | - if(isset($type)) |
|
16 | + if (isset($type)) |
|
17 | 17 | $this->setType($type); |
18 | 18 | } |
19 | 19 | |
20 | - public static function slider($identifier, $label=NULL,$value=NULL){ |
|
21 | - return new HtmlFormCheckbox($identifier,$label,$value,CheckboxType::SLIDER); |
|
20 | + public static function slider($identifier, $label=NULL, $value=NULL) { |
|
21 | + return new HtmlFormCheckbox($identifier, $label, $value, CheckboxType::SLIDER); |
|
22 | 22 | } |
23 | 23 | |
24 | - public static function toggle($identifier, $label=NULL,$value=NULL){ |
|
25 | - return new HtmlFormCheckbox($identifier,$label,$value,CheckboxType::TOGGLE); |
|
24 | + public static function toggle($identifier, $label=NULL, $value=NULL) { |
|
25 | + return new HtmlFormCheckbox($identifier, $label, $value, CheckboxType::TOGGLE); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | \ No newline at end of file |
@@ -109,6 +109,10 @@ discard block |
||
109 | 109 | return true; |
110 | 110 | } |
111 | 111 | |
112 | + /** |
|
113 | + * @param string $propertyName |
|
114 | + * @param string $value |
|
115 | + */ |
|
112 | 116 | protected function propertyContains($propertyName,$value){ |
113 | 117 | $values=$this->getProperty($propertyName); |
114 | 118 | if(isset($values)){ |
@@ -138,22 +142,36 @@ discard block |
||
138 | 142 | return $this; |
139 | 143 | } |
140 | 144 | |
145 | + /** |
|
146 | + * @param string $name |
|
147 | + * @param string $value |
|
148 | + */ |
|
141 | 149 | protected function removePropertyValue($name,$value){ |
142 | 150 | $this->properties[$name]=\str_replace($value, "", $this->properties[$name]); |
143 | 151 | return $this; |
144 | 152 | } |
145 | 153 | |
154 | + /** |
|
155 | + * @param string $name |
|
156 | + */ |
|
146 | 157 | protected function removePropertyValues($name,$values){ |
147 | 158 | $this->removeOldValues($this->properties[$name], $values); |
148 | 159 | return $this; |
149 | 160 | } |
150 | 161 | |
162 | + /** |
|
163 | + * @param string $name |
|
164 | + */ |
|
151 | 165 | protected function removeProperty($name){ |
152 | 166 | if(\array_key_exists($name, $this->properties)) |
153 | 167 | unset($this->properties[$name]); |
154 | 168 | return $this; |
155 | 169 | } |
156 | 170 | |
171 | + /** |
|
172 | + * @param string $name |
|
173 | + * @param string[] $typeCtrl |
|
174 | + */ |
|
157 | 175 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
158 | 176 | if ($this->ctrl($name, $value, $typeCtrl)===true) { |
159 | 177 | if (is_array($typeCtrl)) { |
@@ -178,6 +196,9 @@ discard block |
||
178 | 196 | return $this->addToProperty($name, $value); |
179 | 197 | } |
180 | 198 | |
199 | + /** |
|
200 | + * @param string $name |
|
201 | + */ |
|
181 | 202 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
182 | 203 | // if($this->ctrl($name, $value, $typeCtrl)===true){ |
183 | 204 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
@@ -317,6 +338,9 @@ discard block |
||
317 | 338 | } |
318 | 339 | } |
319 | 340 | |
341 | + /** |
|
342 | + * @param string $operation |
|
343 | + */ |
|
320 | 344 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
321 | 345 | $params=array ( |
322 | 346 | "url" => $url, |
@@ -327,14 +351,23 @@ discard block |
||
327 | 351 | return $this; |
328 | 352 | } |
329 | 353 | |
354 | + /** |
|
355 | + * @param string $event |
|
356 | + */ |
|
330 | 357 | public function getOn($event, $url, $responseElement="", $parameters=array()) { |
331 | 358 | return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters); |
332 | 359 | } |
333 | 360 | |
361 | + /** |
|
362 | + * @param string $url |
|
363 | + */ |
|
334 | 364 | public function getOnClick($url, $responseElement="", $parameters=array()) { |
335 | 365 | return $this->getOn("click", $url, $responseElement, $parameters); |
336 | 366 | } |
337 | 367 | |
368 | + /** |
|
369 | + * @param string $event |
|
370 | + */ |
|
338 | 371 | public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) { |
339 | 372 | $parameters ["params"]=$params; |
340 | 373 | return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters); |
@@ -344,6 +377,9 @@ discard block |
||
344 | 377 | return $this->postOn("click", $url, $params, $responseElement, $parameters); |
345 | 378 | } |
346 | 379 | |
380 | + /** |
|
381 | + * @param string $event |
|
382 | + */ |
|
347 | 383 | public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) { |
348 | 384 | $parameters ["form"]=$form; |
349 | 385 | return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters); |
@@ -393,6 +429,9 @@ discard block |
||
393 | 429 | return $value; |
394 | 430 | } |
395 | 431 | |
432 | + /** |
|
433 | + * @param string $jqueryCall |
|
434 | + */ |
|
396 | 435 | public function jsDoJquery($jqueryCall, $param=""){ |
397 | 436 | return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");"; |
398 | 437 | } |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | abstract class BaseHtml extends BaseWidget { |
18 | 18 | protected $_template; |
19 | 19 | protected $tagName; |
20 | - protected $properties=array (); |
|
21 | - protected $_events=array (); |
|
20 | + protected $properties=array(); |
|
21 | + protected $_events=array(); |
|
22 | 22 | protected $_wrapBefore=array(); |
23 | 23 | protected $_wrapAfter=array(); |
24 | 24 | protected $_bsComponent; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | public function addToProperty($name, $value, $separator=" ") { |
59 | 59 | $v=@$this->properties[$name]; |
60 | - if (isset($v)&&$v!=="") |
|
60 | + if (isset($v) && $v!=="") |
|
61 | 61 | $v=$v.$separator.$value; |
62 | 62 | else |
63 | 63 | $v=$value; |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | |
73 | 73 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
74 | 74 | $result=$this->getTemplate($js); |
75 | - foreach ( $this as $key => $value ) { |
|
76 | - if (PhalconUtils::startsWith($key, "_")===false&&$key!=="events") { |
|
75 | + foreach ($this as $key => $value) { |
|
76 | + if (PhalconUtils::startsWith($key, "_")===false && $key!=="events") { |
|
77 | 77 | if (is_array($value)) { |
78 | 78 | $v=PropertyWrapper::wrap($value, $js); |
79 | - } else { |
|
79 | + }else { |
|
80 | 80 | $v=$value; |
81 | 81 | } |
82 | 82 | $result=str_ireplace("%".$key."%", $v, $result); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | if (isset($view)===true) { |
89 | 89 | $controls=$view->getVar("q"); |
90 | 90 | if (isset($controls)===false) { |
91 | - $controls=array (); |
|
91 | + $controls=array(); |
|
92 | 92 | } |
93 | 93 | $controls [$this->identifier]=$result; |
94 | 94 | $view->setVar("q", $controls); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | if (array_search($value, $typeCtrl)===false) { |
102 | 102 | throw new \Exception("La valeur passée a propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
103 | 103 | } |
104 | - } else { |
|
104 | + }else { |
|
105 | 105 | if (!$typeCtrl($value)) { |
106 | 106 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name); |
107 | 107 | } |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | return true; |
110 | 110 | } |
111 | 111 | |
112 | - protected function propertyContains($propertyName,$value){ |
|
112 | + protected function propertyContains($propertyName, $value) { |
|
113 | 113 | $values=$this->getProperty($propertyName); |
114 | - if(isset($values)){ |
|
114 | + if (isset($values)) { |
|
115 | 115 | return JString::contains($values, $value); |
116 | 116 | } |
117 | 117 | return false; |
@@ -138,18 +138,18 @@ discard block |
||
138 | 138 | return $this; |
139 | 139 | } |
140 | 140 | |
141 | - protected function removePropertyValue($name,$value){ |
|
141 | + protected function removePropertyValue($name, $value) { |
|
142 | 142 | $this->properties[$name]=\str_replace($value, "", $this->properties[$name]); |
143 | 143 | return $this; |
144 | 144 | } |
145 | 145 | |
146 | - protected function removePropertyValues($name,$values){ |
|
146 | + protected function removePropertyValues($name, $values) { |
|
147 | 147 | $this->removeOldValues($this->properties[$name], $values); |
148 | 148 | return $this; |
149 | 149 | } |
150 | 150 | |
151 | - protected function removeProperty($name){ |
|
152 | - if(\array_key_exists($name, $this->properties)) |
|
151 | + protected function removeProperty($name) { |
|
152 | + if (\array_key_exists($name, $this->properties)) |
|
153 | 153 | unset($this->properties[$name]); |
154 | 154 | return $this; |
155 | 155 | } |
@@ -206,28 +206,28 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | public function fromArray($array) { |
209 | - foreach ( $this as $key => $value ) { |
|
209 | + foreach ($this as $key => $value) { |
|
210 | 210 | if (array_key_exists($key, $array) && !PhalconUtils::startsWith($key, "_")) { |
211 | 211 | $setter="set".ucfirst($key); |
212 | 212 | $this->$setter($array [$key]); |
213 | 213 | unset($array [$key]); |
214 | 214 | } |
215 | 215 | } |
216 | - foreach ( $array as $key => $value ) { |
|
216 | + foreach ($array as $key => $value) { |
|
217 | 217 | if (method_exists($this, $key)) { |
218 | 218 | try { |
219 | 219 | $this->$key($value); |
220 | 220 | unset($array [$key]); |
221 | - } catch ( \Exception $e ) { |
|
221 | + } catch (\Exception $e) { |
|
222 | 222 | // Nothing to do |
223 | 223 | } |
224 | - } else { |
|
224 | + }else { |
|
225 | 225 | $setter="set".ucfirst($key); |
226 | 226 | if (method_exists($this, $setter)) { |
227 | 227 | try { |
228 | 228 | $this->$setter($value); |
229 | 229 | unset($array [$key]); |
230 | - } catch ( \Exception $e ) { |
|
230 | + } catch (\Exception $e) { |
|
231 | 231 | // Nothing to do |
232 | 232 | } |
233 | 233 | } |
@@ -236,21 +236,21 @@ discard block |
||
236 | 236 | return $array; |
237 | 237 | } |
238 | 238 | |
239 | - public function fromDatabaseObjects($objects,$function) { |
|
240 | - if(isset($objects)){ |
|
241 | - foreach ($objects as $object){ |
|
242 | - $this->fromDatabaseObject($object,$function); |
|
239 | + public function fromDatabaseObjects($objects, $function) { |
|
240 | + if (isset($objects)) { |
|
241 | + foreach ($objects as $object) { |
|
242 | + $this->fromDatabaseObject($object, $function); |
|
243 | 243 | } |
244 | 244 | } |
245 | 245 | return $this; |
246 | 246 | } |
247 | 247 | |
248 | - public function fromDatabaseObject($object,$function){ |
|
248 | + public function fromDatabaseObject($object, $function) { |
|
249 | 249 | |
250 | 250 | } |
251 | 251 | |
252 | 252 | public function wrap($before, $after="") { |
253 | - if(isset($before)){ |
|
253 | + if (isset($before)) { |
|
254 | 254 | $this->_wrapBefore[]=$before; |
255 | 255 | } |
256 | 256 | $this->_wrapAfter[]=$after; |
@@ -271,13 +271,13 @@ discard block |
||
271 | 271 | if (array_key_exists($event, $this->_events)) { |
272 | 272 | if (is_array($this->_events [$event])) { |
273 | 273 | $this->_events [$event] []=$jsCode; |
274 | - } else { |
|
275 | - $this->_events [$event]=array ( |
|
274 | + }else { |
|
275 | + $this->_events [$event]=array( |
|
276 | 276 | $this->_events [$event], |
277 | 277 | $jsCode |
278 | 278 | ); |
279 | 279 | } |
280 | - } else { |
|
280 | + }else { |
|
281 | 281 | $this->_events [$event]=$jsCode; |
282 | 282 | } |
283 | 283 | return $this; |
@@ -297,14 +297,14 @@ discard block |
||
297 | 297 | |
298 | 298 | public function addEventsOnRun(JsUtils $js) { |
299 | 299 | if (isset($this->_bsComponent)) { |
300 | - foreach ( $this->_events as $event => $jsCode ) { |
|
300 | + foreach ($this->_events as $event => $jsCode) { |
|
301 | 301 | $code=$jsCode; |
302 | 302 | if (is_array($jsCode)) { |
303 | 303 | $code=""; |
304 | - foreach ( $jsCode as $jsC ) { |
|
304 | + foreach ($jsCode as $jsC) { |
|
305 | 305 | if ($jsC instanceof AjaxCall) { |
306 | 306 | $code.="\n".$jsC->compile($js); |
307 | - } else { |
|
307 | + }else { |
|
308 | 308 | $code.="\n".$jsC; |
309 | 309 | } |
310 | 310 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | } |
319 | 319 | |
320 | 320 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
321 | - $params=array ( |
|
321 | + $params=array( |
|
322 | 322 | "url" => $url, |
323 | 323 | "responseElement" => $responseElement |
324 | 324 | ); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | if (is_array($elements)) { |
358 | 358 | $flag=false; |
359 | 359 | $index=0; |
360 | - while ( !$flag&&$index<sizeof($elements) ) { |
|
360 | + while (!$flag && $index<sizeof($elements)) { |
|
361 | 361 | if ($elements [$index] instanceof BaseHtml) |
362 | 362 | $flag=($elements [$index]->getIdentifier()===$identifier); |
363 | 363 | $index++; |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | return null; |
372 | 372 | } |
373 | 373 | |
374 | - public function __toString(){ |
|
374 | + public function __toString() { |
|
375 | 375 | return $this->compile(); |
376 | 376 | } |
377 | 377 | |
@@ -387,29 +387,29 @@ discard block |
||
387 | 387 | if (is_array($value)) { |
388 | 388 | $value=implode(",", $value); |
389 | 389 | } |
390 | - if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false) { |
|
390 | + if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) { |
|
391 | 391 | $value='"'.$value.'"'; |
392 | 392 | } |
393 | 393 | return $value; |
394 | 394 | } |
395 | 395 | |
396 | - public function jsDoJquery($jqueryCall, $param=""){ |
|
396 | + public function jsDoJquery($jqueryCall, $param="") { |
|
397 | 397 | return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");"; |
398 | 398 | } |
399 | 399 | |
400 | - public function executeOnRun($jsCode){ |
|
400 | + public function executeOnRun($jsCode) { |
|
401 | 401 | return $this->_addEvent("execute", $jsCode); |
402 | 402 | } |
403 | 403 | |
404 | - public function jsHtml($content=""){ |
|
405 | - return $this->jsDoJquery("html",$content); |
|
404 | + public function jsHtml($content="") { |
|
405 | + return $this->jsDoJquery("html", $content); |
|
406 | 406 | } |
407 | 407 | |
408 | - public function jsShow(){ |
|
408 | + public function jsShow() { |
|
409 | 409 | return $this->jsDoJquery("show"); |
410 | 410 | } |
411 | 411 | |
412 | - public function jsHide(){ |
|
412 | + public function jsHide() { |
|
413 | 413 | return $this->jsDoJquery("hide"); |
414 | 414 | } |
415 | 415 |
@@ -10,6 +10,11 @@ discard block |
||
10 | 10 | |
11 | 11 | class HtmlLabel extends HtmlSemDoubleElement { |
12 | 12 | use LabeledIconTrait; |
13 | + |
|
14 | + /** |
|
15 | + * @param string $identifier |
|
16 | + * @param string $icon |
|
17 | + */ |
|
13 | 18 | public function __construct($identifier,$caption="",$icon=NULL,$tagName="div") { |
14 | 19 | parent::__construct($identifier,$tagName,"ui label"); |
15 | 20 | $this->content=$caption; |
@@ -18,7 +23,6 @@ discard block |
||
18 | 23 | } |
19 | 24 | |
20 | 25 | /** |
21 | - * @param string $side |
|
22 | 26 | * @return \Ajax\semantic\html\elements\HtmlLabel |
23 | 27 | */ |
24 | 28 | public function setPointing($value=Direction::NONE){ |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | class HtmlLabel extends HtmlSemDoubleElement { |
12 | 12 | use LabeledIconTrait; |
13 | - public function __construct($identifier,$caption="",$icon=NULL,$tagName="div") { |
|
14 | - parent::__construct($identifier,$tagName,"ui label"); |
|
13 | + public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") { |
|
14 | + parent::__construct($identifier, $tagName, "ui label"); |
|
15 | 15 | $this->content=$caption; |
16 | - if(isset($icon)) |
|
16 | + if (isset($icon)) |
|
17 | 17 | $this->addIcon($icon); |
18 | 18 | } |
19 | 19 | |
@@ -21,33 +21,33 @@ discard block |
||
21 | 21 | * @param string $side |
22 | 22 | * @return \Ajax\semantic\html\elements\HtmlLabel |
23 | 23 | */ |
24 | - public function setPointing($value=Direction::NONE){ |
|
25 | - return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing")); |
|
24 | + public function setPointing($value=Direction::NONE) { |
|
25 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @param string $side |
30 | 30 | * @return \Ajax\semantic\html\elements\HtmlLabel |
31 | 31 | */ |
32 | - public function toCorner($side="left"){ |
|
33 | - return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner")); |
|
32 | + public function toCorner($side="left") { |
|
33 | + return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner")); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @return \Ajax\semantic\html\elements\HtmlLabel |
38 | 38 | */ |
39 | - public function asTag(){ |
|
39 | + public function asTag() { |
|
40 | 40 | return $this->addToProperty("class", "tag"); |
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @return \Ajax\semantic\html\elements\HtmlLabel |
45 | 45 | */ |
46 | - public function asLink(){ |
|
46 | + public function asLink() { |
|
47 | 47 | return $this->setTagName("a"); |
48 | 48 | } |
49 | 49 | |
50 | - public function setBasic(){ |
|
50 | + public function setBasic() { |
|
51 | 51 | return $this->addToProperty("class", "basic"); |
52 | 52 | } |
53 | 53 | |
@@ -58,17 +58,17 @@ discard block |
||
58 | 58 | * @param string $before |
59 | 59 | * @return \Ajax\semantic\html\elements\HtmlLabel |
60 | 60 | */ |
61 | - public function addImage($src,$alt="",$before=true){ |
|
61 | + public function addImage($src, $alt="", $before=true) { |
|
62 | 62 | $this->addToProperty("class", "image"); |
63 | - return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before); |
|
63 | + return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | 67 | * @param string $detail |
68 | 68 | * @return \Ajax\common\html\HtmlDoubleElement |
69 | 69 | */ |
70 | - public function addDetail($detail){ |
|
71 | - $div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName); |
|
70 | + public function addDetail($detail) { |
|
71 | + $div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName); |
|
72 | 72 | $div->setClass("detail"); |
73 | 73 | $div->setContent($detail); |
74 | 74 | $this->addContent($div); |
@@ -13,8 +13,9 @@ |
||
13 | 13 | public function __construct($identifier,$caption="",$icon=NULL,$tagName="div") { |
14 | 14 | parent::__construct($identifier,$tagName,"ui label"); |
15 | 15 | $this->content=$caption; |
16 | - if(isset($icon)) |
|
17 | - $this->addIcon($icon); |
|
16 | + if(isset($icon)) { |
|
17 | + $this->addIcon($icon); |
|
18 | + } |
|
18 | 19 | } |
19 | 20 | |
20 | 21 | /** |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | class JArray { |
6 | 6 | |
7 | 7 | public static function isAssociative($array) { |
8 | - return (array_values($array) !== $array); |
|
8 | + return (array_values($array)!==$array); |
|
9 | 9 | //return (array_keys($array)!==range(0, count($array)-1)); |
10 | 10 | } |
11 | 11 | |
@@ -18,16 +18,16 @@ discard block |
||
18 | 18 | return $values [$pos]; |
19 | 19 | } |
20 | 20 | |
21 | - public static function getConditionalValue($array,$key,$condition){ |
|
21 | + public static function getConditionalValue($array, $key, $condition) { |
|
22 | 22 | $result=NULL; |
23 | 23 | if (array_key_exists($key, $array)) { |
24 | 24 | $result=$array [$key]; |
25 | - if($condition($result)===true) |
|
25 | + if ($condition($result)===true) |
|
26 | 26 | return $result; |
27 | 27 | } |
28 | 28 | $values=array_values($array); |
29 | - foreach ($values as $val){ |
|
30 | - if($condition($val)===true) |
|
29 | + foreach ($values as $val) { |
|
30 | + if ($condition($val)===true) |
|
31 | 31 | return $val; |
32 | 32 | } |
33 | 33 | return $result; |
@@ -36,21 +36,21 @@ discard block |
||
36 | 36 | public static function getDefaultValue($array, $key, $default=NULL) { |
37 | 37 | if (array_key_exists($key, $array)) { |
38 | 38 | return $array [$key]; |
39 | - } else |
|
39 | + }else |
|
40 | 40 | return $default; |
41 | 41 | } |
42 | 42 | |
43 | - public static function implode($glue,$pieces){ |
|
43 | + public static function implode($glue, $pieces) { |
|
44 | 44 | $result=""; |
45 | - if(\is_array($glue)){ |
|
45 | + if (\is_array($glue)) { |
|
46 | 46 | $size=\sizeof($pieces); |
47 | - if($size>0){ |
|
48 | - for($i=0;$i<$size-1;$i++){ |
|
47 | + if ($size>0) { |
|
48 | + for ($i=0; $i<$size-1; $i++) { |
|
49 | 49 | $result.=$pieces[$i].@$glue[$i]; |
50 | 50 | } |
51 | 51 | $result.=$pieces[$size-1]; |
52 | 52 | } |
53 | - }else{ |
|
53 | + }else { |
|
54 | 54 | $result=\implode($glue, $pieces); |
55 | 55 | } |
56 | 56 | return $result; |
@@ -14,21 +14,24 @@ discard block |
||
14 | 14 | return $array [$key]; |
15 | 15 | } |
16 | 16 | $values=array_values($array); |
17 | - if ($pos<sizeof($values)) |
|
18 | - return $values [$pos]; |
|
17 | + if ($pos<sizeof($values)) { |
|
18 | + return $values [$pos]; |
|
19 | + } |
|
19 | 20 | } |
20 | 21 | |
21 | 22 | public static function getConditionalValue($array,$key,$condition){ |
22 | 23 | $result=NULL; |
23 | 24 | if (array_key_exists($key, $array)) { |
24 | 25 | $result=$array [$key]; |
25 | - if($condition($result)===true) |
|
26 | - return $result; |
|
26 | + if($condition($result)===true) { |
|
27 | + return $result; |
|
28 | + } |
|
27 | 29 | } |
28 | 30 | $values=array_values($array); |
29 | 31 | foreach ($values as $val){ |
30 | - if($condition($val)===true) |
|
31 | - return $val; |
|
32 | + if($condition($val)===true) { |
|
33 | + return $val; |
|
34 | + } |
|
32 | 35 | } |
33 | 36 | return $result; |
34 | 37 | } |
@@ -36,8 +39,9 @@ discard block |
||
36 | 39 | public static function getDefaultValue($array, $key, $default=NULL) { |
37 | 40 | if (array_key_exists($key, $array)) { |
38 | 41 | return $array [$key]; |
39 | - } else |
|
40 | - return $default; |
|
42 | + } else { |
|
43 | + return $default; |
|
44 | + } |
|
41 | 45 | } |
42 | 46 | |
43 | 47 | public static function implode($glue,$pieces){ |
@@ -50,7 +54,7 @@ discard block |
||
50 | 54 | } |
51 | 55 | $result.=$pieces[$size-1]; |
52 | 56 | } |
53 | - }else{ |
|
57 | + } else{ |
|
54 | 58 | $result=\implode($glue, $pieces); |
55 | 59 | } |
56 | 60 | return $result; |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | * @param boolean $asIcons |
45 | 45 | * @return HtmlButtonGroups |
46 | 46 | */ |
47 | - public function htmlButtonGroups($identifier,$elements=array(),$asIcons=false){ |
|
48 | - return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements,$asIcons)); |
|
47 | + public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) { |
|
48 | + return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons)); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param string $content |
55 | 55 | * @return HtmlContainer |
56 | 56 | */ |
57 | - public function htmlContainer($identifier,$content=""){ |
|
57 | + public function htmlContainer($identifier, $content="") { |
|
58 | 58 | return $this->addHtmlComponent(new HtmlContainer($identifier, $content)); |
59 | 59 | } |
60 | 60 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * @param string $content |
64 | 64 | * @return HtmlDivider |
65 | 65 | */ |
66 | - public function htmlDivider($identifier,$content="",$tagName="div"){ |
|
67 | - return $this->addHtmlComponent(new HtmlDivider($identifier, $content,$tagName)); |
|
66 | + public function htmlDivider($identifier, $content="", $tagName="div") { |
|
67 | + return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName)); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | * @param string $type |
75 | 75 | * @return HtmlHeader |
76 | 76 | */ |
77 | - public function htmlHeader($identifier,$niveau=1,$content=NULL,$type="page"){ |
|
78 | - return $this->addHtmlComponent(new HtmlHeader($identifier,$niveau,$content,$type)); |
|
77 | + public function htmlHeader($identifier, $niveau=1, $content=NULL, $type="page") { |
|
78 | + return $this->addHtmlComponent(new HtmlHeader($identifier, $niveau, $content, $type)); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * @param string $icon |
84 | 84 | * @return HtmlIcon |
85 | 85 | */ |
86 | - public function htmlIcon($identifier,$icon){ |
|
86 | + public function htmlIcon($identifier, $icon) { |
|
87 | 87 | return $this->addHtmlComponent(new HtmlIcon($identifier, $icon)); |
88 | 88 | } |
89 | 89 | |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | * @param array $icons |
94 | 94 | * @return HtmlIconGroups |
95 | 95 | */ |
96 | - public function htmlIconGroups($identifier,$size="",$icons=array()){ |
|
97 | - $group=new HtmlIconGroups($identifier,$size); |
|
98 | - if(JArray::isAssociative($icons)){ |
|
99 | - foreach ($icons as $icon=>$size){ |
|
100 | - $group->add($icon,$size); |
|
96 | + public function htmlIconGroups($identifier, $size="", $icons=array()) { |
|
97 | + $group=new HtmlIconGroups($identifier, $size); |
|
98 | + if (JArray::isAssociative($icons)) { |
|
99 | + foreach ($icons as $icon=>$size) { |
|
100 | + $group->add($icon, $size); |
|
101 | 101 | } |
102 | - }else{ |
|
103 | - foreach ($icons as $icon){ |
|
102 | + }else { |
|
103 | + foreach ($icons as $icon) { |
|
104 | 104 | $group->add($icon); |
105 | 105 | } |
106 | 106 | } |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | * @param string $placeholder |
116 | 116 | * @return HtmlInput |
117 | 117 | */ |
118 | - public function htmlInput($identifier,$type="text",$value="",$placeholder=""){ |
|
119 | - return $this->addHtmlComponent(new HtmlInput($identifier,$type,$value,$placeholder)); |
|
118 | + public function htmlInput($identifier, $type="text", $value="", $placeholder="") { |
|
119 | + return $this->addHtmlComponent(new HtmlInput($identifier, $type, $value, $placeholder)); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | * @param string $tagName |
126 | 126 | * @return HtmlLabel |
127 | 127 | */ |
128 | - public function htmlLabel($identifier,$content="",$tagName="div"){ |
|
129 | - return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$tagName)); |
|
128 | + public function htmlLabel($identifier, $content="", $tagName="div") { |
|
129 | + return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $tagName)); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | * @param array $items |
136 | 136 | * @return HtmlList |
137 | 137 | */ |
138 | - public function htmlList($identifier,$items=array()){ |
|
139 | - return $this->addHtmlComponent(new HtmlList($identifier,$items)); |
|
138 | + public function htmlList($identifier, $items=array()) { |
|
139 | + return $this->addHtmlComponent(new HtmlList($identifier, $items)); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | * @param string $content |
146 | 146 | * @return HtmlSegment |
147 | 147 | */ |
148 | - public function htmlSegment($identifier, $content=""){ |
|
149 | - return $this->addHtmlComponent(new HtmlSegment($identifier,$content)); |
|
148 | + public function htmlSegment($identifier, $content="") { |
|
149 | + return $this->addHtmlComponent(new HtmlSegment($identifier, $content)); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | * @param array $items the segments |
156 | 156 | * @return HtmlSegmentGroups |
157 | 157 | */ |
158 | - public function htmlSegmentGroups($identifier, $items=array()){ |
|
159 | - return $this->addHtmlComponent(new HtmlSegmentGroups($identifier,$items)); |
|
158 | + public function htmlSegmentGroups($identifier, $items=array()) { |
|
159 | + return $this->addHtmlComponent(new HtmlSegmentGroups($identifier, $items)); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | * @param mixed $value |
166 | 166 | * @param CheckboxType $type |
167 | 167 | */ |
168 | - public function htmlCheckbox($identifier, $label=NULL,$value=NULL,$type=NULL){ |
|
169 | - return $this->addHtmlComponent(new HtmlFormCheckbox($identifier,$label,$value,$type)); |
|
168 | + public function htmlCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) { |
|
169 | + return $this->addHtmlComponent(new HtmlFormCheckbox($identifier, $label, $value, $type)); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | * @param RevealType|string $type |
177 | 177 | * @param Direction|string $attributeType |
178 | 178 | */ |
179 | - public function htmlReveal($identifier, $visibleContent,$hiddenContent,$type=RevealType::FADE,$attributeType=NULL){ |
|
180 | - return $this->addHtmlComponent(new HtmlReveal($identifier,$visibleContent,$hiddenContent,$type,$attributeType)); |
|
179 | + public function htmlReveal($identifier, $visibleContent, $hiddenContent, $type=RevealType::FADE, $attributeType=NULL) { |
|
180 | + return $this->addHtmlComponent(new HtmlReveal($identifier, $visibleContent, $hiddenContent, $type, $attributeType)); |
|
181 | 181 | } |
182 | 182 | |
183 | - public function htmlStep($identifier, $steps=array()){ |
|
184 | - return $this->addHtmlComponent(new HtmlStep($identifier,$steps)); |
|
183 | + public function htmlStep($identifier, $steps=array()) { |
|
184 | + return $this->addHtmlComponent(new HtmlStep($identifier, $steps)); |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | \ No newline at end of file |
@@ -10,64 +10,64 @@ |
||
10 | 10 | |
11 | 11 | class HtmlReveal extends HtmlSemDoubleElement { |
12 | 12 | |
13 | - public function __construct($identifier, $visibleContent,$hiddenContent,$type=RevealType::FADE,$attributeType=NULL) { |
|
13 | + public function __construct($identifier, $visibleContent, $hiddenContent, $type=RevealType::FADE, $attributeType=NULL) { |
|
14 | 14 | parent::__construct($identifier, "div", "ui reveal"); |
15 | 15 | $this->setElement(0, $visibleContent); |
16 | 16 | $this->setElement(1, $hiddenContent); |
17 | - $this->setType($type,$attributeType); |
|
17 | + $this->setType($type, $attributeType); |
|
18 | 18 | } |
19 | 19 | |
20 | - private function setElement($index,$content){ |
|
21 | - if(!$content instanceof HtmlSingleElement){ |
|
22 | - $content=new HtmlLabel("",$content); |
|
20 | + private function setElement($index, $content) { |
|
21 | + if (!$content instanceof HtmlSingleElement) { |
|
22 | + $content=new HtmlLabel("", $content); |
|
23 | 23 | } |
24 | - if($content instanceof HtmlSemDoubleElement){ |
|
25 | - $content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content); |
|
26 | - }elseif ($content instanceof HtmlImg){ |
|
24 | + if ($content instanceof HtmlSemDoubleElement) { |
|
25 | + $content=new HtmlSemDoubleElement($this->identifier."-".$index, "div", "", $content); |
|
26 | + }elseif ($content instanceof HtmlImg) { |
|
27 | 27 | $this->addToPropertyCtrl("class", "image", array("image")); |
28 | 28 | } |
29 | - $content->addToProperty("class",(($index===0)?"visible":"hidden")." content"); |
|
29 | + $content->addToProperty("class", (($index===0) ? "visible" : "hidden")." content"); |
|
30 | 30 | $this->content[$index]=$content; |
31 | 31 | return $this; |
32 | 32 | } |
33 | 33 | |
34 | - public function setVisibleContent($visibleContent){ |
|
34 | + public function setVisibleContent($visibleContent) { |
|
35 | 35 | return $this->setElement(0, $visibleContent); |
36 | 36 | } |
37 | 37 | |
38 | - public function setHiddenContent($hiddenContent){ |
|
38 | + public function setHiddenContent($hiddenContent) { |
|
39 | 39 | return $this->setElement(1, $hiddenContent); |
40 | 40 | } |
41 | 41 | |
42 | - public function getVisibleContent(){ |
|
42 | + public function getVisibleContent() { |
|
43 | 43 | return $this->content[0]; |
44 | 44 | } |
45 | 45 | |
46 | - public function getHiddenContent(){ |
|
46 | + public function getHiddenContent() { |
|
47 | 47 | return $this->content[1]; |
48 | 48 | } |
49 | 49 | |
50 | - public function setType($type,$attribute=NULL){ |
|
50 | + public function setType($type, $attribute=NULL) { |
|
51 | 51 | $this->addToPropertyCtrl("class", $type, RevealType::getConstants()); |
52 | - if(isset($attribute)){ |
|
52 | + if (isset($attribute)) { |
|
53 | 53 | $this->addToPropertyCtrl("class", $attribute, Direction::getConstants()); |
54 | 54 | } |
55 | 55 | return $this; |
56 | 56 | } |
57 | 57 | |
58 | - public function setFade($attribute=NULL){ |
|
59 | - return $this->setType(RevealType::FADE,$attribute); |
|
58 | + public function setFade($attribute=NULL) { |
|
59 | + return $this->setType(RevealType::FADE, $attribute); |
|
60 | 60 | } |
61 | 61 | |
62 | - public function setMove($attribute=NULL){ |
|
63 | - return $this->setType(RevealType::MOVE,$attribute); |
|
62 | + public function setMove($attribute=NULL) { |
|
63 | + return $this->setType(RevealType::MOVE, $attribute); |
|
64 | 64 | } |
65 | 65 | |
66 | - public function setRotate($attribute=NULL){ |
|
67 | - return $this->setType(RevealType::ROTATE,$attribute); |
|
66 | + public function setRotate($attribute=NULL) { |
|
67 | + return $this->setType(RevealType::ROTATE, $attribute); |
|
68 | 68 | } |
69 | 69 | |
70 | - public function setCircular(){ |
|
70 | + public function setCircular() { |
|
71 | 71 | return $this->addToProperty("class", "circular"); |
72 | 72 | } |
73 | 73 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | } |
24 | 24 | if($content instanceof HtmlSemDoubleElement){ |
25 | 25 | $content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content); |
26 | - }elseif ($content instanceof HtmlImg){ |
|
26 | + } elseif ($content instanceof HtmlImg){ |
|
27 | 27 | $this->addToPropertyCtrl("class", "image", array("image")); |
28 | 28 | } |
29 | 29 | $content->addToProperty("class",(($index===0)?"visible":"hidden")." content"); |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | use Ajax\common\html\HtmlDoubleElement; |
10 | 10 | use Ajax\semantic\html\base\constants\Side; |
11 | 11 | |
12 | -class HtmlStep extends HtmlSemCollection{ |
|
12 | +class HtmlStep extends HtmlSemCollection { |
|
13 | 13 | protected $_activeStep; |
14 | 14 | |
15 | - public function __construct( $identifier,$steps=array()){ |
|
16 | - parent::__construct( $identifier,"div", "ui steps"); |
|
15 | + public function __construct($identifier, $steps=array()) { |
|
16 | + parent::__construct($identifier, "div", "ui steps"); |
|
17 | 17 | $this->addItems($steps); |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @see \Ajax\common\html\html5\HtmlCollection::createItem() |
24 | 24 | */ |
25 | 25 | protected function createItem($value) { |
26 | - $itemO=new HtmlStepItem("item-".\sizeof($this->content),$value); |
|
26 | + $itemO=new HtmlStepItem("item-".\sizeof($this->content), $value); |
|
27 | 27 | return $itemO; |
28 | 28 | } |
29 | 29 | |
@@ -31,50 +31,50 @@ discard block |
||
31 | 31 | * @param string|array $step |
32 | 32 | * @return HtmlStepItem |
33 | 33 | */ |
34 | - public function addStep($step){ |
|
34 | + public function addStep($step) { |
|
35 | 35 | return $this->addItem($step); |
36 | 36 | } |
37 | 37 | |
38 | - public function setOrdered(){ |
|
38 | + public function setOrdered() { |
|
39 | 39 | return $this->addToProperty("class", "ordered"); |
40 | 40 | } |
41 | 41 | |
42 | - public function isOrdered(){ |
|
42 | + public function isOrdered() { |
|
43 | 43 | return $this->propertyContains("class", "ordered"); |
44 | 44 | } |
45 | 45 | |
46 | - public function setVertical(){ |
|
46 | + public function setVertical() { |
|
47 | 47 | return $this->addToProperty("class", "vertical"); |
48 | 48 | } |
49 | 49 | |
50 | - protected function defineActiveStep(){ |
|
50 | + protected function defineActiveStep() { |
|
51 | 51 | $activestep=$this->_activeStep; |
52 | 52 | $count=$this->count(); |
53 | - if($this->isOrdered()){ |
|
54 | - for($i=0;$i<$count;$i++){ |
|
53 | + if ($this->isOrdered()) { |
|
54 | + for ($i=0; $i<$count; $i++) { |
|
55 | 55 | $step=$this->content[$i]; |
56 | 56 | $step->removeStatus(); |
57 | - if($i<$activestep) |
|
57 | + if ($i<$activestep) |
|
58 | 58 | $step->setCompleted(); |
59 | 59 | elseif ($i===$activestep) |
60 | 60 | $step->setActive(); |
61 | 61 | else |
62 | 62 | $step->setDisabled(); |
63 | 63 | } |
64 | - }else{ |
|
65 | - foreach ($this->content as $step){ |
|
64 | + }else { |
|
65 | + foreach ($this->content as $step) { |
|
66 | 66 | $step->removeStatus(); |
67 | 67 | } |
68 | - if($activestep<$count) |
|
68 | + if ($activestep<$count) |
|
69 | 69 | $this->content[$activestep]->setActive(); |
70 | 70 | } |
71 | 71 | return $this; |
72 | 72 | } |
73 | 73 | |
74 | 74 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
75 | - if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) |
|
75 | + if (isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) |
|
76 | 76 | $this->defineActiveStep(); |
77 | - return parent::compile($js,$view); |
|
77 | + return parent::compile($js, $view); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | public function setActiveStep($_activeStep) { |
@@ -82,15 +82,15 @@ discard block |
||
82 | 82 | return $this; |
83 | 83 | } |
84 | 84 | |
85 | - public function setAttached($side="",HtmlDoubleElement $toElement=NULL){ |
|
86 | - if(isset($toElement)){ |
|
87 | - $toElement->addToPropertyCtrl("class", "attached",array("attached")); |
|
85 | + public function setAttached($side="", HtmlDoubleElement $toElement=NULL) { |
|
86 | + if (isset($toElement)) { |
|
87 | + $toElement->addToPropertyCtrl("class", "attached", array("attached")); |
|
88 | 88 | } |
89 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
89 | + return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached")); |
|
90 | 90 | } |
91 | 91 | |
92 | - public function asLink(){ |
|
93 | - foreach ($this->content as $step){ |
|
92 | + public function asLink() { |
|
93 | + foreach ($this->content as $step) { |
|
94 | 94 | $step->asLink(); |
95 | 95 | } |
96 | 96 | return $this; |
@@ -54,26 +54,29 @@ |
||
54 | 54 | for($i=0;$i<$count;$i++){ |
55 | 55 | $step=$this->content[$i]; |
56 | 56 | $step->removeStatus(); |
57 | - if($i<$activestep) |
|
58 | - $step->setCompleted(); |
|
59 | - elseif ($i===$activestep) |
|
60 | - $step->setActive(); |
|
61 | - else |
|
62 | - $step->setDisabled(); |
|
57 | + if($i<$activestep) { |
|
58 | + $step->setCompleted(); |
|
59 | + } elseif ($i===$activestep) { |
|
60 | + $step->setActive(); |
|
61 | + } else { |
|
62 | + $step->setDisabled(); |
|
63 | + } |
|
63 | 64 | } |
64 | - }else{ |
|
65 | + } else{ |
|
65 | 66 | foreach ($this->content as $step){ |
66 | 67 | $step->removeStatus(); |
67 | 68 | } |
68 | - if($activestep<$count) |
|
69 | - $this->content[$activestep]->setActive(); |
|
69 | + if($activestep<$count) { |
|
70 | + $this->content[$activestep]->setActive(); |
|
71 | + } |
|
70 | 72 | } |
71 | 73 | return $this; |
72 | 74 | } |
73 | 75 | |
74 | 76 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
75 | - if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) |
|
76 | - $this->defineActiveStep(); |
|
77 | + if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) { |
|
78 | + $this->defineActiveStep(); |
|
79 | + } |
|
77 | 80 | return parent::compile($js,$view); |
78 | 81 | } |
79 | 82 |
@@ -7,24 +7,24 @@ |
||
7 | 7 | use Ajax\semantic\html\base\constants\Size; |
8 | 8 | |
9 | 9 | class HtmlImage extends HtmlSemDoubleElement { |
10 | - public function __construct($identifier, $src="", $alt="",$size=NULL) { |
|
11 | - $image=new HtmlImg("img-",$src,$alt); |
|
12 | - parent::__construct($identifier, "div","ui image",$image); |
|
13 | - if(isset($size)) |
|
10 | + public function __construct($identifier, $src="", $alt="", $size=NULL) { |
|
11 | + $image=new HtmlImg("img-", $src, $alt); |
|
12 | + parent::__construct($identifier, "div", "ui image", $image); |
|
13 | + if (isset($size)) |
|
14 | 14 | $this->setSize($size); |
15 | 15 | } |
16 | 16 | |
17 | - public function setCircular(){ |
|
17 | + public function setCircular() { |
|
18 | 18 | return $this->addToProperty("class", "circular"); |
19 | 19 | } |
20 | 20 | |
21 | - public function asAvatar($caption=NULL){ |
|
22 | - if(isset($caption)) |
|
23 | - $this->wrap("",$caption); |
|
21 | + public function asAvatar($caption=NULL) { |
|
22 | + if (isset($caption)) |
|
23 | + $this->wrap("", $caption); |
|
24 | 24 | return $this->addToProperty("class", "avatar"); |
25 | 25 | } |
26 | 26 | |
27 | - public static function small($identifier, $src="", $alt=""){ |
|
28 | - return new HtmlImage($identifier,$src,$alt,Size::SMALL); |
|
27 | + public static function small($identifier, $src="", $alt="") { |
|
28 | + return new HtmlImage($identifier, $src, $alt, Size::SMALL); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -10,8 +10,9 @@ discard block |
||
10 | 10 | public function __construct($identifier, $src="", $alt="",$size=NULL) { |
11 | 11 | $image=new HtmlImg("img-",$src,$alt); |
12 | 12 | parent::__construct($identifier, "div","ui image",$image); |
13 | - if(isset($size)) |
|
14 | - $this->setSize($size); |
|
13 | + if(isset($size)) { |
|
14 | + $this->setSize($size); |
|
15 | + } |
|
15 | 16 | } |
16 | 17 | |
17 | 18 | public function setCircular(){ |
@@ -19,8 +20,9 @@ discard block |
||
19 | 20 | } |
20 | 21 | |
21 | 22 | public function asAvatar($caption=NULL){ |
22 | - if(isset($caption)) |
|
23 | - $this->wrap("",$caption); |
|
23 | + if(isset($caption)) { |
|
24 | + $this->wrap("",$caption); |
|
25 | + } |
|
24 | 26 | return $this->addToProperty("class", "avatar"); |
25 | 27 | } |
26 | 28 |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | abstract class StepStatus extends BaseEnum { |
8 | - const ACTIVE="active",COMPLETED="completed",DISABLED="disabled",NONE=""; |
|
8 | + const ACTIVE="active", COMPLETED="completed", DISABLED="disabled", NONE=""; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |