@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->load_all_plugins= true; |
| 38 | 38 | $this->full_cache_file= $this->path."edit_area_full_with_plugins.js"; |
| 39 | 39 | $this->gzip_cache_file= $this->path."edit_area_full_with_plugins.gz"; |
| 40 | - }else{ |
|
| 40 | + } else{ |
|
| 41 | 41 | $this->load_all_plugins= false; |
| 42 | 42 | $this->full_cache_file= $this->path."edit_area_full.js"; |
| 43 | 43 | $this->gzip_cache_file= $this->path."edit_area_full.gz"; |
@@ -55,8 +55,9 @@ discard block |
||
| 55 | 55 | header("Content-type: text/javascript; charset: UTF-8"); |
| 56 | 56 | header("Vary: Accept-Encoding"); // Handle proxies |
| 57 | 57 | header(sprintf("Expires: %s GMT", gmdate("D, d M Y H:i:s", time() + $this->param['cache_duration'])) ); |
| 58 | - if($this->use_gzip) |
|
| 59 | - header("Content-Encoding: ".$this->gzip_enc_header); |
|
| 58 | + if($this->use_gzip) { |
|
| 59 | + header("Content-Encoding: ".$this->gzip_enc_header); |
|
| 60 | + } |
|
| 60 | 61 | } |
| 61 | 62 | |
| 62 | 63 | function check_gzip_use() |
@@ -64,14 +65,16 @@ discard block |
||
| 64 | 65 | $encodings = array(); |
| 65 | 66 | $desactivate_gzip=false; |
| 66 | 67 | |
| 67 | - if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) |
|
| 68 | - $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); |
|
| 68 | + if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { |
|
| 69 | + $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); |
|
| 70 | + } |
|
| 69 | 71 | |
| 70 | 72 | // desactivate gzip for IE version < 7 |
| 71 | 73 | if(preg_match("/(?:msie )([0-9.]+)/i", $_SERVER['HTTP_USER_AGENT'], $ie)) |
| 72 | 74 | { |
| 73 | - if($ie[1]<7) |
|
| 74 | - $desactivate_gzip=true; |
|
| 75 | + if($ie[1]<7) { |
|
| 76 | + $desactivate_gzip=true; |
|
| 77 | + } |
|
| 75 | 78 | } |
| 76 | 79 | |
| 77 | 80 | // Check for gzip header or northon internet securities |
@@ -79,7 +82,7 @@ discard block |
||
| 79 | 82 | $this->gzip_enc_header= in_array('x-gzip', $encodings) ? "x-gzip" : "gzip"; |
| 80 | 83 | $this->use_gzip=true; |
| 81 | 84 | $this->cache_file=$this->gzip_cache_file; |
| 82 | - }else{ |
|
| 85 | + } else{ |
|
| 83 | 86 | $this->use_gzip=false; |
| 84 | 87 | $this->cache_file=$this->full_cache_file; |
| 85 | 88 | } |
@@ -93,8 +96,9 @@ discard block |
||
| 93 | 96 | $cache_date=0; |
| 94 | 97 | if ($dir = opendir($this->path)) { |
| 95 | 98 | while (($file = readdir($dir)) !== false) { |
| 96 | - if(is_file($this->path.$file) && $file!="." && $file!="..") |
|
| 97 | - $cache_date= max($cache_date, filemtime($this->path.$file)); |
|
| 99 | + if(is_file($this->path.$file) && $file!="." && $file!="..") { |
|
| 100 | + $cache_date= max($cache_date, filemtime($this->path.$file)); |
|
| 101 | + } |
|
| 98 | 102 | } |
| 99 | 103 | closedir($dir); |
| 100 | 104 | } |
@@ -106,8 +110,9 @@ discard block |
||
| 106 | 110 | { |
| 107 | 111 | if ($file !== "." && $file !== "..") |
| 108 | 112 | { |
| 109 | - if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 110 | - $cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js")); |
|
| 113 | + if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) { |
|
| 114 | + $cache_date= max($cache_date, filemtime("plugins/".$file."/".$file.".js")); |
|
| 115 | + } |
|
| 111 | 116 | } |
| 112 | 117 | } |
| 113 | 118 | closedir($dir); |
@@ -123,8 +128,7 @@ discard block |
||
| 123 | 128 | header("Last-modified: ".$last_modified); |
| 124 | 129 | header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache |
| 125 | 130 | header("Pragma:"); // Tells HTTP 1.0 clients to cache |
| 126 | - } |
|
| 127 | - else |
|
| 131 | + } else |
|
| 128 | 132 | { |
| 129 | 133 | header("Last-modified: ".$last_modified); |
| 130 | 134 | header("Cache-Control: Public"); // Tells HTTP 1.1 clients to cache |
@@ -207,8 +211,9 @@ discard block |
||
| 207 | 211 | { |
| 208 | 212 | if ($file !== "." && $file !== "..") |
| 209 | 213 | { |
| 210 | - if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) |
|
| 211 | - $sub_scripts_list[]= "plugins/".$file."/".$file.".js"; |
|
| 214 | + if(is_dir($plug_path.$file) && file_exists($plug_path.$file."/".$file.".js")) { |
|
| 215 | + $sub_scripts_list[]= "plugins/".$file."/".$file.".js"; |
|
| 216 | + } |
|
| 212 | 217 | } |
| 213 | 218 | } |
| 214 | 219 | closedir($dir); |
@@ -247,22 +252,23 @@ discard block |
||
| 247 | 252 | 'Î' => '"', |
| 248 | 253 | 'Ï' => "\n", |
| 249 | 254 | 'À' => "\r"*/); |
| 250 | - } |
|
| 251 | - else |
|
| 255 | + } else |
|
| 252 | 256 | { |
| 253 | 257 | $last_comp = array(); |
| 254 | 258 | } |
| 255 | 259 | |
| 256 | 260 | $js_replace= ''; |
| 257 | - foreach( $last_comp as $key => $val ) |
|
| 258 | - $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')"; |
|
| 261 | + foreach( $last_comp as $key => $val ) { |
|
| 262 | + $js_replace .= ".replace(/". $key ."/g,'". str_replace( array("\n", "\r"), array('\n','\r'), $val ) ."')"; |
|
| 263 | + } |
|
| 259 | 264 | |
| 260 | 265 | $this->datas.= sprintf("editAreaLoader.iframe_script= \"<script type='text/javascript'>%s</script>\"%s;\n", |
| 261 | 266 | str_replace( array_values($last_comp), array_keys($last_comp), $sub_scripts ), |
| 262 | 267 | $js_replace); |
| 263 | 268 | |
| 264 | - if($this->load_all_plugins) |
|
| 265 | - $this->datas.="editAreaLoader.all_plugins_loaded=true;\n"; |
|
| 269 | + if($this->load_all_plugins) { |
|
| 270 | + $this->datas.="editAreaLoader.all_plugins_loaded=true;\n"; |
|
| 271 | + } |
|
| 266 | 272 | |
| 267 | 273 | |
| 268 | 274 | // load the template |
@@ -283,7 +289,7 @@ discard block |
||
| 283 | 289 | $gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
| 284 | 290 | $header.=sprintf("=> GZIP COMPRESSION => %s", strlen($gzip_datas)); |
| 285 | 291 | $ratio = round(100 - strlen($gzip_datas) / $this->file_loaded_size * 100.0); |
| 286 | - }else{ |
|
| 292 | + } else{ |
|
| 287 | 293 | $ratio = round(100 - strlen($this->datas) / $this->file_loaded_size * 100.0); |
| 288 | 294 | } |
| 289 | 295 | $header.=sprintf(", reduced by %s%%\n", $ratio); |
@@ -296,19 +302,22 @@ discard block |
||
| 296 | 302 | // generate gzip file and cahce it if using disk cache |
| 297 | 303 | if($this->use_gzip){ |
| 298 | 304 | $this->gzip_datas= gzencode($this->datas, 9, FORCE_GZIP); |
| 299 | - if($this->param['use_disk_cache']) |
|
| 300 | - $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime); |
|
| 305 | + if($this->param['use_disk_cache']) { |
|
| 306 | + $this->file_put_contents($this->gzip_cache_file, $this->gzip_datas, $mtime); |
|
| 307 | + } |
|
| 301 | 308 | } |
| 302 | 309 | |
| 303 | 310 | // generate full js file and cache it if using disk cache |
| 304 | - if($this->param['use_disk_cache']) |
|
| 305 | - $this->file_put_contents($this->full_cache_file, $this->datas, $mtime); |
|
| 311 | + if($this->param['use_disk_cache']) { |
|
| 312 | + $this->file_put_contents($this->full_cache_file, $this->datas, $mtime); |
|
| 313 | + } |
|
| 306 | 314 | |
| 307 | 315 | // generate output |
| 308 | - if($this->use_gzip) |
|
| 309 | - echo $this->gzip_datas; |
|
| 310 | - else |
|
| 311 | - echo $this->datas; |
|
| 316 | + if($this->use_gzip) { |
|
| 317 | + echo $this->gzip_datas; |
|
| 318 | + } else { |
|
| 319 | + echo $this->datas; |
|
| 320 | + } |
|
| 312 | 321 | |
| 313 | 322 | // die; |
| 314 | 323 | } |
@@ -325,7 +334,7 @@ discard block |
||
| 325 | 334 | fclose($fd); |
| 326 | 335 | return $content;*/ |
| 327 | 336 | return $this->file_get_contents($file); |
| 328 | - }else{ |
|
| 337 | + } else{ |
|
| 329 | 338 | $this->infos[]=sprintf("'%s' not loaded", $end_uri); |
| 330 | 339 | return ""; |
| 331 | 340 | } |
@@ -382,10 +391,11 @@ discard block |
||
| 382 | 391 | /*$pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
| 383 | 392 | $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\\\n"$1+"');*/ |
| 384 | 393 | $pattern= array("/(\\\\)?\"/", '/\\\n/' , '/\\\r/' , "/(\r?\n)/"); |
| 385 | - if($this->param['compress']) |
|
| 386 | - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n'); |
|
| 387 | - else |
|
| 388 | - $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\""); |
|
| 394 | + if($this->param['compress']) { |
|
| 395 | + $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , '\n'); |
|
| 396 | + } else { |
|
| 397 | + $replace= array('$1$1\\"', '\\\\\\n', '\\\\\\r' , "\\n\"\n+\""); |
|
| 398 | + } |
|
| 389 | 399 | $str= preg_replace($pattern, $replace, $str); |
| 390 | 400 | } |
| 391 | 401 | |
@@ -407,8 +417,9 @@ discard block |
||
| 407 | 417 | |
| 408 | 418 | function file_put_contents($file, &$content, $mtime=-1) |
| 409 | 419 | { |
| 410 | - if($mtime==-1) |
|
| 411 | - $mtime=time(); |
|
| 420 | + if($mtime==-1) { |
|
| 421 | + $mtime=time(); |
|
| 422 | + } |
|
| 412 | 423 | $fp = @fopen($file, "wb"); |
| 413 | 424 | if ($fp) { |
| 414 | 425 | fwrite($fp, $content); |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | |
| 76 | 76 | if (strtolower($api->method_type) == 'get' && $httpbuilder) { |
| 77 | 77 | $httpbuilder = "?".http_build_query($httpbuilder); |
| 78 | - }else{ |
|
| 78 | + } else{ |
|
| 79 | 79 | $httpbuilder = ''; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -117,7 +117,10 @@ |
||
| 117 | 117 | @if($param['used']) |
| 118 | 118 | <?php |
| 119 | 119 | $param_exception = ['in', 'not_in', 'digits_between']; |
| 120 | - if ($param['config'] && substr($param['config'], 0, 1) != '*' && ! in_array($param['type'], $param_exception)) continue;?> |
|
| 120 | + if ($param['config'] && substr($param['config'], 0, 1) != '*' && ! in_array($param['type'], $param_exception)) { |
|
| 121 | + continue; |
|
| 122 | + } |
|
| 123 | + ?> |
|
| 121 | 124 | <tr> |
| 122 | 125 | <td>{{++$i}}</td> |
| 123 | 126 | <td width="5%"><em>{{$param['type']}}</em></td> |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | </script> |
| 66 | 66 | @endpush |
| 67 | 67 | <?php |
| 68 | - }else { |
|
| 68 | + } else { |
|
| 69 | 69 | echo $value; |
| 70 | 70 | } |
| 71 | 71 | ?> |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | </table> |
| 74 | 74 | @endif |
| 75 | 75 | <?php |
| 76 | - }else { |
|
| 76 | + } else { |
|
| 77 | 77 | echo $value; |
| 78 | 78 | } |
| 79 | 79 | ?> |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | |
| 39 | 39 | if (file_exists(controller_path($row->controller))) { |
| 40 | 40 | $response = FileManipulator::readCtrlContent(str_replace('.', '', $row->controller)); |
| 41 | - }else{ |
|
| 41 | + } else{ |
|
| 42 | 42 | $response = file_get_contents(__DIR__.'Step1Handler.php/'.str_replace('.', '', $row->controller).'.php'); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -9,7 +9,10 @@ |
||
| 9 | 9 | <form method='get' action=''> |
| 10 | 10 | <div class="modal-body"> |
| 11 | 11 | @foreach($columns as $key => $col) |
| 12 | - <?php if (isset($col['image']) || isset($col['download']) || $col['visible'] === FALSE) continue;?> |
|
| 12 | + <?php if (isset($col['image']) || isset($col['download']) || $col['visible'] === FALSE) { |
|
| 13 | + continue; |
|
| 14 | +} |
|
| 15 | +?> |
|
| 13 | 16 | |
| 14 | 17 | <div class='form-group'> |
| 15 | 18 | |
@@ -60,7 +60,9 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | <?php |
| 62 | 62 | foreach ($columns as $col) { |
| 63 | - if ($col['visible'] === FALSE) continue; |
|
| 63 | + if ($col['visible'] === FALSE) { |
|
| 64 | + continue; |
|
| 65 | + } |
|
| 64 | 66 | |
| 65 | 67 | $sort_column = Request::get('filter_column'); |
| 66 | 68 | $colname = $col['label']; |
@@ -159,7 +161,9 @@ discard block |
||
| 159 | 161 | |
| 160 | 162 | <?php |
| 161 | 163 | foreach ($columns as $col) { |
| 162 | - if ($col['visible'] === FALSE) continue; |
|
| 164 | + if ($col['visible'] === FALSE) { |
|
| 165 | + continue; |
|
| 166 | + } |
|
| 163 | 167 | $colname = $col['label']; |
| 164 | 168 | $width = ($col['width']) ?: "auto"; |
| 165 | 169 | echo "<th width='$width'>$colname</th>"; |
@@ -30,7 +30,9 @@ |
||
| 30 | 30 | break; |
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | - if (! $value) $value = []; |
|
| 33 | + if (! $value) { |
|
| 34 | + $value = []; |
|
| 35 | + } |
|
| 34 | 36 | } |
| 35 | 37 | } else { |
| 36 | 38 | $value = explode(";", $value); |