@@ -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 |
@@ -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 | } |
@@ -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){ |
@@ -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 | /** |
@@ -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; |
@@ -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"); |
@@ -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 |
@@ -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 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $title=JArray::getValue($content, "title",1); |
19 | 19 | $desc=JArray::getValue($content, "description",2); |
20 | 20 | $status=JArray::getValue($content, "status",3); |
21 | - }else{ |
|
21 | + } else{ |
|
22 | 22 | $icon=@$content["icon"]; |
23 | 23 | $title=@$content["title"]; |
24 | 24 | $desc=@$content["description"]; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | if(isset($title)===true){ |
34 | 34 | $this->setTitle($title,$desc); |
35 | 35 | } |
36 | - }else{ |
|
36 | + } else{ |
|
37 | 37 | $this->setContent($content); |
38 | 38 | } |
39 | 39 | } |