@@ -186,8 +186,9 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | public function addItemInToolbar($caption,$icon=NULL,$callback=NULL){ |
| 188 | 188 | $result=$this->addInToolbar($caption,$callback); |
| 189 | - if(isset($icon)) |
|
| 190 | - $result->addIcon($icon); |
|
| 189 | + if(isset($icon)) { |
|
| 190 | + $result->addIcon($icon); |
|
| 191 | + } |
|
| 191 | 192 | return $result; |
| 192 | 193 | } |
| 193 | 194 | |
@@ -201,7 +202,7 @@ discard block |
||
| 201 | 202 | foreach ($items as $icon=>$item){ |
| 202 | 203 | $this->addItemInToolbar($item,$icon,$callback); |
| 203 | 204 | } |
| 204 | - }else{ |
|
| 205 | + } else{ |
|
| 205 | 206 | foreach ($items as $item){ |
| 206 | 207 | $this->addItemInToolbar($item,null,$callback); |
| 207 | 208 | } |
@@ -352,8 +353,9 @@ discard block |
||
| 352 | 353 | protected function _compileForm(){ |
| 353 | 354 | if(isset($this->_form)){ |
| 354 | 355 | $noValidate=""; |
| 355 | - if(\sizeof($this->_form->getValidationParams())>0) |
|
| 356 | - $noValidate="novalidate"; |
|
| 356 | + if(\sizeof($this->_form->getValidationParams())>0) { |
|
| 357 | + $noValidate="novalidate"; |
|
| 358 | + } |
|
| 357 | 359 | $this->wrapContent("<form class='ui form' id='frm-".$this->identifier."' name='frm-".$this->identifier."' ".$noValidate.">","</form>"); |
| 358 | 360 | } |
| 359 | 361 | } |
@@ -52,8 +52,9 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function addHeader($title, $niveau=1, $dividing=true) { |
| 54 | 54 | $header=new HtmlHeader("", $niveau, $title); |
| 55 | - if ($dividing) |
|
| 56 | - $header->setDividing(); |
|
| 55 | + if ($dividing) { |
|
| 56 | + $header->setDividing(); |
|
| 57 | + } |
|
| 57 | 58 | return $this->addItem($header); |
| 58 | 59 | } |
| 59 | 60 | |
@@ -74,14 +75,16 @@ discard block |
||
| 74 | 75 | if (\is_string($end)) { |
| 75 | 76 | $label=$end; |
| 76 | 77 | \array_pop($fields); |
| 77 | - } else |
|
| 78 | - $label=NULL; |
|
| 78 | + } else { |
|
| 79 | + $label=NULL; |
|
| 80 | + } |
|
| 79 | 81 | } |
| 80 | 82 | $this->_fields=\array_merge($this->_fields, $fields); |
| 81 | 83 | $fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count(), $fields); |
| 82 | 84 | } |
| 83 | - if (isset($label)) |
|
| 84 | - $fields=new HtmlFormField("", $fields, $label); |
|
| 85 | + if (isset($label)) { |
|
| 86 | + $fields=new HtmlFormField("", $fields, $label); |
|
| 87 | + } |
|
| 85 | 88 | } else { |
| 86 | 89 | $fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count()); |
| 87 | 90 | } |
@@ -134,27 +137,31 @@ discard block |
||
| 134 | 137 | */ |
| 135 | 138 | public function addMessage($identifier, $content, $header=NULL, $icon=NULL, $type=NULL) { |
| 136 | 139 | $message=new HtmlMessage($identifier, $content); |
| 137 | - if (isset($header)) |
|
| 138 | - $message->addHeader($header); |
|
| 139 | - if (isset($icon)) |
|
| 140 | - $message->setIcon($icon); |
|
| 141 | - if (isset($type)) |
|
| 142 | - $message->setStyle($type); |
|
| 140 | + if (isset($header)) { |
|
| 141 | + $message->addHeader($header); |
|
| 142 | + } |
|
| 143 | + if (isset($icon)) { |
|
| 144 | + $message->setIcon($icon); |
|
| 145 | + } |
|
| 146 | + if (isset($type)) { |
|
| 147 | + $message->setStyle($type); |
|
| 148 | + } |
|
| 143 | 149 | return $this->addItem($message); |
| 144 | 150 | } |
| 145 | 151 | |
| 146 | 152 | |
| 147 | 153 | |
| 148 | 154 | public function compile(JsUtils $js=NULL,&$view=NULL){ |
| 149 | - if(\sizeof($this->_validationParams)>0) |
|
| 150 | - $this->setProperty("novalidate", ""); |
|
| 155 | + if(\sizeof($this->_validationParams)>0) { |
|
| 156 | + $this->setProperty("novalidate", ""); |
|
| 157 | + } |
|
| 151 | 158 | return parent::compile($js,$view); |
| 152 | 159 | } |
| 153 | 160 | |
| 154 | 161 | public function run(JsUtils $js) { |
| 155 | 162 | if(isset($js)){ |
| 156 | 163 | $compo=$js->semantic()->form("#".$this->identifier); |
| 157 | - }else{ |
|
| 164 | + } else{ |
|
| 158 | 165 | $compo=new Form(); |
| 159 | 166 | $compo->attach("#".$this->identifier); |
| 160 | 167 | } |
@@ -167,8 +174,9 @@ discard block |
||
| 167 | 174 | if($field instanceof HtmlFormFields){ |
| 168 | 175 | $items=$field->getItems(); |
| 169 | 176 | foreach ($items as $_field){ |
| 170 | - if($_field instanceof HtmlFormField) |
|
| 171 | - $compo=$this->addCompoValidation($compo, $_field); |
|
| 177 | + if($_field instanceof HtmlFormField) { |
|
| 178 | + $compo=$this->addCompoValidation($compo, $_field); |
|
| 179 | + } |
|
| 172 | 180 | } |
| 173 | 181 | } |
| 174 | 182 | } |
@@ -57,8 +57,7 @@ discard block |
||
| 57 | 57 | $rules=$attributes["rules"]; |
| 58 | 58 | if(\is_array($rules)){ |
| 59 | 59 | $element->addRules($rules); |
| 60 | - } |
|
| 61 | - else{ |
|
| 60 | + } else{ |
|
| 62 | 61 | $element->addRule($rules); |
| 63 | 62 | } |
| 64 | 63 | unset($attributes["rules"]); |
@@ -118,8 +117,9 @@ discard block |
||
| 118 | 117 | public function fieldAsHeader($index,$niveau=1,$icon=NULL,$attributes=NULL){ |
| 119 | 118 | return $this->_fieldAs(function($id,$name,$value) use($niveau,$icon){ |
| 120 | 119 | $header=new HtmlHeader($id,$niveau,$value); |
| 121 | - if(isset($icon)) |
|
| 122 | - $header->asIcon($icon, $value); |
|
| 120 | + if(isset($icon)) { |
|
| 121 | + $header->asIcon($icon, $value); |
|
| 122 | + } |
|
| 123 | 123 | return $header; |
| 124 | 124 | }, $index,$attributes,"header"); |
| 125 | 125 | } |
@@ -127,7 +127,9 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | public function fieldAsImage($index,$size=Size::MINI,$circular=false){ |
| 129 | 129 | $this->setValueFunction($index,function($img) use($size,$circular){ |
| 130 | - $image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular)$image->setCircular(); |
|
| 130 | + $image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular) { |
|
| 131 | + $image->setCircular(); |
|
| 132 | + } |
|
| 131 | 133 | return $image; |
| 132 | 134 | }); |
| 133 | 135 | return $this; |
@@ -209,12 +211,13 @@ discard block |
||
| 209 | 211 | $i=0; |
| 210 | 212 | if(JArray::isAssociative($types)){ |
| 211 | 213 | foreach ($types as $type=>$attributes){ |
| 212 | - if(\is_int($type)) |
|
| 213 | - $this->fieldAs($i++,$attributes,[]); |
|
| 214 | - else |
|
| 215 | - $this->fieldAs($i++,$type,$attributes); |
|
| 214 | + if(\is_int($type)) { |
|
| 215 | + $this->fieldAs($i++,$attributes,[]); |
|
| 216 | + } else { |
|
| 217 | + $this->fieldAs($i++,$type,$attributes); |
|
| 218 | + } |
|
| 216 | 219 | } |
| 217 | - }else{ |
|
| 220 | + } else{ |
|
| 218 | 221 | foreach ($types as $type){ |
| 219 | 222 | $this->fieldAs($i++,$type); |
| 220 | 223 | } |
@@ -226,7 +229,7 @@ discard block |
||
| 226 | 229 | if(\method_exists($this, $method)){ |
| 227 | 230 | if(!\is_array($attributes)){ |
| 228 | 231 | $attributes=[$index]; |
| 229 | - }else{ |
|
| 232 | + } else{ |
|
| 230 | 233 | \array_unshift($attributes, $index); |
| 231 | 234 | } |
| 232 | 235 | \call_user_func_array([$this,$method], $attributes); |
@@ -45,8 +45,9 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | public function setVariations($variations) { |
| 47 | 47 | $this->setProperty("class", $this->_baseClass); |
| 48 | - if (\is_string($variations)) |
|
| 49 | - $variations=\explode(" ", $variations); |
|
| 48 | + if (\is_string($variations)) { |
|
| 49 | + $variations=\explode(" ", $variations); |
|
| 50 | + } |
|
| 50 | 51 | foreach ( $variations as $variation ) { |
| 51 | 52 | $this->addVariation($variation); |
| 52 | 53 | } |
@@ -59,8 +60,9 @@ discard block |
||
| 59 | 60 | } |
| 60 | 61 | |
| 61 | 62 | public function addVariations($variations=array()) { |
| 62 | - if (\is_string($variations)) |
|
| 63 | - $variations=\explode(" ", $variations); |
|
| 63 | + if (\is_string($variations)) { |
|
| 64 | + $variations=\explode(" ", $variations); |
|
| 65 | + } |
|
| 64 | 66 | foreach ( $variations as $variation ) { |
| 65 | 67 | $this->addVariation($variation); |
| 66 | 68 | } |
@@ -68,8 +70,9 @@ discard block |
||
| 68 | 70 | } |
| 69 | 71 | |
| 70 | 72 | public function addStates($states=array()) { |
| 71 | - if (\is_string($states)) |
|
| 72 | - $states=\explode(" ", $states); |
|
| 73 | + if (\is_string($states)) { |
|
| 74 | + $states=\explode(" ", $states); |
|
| 75 | + } |
|
| 73 | 76 | foreach ( $states as $state ) { |
| 74 | 77 | $this->addState($state); |
| 75 | 78 | } |
@@ -78,8 +81,9 @@ discard block |
||
| 78 | 81 | |
| 79 | 82 | public function setStates($states) { |
| 80 | 83 | $this->setProperty("class", $this->_baseClass); |
| 81 | - if (\is_string($states)) |
|
| 82 | - $states=\explode(" ", $states); |
|
| 84 | + if (\is_string($states)) { |
|
| 85 | + $states=\explode(" ", $states); |
|
| 86 | + } |
|
| 83 | 87 | foreach ( $states as $state ) { |
| 84 | 88 | $this->addState($state); |
| 85 | 89 | } |
@@ -111,8 +115,9 @@ discard block |
||
| 111 | 115 | * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement |
| 112 | 116 | */ |
| 113 | 117 | public function setDisabled($disable=true) { |
| 114 | - if($disable) |
|
| 115 | - $this->addToProperty("class", "disabled"); |
|
| 118 | + if($disable) { |
|
| 119 | + $this->addToProperty("class", "disabled"); |
|
| 120 | + } |
|
| 116 | 121 | return $this; |
| 117 | 122 | } |
| 118 | 123 | |
@@ -146,14 +151,16 @@ discard block |
||
| 146 | 151 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
| 147 | 152 | */ |
| 148 | 153 | public function setActive($value=true){ |
| 149 | - if($value) |
|
| 150 | - $this->addToProperty("class", "active"); |
|
| 154 | + if($value) { |
|
| 155 | + $this->addToProperty("class", "active"); |
|
| 156 | + } |
|
| 151 | 157 | return $this; |
| 152 | 158 | } |
| 153 | 159 | |
| 154 | 160 | public function setAttached($value=true){ |
| 155 | - if($value) |
|
| 156 | - $this->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 161 | + if($value) { |
|
| 162 | + $this->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 163 | + } |
|
| 157 | 164 | return $this; |
| 158 | 165 | } |
| 159 | 166 | |
@@ -42,8 +42,9 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function setAttached($value=true){ |
| 44 | 44 | $form=$this->getForm(); |
| 45 | - if($value) |
|
| 46 | - $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 45 | + if($value) { |
|
| 46 | + $form->addToPropertyCtrl("class", "attached", array ("attached" )); |
|
| 47 | + } |
|
| 47 | 48 | return $form; |
| 48 | 49 | } |
| 49 | 50 | |
@@ -85,8 +86,9 @@ discard block |
||
| 85 | 86 | if(isset($url) && isset($responseElement)){ |
| 86 | 87 | $button->addEvent($event, "$('#".$form->getIdentifier()."').form('validate form');"); |
| 87 | 88 | $params=["form"=>$form->getIdentifier(),"responseElement"=>$responseElement,"url"=>$url]; |
| 88 | - if(\is_array($parameters)) |
|
| 89 | - $params=\array_merge($params,$parameters); |
|
| 89 | + if(\is_array($parameters)) { |
|
| 90 | + $params=\array_merge($params,$parameters); |
|
| 91 | + } |
|
| 90 | 92 | $form->addValidationParam("_ajaxSubmit", new AjaxCall("postForm", $params)); |
| 91 | 93 | } |
| 92 | 94 | return $button; |
@@ -17,15 +17,17 @@ |
||
| 17 | 17 | |
| 18 | 18 | public function setBasic($very=false) { |
| 19 | 19 | $table=$this->getTable(); |
| 20 | - if ($very) |
|
| 21 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 20 | + if ($very) { |
|
| 21 | + $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 22 | + } |
|
| 22 | 23 | return $table->addToPropertyCtrl("class", "basic", array ("basic" )); |
| 23 | 24 | } |
| 24 | 25 | |
| 25 | 26 | public function setCompact($very=false) { |
| 26 | 27 | $table=$this->getTable(); |
| 27 | - if ($very) |
|
| 28 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 28 | + if ($very) { |
|
| 29 | + $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 30 | + } |
|
| 29 | 31 | return $table->addToPropertyCtrl("class", "compact", array ("compact" )); |
| 30 | 32 | } |
| 31 | 33 | |
@@ -136,10 +136,12 @@ discard block |
||
| 136 | 136 | if (isset($param)) { |
| 137 | 137 | $param=Javascript::prep_value($param); |
| 138 | 138 | $str="$({$element}).{$jQueryCall}({$param});"; |
| 139 | - } else |
|
| 140 | - $str="$({$element}).{$jQueryCall}();"; |
|
| 141 | - if ($immediatly) |
|
| 142 | - $this->jquery_code_for_compile[]=$str; |
|
| 139 | + } else { |
|
| 140 | + $str="$({$element}).{$jQueryCall}();"; |
|
| 141 | + } |
|
| 142 | + if ($immediatly) { |
|
| 143 | + $this->jquery_code_for_compile[]=$str; |
|
| 144 | + } |
|
| 143 | 145 | return $str; |
| 144 | 146 | } |
| 145 | 147 | /** |
@@ -154,8 +156,9 @@ discard block |
||
| 154 | 156 | $to=Javascript::prep_element($to); |
| 155 | 157 | $element=Javascript::prep_element($element); |
| 156 | 158 | $str="$({$to}).{$jQueryCall}({$element});"; |
| 157 | - if ($immediatly) |
|
| 158 | - $this->jquery_code_for_compile[]=$str; |
|
| 159 | + if ($immediatly) { |
|
| 160 | + $this->jquery_code_for_compile[]=$str; |
|
| 161 | + } |
|
| 159 | 162 | return $str; |
| 160 | 163 | } |
| 161 | 164 | |
@@ -211,12 +214,14 @@ discard block |
||
| 211 | 214 | if ($stopPropagation===true) { |
| 212 | 215 | $js=Javascript::$stopPropagation.$js; |
| 213 | 216 | } |
| 214 | - if (array_search($event, $this->jquery_events)===false) |
|
| 215 | - $event="\n\t$(".Javascript::prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
| 216 | - else |
|
| 217 | - $event="\n\t$(".Javascript::prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
| 218 | - if($immediatly) |
|
| 219 | - $this->jquery_code_for_compile[]=$event; |
|
| 217 | + if (array_search($event, $this->jquery_events)===false) { |
|
| 218 | + $event="\n\t$(".Javascript::prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
| 219 | + } else { |
|
| 220 | + $event="\n\t$(".Javascript::prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
| 221 | + } |
|
| 222 | + if($immediatly) { |
|
| 223 | + $this->jquery_code_for_compile[]=$event; |
|
| 224 | + } |
|
| 220 | 225 | return $event; |
| 221 | 226 | } |
| 222 | 227 | |
@@ -301,7 +306,9 @@ discard block |
||
| 301 | 306 | } |
| 302 | 307 | |
| 303 | 308 | private function minify($input) { |
| 304 | - if(trim($input) === "") return $input; |
|
| 309 | + if(trim($input) === "") { |
|
| 310 | + return $input; |
|
| 311 | + } |
|
| 305 | 312 | return preg_replace( |
| 306 | 313 | array( |
| 307 | 314 | // Remove comment(s) |
@@ -50,10 +50,12 @@ discard block |
||
| 50 | 50 | $js->execOn("mouseover", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'visible');",["preventDefault"=>false,"stopPropagation"=>true]); |
| 51 | 51 | $js->execOn("mouseout", "#".$this->identifier." tr", "$(event.target).closest('tr').find('.visibleover').css('visibility', 'hidden');",["preventDefault"=>false,"stopPropagation"=>true]); |
| 52 | 52 | } |
| 53 | - if($this->_hasDelete) |
|
| 54 | - $this->_generateBehavior("delete", $js); |
|
| 55 | - if($this->_hasEdit) |
|
| 56 | - $this->_generateBehavior("edit", $js); |
|
| 53 | + if($this->_hasDelete) { |
|
| 54 | + $this->_generateBehavior("delete", $js); |
|
| 55 | + } |
|
| 56 | + if($this->_hasEdit) { |
|
| 57 | + $this->_generateBehavior("edit", $js); |
|
| 58 | + } |
|
| 57 | 59 | return parent::run($js); |
| 58 | 60 | } |
| 59 | 61 | |
@@ -76,8 +78,9 @@ discard block |
||
| 76 | 78 | } |
| 77 | 79 | |
| 78 | 80 | protected function _generateBehavior($op,JsUtils $js){ |
| 79 | - if(isset($this->_urls[$op])) |
|
| 80 | - $js->getOnClick("#".$this->identifier." .".$op, $this->_urls[$op],$this->getTargetSelector(),["preventDefault"=>false,"attr"=>"data-ajax"]); |
|
| 81 | + if(isset($this->_urls[$op])) { |
|
| 82 | + $js->getOnClick("#".$this->identifier." .".$op, $this->_urls[$op],$this->getTargetSelector(),["preventDefault"=>false,"attr"=>"data-ajax"]); |
|
| 83 | + } |
|
| 81 | 84 | } |
| 82 | 85 | |
| 83 | 86 | /** |
@@ -102,12 +105,14 @@ discard block |
||
| 102 | 105 | |
| 103 | 106 | $table->setRowCount(0, \sizeof($captions)); |
| 104 | 107 | $table->setHeaderValues($captions); |
| 105 | - if(isset($this->_compileParts)) |
|
| 106 | - $table->setCompileParts($this->_compileParts); |
|
| 108 | + if(isset($this->_compileParts)) { |
|
| 109 | + $table->setCompileParts($this->_compileParts); |
|
| 110 | + } |
|
| 107 | 111 | |
| 108 | 112 | if(isset($this->_searchField) && isset($js)){ |
| 109 | - if(isset($this->_urls["refresh"])) |
|
| 110 | - $this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
| 113 | + if(isset($this->_urls["refresh"])) { |
|
| 114 | + $this->_searchField->postOn("change", $this->_urls["refresh"],"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
| 115 | + } |
|
| 111 | 116 | } |
| 112 | 117 | |
| 113 | 118 | $this->_generateContent($table); |
@@ -132,8 +137,9 @@ discard block |
||
| 132 | 137 | private function _generateMainCheckbox(&$captions){ |
| 133 | 138 | $ck=new HtmlCheckbox("main-ck-".$this->identifier,""); |
| 134 | 139 | $checkedMessageCall=""; |
| 135 | - if($this->_hasCheckedMessage) |
|
| 136 | - $checkedMessageCall="updateChecked();"; |
|
| 140 | + if($this->_hasCheckedMessage) { |
|
| 141 | + $checkedMessageCall="updateChecked();"; |
|
| 142 | + } |
|
| 137 | 143 | $ck->setOnChecked("$('#".$this->identifier." [name=%quote%selection[]%quote%]').prop('checked',true);".$checkedMessageCall); |
| 138 | 144 | $ck->setOnUnchecked("$('#".$this->identifier." [name=%quote%selection[]%quote%]').prop('checked',false);".$checkedMessageCall); |
| 139 | 145 | \array_unshift($captions, $ck); |
@@ -170,8 +176,9 @@ discard block |
||
| 170 | 176 | $menu->floatRight(); |
| 171 | 177 | $menu->setActiveItem($this->_pagination->getPage()-1); |
| 172 | 178 | $footer->setValues($menu); |
| 173 | - if(isset($this->_urls["refresh"])) |
|
| 174 | - $menu->postOnClick($this->_urls["refresh"],"{'p':$(this).attr('data-page')}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
| 179 | + if(isset($this->_urls["refresh"])) { |
|
| 180 | + $menu->postOnClick($this->_urls["refresh"],"{'p':$(this).attr('data-page')}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
|
| 181 | + } |
|
| 175 | 182 | } |
| 176 | 183 | |
| 177 | 184 | protected function _getFieldName($index){ |
@@ -214,7 +221,7 @@ discard block |
||
| 214 | 221 | $hasPart=$table->hasPart($part); |
| 215 | 222 | if($hasPart){ |
| 216 | 223 | $row=$table->getPart($part)->addRow(\sizeof($captions)); |
| 217 | - }else{ |
|
| 224 | + } else{ |
|
| 218 | 225 | $row=$table->getPart($part)->getRow(0); |
| 219 | 226 | } |
| 220 | 227 | $row->mergeCol(); |
@@ -239,7 +246,7 @@ discard block |
||
| 239 | 246 | $this->_urls["refresh"]=JArray::getValue($urls, "refresh",0); |
| 240 | 247 | $this->_urls["edit"]=JArray::getValue($urls, "edit",1); |
| 241 | 248 | $this->_urls["delete"]=JArray::getValue($urls, "delete",2); |
| 242 | - }else{ |
|
| 249 | + } else{ |
|
| 243 | 250 | $this->_urls=["refresh"=>$urls,"edit"=>$urls,"delete"=>$urls]; |
| 244 | 251 | } |
| 245 | 252 | return $this; |
@@ -295,8 +302,9 @@ discard block |
||
| 295 | 302 | |
| 296 | 303 | protected function getTargetSelector() { |
| 297 | 304 | $result=$this->_targetSelector; |
| 298 | - if(!isset($result)) |
|
| 299 | - $result="#".$this->identifier; |
|
| 305 | + if(!isset($result)) { |
|
| 306 | + $result="#".$this->identifier; |
|
| 307 | + } |
|
| 300 | 308 | return $result; |
| 301 | 309 | } |
| 302 | 310 | |
@@ -334,8 +342,9 @@ discard block |
||
| 334 | 342 | * @param callable $callback |
| 335 | 343 | */ |
| 336 | 344 | public function addCountCheckedInToolbar(array $checkedMessage=null,$callback=null){ |
| 337 | - if(isset($checkedMessage)) |
|
| 338 | - $this->_checkedMessage=$checkedMessage; |
|
| 345 | + if(isset($checkedMessage)) { |
|
| 346 | + $this->_checkedMessage=$checkedMessage; |
|
| 347 | + } |
|
| 339 | 348 | $checkedMessage=$this->getCheckedMessage(); |
| 340 | 349 | $this->_hasCheckboxes=true; |
| 341 | 350 | $this->_hasCheckedMessage=true; |
@@ -57,8 +57,9 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | private function getFieldButton($caption,$visibleHover=true){ |
| 59 | 59 | $bt= new HtmlButton("",$caption); |
| 60 | - if($visibleHover) |
|
| 61 | - $this->_visibleOver($bt); |
|
| 60 | + if($visibleHover) { |
|
| 61 | + $this->_visibleOver($bt); |
|
| 62 | + } |
|
| 62 | 63 | return $bt; |
| 63 | 64 | } |
| 64 | 65 | |
@@ -75,8 +76,9 @@ discard block |
||
| 75 | 76 | return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$index,$attributes){ |
| 76 | 77 | $button=new HtmlButton($id,$value,$cssStyle); |
| 77 | 78 | $button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]); |
| 78 | - if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) |
|
| 79 | - $this->_visibleOver($button); |
|
| 79 | + if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"]) { |
|
| 80 | + $this->_visibleOver($button); |
|
| 81 | + } |
|
| 80 | 82 | return $button; |
| 81 | 83 | }, $index,$attributes); |
| 82 | 84 | } |
@@ -135,8 +137,9 @@ discard block |
||
| 135 | 137 | private function getDefaultButton($icon,$class=null,$visibleHover=true){ |
| 136 | 138 | $bt=$this->getFieldButton("",$visibleHover); |
| 137 | 139 | $bt->asIcon($icon); |
| 138 | - if(isset($class)) |
|
| 139 | - $bt->addClass($class); |
|
| 140 | + if(isset($class)) { |
|
| 141 | + $bt->addClass($class); |
|
| 142 | + } |
|
| 140 | 143 | return $bt; |
| 141 | 144 | } |
| 142 | 145 | |