@@ -14,10 +14,11 @@ discard block |
||
14 | 14 | $this->data=$this->data ["JQueryUI"]; |
15 | 15 | if (is_int($theme)) { |
16 | 16 | $themes=$this->getThemes(); |
17 | - if (sizeof($themes)>$theme-1) |
|
18 | - $this->theme=$themes [$theme-1]; |
|
19 | - else |
|
20 | - throw new \Exception("CDNGuiGen : Le numéro de thème demandé n'existe pas"); |
|
17 | + if (sizeof($themes)>$theme-1) { |
|
18 | + $this->theme=$themes [$theme-1]; |
|
19 | + } else { |
|
20 | + throw new \Exception("CDNGuiGen : Le numéro de thème demandé n'existe pas"); |
|
21 | + } |
|
21 | 22 | } |
22 | 23 | $this->theme=$theme; |
23 | 24 | $this->cssUrl=null; |
@@ -28,16 +29,18 @@ discard block |
||
28 | 29 | } |
29 | 30 | |
30 | 31 | public function getThemes($provider=NULL) { |
31 | - if (isset($provider)) |
|
32 | - return $this->data [$provider] ["themes"]; |
|
33 | - else |
|
34 | - return $this->data [$this->provider] ["themes"]; |
|
32 | + if (isset($provider)) { |
|
33 | + return $this->data [$provider] ["themes"]; |
|
34 | + } else { |
|
35 | + return $this->data [$this->provider] ["themes"]; |
|
36 | + } |
|
35 | 37 | } |
36 | 38 | |
37 | 39 | public function getFirstTheme($provider=NULL) { |
38 | 40 | $themes=$this->getThemes($provider); |
39 | - if (sizeof($themes)>0) |
|
40 | - return $themes [0]; |
|
41 | + if (sizeof($themes)>0) { |
|
42 | + return $themes [0]; |
|
43 | + } |
|
41 | 44 | return ""; |
42 | 45 | } |
43 | 46 | |
@@ -46,14 +49,17 @@ discard block |
||
46 | 49 | } |
47 | 50 | |
48 | 51 | public function getCss() { |
49 | - if (isset($this->cssUrl)) |
|
50 | - return $this->cssUrl; |
|
52 | + if (isset($this->cssUrl)) { |
|
53 | + return $this->cssUrl; |
|
54 | + } |
|
51 | 55 | $version=$this->version; |
52 | - if (array_search($version, $this->getVersions())===false) |
|
53 | - $version=$this->getLastVersion(); |
|
56 | + if (array_search($version, $this->getVersions())===false) { |
|
57 | + $version=$this->getLastVersion(); |
|
58 | + } |
|
54 | 59 | $theme=$this->theme; |
55 | - if (array_search($theme, $this->getThemes())===false) |
|
56 | - $theme=$this->getFirstTheme(); |
|
60 | + if (array_search($theme, $this->getThemes())===false) { |
|
61 | + $theme=$this->getFirstTheme(); |
|
62 | + } |
|
57 | 63 | return $this->replaceVersionAndTheme($this->data [$this->provider] ["css"], $version, $theme); |
58 | 64 | } |
59 | 65 |
@@ -147,10 +147,12 @@ discard block |
||
147 | 147 | if (isset($param)) { |
148 | 148 | $param=$this->_prep_value($param); |
149 | 149 | $str="$({$element}).{$jQueryCall}({$param});"; |
150 | - } else |
|
151 | - $str="$({$element}).{$jQueryCall}();"; |
|
152 | - if ($immediatly) |
|
153 | - $this->jquery_code_for_compile[]=$str; |
|
150 | + } else { |
|
151 | + $str="$({$element}).{$jQueryCall}();"; |
|
152 | + } |
|
153 | + if ($immediatly) { |
|
154 | + $this->jquery_code_for_compile[]=$str; |
|
155 | + } |
|
154 | 156 | return $str; |
155 | 157 | } |
156 | 158 | /** |
@@ -165,8 +167,9 @@ discard block |
||
165 | 167 | $to=$this->_prep_element($to); |
166 | 168 | $element=$this->_prep_element($element); |
167 | 169 | $str="$({$to}).{$jQueryCall}({$element});"; |
168 | - if ($immediatly) |
|
169 | - $this->jquery_code_for_compile[]=$str; |
|
170 | + if ($immediatly) { |
|
171 | + $this->jquery_code_for_compile[]=$str; |
|
172 | + } |
|
170 | 173 | return $str; |
171 | 174 | } |
172 | 175 | |
@@ -222,12 +225,14 @@ discard block |
||
222 | 225 | if ($stopPropagation===true) { |
223 | 226 | $js="event.stopPropagation();\n".$js; |
224 | 227 | } |
225 | - if (array_search($event, $this->jquery_events)===false) |
|
226 | - $event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
227 | - else |
|
228 | - $event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
229 | - if($immediatly) |
|
230 | - $this->jquery_code_for_compile[]=$event; |
|
228 | + if (array_search($event, $this->jquery_events)===false) { |
|
229 | + $event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
230 | + } else { |
|
231 | + $event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
232 | + } |
|
233 | + if($immediatly) { |
|
234 | + $this->jquery_code_for_compile[]=$event; |
|
235 | + } |
|
231 | 236 | return $event; |
232 | 237 | } |
233 | 238 | |
@@ -355,7 +360,9 @@ discard block |
||
355 | 360 | } |
356 | 361 | |
357 | 362 | private function minify($input) { |
358 | - if(trim($input) === "") return $input; |
|
363 | + if(trim($input) === "") { |
|
364 | + return $input; |
|
365 | + } |
|
359 | 366 | return preg_replace( |
360 | 367 | array( |
361 | 368 | // Remove comment(s) |
@@ -62,8 +62,9 @@ |
||
62 | 62 | * @see BaseHtml::run() |
63 | 63 | */ |
64 | 64 | public function run(JsUtils $js) { |
65 | - if(isset($this->_bsComponent)===false) |
|
66 | - $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
65 | + if(isset($this->_bsComponent)===false) { |
|
66 | + $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
67 | + } |
|
67 | 68 | $this->addEventsOnRun($js); |
68 | 69 | return $this->_bsComponent; |
69 | 70 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $title=@$content[1]; |
18 | 18 | $desc=@$content[2]; |
19 | 19 | $status=@$content[3]; |
20 | - }else{ |
|
20 | + } else{ |
|
21 | 21 | $icon=@$content["icon"]; |
22 | 22 | $title=@$content["title"]; |
23 | 23 | $desc=@$content["description"]; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | if(isset($title)===true){ |
33 | 33 | $this->setTitle($title,$desc); |
34 | 34 | } |
35 | - }else{ |
|
35 | + } else{ |
|
36 | 36 | $this->setContent($content); |
37 | 37 | } |
38 | 38 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $viewVars=$view->viewVars; |
14 | 14 | if (isset($viewVars["q"]) === false) { |
15 | 15 | $controls=array (); |
16 | - }else{ |
|
16 | + } else{ |
|
17 | 17 | $controls=$viewVars["q"]; |
18 | 18 | } |
19 | 19 | $controls[$identifier]=$content; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $title=@$content[1]; |
18 | 18 | $desc=@$content[2]; |
19 | 19 | $status=@$content[3]; |
20 | - }else{ |
|
20 | + } else{ |
|
21 | 21 | $icon=@$content["icon"]; |
22 | 22 | $title=@$content["title"]; |
23 | 23 | $desc=@$content["description"]; |
@@ -32,16 +32,17 @@ discard block |
||
32 | 32 | if(isset($title)===true){ |
33 | 33 | $this->setTitle($title,$desc); |
34 | 34 | } |
35 | - }else{ |
|
35 | + } else{ |
|
36 | 36 | $this->setContent($content); |
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | 40 | public function setActive($value=true){ |
41 | - if($value) |
|
42 | - $this->setStatus(StepStatus::ACTIVE); |
|
43 | - else |
|
44 | - $this->setStatus(StepStatus::NONE); |
|
41 | + if($value) { |
|
42 | + $this->setStatus(StepStatus::ACTIVE); |
|
43 | + } else { |
|
44 | + $this->setStatus(StepStatus::NONE); |
|
45 | + } |
|
45 | 46 | return $this; |
46 | 47 | } |
47 | 48 |
@@ -67,8 +67,9 @@ discard block |
||
67 | 67 | if($index<$menu->count()){ |
68 | 68 | if(isset($this->content[$index])===false){ |
69 | 69 | $this->content[$index]=$this->createSegment($index, $content, $menu->getItem($index)->getIdentifier()); |
70 | - }else |
|
71 | - $this->content[$index]->setContent($content); |
|
70 | + } else { |
|
71 | + $this->content[$index]->setContent($content); |
|
72 | + } |
|
72 | 73 | } |
73 | 74 | return $this; |
74 | 75 | } |
@@ -228,15 +229,17 @@ discard block |
||
228 | 229 | * @see BaseHtml::run() |
229 | 230 | */ |
230 | 231 | public function run(JsUtils $js) { |
231 | - if(isset($this->_bsComponent)===false) |
|
232 | - $this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params); |
|
232 | + if(isset($this->_bsComponent)===false) { |
|
233 | + $this->_bsComponent=$js->semantic()->tab("#".$this->identifier." .item",$this->params); |
|
234 | + } |
|
233 | 235 | $this->addEventsOnRun($js); |
234 | 236 | return $this->_bsComponent; |
235 | 237 | } |
236 | 238 | |
237 | 239 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
238 | - if($this->content["menu"]->count()>0 && \sizeof($this->content)>1) |
|
239 | - $this->activate(0); |
|
240 | + if($this->content["menu"]->count()>0 && \sizeof($this->content)>1) { |
|
241 | + $this->activate(0); |
|
242 | + } |
|
240 | 243 | return parent::compile($js,$view); |
241 | 244 | } |
242 | 245 | } |
243 | 246 | \ No newline at end of file |
@@ -11,14 +11,15 @@ discard block |
||
11 | 11 | public function setContent($content){ |
12 | 12 | if($content==="-"){ |
13 | 13 | $this->asDivider(); |
14 | - }elseif($content==="-search-"){ |
|
14 | + } elseif($content==="-search-"){ |
|
15 | 15 | $values=\explode(",",$content,-1); |
16 | 16 | $this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search")); |
17 | - }elseif(JString::startswith($content, "-")){ |
|
17 | + } elseif(JString::startswith($content, "-")){ |
|
18 | 18 | $content=\ltrim($content,"-"); |
19 | 19 | $this->asHeader($content); |
20 | - }else |
|
21 | - parent::setContent($content); |
|
20 | + } else { |
|
21 | + parent::setContent($content); |
|
22 | + } |
|
22 | 23 | return $this; |
23 | 24 | } |
24 | 25 | |
@@ -30,11 +31,13 @@ discard block |
||
30 | 31 | public function asSearchInput($placeholder=NULL,$icon=NULL){ |
31 | 32 | $this->setClass("ui icon search input"); |
32 | 33 | $input=new HtmlInput("search-".$this->identifier); |
33 | - if(isset($placeholder)) |
|
34 | - $input->setProperty("placeholder", $placeholder); |
|
34 | + if(isset($placeholder)) { |
|
35 | + $input->setProperty("placeholder", $placeholder); |
|
36 | + } |
|
35 | 37 | $this->content=$input; |
36 | - if(isset($icon)) |
|
37 | - $this->addIcon($icon); |
|
38 | + if(isset($icon)) { |
|
39 | + $this->addIcon($icon); |
|
40 | + } |
|
38 | 41 | return $this; |
39 | 42 | } |
40 | 43 | |
@@ -57,8 +60,9 @@ discard block |
||
57 | 60 | $this->setClass("header"); |
58 | 61 | $this->tagName="div"; |
59 | 62 | $this->content=$caption; |
60 | - if(isset($icon)) |
|
61 | - $this->addIcon($icon,Direction::LEFT); |
|
63 | + if(isset($icon)) { |
|
64 | + $this->addIcon($icon,Direction::LEFT); |
|
65 | + } |
|
62 | 66 | return $this; |
63 | 67 | } |
64 | 68 | } |
65 | 69 | \ No newline at end of file |
@@ -32,8 +32,9 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
35 | - if (isset($this->_popup)) |
|
36 | - $this->_popup->setAttributes($variation, $popupEvent); |
|
35 | + if (isset($this->_popup)) { |
|
36 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
37 | + } |
|
37 | 38 | } |
38 | 39 | |
39 | 40 | public function addPopup($title="", $content="", $variation=NULL, $params=array()) { |
@@ -60,8 +61,9 @@ discard block |
||
60 | 61 | $labelO=$label; |
61 | 62 | if (\is_object($label) === false) { |
62 | 63 | $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
63 | - if (isset($icon)) |
|
64 | - $labelO->addIcon($icon); |
|
64 | + if (isset($icon)) { |
|
65 | + $labelO->addIcon($icon); |
|
66 | + } |
|
65 | 67 | } else { |
66 | 68 | $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
67 | 69 | } |
@@ -80,21 +82,24 @@ discard block |
||
80 | 82 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
81 | 83 | */ |
82 | 84 | public function asLink($href=NULL) { |
83 | - if (isset($href)) |
|
84 | - $this->setProperty("href", $href); |
|
85 | + if (isset($href)) { |
|
86 | + $this->setProperty("href", $href); |
|
87 | + } |
|
85 | 88 | return $this->setTagName("a"); |
86 | 89 | } |
87 | 90 | |
88 | 91 | public function jsShowDimmer($show=true) { |
89 | 92 | $status="hide"; |
90 | - if ($show === true) |
|
91 | - $status="show"; |
|
93 | + if ($show === true) { |
|
94 | + $status="show"; |
|
95 | + } |
|
92 | 96 | return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
93 | 97 | } |
94 | 98 | |
95 | 99 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
96 | - if (isset($this->_popup)) |
|
97 | - $this->_popup->compile($js); |
|
100 | + if (isset($this->_popup)) { |
|
101 | + $this->_popup->compile($js); |
|
102 | + } |
|
98 | 103 | return parent::compile($js, $view); |
99 | 104 | } |
100 | 105 |