@@ -89,8 +89,9 @@ discard block |
||
89 | 89 | public function asLink($href=NULL,$target=NULL) { |
90 | 90 | if (isset($href)) { |
91 | 91 | $_target=""; |
92 | - if(isset($target)) |
|
93 | - $_target="target='{$target}'"; |
|
92 | + if(isset($target)) { |
|
93 | + $_target="target='{$target}'"; |
|
94 | + } |
|
94 | 95 | $this->wrap("<a href='" . $href . "' {$_target}>", "</a>"); |
95 | 96 | } |
96 | 97 | return $this->addToProperty("class", "link"); |
@@ -107,8 +108,9 @@ discard block |
||
107 | 108 | */ |
108 | 109 | public function setBordered($inverted=false) { |
109 | 110 | $invertedStr=""; |
110 | - if ($inverted !== false) |
|
111 | - $invertedStr=" inverted"; |
|
111 | + if ($inverted !== false) { |
|
112 | + $invertedStr=" inverted"; |
|
113 | + } |
|
112 | 114 | return $this->addToProperty("class", "bordered" . $invertedStr); |
113 | 115 | } |
114 | 116 | |
@@ -121,12 +123,14 @@ discard block |
||
121 | 123 | } |
122 | 124 | |
123 | 125 | public function addLabel($label, $before=false, $icon=NULL) { |
124 | - if($before) |
|
125 | - $this->wrap($label); |
|
126 | - else |
|
127 | - $this->wrap("", $label); |
|
128 | - if(isset($icon)) |
|
129 | - $this->addToIcon($icon); |
|
126 | + if($before) { |
|
127 | + $this->wrap($label); |
|
128 | + } else { |
|
129 | + $this->wrap("", $label); |
|
130 | + } |
|
131 | + if(isset($icon)) { |
|
132 | + $this->addToIcon($icon); |
|
133 | + } |
|
130 | 134 | return $this; |
131 | 135 | } |
132 | 136 |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | public function setFocusable($value=true) { |
59 | - if ($value === true) |
|
60 | - $this->setProperty("tabindex", "0"); |
|
61 | - else { |
|
59 | + if ($value === true) { |
|
60 | + $this->setProperty("tabindex", "0"); |
|
61 | + } else { |
|
62 | 62 | $this->removeProperty("tabindex"); |
63 | 63 | } |
64 | 64 | return $this; |
@@ -184,8 +184,9 @@ discard block |
||
184 | 184 | * @return HtmlButton |
185 | 185 | */ |
186 | 186 | public static function social($identifier, $social, $value=NULL) { |
187 | - if ($value === NULL) |
|
188 | - $value=\ucfirst($social); |
|
187 | + if ($value === NULL) { |
|
188 | + $value=\ucfirst($social); |
|
189 | + } |
|
189 | 190 | $return=new HtmlButton($identifier, $value); |
190 | 191 | $return->addIcon($social); |
191 | 192 | return $return->addToPropertyCtrl("class", $social, Social::getConstants()); |
@@ -40,8 +40,9 @@ discard block |
||
40 | 40 | * @param string $popupEvent |
41 | 41 | */ |
42 | 42 | public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
43 | - if (isset($this->_popup)) |
|
44 | - $this->_popup->setAttributes($variation, $popupEvent); |
|
43 | + if (isset($this->_popup)) { |
|
44 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
45 | + } |
|
45 | 46 | } |
46 | 47 | |
47 | 48 | /** |
@@ -96,8 +97,9 @@ discard block |
||
96 | 97 | $labelO=$label; |
97 | 98 | if (\is_object($label) === false) { |
98 | 99 | $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
99 | - if (isset($icon)) |
|
100 | - $labelO->addIcon($icon); |
|
100 | + if (isset($icon)) { |
|
101 | + $labelO->addIcon($icon); |
|
102 | + } |
|
101 | 103 | } else { |
102 | 104 | $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
103 | 105 | } |
@@ -124,10 +126,12 @@ discard block |
||
124 | 126 | * @return HtmlSemDoubleElement |
125 | 127 | */ |
126 | 128 | public function asLink($href=NULL,$target=NULL) { |
127 | - if (isset($href)) |
|
128 | - $this->setProperty("href", $href); |
|
129 | - if(isset($target)) |
|
130 | - $this->setProperty("target", $target); |
|
129 | + if (isset($href)) { |
|
130 | + $this->setProperty("href", $href); |
|
131 | + } |
|
132 | + if(isset($target)) { |
|
133 | + $this->setProperty("target", $target); |
|
134 | + } |
|
131 | 135 | return $this->setTagName("a"); |
132 | 136 | } |
133 | 137 | |
@@ -138,8 +142,9 @@ discard block |
||
138 | 142 | */ |
139 | 143 | public function jsShowDimmer($show=true) { |
140 | 144 | $status="hide"; |
141 | - if ($show === true) |
|
142 | - $status="show"; |
|
145 | + if ($show === true) { |
|
146 | + $status="show"; |
|
147 | + } |
|
143 | 148 | return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
144 | 149 | } |
145 | 150 | |
@@ -148,8 +153,9 @@ discard block |
||
148 | 153 | * @see BaseHtml::compile() |
149 | 154 | */ |
150 | 155 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
151 | - if (isset($this->_popup)) |
|
152 | - $this->_popup->compile($js); |
|
156 | + if (isset($this->_popup)) { |
|
157 | + $this->_popup->compile($js); |
|
158 | + } |
|
153 | 159 | return parent::compile($js, $view); |
154 | 160 | } |
155 | 161 |
@@ -37,8 +37,9 @@ discard block |
||
37 | 37 | |
38 | 38 | private function getPart($part, $index=NULL) { |
39 | 39 | if (\array_key_exists($part, $this->content)) { |
40 | - if (isset($index)) |
|
41 | - return $this->content[$part][$index]; |
|
40 | + if (isset($index)) { |
|
41 | + return $this->content[$part][$index]; |
|
42 | + } |
|
42 | 43 | return $this->content[$part]; |
43 | 44 | } |
44 | 45 | return NULL; |
@@ -140,8 +141,9 @@ discard block |
||
140 | 141 | $this->addToProperty("class", "link"); |
141 | 142 | if ($href !== "") { |
142 | 143 | $this->setProperty("href", $href); |
143 | - if (isset($target)) |
|
144 | - $this->setProperty("target", $target); |
|
144 | + if (isset($target)) { |
|
145 | + $this->setProperty("target", $target); |
|
146 | + } |
|
145 | 147 | } |
146 | 148 | return $this; |
147 | 149 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | foreach ($values as $v){ |
60 | 60 | $form->addField($v); |
61 | 61 | } |
62 | - }else{ |
|
62 | + } else{ |
|
63 | 63 | $separators[]=$count; |
64 | 64 | for($i=0;$i<$size;$i++){ |
65 | 65 | $this->_generateFields($form, $values, $headers, $separators[$i], $separators[$i+1], $wrappers); |
@@ -70,18 +70,20 @@ discard block |
||
70 | 70 | protected function _generateFields($form,$values,$headers,$sepFirst,$sepLast,$wrappers){ |
71 | 71 | $wrapper=null; |
72 | 72 | $fields=\array_slice($values, $sepFirst+1,$sepLast-$sepFirst); |
73 | - if(isset($headers[$sepFirst+1])) |
|
74 | - $form->addHeader($headers[$sepFirst+1],4,true); |
|
73 | + if(isset($headers[$sepFirst+1])) { |
|
74 | + $form->addHeader($headers[$sepFirst+1],4,true); |
|
75 | + } |
|
75 | 76 | if(isset($wrappers[$sepFirst+1])){ |
76 | 77 | $wrapper=$wrappers[$sepFirst+1]; |
77 | 78 | } |
78 | 79 | if(\sizeof($fields)===1){ |
79 | 80 | $added=$form->addField($fields[0]); |
80 | - }elseif(\sizeof($fields)>1){ |
|
81 | + } elseif(\sizeof($fields)>1){ |
|
81 | 82 | $added=$form->addFields($fields); |
82 | 83 | } |
83 | - if(isset($wrapper)) |
|
84 | - $added->wrap($wrapper[0],$wrapper[1]); |
|
84 | + if(isset($wrapper)) { |
|
85 | + $added->wrap($wrapper[0],$wrapper[1]); |
|
86 | + } |
|
85 | 87 | } |
86 | 88 | |
87 | 89 | /** |
@@ -14,8 +14,9 @@ |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | public function compile(JsUtils $js=null) { |
17 | - if ($js==null) |
|
18 | - return; |
|
17 | + if ($js==null) { |
|
18 | + return; |
|
19 | + } |
|
19 | 20 | $params="{}"; |
20 | 21 | $jsCallback=NULL; |
21 | 22 | $attr="id"; |
@@ -68,10 +68,11 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | public function setDismissable($dismiss=true){ |
71 | - if($dismiss===true) |
|
72 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
73 | - else |
|
74 | - $this->close=NULL; |
|
71 | + if($dismiss===true) { |
|
72 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
73 | + } else { |
|
74 | + $this->close=NULL; |
|
75 | + } |
|
75 | 76 | return $this; |
76 | 77 | } |
77 | 78 | |
@@ -113,8 +114,9 @@ discard block |
||
113 | 114 | public function setMessage($message){ |
114 | 115 | if(\is_array($this->content)){ |
115 | 116 | $this->content[\sizeof($this->content)-1]=$message; |
116 | - }else |
|
117 | - $this->setContent($message); |
|
117 | + } else { |
|
118 | + $this->setContent($message); |
|
119 | + } |
|
118 | 120 | } |
119 | 121 | |
120 | 122 | public function setTimeout($_timeout) { |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | //echo $itemSelector.":::".$jsCode."<br>"; |
29 | 29 | if($event=="execute"){ |
30 | 30 | $this->jquery_code_for_compile []=$jsCode; |
31 | - }else if($event=="beforeExecute"){ |
|
31 | + } else if($event=="beforeExecute"){ |
|
32 | 32 | \array_unshift($this->jquery_code_for_compile, $jsCode); |
33 | - }else{ |
|
33 | + } else{ |
|
34 | 34 | $selector=$this->_createSelector($itemSelector, $this->attachTo); |
35 | 35 | $this->jquery_code_for_compile []="$( \"".$selector."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});"; |
36 | 36 | } |
@@ -38,10 +38,12 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | protected function _createSelector($itemSelector,$selector){ |
41 | - if(!isset($itemSelector)) |
|
42 | - $itemSelector=$this->itemSelector; |
|
43 | - if(isset($itemSelector) && $itemSelector!=="") |
|
44 | - $selector.=" ".$itemSelector; |
|
41 | + if(!isset($itemSelector)) { |
|
42 | + $itemSelector=$this->itemSelector; |
|
43 | + } |
|
44 | + if(isset($itemSelector) && $itemSelector!=="") { |
|
45 | + $selector.=" ".$itemSelector; |
|
46 | + } |
|
45 | 47 | return $selector; |
46 | 48 | } |
47 | 49 | |
@@ -84,8 +86,9 @@ discard block |
||
84 | 86 | |
85 | 87 | protected function setParamCtrl($key, $value, $typeCtrl) { |
86 | 88 | if (\is_array($typeCtrl)) { |
87 | - if (array_search($value, $typeCtrl)===false) |
|
88 | - throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
89 | + if (array_search($value, $typeCtrl)===false) { |
|
90 | + throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
91 | + } |
|
89 | 92 | } else { |
90 | 93 | if (!$typeCtrl($value)) { |
91 | 94 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName); |
@@ -54,8 +54,9 @@ discard block |
||
54 | 54 | |
55 | 55 | public function setAttached($value=true){ |
56 | 56 | $form=$this->getForm(); |
57 | - if($value) |
|
58 | - $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
57 | + if($value) { |
|
58 | + $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
59 | + } |
|
59 | 60 | return $form; |
60 | 61 | } |
61 | 62 | |
@@ -77,10 +78,11 @@ discard block |
||
77 | 78 | */ |
78 | 79 | public function submitOn($event,$identifierOrElement,$url,$responseElement,$parameters=NULL){ |
79 | 80 | $form=$this->getForm(); |
80 | - if($identifierOrElement instanceof BaseHtml) |
|
81 | - $elem=$identifierOrElement; |
|
82 | - else |
|
83 | - $elem=$form->getElementById($identifierOrElement, $form->getContent()); |
|
81 | + if($identifierOrElement instanceof BaseHtml) { |
|
82 | + $elem=$identifierOrElement; |
|
83 | + } else { |
|
84 | + $elem=$form->getElementById($identifierOrElement, $form->getContent()); |
|
85 | + } |
|
84 | 86 | if(isset($elem)){ |
85 | 87 | $this->_buttonAsSubmit($elem, $event,$url,$responseElement,$parameters); |
86 | 88 | } |
@@ -101,8 +103,9 @@ discard block |
||
101 | 103 | if(isset($url) && isset($responseElement)){ |
102 | 104 | $button->addEvent($event, "$('#".$form->getIdentifier()."').form('validate form');",true,true); |
103 | 105 | $params=["form"=>$form->getIdentifier(),"responseElement"=>$responseElement,"url"=>$url,"stopPropagation"=>true]; |
104 | - if(\is_array($parameters)) |
|
105 | - $params=\array_merge($params,$parameters); |
|
106 | + if(\is_array($parameters)) { |
|
107 | + $params=\array_merge($params,$parameters); |
|
108 | + } |
|
106 | 109 | $form->addValidationParam("_ajaxSubmit", new AjaxCall("postForm", $params)); |
107 | 110 | } |
108 | 111 | return $button; |