@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $res['message_ok'] = _T('info_modification_enregistree'); |
| 101 | 101 | if ($retour) { |
| 102 | 102 | if (strncmp($retour, 'javascript:', 11) == 0) { |
| 103 | - $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 103 | + $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>'; |
|
| 104 | 104 | $res['editable'] = true; |
| 105 | 105 | } else { |
| 106 | 106 | $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if (!isset($erreurs[$champ])) { |
| 141 | 141 | $erreurs[$champ] = ''; |
| 142 | 142 | } |
| 143 | - $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 143 | + $erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | if ( |
| 219 | 219 | $config_fonc |
| 220 | 220 | and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 221 | - and $config_fonc !== $table_objet . '_edit_config' |
|
| 221 | + and $config_fonc !== $table_objet.'_edit_config' |
|
| 222 | 222 | ) { |
| 223 | 223 | if ( |
| 224 | 224 | $args = test_formulaire_inclus_par_modele() |
@@ -233,12 +233,12 @@ discard block |
||
| 233 | 233 | // Appel direct dans un squelette |
| 234 | 234 | if (!$row) { |
| 235 | 235 | if (!$new or $lier_trad) { |
| 236 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 236 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 237 | 237 | $row = $select($id, $id_parent, $lier_trad); |
| 238 | 238 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 239 | 239 | $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
| 240 | 240 | } else { |
| 241 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 241 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id)); |
|
| 242 | 242 | } |
| 243 | 243 | if (!$new) { |
| 244 | 244 | $md5 = controles_md5($row ?? []); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | if ($config_fonc) { |
| 289 | 289 | $contexte['config'] = $config = $config_fonc($contexte); |
| 290 | 290 | if (!$lang_default) { |
| 291 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 291 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 292 | 292 | } |
| 293 | 293 | } |
| 294 | 294 | $config = $config + [ |
@@ -312,13 +312,12 @@ discard block |
||
| 312 | 312 | unset($contexte['lang']); |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 316 | - (!$lier_trad ? '' : |
|
| 317 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 318 | - $lier_trad . |
|
| 319 | - "' />" . |
|
| 320 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 321 | - $lang_default . |
|
| 315 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 316 | + (!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='". |
|
| 317 | + $lier_trad. |
|
| 318 | + "' />". |
|
| 319 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 320 | + $lang_default. |
|
| 322 | 321 | "' />")) |
| 323 | 322 | . $hidden |
| 324 | 323 | . ($md5 ?? ''); |
@@ -358,14 +357,14 @@ discard block |
||
| 358 | 357 | $aider = charger_fonction('aider', 'inc'); |
| 359 | 358 | if (strlen($texte) > 28 * 1024) { |
| 360 | 359 | $texte = str_replace("\r\n", "\n", $texte); |
| 361 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 360 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 362 | 361 | if ($pos > 0 and $pos < 32 * 1024) { |
| 363 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 362 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 364 | 363 | $suite = substr($texte, $pos + 2); |
| 365 | 364 | } else { |
| 366 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 365 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 367 | 366 | if (!($pos > 0 and $pos < 32 * 1024)) { |
| 368 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 367 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 369 | 368 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 370 | 369 | } else { |
| 371 | 370 | $decalage = 1; |
@@ -396,13 +395,13 @@ discard block |
||
| 396 | 395 | } |
| 397 | 396 | |
| 398 | 397 | include_spip('inc/barre'); |
| 399 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 398 | + $textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n"; |
|
| 400 | 399 | $nombre = 0; |
| 401 | 400 | |
| 402 | 401 | while (strlen($texte) > 29 * 1024) { |
| 403 | 402 | $nombre++; |
| 404 | 403 | [$texte1, $texte] = coupe_trop_long($texte); |
| 405 | - $textes_supplement .= '<br />' . |
|
| 404 | + $textes_supplement .= '<br />'. |
|
| 406 | 405 | "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
| 407 | 406 | } |
| 408 | 407 | |
@@ -485,7 +484,7 @@ discard block |
||
| 485 | 484 | $ctr = []; |
| 486 | 485 | foreach ($data as $key => $val) { |
| 487 | 486 | $m = md5($val ?? ''); |
| 488 | - $k = $prefixe . $key; |
|
| 487 | + $k = $prefixe.$key; |
|
| 489 | 488 | |
| 490 | 489 | switch ($format) { |
| 491 | 490 | case 'html': |
@@ -498,7 +497,7 @@ discard block |
||
| 498 | 497 | } |
| 499 | 498 | |
| 500 | 499 | if ($format === 'html') { |
| 501 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 500 | + return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n"; |
|
| 502 | 501 | } else { |
| 503 | 502 | return $ctr; |
| 504 | 503 | } |
@@ -650,7 +649,7 @@ discard block |
||
| 650 | 649 | // On elimine les donnees non modifiees par le formulaire (mais |
| 651 | 650 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 652 | 651 | foreach ($champs as $key => $val) { |
| 653 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 652 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 654 | 653 | if (is_scalar($val) and $m == md5($val)) { |
| 655 | 654 | unset($champs[$key]); |
| 656 | 655 | } |
@@ -679,7 +678,7 @@ discard block |
||
| 679 | 678 | // de conflit. |
| 680 | 679 | $ctrh = $ctrq = $conflits = []; |
| 681 | 680 | foreach (array_keys($champs) as $key) { |
| 682 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 681 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 683 | 682 | $ctrh[$key] = $m; |
| 684 | 683 | $ctrq[] = $key; |
| 685 | 684 | } |
@@ -713,9 +712,9 @@ discard block |
||
| 713 | 712 | */ |
| 714 | 713 | function display_conflit_champ($x) { |
| 715 | 714 | if (strstr($x, "\n") or strlen($x) > 80) { |
| 716 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 715 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 717 | 716 | } else { |
| 718 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 717 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 719 | 718 | } |
| 720 | 719 | } |
| 721 | 720 | |
@@ -755,11 +754,11 @@ discard block |
||
| 755 | 754 | ) : $champ; |
| 756 | 755 | |
| 757 | 756 | $diffs[] = "<h2>$titre</h2>\n" |
| 758 | - . '<h3>' . _T('info_conflit_edition_differences') . "</h3>\n" |
|
| 759 | - . "<div style='max-height:8em; overflow: auto; width:99%;'>" . $d . "</div>\n" |
|
| 760 | - . '<h4>' . _T('info_conflit_edition_votre_version') . '</h4>' |
|
| 757 | + . '<h3>'._T('info_conflit_edition_differences')."</h3>\n" |
|
| 758 | + . "<div style='max-height:8em; overflow: auto; width:99%;'>".$d."</div>\n" |
|
| 759 | + . '<h4>'._T('info_conflit_edition_votre_version').'</h4>' |
|
| 761 | 760 | . display_conflit_champ($a['post']) |
| 762 | - . '<h4>' . _T('info_conflit_edition_version_enregistree') . '</h4>' |
|
| 761 | + . '<h4>'._T('info_conflit_edition_version_enregistree').'</h4>' |
|
| 763 | 762 | . display_conflit_champ($base); |
| 764 | 763 | } |
| 765 | 764 | |
@@ -767,16 +766,16 @@ discard block |
||
| 767 | 766 | $id = uniqid(random_int(0, mt_getrandmax())); |
| 768 | 767 | $redirect = "<form action='$redirect' method='get' |
| 769 | 768 | id='$id' |
| 770 | - style='float:" . $GLOBALS['spip_lang_right'] . "; margin-top:2em;'>\n" |
|
| 769 | + style='float:".$GLOBALS['spip_lang_right']."; margin-top:2em;'>\n" |
|
| 771 | 770 | . form_hidden($redirect) |
| 772 | - . "<input type='submit' value='" . _T('icone_retour') . "' /> |
|
| 771 | + . "<input type='submit' value='"._T('icone_retour')."' /> |
|
| 773 | 772 | </form>\n"; |
| 774 | 773 | |
| 775 | 774 | // pour les documents, on est probablement en ajax : il faut ajaxer |
| 776 | 775 | if (_AJAX) { |
| 777 | 776 | $redirect .= '<script type="text/javascript">' |
| 778 | - . 'setTimeout(function(){$("#' . $id . '") |
|
| 779 | - .ajaxForm({target:$("#' . $id . '").parent()}); |
|
| 777 | + . 'setTimeout(function(){$("#'.$id.'") |
|
| 778 | + .ajaxForm({target:$("#' . $id.'").parent()}); |
|
| 780 | 779 | }, 200);' |
| 781 | 780 | . "</script>\n"; |
| 782 | 781 | } |
@@ -795,9 +794,9 @@ discard block |
||
| 795 | 794 | .diff-para-deplace .diff-supprime { background: #ffb8b8; border: 1px solid #808080; } |
| 796 | 795 | .diff-para-deplace .diff-deplace { background: #b8b8ff; border: 1px solid #808080; } |
| 797 | 796 | </style>' |
| 798 | - . '<p>' . _T('info_conflit_edition_avis_non_sauvegarde') . '</p>' |
|
| 799 | - . '<p>' . _T('texte_conflit_edition_correction') . '</p>' |
|
| 800 | - . "<div style='text-align:" . $GLOBALS['spip_lang_left'] . ";'>" |
|
| 797 | + . '<p>'._T('info_conflit_edition_avis_non_sauvegarde').'</p>' |
|
| 798 | + . '<p>'._T('texte_conflit_edition_correction').'</p>' |
|
| 799 | + . "<div style='text-align:".$GLOBALS['spip_lang_left'].";'>" |
|
| 801 | 800 | . join("\n", $diffs) |
| 802 | 801 | . "</div>\n" |
| 803 | 802 | |