@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | $blue = dechex($blue); |
| 44 | 44 | |
| 45 | 45 | if (strlen($red) == 1) { |
| 46 | - $red = '0' . $red; |
|
| 46 | + $red = '0'.$red; |
|
| 47 | 47 | } |
| 48 | 48 | if (strlen($green) == 1) { |
| 49 | - $green = '0' . $green; |
|
| 49 | + $green = '0'.$green; |
|
| 50 | 50 | } |
| 51 | 51 | if (strlen($blue) == 1) { |
| 52 | - $blue = '0' . $blue; |
|
| 52 | + $blue = '0'.$blue; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | return "$red$green$blue"; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $couleur = couleur_html_to_hex($couleur); |
| 68 | 68 | $couleur = ltrim($couleur, '#'); |
| 69 | 69 | if (strlen($couleur) === 3) { |
| 70 | - $couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2]; |
|
| 70 | + $couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2]; |
|
| 71 | 71 | } |
| 72 | 72 | $retour = []; |
| 73 | 73 | $retour['red'] = hexdec(substr($couleur, 0, 2)); |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | $var_G = ($G / 255); |
| 125 | 125 | $var_B = ($B / 255); |
| 126 | 126 | |
| 127 | - $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 128 | - $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 129 | - $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 127 | + $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 128 | + $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 129 | + $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 130 | 130 | |
| 131 | 131 | $L = ($var_Max + $var_Min) / 2; |
| 132 | 132 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | function _couleur_hsl_to_rgb($H, $S, $L) { |
| 190 | 190 | // helper |
| 191 | - $hue_2_rgb = function ($v1, $v2, $vH) { |
|
| 191 | + $hue_2_rgb = function($v1, $v2, $vH) { |
|
| 192 | 192 | if ($vH < 0) { |
| 193 | 193 | $vH += 1; |
| 194 | 194 | } |
@@ -318,10 +318,10 @@ discard block |
||
| 318 | 318 | } # gerer img src="data:....base64" |
| 319 | 319 | elseif ( |
| 320 | 320 | preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs) |
| 321 | - and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1]) |
|
| 321 | + and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1]) |
|
| 322 | 322 | and in_array($extension, _image_extensions_acceptees_en_entree()) |
| 323 | 323 | ) { |
| 324 | - $local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension); |
|
| 324 | + $local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension); |
|
| 325 | 325 | if (!file_exists($local)) { |
| 326 | 326 | ecrire_fichier($local, base64_decode($regs[2])); |
| 327 | 327 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | // les protocoles web prennent au moins 3 lettres |
| 336 | 336 | if (tester_url_absolue($source)) { |
| 337 | 337 | include_spip('inc/distant'); |
| 338 | - $fichier = _DIR_RACINE . copie_locale($source); |
|
| 338 | + $fichier = _DIR_RACINE.copie_locale($source); |
|
| 339 | 339 | if (!$fichier) { |
| 340 | 340 | return ''; |
| 341 | 341 | } |
@@ -427,9 +427,9 @@ discard block |
||
| 427 | 427 | // on garde la terminaison initiale car image simplement copiee |
| 428 | 428 | // et on postfixe son nom avec un md5 du path |
| 429 | 429 | $terminaison_dest = $terminaison; |
| 430 | - $fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5); |
|
| 430 | + $fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5); |
|
| 431 | 431 | } else { |
| 432 | - $fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5); |
|
| 432 | + $fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5); |
|
| 433 | 433 | } |
| 434 | 434 | $cache = sous_repertoire(_DIR_VAR, $cache); |
| 435 | 435 | $cache = sous_repertoire($cache, $effet); |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | $fichier_dest = substr($fichier_dest, 2); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | - $fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest; |
|
| 443 | + $fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest; |
|
| 444 | 444 | |
| 445 | 445 | $GLOBALS['images_calculees'][] = $fichier_dest; |
| 446 | 446 | |
@@ -478,15 +478,15 @@ discard block |
||
| 478 | 478 | |
| 479 | 479 | if ($creer) { |
| 480 | 480 | spip_log( |
| 481 | - 'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 482 | - 'images' . _LOG_DEBUG |
|
| 481 | + 'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 482 | + 'images'._LOG_DEBUG |
|
| 483 | 483 | ); |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 487 | - $ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction; |
|
| 487 | + $ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction; |
|
| 488 | 488 | $ret['fichier'] = $fichier; |
| 489 | - $ret['fonction_image'] = '_image_image' . $terminaison_dest; |
|
| 489 | + $ret['fonction_image'] = '_image_image'.$terminaison_dest; |
|
| 490 | 490 | $ret['fichier_dest'] = $fichier_dest; |
| 491 | 491 | $ret['format_source'] = _image_extension_normalisee($terminaison); |
| 492 | 492 | $ret['format_dest'] = $terminaison_dest; |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | |
| 636 | 636 | $_terminaison = _image_trouver_extension_depuis_mime($mime); |
| 637 | 637 | if ($_terminaison and $_terminaison !== $terminaison) { |
| 638 | - spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE); |
|
| 638 | + spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE); |
|
| 639 | 639 | $terminaison = $_terminaison; |
| 640 | 640 | } |
| 641 | 641 | return $terminaison; |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | if (!function_exists('imagepng')) { |
| 793 | 793 | return false; |
| 794 | 794 | } |
| 795 | - $tmp = $fichier . '.tmp'; |
|
| 795 | + $tmp = $fichier.'.tmp'; |
|
| 796 | 796 | $ret = imagepng($img, $tmp); |
| 797 | 797 | if (file_exists($tmp)) { |
| 798 | 798 | $taille_test = getimagesize($tmp); |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | if (!function_exists('imagegif')) { |
| 828 | 828 | return false; |
| 829 | 829 | } |
| 830 | - $tmp = $fichier . '.tmp'; |
|
| 830 | + $tmp = $fichier.'.tmp'; |
|
| 831 | 831 | $ret = imagegif($img, $tmp); |
| 832 | 832 | if (file_exists($tmp)) { |
| 833 | 833 | $taille_test = getimagesize($tmp); |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | if (!function_exists('imagejpeg')) { |
| 868 | 868 | return false; |
| 869 | 869 | } |
| 870 | - $tmp = $fichier . '.tmp'; |
|
| 870 | + $tmp = $fichier.'.tmp'; |
|
| 871 | 871 | |
| 872 | 872 | // Enable interlancing |
| 873 | 873 | imageinterlace($img, true); |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | if (!function_exists('imagewebp')) { |
| 929 | 929 | return false; |
| 930 | 930 | } |
| 931 | - $tmp = $fichier . '.tmp'; |
|
| 931 | + $tmp = $fichier.'.tmp'; |
|
| 932 | 932 | $ret = imagewebp($img, $tmp, $qualite); |
| 933 | 933 | if (file_exists($tmp)) { |
| 934 | 934 | $taille_test = getimagesize($tmp); |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | */ |
| 963 | 963 | function _image_imagesvg($img, $fichier) { |
| 964 | 964 | |
| 965 | - $tmp = $fichier . '.tmp'; |
|
| 965 | + $tmp = $fichier.'.tmp'; |
|
| 966 | 966 | if (strpos($img, '<') === false) { |
| 967 | 967 | $img = supprimer_timestamp($img); |
| 968 | 968 | if (!file_exists($img)) { |
@@ -1019,13 +1019,13 @@ discard block |
||
| 1019 | 1019 | */ |
| 1020 | 1020 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1021 | 1021 | if (is_null($fonction)) { |
| 1022 | - $fonction = '_image_image' . $valeurs['format_dest']; |
|
| 1022 | + $fonction = '_image_image'.$valeurs['format_dest']; |
|
| 1023 | 1023 | } |
| 1024 | 1024 | $ret = false; |
| 1025 | 1025 | #un flag pour reperer les images gravees |
| 1026 | 1026 | $lock = |
| 1027 | 1027 | !statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout |
| 1028 | - or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src')); |
|
| 1028 | + or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src')); |
|
| 1029 | 1029 | if ( |
| 1030 | 1030 | function_exists($fonction) |
| 1031 | 1031 | && ($ret = $fonction($img, $valeurs['fichier_dest'], $qualite)) # on a reussi a creer l'image |
@@ -1036,7 +1036,7 @@ discard block |
||
| 1036 | 1036 | // dans tous les cas mettre a jour la taille de l'image finale |
| 1037 | 1037 | list($valeurs['hauteur_dest'], $valeurs['largeur_dest']) = taille_image($valeurs['fichier_dest']); |
| 1038 | 1038 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition |
| 1039 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1039 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1040 | 1040 | } |
| 1041 | 1041 | } |
| 1042 | 1042 | |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | |
| 1250 | 1250 | // attributs deprecies. Transformer en CSS |
| 1251 | 1251 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1252 | - $style = "margin:${espace}px;" . $style; |
|
| 1252 | + $style = "margin:${espace}px;".$style; |
|
| 1253 | 1253 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1254 | 1254 | } |
| 1255 | 1255 | |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | $image = $valeurs['fichier']; |
| 1375 | 1375 | $format = $valeurs['format_source']; |
| 1376 | 1376 | $destdir = dirname($valeurs['fichier_dest']); |
| 1377 | - $destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']); |
|
| 1377 | + $destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']); |
|
| 1378 | 1378 | |
| 1379 | 1379 | $format_sortie = $valeurs['format_dest']; |
| 1380 | 1380 | |
@@ -1406,14 +1406,14 @@ discard block |
||
| 1406 | 1406 | |
| 1407 | 1407 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1408 | 1408 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1409 | - $vignette = $destination . '.' . $format; |
|
| 1409 | + $vignette = $destination.'.'.$format; |
|
| 1410 | 1410 | @copy($image, $vignette); |
| 1411 | 1411 | } |
| 1412 | 1412 | |
| 1413 | 1413 | elseif ($valeurs['format_source'] === 'svg') { |
| 1414 | 1414 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1415 | 1415 | $format_sortie = 'svg'; |
| 1416 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1416 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1417 | 1417 | $valeurs['fichier_dest'] = $vignette; |
| 1418 | 1418 | _image_gd_output($svg, $valeurs); |
| 1419 | 1419 | } |
@@ -1425,9 +1425,9 @@ discard block |
||
| 1425 | 1425 | define('_CONVERT_COMMAND', 'convert'); |
| 1426 | 1426 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1427 | 1427 | if (!defined('_RESIZE_COMMAND')) { |
| 1428 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest'); |
|
| 1428 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest'); |
|
| 1429 | 1429 | } |
| 1430 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1430 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1431 | 1431 | $commande = str_replace( |
| 1432 | 1432 | ['%x', '%y', '%src', '%dest'], |
| 1433 | 1433 | [ |
@@ -1443,13 +1443,13 @@ discard block |
||
| 1443 | 1443 | if (!@file_exists($vignette)) { |
| 1444 | 1444 | spip_log("echec convert sur $vignette"); |
| 1445 | 1445 | |
| 1446 | - return; // echec commande |
|
| 1446 | + return; // echec commande |
|
| 1447 | 1447 | } |
| 1448 | 1448 | } |
| 1449 | 1449 | |
| 1450 | 1450 | // php5 imagemagick |
| 1451 | 1451 | elseif ($process == 'imagick') { |
| 1452 | - $vignette = "$destination." . $format_sortie; |
|
| 1452 | + $vignette = "$destination.".$format_sortie; |
|
| 1453 | 1453 | |
| 1454 | 1454 | if (!class_exists('Imagick')) { |
| 1455 | 1455 | spip_log('Classe Imagick absente !', _LOG_ERREUR); |
@@ -1463,7 +1463,7 @@ discard block |
||
| 1463 | 1463 | $destHeight, |
| 1464 | 1464 | Imagick::FILTER_LANCZOS, |
| 1465 | 1465 | 1 |
| 1466 | - );//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1466 | + ); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1467 | 1467 | $imagick->writeImage($vignette); |
| 1468 | 1468 | |
| 1469 | 1469 | if (!@file_exists($vignette)) { |
@@ -1481,11 +1481,11 @@ discard block |
||
| 1481 | 1481 | if (_PNMSCALE_COMMAND == '') { |
| 1482 | 1482 | return; |
| 1483 | 1483 | } |
| 1484 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1484 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1485 | 1485 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND); |
| 1486 | 1486 | if ($format == 'jpg') { |
| 1487 | 1487 | $jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND); |
| 1488 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1488 | + exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1489 | 1489 | if (!($s = @filesize($vignette))) { |
| 1490 | 1490 | spip_unlink($vignette); |
| 1491 | 1491 | } |
@@ -1497,7 +1497,7 @@ discard block |
||
| 1497 | 1497 | } else { |
| 1498 | 1498 | if ($format == 'gif') { |
| 1499 | 1499 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND); |
| 1500 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1500 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1501 | 1501 | if (!($s = @filesize($vignette))) { |
| 1502 | 1502 | spip_unlink($vignette); |
| 1503 | 1503 | } |
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | } else { |
| 1510 | 1510 | if ($format == 'png') { |
| 1511 | 1511 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND); |
| 1512 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1512 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1513 | 1513 | if (!($s = @filesize($vignette))) { |
| 1514 | 1514 | spip_unlink($vignette); |
| 1515 | 1515 | } |
@@ -1531,7 +1531,7 @@ discard block |
||
| 1531 | 1531 | return; |
| 1532 | 1532 | } |
| 1533 | 1533 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1534 | - spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels'); |
|
| 1534 | + spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels'); |
|
| 1535 | 1535 | |
| 1536 | 1536 | return; |
| 1537 | 1537 | } |
@@ -1843,7 +1843,7 @@ discard block |
||
| 1843 | 1843 | // de l'image, de facon a tromper le cache du navigateur |
| 1844 | 1844 | // quand on fait supprimer/reuploader un logo |
| 1845 | 1845 | // (pas de filemtime si SAFE MODE) |
| 1846 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1846 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1847 | 1847 | |
| 1848 | 1848 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1849 | 1849 | } |
@@ -1890,7 +1890,7 @@ discard block |
||
| 1890 | 1890 | public static function LittleEndian2String($number, $minbytes = 1) { |
| 1891 | 1891 | $intstring = ''; |
| 1892 | 1892 | while ($number > 0) { |
| 1893 | - $intstring = $intstring . chr($number & 255); |
|
| 1893 | + $intstring = $intstring.chr($number & 255); |
|
| 1894 | 1894 | $number >>= 8; |
| 1895 | 1895 | } |
| 1896 | 1896 | |
@@ -1922,9 +1922,9 @@ discard block |
||
| 1922 | 1922 | $b = $argb['blue']; |
| 1923 | 1923 | |
| 1924 | 1924 | if ($bpp[$key] == 32) { |
| 1925 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1925 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1926 | 1926 | } elseif ($bpp[$key] == 24) { |
| 1927 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1927 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1928 | 1928 | } |
| 1929 | 1929 | |
| 1930 | 1930 | if ($a < 128) { |
@@ -1951,48 +1951,48 @@ discard block |
||
| 1951 | 1951 | |
| 1952 | 1952 | // BITMAPINFOHEADER - 40 bytes |
| 1953 | 1953 | $BitmapInfoHeader[$key] = ''; |
| 1954 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1955 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1954 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1955 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1956 | 1956 | // The biHeight member specifies the combined |
| 1957 | 1957 | // height of the XOR and AND masks. |
| 1958 | 1958 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1959 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1960 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1961 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1962 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1963 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1964 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1965 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1966 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1959 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1960 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1961 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1962 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1963 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1964 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1965 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1966 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1967 | 1967 | } |
| 1968 | 1968 | |
| 1969 | 1969 | |
| 1970 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1971 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1972 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1970 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1971 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1972 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1973 | 1973 | |
| 1974 | 1974 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1975 | 1975 | foreach ($gd_image_array as $key => $gd_image) { |
| 1976 | 1976 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1977 | 1977 | |
| 1978 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1979 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1980 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1981 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1978 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1979 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1980 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1981 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1982 | 1982 | |
| 1983 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1984 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1983 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1984 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 1985 | 1985 | |
| 1986 | 1986 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 1987 | 1987 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1988 | 1988 | $dwBytesInRes, |
| 1989 | 1989 | 4 |
| 1990 | - ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1990 | + ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1991 | 1991 | |
| 1992 | 1992 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1993 | 1993 | $dwImageOffset, |
| 1994 | 1994 | 4 |
| 1995 | - ); // dwImageOffset; // Where in the file is this image? |
|
| 1995 | + ); // dwImageOffset; // Where in the file is this image? |
|
| 1996 | 1996 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 1997 | 1997 | $dwImageOffset += strlen($icXOR[$key]); |
| 1998 | 1998 | $dwImageOffset += strlen($icAND[$key]); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $rejouer = (_SESSION_REJOUER === true) ? rejouer_session() : _SESSION_REJOUER; |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - return $rejouer . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : ''); |
|
| 191 | + return $rejouer.(defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : ''); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -234,9 +234,9 @@ discard block |
||
| 234 | 234 | // |
| 235 | 235 | if ($vcs = version_vcs_courante(_DIR_RACINE, true)) { |
| 236 | 236 | if ($vcs['vcs'] === 'GIT') { |
| 237 | - $url = 'https://git.spip.net/spip/spip/commit/' . $vcs['commit']; |
|
| 237 | + $url = 'https://git.spip.net/spip/spip/commit/'.$vcs['commit']; |
|
| 238 | 238 | } elseif ($vcs['vcs'] === 'SVN') { |
| 239 | - $url = 'https://core.spip.net/projects/spip/repository/revisions/' . $vcs['commit']; |
|
| 239 | + $url = 'https://core.spip.net/projects/spip/repository/revisions/'.$vcs['commit']; |
|
| 240 | 240 | } else { |
| 241 | 241 | $url = ''; |
| 242 | 242 | } |
@@ -246,14 +246,14 @@ discard block |
||
| 246 | 246 | $commit = "<a href=\"$url\" target=\"_blank\" rel=\"noopener noreferrer\">$commit</a>"; |
| 247 | 247 | } |
| 248 | 248 | if ($vcs['branch']) { |
| 249 | - $commit = $vcs['branch'] . ': ' . $commit; |
|
| 249 | + $commit = $vcs['branch'].': '.$commit; |
|
| 250 | 250 | } |
| 251 | 251 | $version .= " {$vcs['vcs']} [$commit]"; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | // et la version de l'ecran de securite |
| 255 | 255 | $secu = defined('_ECRAN_SECURITE') |
| 256 | - ? '<br />' . _T('ecran_securite', ['version' => _ECRAN_SECURITE]) |
|
| 256 | + ? '<br />'._T('ecran_securite', ['version' => _ECRAN_SECURITE]) |
|
| 257 | 257 | : ''; |
| 258 | 258 | |
| 259 | 259 | return _T( |
@@ -261,10 +261,10 @@ discard block |
||
| 261 | 261 | [ |
| 262 | 262 | 'spip' => "<b>SPIP $version</b> ", |
| 263 | 263 | 'lien_gpl' => |
| 264 | - "<a href='" . generer_url_ecrire( |
|
| 264 | + "<a href='".generer_url_ecrire( |
|
| 265 | 265 | 'aide', |
| 266 | - 'aide=licence&var_lang=' . $GLOBALS['spip_lang'] |
|
| 267 | - ) . "' class=\"aide popin\">" . _T('info_copyright_gpl') . '</a>' |
|
| 266 | + 'aide=licence&var_lang='.$GLOBALS['spip_lang'] |
|
| 267 | + )."' class=\"aide popin\">"._T('info_copyright_gpl').'</a>' |
|
| 268 | 268 | ] |
| 269 | 269 | ) |
| 270 | 270 | . $secu; |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | $onfocus = ''; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - $form = '<input type="text" size="10" value="' . $recherche_aff . '" name="recherche" class="recherche" accesskey="r"' . $onfocus . ' />'; |
|
| 295 | - $form .= "<input type='image' src='" . chemin_image('rechercher-20.png') . "' name='submit' class='submit' alt='" . _T('info_rechercher') . "' />"; |
|
| 294 | + $form = '<input type="text" size="10" value="'.$recherche_aff.'" name="recherche" class="recherche" accesskey="r"'.$onfocus.' />'; |
|
| 295 | + $form .= "<input type='image' src='".chemin_image('rechercher-20.png')."' name='submit' class='submit' alt='"._T('info_rechercher')."' />"; |
|
| 296 | 296 | |
| 297 | - return "<div class='spip_recherche'>" . generer_form_ecrire($page, $form . $complement, " method='get'") . '</div>'; |
|
| 297 | + return "<div class='spip_recherche'>".generer_form_ecrire($page, $form.$complement, " method='get'").'</div>'; |
|
| 298 | 298 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | lire_fichier($file, $c); |
| 75 | 75 | $css .= $c; |
| 76 | 76 | } |
| 77 | - $css = "<style type='text/css'>" . $css . '</style>'; |
|
| 77 | + $css = "<style type='text/css'>".$css.'</style>'; |
|
| 78 | 78 | } else { |
| 79 | 79 | foreach ($files as $name) { |
| 80 | 80 | $file = direction_css(find_in_theme($name)); |
@@ -87,19 +87,19 @@ discard block |
||
| 87 | 87 | define('_DOCTYPE_ECRIRE', ''); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - return _DOCTYPE_ECRIRE . |
|
| 91 | - html_lang_attributes() . |
|
| 92 | - "<head>\n" . |
|
| 93 | - '<title>' . |
|
| 94 | - textebrut($titre) . |
|
| 95 | - "</title>\n" . |
|
| 96 | - "<meta name='viewport' content='width=device-width' />\n" . |
|
| 97 | - $css . |
|
| 90 | + return _DOCTYPE_ECRIRE. |
|
| 91 | + html_lang_attributes(). |
|
| 92 | + "<head>\n". |
|
| 93 | + '<title>'. |
|
| 94 | + textebrut($titre). |
|
| 95 | + "</title>\n". |
|
| 96 | + "<meta name='viewport' content='width=device-width' />\n". |
|
| 97 | + $css. |
|
| 98 | 98 | '</head> |
| 99 | -<body' . $onLoad . " class='minipres'> |
|
| 99 | +<body' . $onLoad." class='minipres'> |
|
| 100 | 100 | <div id='minipres'> |
| 101 | 101 | <h1>" . |
| 102 | - $titre . |
|
| 102 | + $titre. |
|
| 103 | 103 | "</h1> |
| 104 | 104 | <div>\n"; |
| 105 | 105 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $titre = ($titre == 'install') |
| 184 | 184 | ? _T('avis_espace_interdit') |
| 185 | - : $titre . ' : ' . _T('info_acces_interdit'); |
|
| 185 | + : $titre.' : '._T('info_acces_interdit'); |
|
| 186 | 186 | |
| 187 | 187 | $statut = isset($GLOBALS['visiteur_session']['statut']) ? $GLOBALS['visiteur_session']['statut'] : ''; |
| 188 | 188 | $nom = isset($GLOBALS['visiteur_session']['nom']) ? $GLOBALS['visiteur_session']['nom'] : ''; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $corps = bouton_action(_T('public:accueil_site'), $GLOBALS['meta']['adresse_site']); |
| 202 | 202 | } |
| 203 | 203 | $corps = "<div class='boutons'>$corps</div>"; |
| 204 | - spip_log($nom . " $titre " . $_SERVER['REQUEST_URI']); |
|
| 204 | + spip_log($nom." $titre ".$_SERVER['REQUEST_URI']); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | if (!_AJAX) { |
@@ -219,6 +219,6 @@ discard block |
||
| 219 | 219 | foreach ($_POST as $v => $c) { |
| 220 | 220 | $url = parametre_url($url, $v, $c, '&'); |
| 221 | 221 | } |
| 222 | - ajax_retour('<div>' . $titre . redirige_formulaire($url) . '</div>', false); |
|
| 222 | + ajax_retour('<div>'.$titre.redirige_formulaire($url).'</div>', false); |
|
| 223 | 223 | } |
| 224 | 224 | } |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | && autoriser('onglet', "_$id") |
| 103 | 103 | ) { |
| 104 | 104 | $onglets[$id] = new Bouton( |
| 105 | - isset($infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 106 | - $infos['titre'], // titre |
|
| 105 | + isset($infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 106 | + $infos['titre'], // titre |
|
| 107 | 107 | (isset($infos['action']) and $infos['action']) |
| 108 | 108 | ? generer_url_ecrire( |
| 109 | 109 | $infos['action'], |
@@ -142,5 +142,5 @@ discard block |
||
| 142 | 142 | $res .= onglet(_T($onglet->libelle), $url, $exec, $ongletCourant, $onglet->icone); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - return !$res ? '' : (debut_onglet($class) . $res . fin_onglet()); |
|
| 145 | + return !$res ? '' : (debut_onglet($class).$res.fin_onglet()); |
|
| 146 | 146 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $class = ' blocreplie'; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - return '<div ' . ($id ? "id='$id' " : '') . "class='bloc_depliable$class'>"; |
|
| 58 | + return '<div '.($id ? "id='$id' " : '')."class='bloc_depliable$class'>"; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // https://code.spip.net/@fin_block |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | // $ids : id des div lies au bouton (facultatif, par defaut c'est le div.bloc_depliable qui suit) |
| 69 | 69 | // https://code.spip.net/@bouton_block_depliable |
| 70 | 70 | function bouton_block_depliable($texte, $deplie, $ids = '') { |
| 71 | - $bouton_id = 'b' . substr(md5($texte . microtime()), 0, 8); |
|
| 71 | + $bouton_id = 'b'.substr(md5($texte.microtime()), 0, 8); |
|
| 72 | 72 | |
| 73 | 73 | $class = ($deplie === true) ? ' deplie' : (($deplie == -1) ? ' impliable' : ' replie'); |
| 74 | 74 | if (strlen($ids)) { |
| 75 | 75 | $cible = explode(',', $ids); |
| 76 | - $cible = '#' . implode(',#', $cible); |
|
| 76 | + $cible = '#'.implode(',#', $cible); |
|
| 77 | 77 | } else { |
| 78 | 78 | $cible = "#$bouton_id + div.bloc_depliable"; |
| 79 | 79 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $texte = $x . $texte; |
|
| 68 | + $texte = $x.$texte; |
|
| 69 | 69 | |
| 70 | 70 | return $texte; |
| 71 | 71 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | || ($pos = 0); |
| 180 | 180 | |
| 181 | 181 | if (false === strpos(substr($texte, 0, $pos), '<!-- insert_head -->')) { |
| 182 | - $insert = "\n" . pipeline('insert_head', '<!-- f_insert_head -->') . "\n"; |
|
| 182 | + $insert = "\n".pipeline('insert_head', '<!-- f_insert_head -->')."\n"; |
|
| 183 | 183 | $texte = substr_replace($texte, $insert, $pos, 0); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } |
| 212 | 212 | $texte = substr_replace($texte, $x, $pos, 0); |
| 213 | 213 | // pas de preview en fenetre enfant |
| 214 | - $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='" . addslashes($GLOBALS['meta']['adresse_site']) . "';}</script>"; |
|
| 214 | + $x = "<script type='text/javascript'>const frameEl = window.frameElement;if (frameEl) {frameEl.sandbox='sandbox';window.location.href='".addslashes($GLOBALS['meta']['adresse_site'])."';}</script>"; |
|
| 215 | 215 | if (!$pos = stripos($texte, '<head') or !$pos = strpos($texte, '>', $pos)) { |
| 216 | 216 | $pos = -1; |
| 217 | 217 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | // inserer avant le </body> fermant si on peut, a la fin de la page sinon |
| 284 | 284 | if (($p = strpos($texte, '</body>')) !== false) { |
| 285 | - $texte = substr($texte, 0, $p) . $code . substr($texte, $p); |
|
| 285 | + $texte = substr($texte, 0, $p).$code.substr($texte, $p); |
|
| 286 | 286 | } else { |
| 287 | 287 | $texte .= $code; |
| 288 | 288 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $_id_table = reset($_id_table); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - $requete['SELECT'][] = 't.' . $_id_table; |
|
| 70 | + $requete['SELECT'][] = 't.'.$_id_table; |
|
| 71 | 71 | $a = []; |
| 72 | 72 | // Recherche fulltext |
| 73 | 73 | foreach ($champs as $champ => $poids) { |
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | $champ = "t.$champ"; |
| 79 | 79 | } |
| 80 | 80 | $requete['SELECT'][] = $champ; |
| 81 | - $a[] = $champ . ' ' . $methode . ' ' . $q; |
|
| 81 | + $a[] = $champ.' '.$methode.' '.$q; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | if ($a) { |
| 85 | 85 | $requete['WHERE'][] = join(' OR ', $a); |
| 86 | 86 | } |
| 87 | - $requete['FROM'][] = table_objet_sql($table) . ' AS t'; |
|
| 87 | + $requete['FROM'][] = table_objet_sql($table).' AS t'; |
|
| 88 | 88 | |
| 89 | 89 | $results = []; |
| 90 | 90 | |
@@ -252,8 +252,8 @@ discard block |
||
| 252 | 252 | ); |
| 253 | 253 | } // cas table de liaison generique spip_xxx_yyy |
| 254 | 254 | elseif ( |
| 255 | - $t = $trouver_table($table_arrivee . '_' . $table_depart, $serveur) |
|
| 256 | - or $t = $trouver_table($table_depart . '_' . $table_arrivee, $serveur) |
|
| 255 | + $t = $trouver_table($table_arrivee.'_'.$table_depart, $serveur) |
|
| 256 | + or $t = $trouver_table($table_depart.'_'.$table_arrivee, $serveur) |
|
| 257 | 257 | ) { |
| 258 | 258 | $s = sql_select( |
| 259 | 259 | "$cle_depart,$cle_arrivee", |
@@ -292,12 +292,12 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | if (isset($joint['champs']) and $joint['champs']) { |
| 294 | 294 | foreach ($joint['champs'] as $c => $val) { |
| 295 | - $results[$id]['champs'][$table_liee . '.' . $c] = $val; |
|
| 295 | + $results[$id]['champs'][$table_liee.'.'.$c] = $val; |
|
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | if (isset($joint['matches']) and $joint['matches']) { |
| 299 | 299 | foreach ($joint['matches'] as $c => $val) { |
| 300 | - $results[$id]['matches'][$table_liee . '.' . $c] = $val; |
|
| 300 | + $results[$id]['matches'][$table_liee.'.'.$c] = $val; |
|
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | } |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | * @return void |
| 44 | 44 | **/ |
| 45 | 45 | function install_fichier_connexion($nom, $texte) { |
| 46 | - $texte = '<' . "?php\n" |
|
| 46 | + $texte = '<'."?php\n" |
|
| 47 | 47 | . "if (!defined(\"_ECRIRE_INC_VERSION\")) return;\n" |
| 48 | 48 | . $texte |
| 49 | - . '?' . '>'; |
|
| 49 | + . '?'.'>'; |
|
| 50 | 50 | |
| 51 | 51 | ecrire_fichier($nom, $texte); |
| 52 | 52 | } |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | return $regs; |
| 114 | 114 | } else { |
| 115 | 115 | $ar = '\s*\'([^\']*)\''; |
| 116 | - $r = '\s*,' . $ar; |
|
| 116 | + $r = '\s*,'.$ar; |
|
| 117 | 117 | $r = "#spip_connect_db[(]$ar$r$r$r$r(?:$r(?:$r(?:$r(?:$r)?)?)?)?#"; |
| 118 | 118 | if (preg_match($r, $s, $regs)) { |
| 119 | - $regs[2] = $regs[1] . (!$regs[2] ? '' : ':' . $regs[2] . ';'); |
|
| 119 | + $regs[2] = $regs[1].(!$regs[2] ? '' : ':'.$regs[2].';'); |
|
| 120 | 120 | array_shift($regs); |
| 121 | 121 | array_shift($regs); |
| 122 | 122 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | // Si on n'a pas la bonne version de PHP, c'est la fin |
| 175 | 175 | if ($err) { |
| 176 | 176 | die("<div class='error'>" |
| 177 | - . '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>" |
|
| 177 | + . '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>" |
|
| 178 | 178 | . "<li><strong>{$err[0]}</strong></li>\n</ul></div>"); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | if ($err) { |
| 203 | 203 | echo "<div class='error'>" |
| 204 | - . '<h3>' . _T('avis_attention') . '</h3><p>' . _T('install_echec_annonce') . "</p><ul class='spip'>"; |
|
| 204 | + . '<h3>'._T('avis_attention').'</h3><p>'._T('install_echec_annonce')."</p><ul class='spip'>"; |
|
| 205 | 205 | foreach ($err as $e) { |
| 206 | 206 | echo "<li><strong>$e</strong></li>\n"; |
| 207 | 207 | } |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | // https://code.spip.net/@info_etape |
| 237 | 237 | function info_etape($titre, $complement = '') { |
| 238 | - return '<h2>' . $titre . "</h2>\n" . |
|
| 239 | - ($complement ? '' . $complement . "\n" : ''); |
|
| 238 | + return '<h2>'.$titre."</h2>\n". |
|
| 239 | + ($complement ? ''.$complement."\n" : ''); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
@@ -250,18 +250,18 @@ discard block |
||
| 250 | 250 | $code = _T('bouton_suivant'); |
| 251 | 251 | } |
| 252 | 252 | static $suivant = 0; |
| 253 | - $id = 'suivant' . (($suivant > 0) ? strval($suivant) : ''); |
|
| 253 | + $id = 'suivant'.(($suivant > 0) ? strval($suivant) : ''); |
|
| 254 | 254 | $suivant += 1; |
| 255 | 255 | |
| 256 | - return "\n<p class='boutons suivant'><input id='" . $id . "' type='submit'\nvalue=\"" . |
|
| 257 | - $code . |
|
| 256 | + return "\n<p class='boutons suivant'><input id='".$id."' type='submit'\nvalue=\"". |
|
| 257 | + $code. |
|
| 258 | 258 | " >>\" /></p>\n"; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | // https://code.spip.net/@info_progression_etape |
| 262 | 262 | function info_progression_etape($en_cours, $phase, $dir, $erreur = false) { |
| 263 | 263 | //$en_cours = _request('etape')?_request('etape'):""; |
| 264 | - $liste = find_all_in_path($dir, $phase . '(([0-9])+|fin)[.]php$'); |
|
| 264 | + $liste = find_all_in_path($dir, $phase.'(([0-9])+|fin)[.]php$'); |
|
| 265 | 265 | $debut = 1; |
| 266 | 266 | $etat = 'ok'; |
| 267 | 267 | $last = count($liste); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | $aff_etapes .= "<li class='$class'><div class='fond'>"; |
| 302 | 302 | $aff_etapes .= ($debut == $en_cours) ? '<strong>' : ''; |
| 303 | - $aff_etapes .= '<em>' . _T('etape') . " </em><span class='numero_etape'>$debut</span><em> : </em>"; |
|
| 303 | + $aff_etapes .= '<em>'._T('etape')." </em><span class='numero_etape'>$debut</span><em> : </em>"; |
|
| 304 | 304 | $aff_etapes .= $intitule_etat["$phase"][$debut]; |
| 305 | 305 | $aff_etapes .= ($debut == $en_cours) ? '</strong>' : ''; |
| 306 | 306 | $aff_etapes .= '</div></li>'; |
@@ -316,11 +316,11 @@ discard block |
||
| 316 | 316 | |
| 317 | 317 | // https://code.spip.net/@fieldset |
| 318 | 318 | function fieldset($legend, $champs = [], $apres = '', $avant = '') { |
| 319 | - return "<fieldset>\n" . |
|
| 320 | - $avant . |
|
| 321 | - ($legend ? '<legend>' . $legend . "</legend>\n" : '') . |
|
| 322 | - fieldset_champs($champs) . |
|
| 323 | - $apres . |
|
| 319 | + return "<fieldset>\n". |
|
| 320 | + $avant. |
|
| 321 | + ($legend ? '<legend>'.$legend."</legend>\n" : ''). |
|
| 322 | + fieldset_champs($champs). |
|
| 323 | + $apres. |
|
| 324 | 324 | "</fieldset>\n"; |
| 325 | 325 | } |
| 326 | 326 | |
@@ -330,18 +330,18 @@ discard block |
||
| 330 | 330 | $type = isset($contenu['hidden']) ? 'hidden' : (preg_match(',^pass,', $nom) ? 'password' : 'text'); |
| 331 | 331 | $class = isset($contenu['hidden']) ? '' : "class='formo' size='40' "; |
| 332 | 332 | if (isset($contenu['alternatives'])) { |
| 333 | - $fieldset .= $contenu['label'] . "\n"; |
|
| 333 | + $fieldset .= $contenu['label']."\n"; |
|
| 334 | 334 | foreach ($contenu['alternatives'] as $valeur => $label) { |
| 335 | - $fieldset .= "<input type='radio' name='" . $nom . |
|
| 335 | + $fieldset .= "<input type='radio' name='".$nom. |
|
| 336 | 336 | "' id='$nom-$valeur' value='$valeur'" |
| 337 | 337 | . (($valeur == $contenu['valeur']) ? "\nchecked='checked'" : '') |
| 338 | 338 | . "/>\n"; |
| 339 | - $fieldset .= "<label for='$nom-$valeur'>" . $label . "</label>\n"; |
|
| 339 | + $fieldset .= "<label for='$nom-$valeur'>".$label."</label>\n"; |
|
| 340 | 340 | } |
| 341 | 341 | $fieldset .= "<br />\n"; |
| 342 | 342 | } else { |
| 343 | - $fieldset .= "<label for='" . $nom . "'>" . $contenu['label'] . "</label>\n"; |
|
| 344 | - $fieldset .= '<input ' . $class . "type='" . $type . "' id='" . $nom . "' name='" . $nom . "'\nvalue='" . $contenu['valeur'] . "'" |
|
| 343 | + $fieldset .= "<label for='".$nom."'>".$contenu['label']."</label>\n"; |
|
| 344 | + $fieldset .= '<input '.$class."type='".$type."' id='".$nom."' name='".$nom."'\nvalue='".$contenu['valeur']."'" |
|
| 345 | 345 | . (preg_match(',^(pass|login),', $nom) ? " autocomplete='off'" : '') |
| 346 | 346 | . ((isset($contenu['required']) and $contenu['required']) ? " required='required'" : '') |
| 347 | 347 | . " />\n"; |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | |
| 354 | 354 | function install_select_serveur() { |
| 355 | 355 | $options = []; |
| 356 | - $dir = _DIR_RESTREINT . 'req/'; |
|
| 356 | + $dir = _DIR_RESTREINT.'req/'; |
|
| 357 | 357 | $d = opendir($dir); |
| 358 | 358 | if (!$d) { |
| 359 | 359 | return []; |
@@ -361,17 +361,17 @@ discard block |
||
| 361 | 361 | while (($f = readdir($d)) !== false) { |
| 362 | 362 | if ( |
| 363 | 363 | (preg_match('/^(.*)[.]php$/', $f, $s)) |
| 364 | - and is_readable($f = $dir . $f) |
|
| 364 | + and is_readable($f = $dir.$f) |
|
| 365 | 365 | ) { |
| 366 | 366 | require_once($f); |
| 367 | 367 | $s = $s[1]; |
| 368 | - $v = 'spip_versions_' . $s; |
|
| 368 | + $v = 'spip_versions_'.$s; |
|
| 369 | 369 | if (function_exists($v) and $v()) { |
| 370 | 370 | $titre = _T("install_select_type_$s"); |
| 371 | 371 | // proposer mysql par defaut si dispo |
| 372 | 372 | $checked = ($s == 'mysql' ? " checked='checked'" : ''); |
| 373 | 373 | $options[$s] = "<li><input type='radio' id='$s' value='$s' name='server_db'$checked>" |
| 374 | - . "<label for='$s'>" . ($titre ? $titre : $s) . '</label></li>'; |
|
| 374 | + . "<label for='$s'>".($titre ? $titre : $s).'</label></li>'; |
|
| 375 | 375 | } else { |
| 376 | 376 | spip_log("$s: portage indisponible"); |
| 377 | 377 | } |
@@ -390,8 +390,8 @@ discard block |
||
| 390 | 390 | "\n<input type='hidden' name='etape' value='$etape' />" |
| 391 | 391 | . $hidden |
| 392 | 392 | . (_request('echec') ? |
| 393 | - ('<p><b>' . _T('avis_connexion_echec_1') . |
|
| 394 | - '</b></p><p>' . _T('avis_connexion_echec_2') . "</p><p style='font-size: small;'>" . _T('avis_connexion_echec_3') . '</p>') |
|
| 393 | + ('<p><b>'._T('avis_connexion_echec_1'). |
|
| 394 | + '</b></p><p>'._T('avis_connexion_echec_2')."</p><p style='font-size: small;'>"._T('avis_connexion_echec_3').'</p>') |
|
| 395 | 395 | : '') |
| 396 | 396 | |
| 397 | 397 | . ($jquery ? http_script('', 'jquery.js') : '') |
@@ -429,9 +429,9 @@ discard block |
||
| 429 | 429 | });') |
| 430 | 430 | |
| 431 | 431 | . ($server_db |
| 432 | - ? '<input type="hidden" name="server_db" value="' . $server_db . '" />' |
|
| 432 | + ? '<input type="hidden" name="server_db" value="'.$server_db.'" />' |
|
| 433 | 433 | . (($predef[0]) |
| 434 | - ? ('<h3>' . _T('install_serveur_hebergeur') . '</h3>') |
|
| 434 | + ? ('<h3>'._T('install_serveur_hebergeur').'</h3>') |
|
| 435 | 435 | : '') |
| 436 | 436 | : ('<fieldset><legend>' |
| 437 | 437 | . _T('install_select_type_db') |
@@ -446,9 +446,9 @@ discard block |
||
| 446 | 446 | . "\n</ul>\n</div></fieldset>") |
| 447 | 447 | ) |
| 448 | 448 | . '<div id="install_adresse_base_hebergeur">' |
| 449 | - . '<p>' . _T('texte_connexion_mysql') . '</p>' |
|
| 449 | + . '<p>'._T('texte_connexion_mysql').'</p>' |
|
| 450 | 450 | . ($predef[1] |
| 451 | - ? '<h3>' . _T('install_adresse_base_hebergeur') . '</h3>' |
|
| 451 | + ? '<h3>'._T('install_adresse_base_hebergeur').'</h3>' |
|
| 452 | 452 | : fieldset( |
| 453 | 453 | _T('entree_base_donnee_1'), |
| 454 | 454 | [ |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | |
| 464 | 464 | . '<div id="install_login_base_hebergeur">' |
| 465 | 465 | . ($predef[2] |
| 466 | - ? '<h3>' . _T('install_login_base_hebergeur') . '</h3>' |
|
| 466 | + ? '<h3>'._T('install_login_base_hebergeur').'</h3>' |
|
| 467 | 467 | : fieldset( |
| 468 | 468 | _T('entree_login_connexion_1'), |
| 469 | 469 | [ |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | |
| 479 | 479 | . '<div id="install_pass_base_hebergeur">' |
| 480 | 480 | . ($predef[3] |
| 481 | - ? '<h3>' . _T('install_pass_base_hebergeur') . '</h3>' |
|
| 481 | + ? '<h3>'._T('install_pass_base_hebergeur').'</h3>' |
|
| 482 | 482 | : fieldset( |
| 483 | 483 | _T('entree_mot_passe_1'), |
| 484 | 484 | [ |
@@ -501,20 +501,20 @@ discard block |
||
| 501 | 501 | function predef_ou_cache($adresse_db, $login_db, $pass_db, $server_db) { |
| 502 | 502 | return ((defined('_INSTALL_HOST_DB')) |
| 503 | 503 | ? '' |
| 504 | - : "\n<input type='hidden' name='adresse_db' value=\"" . spip_htmlspecialchars($adresse_db) . '" />' |
|
| 504 | + : "\n<input type='hidden' name='adresse_db' value=\"".spip_htmlspecialchars($adresse_db).'" />' |
|
| 505 | 505 | ) |
| 506 | 506 | . ((defined('_INSTALL_USER_DB')) |
| 507 | 507 | ? '' |
| 508 | - : "\n<input type='hidden' name='login_db' value=\"" . spip_htmlspecialchars($login_db) . '" />' |
|
| 508 | + : "\n<input type='hidden' name='login_db' value=\"".spip_htmlspecialchars($login_db).'" />' |
|
| 509 | 509 | ) |
| 510 | 510 | . ((defined('_INSTALL_PASS_DB')) |
| 511 | 511 | ? '' |
| 512 | - : "\n<input type='hidden' name='pass_db' value=\"" . spip_htmlspecialchars($pass_db) . '" />' |
|
| 512 | + : "\n<input type='hidden' name='pass_db' value=\"".spip_htmlspecialchars($pass_db).'" />' |
|
| 513 | 513 | ) |
| 514 | 514 | |
| 515 | 515 | . ((defined('_INSTALL_SERVER_DB')) |
| 516 | 516 | ? '' |
| 517 | - : "\n<input type='hidden' name='server_db' value=\"" . spip_htmlspecialchars($server_db) . '" />' |
|
| 517 | + : "\n<input type='hidden' name='server_db' value=\"".spip_htmlspecialchars($server_db).'" />' |
|
| 518 | 518 | ); |
| 519 | 519 | } |
| 520 | 520 | |
@@ -47,13 +47,13 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $dir = 'images/'; |
| 49 | 49 | $f = "$type-$size.png"; |
| 50 | - if ($icone = find_in_theme($dir . $f)) { |
|
| 50 | + if ($icone = find_in_theme($dir.$f)) { |
|
| 51 | 51 | $dir = dirname($icone); |
| 52 | 52 | $fond = $icone; |
| 53 | 53 | |
| 54 | 54 | if ( |
| 55 | 55 | $rtl |
| 56 | - and $fr = $dir . '/' . str_replace("$type-", "$type-rtl-", basename($icone)) |
|
| 56 | + and $fr = $dir.'/'.str_replace("$type-", "$type-rtl-", basename($icone)) |
|
| 57 | 57 | and file_exists($fr) |
| 58 | 58 | ) { |
| 59 | 59 | $fond = $fr; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $fonction = ''; |
| 72 | - if (in_array($action, ['add','del', 'new', 'edit', 'config'])) { |
|
| 72 | + if (in_array($action, ['add', 'del', 'new', 'edit', 'config'])) { |
|
| 73 | 73 | $fonction = $action; |
| 74 | 74 | } |
| 75 | 75 | |