@@ -11,35 +11,35 @@ discard block |
||
11 | 11 | */ |
12 | 12 | class HtmlButtonGroups extends HtmlSemDoubleElement { |
13 | 13 | |
14 | - public function __construct($identifier, $elements=array(),$asIcons=false) { |
|
15 | - parent::__construct($identifier, "div","ui buttons"); |
|
14 | + public function __construct($identifier, $elements=array(), $asIcons=false) { |
|
15 | + parent::__construct($identifier, "div", "ui buttons"); |
|
16 | 16 | $this->content=array(); |
17 | - if($asIcons===true) |
|
17 | + if ($asIcons===true) |
|
18 | 18 | $this->asIcons(); |
19 | - $this->addElements($elements,$asIcons); |
|
19 | + $this->addElements($elements, $asIcons); |
|
20 | 20 | } |
21 | - public function addElement($element,$asIcon=false){ |
|
21 | + public function addElement($element, $asIcon=false) { |
|
22 | 22 | $elementO=$element; |
23 | - if(\is_string($element)){ |
|
24 | - if($asIcon){ |
|
23 | + if (\is_string($element)) { |
|
24 | + if ($asIcon) { |
|
25 | 25 | $elementO=new HtmlButton("button-".\sizeof($this->content)); |
26 | 26 | $elementO->asIcon($element); |
27 | 27 | }else |
28 | - $elementO=new HtmlButton("button-".\sizeof($this->content),$element); |
|
28 | + $elementO=new HtmlButton("button-".\sizeof($this->content), $element); |
|
29 | 29 | } |
30 | 30 | $this->addContent($elementO); |
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | - public function addElements($elements,$asIcons=false) { |
|
35 | - foreach ( $elements as $element ) { |
|
36 | - $this->addElement($element,$asIcons); |
|
34 | + public function addElements($elements, $asIcons=false) { |
|
35 | + foreach ($elements as $element) { |
|
36 | + $this->addElement($element, $asIcons); |
|
37 | 37 | } |
38 | 38 | return $this; |
39 | 39 | } |
40 | 40 | |
41 | - public function insertOr($aferIndex=0,$or="or"){ |
|
42 | - $orElement=new HtmlSemDoubleElement("or-".$this->identifier,"div","or"); |
|
41 | + public function insertOr($aferIndex=0, $or="or") { |
|
42 | + $orElement=new HtmlSemDoubleElement("or-".$this->identifier, "div", "or"); |
|
43 | 43 | $orElement->setProperty("data-text", $or); |
44 | 44 | array_splice($this->content, $aferIndex+1, 0, array($orElement)); |
45 | 45 | return $this; |
@@ -52,18 +52,18 @@ discard block |
||
52 | 52 | $this->addElements($array); |
53 | 53 | } |
54 | 54 | |
55 | - public function asIcons(){ |
|
56 | - foreach ($this->content as $item){ |
|
55 | + public function asIcons() { |
|
56 | + foreach ($this->content as $item) { |
|
57 | 57 | $item->asIcon($item->getContent()); |
58 | 58 | } |
59 | 59 | return $this->addToProperty("class", "icons"); |
60 | 60 | } |
61 | 61 | |
62 | - public function setVertical(){ |
|
62 | + public function setVertical() { |
|
63 | 63 | return $this->addToProperty("class", "vertical"); |
64 | 64 | } |
65 | 65 | |
66 | - public function setLabeled(){ |
|
66 | + public function setLabeled() { |
|
67 | 67 | return $this->addToProperty("class", "labeled icon"); |
68 | 68 | } |
69 | 69 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
92 | 92 | */ |
93 | 93 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
94 | - foreach ( $this->content as $element ) { |
|
94 | + foreach ($this->content as $element) { |
|
95 | 95 | $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
96 | 96 | } |
97 | 97 | return $this; |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | * @param string $action one of "select","auto","activate","combo","nothing","hide" |
18 | 18 | * @return \Ajax\semantic\components\Dropdown |
19 | 19 | */ |
20 | - public function setAction($action){ |
|
21 | - return $this->setParamCtrl("action", $action,array("select","auto","activate","combo","nothing","hide")); |
|
20 | + public function setAction($action) { |
|
21 | + return $this->setParamCtrl("action", $action, array("select", "auto", "activate", "combo", "nothing", "hide")); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | * @param string $event Event used to trigger dropdown (Hover, Click, Custom Event) |
27 | 27 | * @return \Ajax\semantic\components\Dropdown |
28 | 28 | */ |
29 | - public function setOn($event){ |
|
29 | + public function setOn($event) { |
|
30 | 30 | return $this->setParam("on", $event); |
31 | 31 | } |
32 | 32 | |
33 | - public function setFullTextSearch($value){ |
|
33 | + public function setFullTextSearch($value) { |
|
34 | 34 | return $this->setParam("fullTextSearch", $value); |
35 | 35 | } |
36 | 36 | } |
37 | 37 | \ No newline at end of file |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | abstract class BaseHtml extends BaseWidget { |
17 | 17 | protected $_template; |
18 | 18 | protected $tagName; |
19 | - protected $properties=array (); |
|
20 | - protected $events=array (); |
|
19 | + protected $properties=array(); |
|
20 | + protected $events=array(); |
|
21 | 21 | protected $wrapBefore=""; |
22 | 22 | protected $wrapAfter=""; |
23 | 23 | protected $_bsComponent; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | public function addToProperty($name, $value, $separator=" ") { |
58 | 58 | $v=@$this->properties[$name]; |
59 | - if (isset($v)&&$v!=="") |
|
59 | + if (isset($v) && $v!=="") |
|
60 | 60 | $v=$v.$separator.$value; |
61 | 61 | else |
62 | 62 | $v=$value; |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | |
72 | 72 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
73 | 73 | $result=$this->getTemplate(); |
74 | - foreach ( $this as $key => $value ) { |
|
75 | - if (PhalconUtils::startsWith($key, "_")===false&&$key!=="events") { |
|
74 | + foreach ($this as $key => $value) { |
|
75 | + if (PhalconUtils::startsWith($key, "_")===false && $key!=="events") { |
|
76 | 76 | if (is_array($value)) { |
77 | 77 | $v=PropertyWrapper::wrap($value, $js); |
78 | - } else { |
|
78 | + }else { |
|
79 | 79 | $v=$value; |
80 | 80 | } |
81 | 81 | $result=str_ireplace("%".$key."%", $v, $result); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if (isset($view)===true) { |
88 | 88 | $controls=$view->getVar("q"); |
89 | 89 | if (isset($controls)===false) { |
90 | - $controls=array (); |
|
90 | + $controls=array(); |
|
91 | 91 | } |
92 | 92 | $controls [$this->identifier]=$result; |
93 | 93 | $view->setVar("q", $controls); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (array_search($value, $typeCtrl)===false) { |
101 | 101 | throw new \Exception("La valeur passée a propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
102 | 102 | } |
103 | - } else { |
|
103 | + }else { |
|
104 | 104 | if (!$typeCtrl($value)) { |
105 | 105 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name); |
106 | 106 | } |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | return true; |
109 | 109 | } |
110 | 110 | |
111 | - protected function propertyContains($propertyName,$value){ |
|
111 | + protected function propertyContains($propertyName, $value) { |
|
112 | 112 | $values=$this->getProperty($propertyName); |
113 | - if(isset($values)){ |
|
113 | + if (isset($values)) { |
|
114 | 114 | return JString::contains($values, $value); |
115 | 115 | } |
116 | 116 | return false; |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | return $this; |
138 | 138 | } |
139 | 139 | |
140 | - protected function removePropertyValue($name,$value){ |
|
140 | + protected function removePropertyValue($name, $value) { |
|
141 | 141 | $this->properties[$name]=\str_replace($value, "", $this->properties[$name]); |
142 | 142 | return $this; |
143 | 143 | } |
144 | 144 | |
145 | - protected function removeProperty($name){ |
|
146 | - if(\array_key_exists($name, $this->properties)) |
|
145 | + protected function removeProperty($name) { |
|
146 | + if (\array_key_exists($name, $this->properties)) |
|
147 | 147 | unset($this->properties[$name]); |
148 | 148 | return $this; |
149 | 149 | } |
@@ -196,28 +196,28 @@ discard block |
||
196 | 196 | } |
197 | 197 | |
198 | 198 | public function fromArray($array) { |
199 | - foreach ( $this as $key => $value ) { |
|
199 | + foreach ($this as $key => $value) { |
|
200 | 200 | if (array_key_exists($key, $array) && !PhalconUtils::startsWith($key, "_")) { |
201 | 201 | $setter="set".ucfirst($key); |
202 | 202 | $this->$setter($array [$key]); |
203 | 203 | unset($array [$key]); |
204 | 204 | } |
205 | 205 | } |
206 | - foreach ( $array as $key => $value ) { |
|
206 | + foreach ($array as $key => $value) { |
|
207 | 207 | if (method_exists($this, $key)) { |
208 | 208 | try { |
209 | 209 | $this->$key($value); |
210 | 210 | unset($array [$key]); |
211 | - } catch ( \Exception $e ) { |
|
211 | + } catch (\Exception $e) { |
|
212 | 212 | // Nothing to do |
213 | 213 | } |
214 | - } else { |
|
214 | + }else { |
|
215 | 215 | $setter="set".ucfirst($key); |
216 | 216 | if (method_exists($this, $setter)) { |
217 | 217 | try { |
218 | 218 | $this->$setter($value); |
219 | 219 | unset($array [$key]); |
220 | - } catch ( \Exception $e ) { |
|
220 | + } catch (\Exception $e) { |
|
221 | 221 | // Nothing to do |
222 | 222 | } |
223 | 223 | } |
@@ -226,21 +226,21 @@ discard block |
||
226 | 226 | return $array; |
227 | 227 | } |
228 | 228 | |
229 | - public function fromDatabaseObjects($objects,$function) { |
|
230 | - if(isset($objects)){ |
|
231 | - foreach ($objects as $object){ |
|
232 | - $this->fromDatabaseObject($object,$function); |
|
229 | + public function fromDatabaseObjects($objects, $function) { |
|
230 | + if (isset($objects)) { |
|
231 | + foreach ($objects as $object) { |
|
232 | + $this->fromDatabaseObject($object, $function); |
|
233 | 233 | } |
234 | 234 | } |
235 | 235 | return $this; |
236 | 236 | } |
237 | 237 | |
238 | - public function fromDatabaseObject($object,$function){ |
|
238 | + public function fromDatabaseObject($object, $function) { |
|
239 | 239 | |
240 | 240 | } |
241 | 241 | |
242 | 242 | public function wrap($before, $after="") { |
243 | - if(isset($before)){ |
|
243 | + if (isset($before)) { |
|
244 | 244 | $this->wrapBefore.=$before; |
245 | 245 | } |
246 | 246 | $this->wrapAfter=$after.$this->wrapAfter; |
@@ -262,13 +262,13 @@ discard block |
||
262 | 262 | if (array_key_exists($event, $this->events)) { |
263 | 263 | if (is_array($this->events [$event])) { |
264 | 264 | $this->events [$event] []=$jsCode; |
265 | - } else { |
|
266 | - $this->events [$event]=array ( |
|
265 | + }else { |
|
266 | + $this->events [$event]=array( |
|
267 | 267 | $this->events [$event], |
268 | 268 | $jsCode |
269 | 269 | ); |
270 | 270 | } |
271 | - } else { |
|
271 | + }else { |
|
272 | 272 | $this->events [$event]=$jsCode; |
273 | 273 | } |
274 | 274 | } |
@@ -287,14 +287,14 @@ discard block |
||
287 | 287 | |
288 | 288 | public function addEventsOnRun(JsUtils $js) { |
289 | 289 | if (isset($this->_bsComponent)) { |
290 | - foreach ( $this->events as $event => $jsCode ) { |
|
290 | + foreach ($this->events as $event => $jsCode) { |
|
291 | 291 | $code=$jsCode; |
292 | 292 | if (is_array($jsCode)) { |
293 | 293 | $code=""; |
294 | - foreach ( $jsCode as $jsC ) { |
|
294 | + foreach ($jsCode as $jsC) { |
|
295 | 295 | if ($jsC instanceof AjaxCall) { |
296 | 296 | $code.="\n".$jsC->compile($js); |
297 | - } else { |
|
297 | + }else { |
|
298 | 298 | $code.="\n".$jsC; |
299 | 299 | } |
300 | 300 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | |
310 | 310 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
311 | - $params=array ( |
|
311 | + $params=array( |
|
312 | 312 | "url" => $url, |
313 | 313 | "responseElement" => $responseElement |
314 | 314 | ); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | if (is_array($elements)) { |
348 | 348 | $flag=false; |
349 | 349 | $index=0; |
350 | - while ( !$flag&&$index<sizeof($elements) ) { |
|
350 | + while (!$flag && $index<sizeof($elements)) { |
|
351 | 351 | if ($elements [$index] instanceof BaseHtml) |
352 | 352 | $flag=($elements [$index]->getIdentifier()===$identifier); |
353 | 353 | $index++; |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | return null; |
362 | 362 | } |
363 | 363 | |
364 | - public function __toString(){ |
|
364 | + public function __toString() { |
|
365 | 365 | return $this->compile(); |
366 | 366 | } |
367 | 367 | |
@@ -377,25 +377,25 @@ discard block |
||
377 | 377 | if (is_array($value)) { |
378 | 378 | $value=implode(",", $value); |
379 | 379 | } |
380 | - if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false) { |
|
380 | + if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) { |
|
381 | 381 | $value='"'.$value.'"'; |
382 | 382 | } |
383 | 383 | return $value; |
384 | 384 | } |
385 | 385 | |
386 | - public function jsDoJquery($jqueryCall, $param=""){ |
|
386 | + public function jsDoJquery($jqueryCall, $param="") { |
|
387 | 387 | return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");"; |
388 | 388 | } |
389 | 389 | |
390 | - public function jsHtml($content=""){ |
|
391 | - return $this->jsDoJquery("html",$content); |
|
390 | + public function jsHtml($content="") { |
|
391 | + return $this->jsDoJquery("html", $content); |
|
392 | 392 | } |
393 | 393 | |
394 | - public function jsShow(){ |
|
394 | + public function jsShow() { |
|
395 | 395 | return $this->jsDoJquery("show"); |
396 | 396 | } |
397 | 397 | |
398 | - public function jsHide(){ |
|
398 | + public function jsHide() { |
|
399 | 399 | return $this->jsDoJquery("hide"); |
400 | 400 | } |
401 | 401 |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | -return array ( |
|
3 | - "JQuery" => array ( |
|
4 | - "MaxCDN" => array ( |
|
2 | +return array( |
|
3 | + "JQuery" => array( |
|
4 | + "MaxCDN" => array( |
|
5 | 5 | "url" => "http://code.jquery.com/jquery-%version%.min.js", |
6 | - "versions" => array ( |
|
6 | + "versions" => array( |
|
7 | 7 | "2.2.3", |
8 | 8 | "2.2.1", |
9 | 9 | "2.1.4", |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | "1.11.2" |
12 | 12 | ) |
13 | 13 | ), |
14 | - "Google" => array ( |
|
14 | + "Google" => array( |
|
15 | 15 | "url" => "https://ajax.googleapis.com/ajax/libs/jquery/%version%/jquery.min.js", |
16 | - "versions" => array ( |
|
16 | + "versions" => array( |
|
17 | 17 | "2.2.2", |
18 | 18 | "2.2.1", |
19 | 19 | "2.2.0", |
@@ -25,17 +25,17 @@ discard block |
||
25 | 25 | ) |
26 | 26 | ) |
27 | 27 | ), |
28 | - "JQueryUI" => array ( |
|
29 | - "MaxCDN" => array ( |
|
28 | + "JQueryUI" => array( |
|
29 | + "MaxCDN" => array( |
|
30 | 30 | "core" => "http://code.jquery.com/ui/%version%/jquery-ui.min.js", |
31 | 31 | "css" => "http://code.jquery.com/ui/%version%/themes/%theme%/jquery-ui.css", |
32 | - "versions" => array ( |
|
32 | + "versions" => array( |
|
33 | 33 | "1.11.4", |
34 | 34 | "1.11.3", |
35 | 35 | "1.11.2", |
36 | 36 | "1.10.4" |
37 | 37 | ), |
38 | - "themes" => array ( |
|
38 | + "themes" => array( |
|
39 | 39 | "black-tie", |
40 | 40 | "blitzer", |
41 | 41 | "cupertino", |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | "vader" |
63 | 63 | ) |
64 | 64 | ), |
65 | - "Google" => array ( |
|
65 | + "Google" => array( |
|
66 | 66 | "core" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/jquery-ui.min.js", |
67 | 67 | "css" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/themes/%theme%/jquery-ui.css", |
68 | - "versions" => array ( |
|
68 | + "versions" => array( |
|
69 | 69 | "1.11.4", |
70 | 70 | "1.11.3", |
71 | 71 | "1.11.2", |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | "1.10.4", |
75 | 75 | "1.10.0" |
76 | 76 | ), |
77 | - "themes" => array ( |
|
77 | + "themes" => array( |
|
78 | 78 | "black-tie", |
79 | 79 | "blitzer", |
80 | 80 | "cupertino", |
@@ -102,25 +102,25 @@ discard block |
||
102 | 102 | ) |
103 | 103 | ) |
104 | 104 | ), |
105 | - "Bootstrap" => array ( |
|
106 | - "MaxCDN" => array ( |
|
105 | + "Bootstrap" => array( |
|
106 | + "MaxCDN" => array( |
|
107 | 107 | "core" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/js/bootstrap.min.js", |
108 | 108 | "css" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/css/bootstrap.min.css", |
109 | - "versions" => array ( |
|
109 | + "versions" => array( |
|
110 | 110 | "3.3.6", |
111 | 111 | "3.3.5" |
112 | 112 | ), |
113 | - "themes" => array () |
|
113 | + "themes" => array() |
|
114 | 114 | ) |
115 | 115 | ), |
116 | - "Semantic" => array ( |
|
117 | - "cdnjs" => array ( |
|
116 | + "Semantic" => array( |
|
117 | + "cdnjs" => array( |
|
118 | 118 | "core" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.js", |
119 | 119 | "css" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.js", |
120 | - "versions" => array ( |
|
120 | + "versions" => array( |
|
121 | 121 | "2.1.8" |
122 | 122 | ), |
123 | - "themes" => array () |
|
123 | + "themes" => array() |
|
124 | 124 | ) |
125 | 125 | ) |
126 | 126 | ); |
127 | 127 | \ No newline at end of file |
@@ -9,7 +9,7 @@ |
||
9 | 9 | protected $localCss; |
10 | 10 | protected $framework; |
11 | 11 | |
12 | - public function __construct($framework,$version, $provider="MaxCDN") { |
|
12 | + public function __construct($framework, $version, $provider="MaxCDN") { |
|
13 | 13 | parent::__construct($version, $provider); |
14 | 14 | $this->framework=$framework; |
15 | 15 | $this->data=$this->data [$framework]; |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base\constants; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Social extends BaseEnum { |
5 | - const FACEBOOK="facebook", TWITTER="twitter",GOOGLEPLUS="google plus",VK="vk",LINKEDIN="linkedin",INSTAGRAM="instagram",YOUTUBE="youtube"; |
|
5 | + const FACEBOOK="facebook", TWITTER="twitter", GOOGLEPLUS="google plus", VK="vk", LINKEDIN="linkedin", INSTAGRAM="instagram", YOUTUBE="youtube"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -4,11 +4,11 @@ |
||
4 | 4 | |
5 | 5 | |
6 | 6 | class HtmlAccordionMenuItem extends HtmlMenuItem { |
7 | - public function __construct($identifier,$title,$content) { |
|
8 | - parent::__construct($identifier, new HtmlAccordionItem("accordion-".$identifier, $title,$content)); |
|
7 | + public function __construct($identifier, $title, $content) { |
|
8 | + parent::__construct($identifier, new HtmlAccordionItem("accordion-".$identifier, $title, $content)); |
|
9 | 9 | } |
10 | 10 | |
11 | - public function setActive($value=true){ |
|
11 | + public function setActive($value=true) { |
|
12 | 12 | $this->content->setActive($value); |
13 | 13 | return $this; |
14 | 14 | } |
@@ -20,30 +20,30 @@ |
||
20 | 20 | $this->_title=$title; |
21 | 21 | } |
22 | 22 | |
23 | - public function setTitle($title){ |
|
23 | + public function setTitle($title) { |
|
24 | 24 | $this->_title=$title; |
25 | 25 | } |
26 | 26 | |
27 | - public function setIcon($icon){ |
|
27 | + public function setIcon($icon) { |
|
28 | 28 | $this->_icon=$icon; |
29 | 29 | } |
30 | 30 | |
31 | - protected function createTitleElement(){ |
|
32 | - $element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title"); |
|
33 | - $element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title)); |
|
34 | - if($this->_active===true) |
|
31 | + protected function createTitleElement() { |
|
32 | + $element=new HtmlSemDoubleElement("title-".$this->identifier, "div", "title"); |
|
33 | + $element->setContent(array(new HtmlIcon("", $this->_icon), $this->_title)); |
|
34 | + if ($this->_active===true) |
|
35 | 35 | $element->addToProperty("class", "active"); |
36 | 36 | return $element; |
37 | 37 | } |
38 | 38 | |
39 | - public function compile(JsUtils $js=NULL, View $view=NULL){ |
|
39 | + public function compile(JsUtils $js=NULL, View $view=NULL) { |
|
40 | 40 | $this->titleElement=$this->createTitleElement(); |
41 | - return parent::compile($js,$view); |
|
41 | + return parent::compile($js, $view); |
|
42 | 42 | } |
43 | 43 | |
44 | - public function setActive($value=true){ |
|
44 | + public function setActive($value=true) { |
|
45 | 45 | $this->_active=$value; |
46 | - if($value===true) |
|
46 | + if ($value===true) |
|
47 | 47 | $this->addToPropertyCtrl("class", "active", array("active")); |
48 | 48 | else |
49 | 49 | $this->removePropertyValue("class", "active"); |
@@ -6,26 +6,26 @@ discard block |
||
6 | 6 | use Ajax\semantic\html\content\HtmlAccordionItem; |
7 | 7 | use Ajax\JsUtils; |
8 | 8 | |
9 | -class HtmlAccordion extends HtmlSemCollection{ |
|
9 | +class HtmlAccordion extends HtmlSemCollection { |
|
10 | 10 | |
11 | 11 | protected $params=array(); |
12 | 12 | |
13 | - public function __construct( $identifier, $tagName="div", $baseClass="ui"){ |
|
14 | - parent::__construct( $identifier, "div", "ui accordion"); |
|
13 | + public function __construct($identifier, $tagName="div", $baseClass="ui") { |
|
14 | + parent::__construct($identifier, "div", "ui accordion"); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | |
18 | - protected function createItem($value){ |
|
18 | + protected function createItem($value) { |
|
19 | 19 | $count=$this->count(); |
20 | 20 | $title=$value; |
21 | 21 | $content=NULL; |
22 | - if(\is_array($value)){ |
|
23 | - $title=@$value[0];$content=@$value[1]; |
|
22 | + if (\is_array($value)) { |
|
23 | + $title=@$value[0]; $content=@$value[1]; |
|
24 | 24 | } |
25 | - return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title,$content); |
|
25 | + return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title, $content); |
|
26 | 26 | } |
27 | 27 | |
28 | - protected function createCondition($value){ |
|
28 | + protected function createCondition($value) { |
|
29 | 29 | return ($value instanceof HtmlAccordionItem)===false; |
30 | 30 | } |
31 | 31 | |
@@ -34,22 +34,22 @@ discard block |
||
34 | 34 | * @see BaseHtml::run() |
35 | 35 | */ |
36 | 36 | public function run(JsUtils $js) { |
37 | - if(isset($this->_bsComponent)===false) |
|
38 | - $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
37 | + if (isset($this->_bsComponent)===false) |
|
38 | + $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier, $this->params); |
|
39 | 39 | $this->addEventsOnRun($js); |
40 | 40 | return $this->_bsComponent; |
41 | 41 | } |
42 | 42 | |
43 | - public function setStyled(){ |
|
43 | + public function setStyled() { |
|
44 | 44 | return $this->addToProperty("class", "styled"); |
45 | 45 | } |
46 | 46 | |
47 | - public function setActive($index){ |
|
47 | + public function setActive($index) { |
|
48 | 48 | $this->getItem($index)->setActive(true); |
49 | 49 | return $this; |
50 | 50 | } |
51 | 51 | |
52 | - public function setExclusive($value){ |
|
52 | + public function setExclusive($value) { |
|
53 | 53 | $this->params["exclusive"]=$value; |
54 | 54 | } |
55 | 55 | } |
56 | 56 | \ No newline at end of file |