@@ -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 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | if ( |
| 222 | 222 | $config_fonc |
| 223 | 223 | and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 224 | - and $config_fonc !== $table_objet . '_edit_config' |
|
| 224 | + and $config_fonc !== $table_objet.'_edit_config' |
|
| 225 | 225 | ) { |
| 226 | 226 | if ( |
| 227 | 227 | $args = test_formulaire_inclus_par_modele() |
@@ -236,12 +236,12 @@ discard block |
||
| 236 | 236 | // Appel direct dans un squelette |
| 237 | 237 | if (!$row) { |
| 238 | 238 | if (!$new or $lier_trad) { |
| 239 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 239 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 240 | 240 | $row = $select($id, $id_parent, $lier_trad); |
| 241 | 241 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 242 | 242 | $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
| 243 | 243 | } else { |
| 244 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 244 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id)); |
|
| 245 | 245 | } |
| 246 | 246 | if (!$new) { |
| 247 | 247 | $md5 = controles_md5($row ?? []); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | if ($config_fonc) { |
| 292 | 292 | $contexte['config'] = $config = $config_fonc($contexte); |
| 293 | 293 | if (!$lang_default) { |
| 294 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 294 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | $config = $config + [ |
@@ -315,13 +315,12 @@ discard block |
||
| 315 | 315 | unset($contexte['lang']); |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 319 | - (!$lier_trad ? '' : |
|
| 320 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 321 | - $lier_trad . |
|
| 322 | - "' />" . |
|
| 323 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 324 | - $lang_default . |
|
| 318 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 319 | + (!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='". |
|
| 320 | + $lier_trad. |
|
| 321 | + "' />". |
|
| 322 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 323 | + $lang_default. |
|
| 325 | 324 | "' />")) |
| 326 | 325 | . $hidden |
| 327 | 326 | . ($md5 ?? ''); |
@@ -361,14 +360,14 @@ discard block |
||
| 361 | 360 | $aider = charger_fonction('aider', 'inc'); |
| 362 | 361 | if (strlen($texte) > 28 * 1024) { |
| 363 | 362 | $texte = str_replace("\r\n", "\n", $texte); |
| 364 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 363 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 365 | 364 | if ($pos > 0 and $pos < 32 * 1024) { |
| 366 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 365 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 367 | 366 | $suite = substr($texte, $pos + 2); |
| 368 | 367 | } else { |
| 369 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 368 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 370 | 369 | if (!($pos > 0 and $pos < 32 * 1024)) { |
| 371 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 370 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 372 | 371 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 373 | 372 | } else { |
| 374 | 373 | $decalage = 1; |
@@ -399,13 +398,13 @@ discard block |
||
| 399 | 398 | } |
| 400 | 399 | |
| 401 | 400 | include_spip('inc/barre'); |
| 402 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 401 | + $textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n"; |
|
| 403 | 402 | $nombre = 0; |
| 404 | 403 | |
| 405 | 404 | while (strlen($texte) > 29 * 1024) { |
| 406 | 405 | $nombre++; |
| 407 | 406 | [$texte1, $texte] = coupe_trop_long($texte); |
| 408 | - $textes_supplement .= '<br />' . |
|
| 407 | + $textes_supplement .= '<br />'. |
|
| 409 | 408 | "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
| 410 | 409 | } |
| 411 | 410 | |
@@ -488,7 +487,7 @@ discard block |
||
| 488 | 487 | $ctr = []; |
| 489 | 488 | foreach ($data as $key => $val) { |
| 490 | 489 | $m = md5($val ?? ''); |
| 491 | - $k = $prefixe . $key; |
|
| 490 | + $k = $prefixe.$key; |
|
| 492 | 491 | |
| 493 | 492 | switch ($format) { |
| 494 | 493 | case 'html': |
@@ -501,7 +500,7 @@ discard block |
||
| 501 | 500 | } |
| 502 | 501 | |
| 503 | 502 | if ($format === 'html') { |
| 504 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 503 | + return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n"; |
|
| 505 | 504 | } else { |
| 506 | 505 | return $ctr; |
| 507 | 506 | } |
@@ -653,7 +652,7 @@ discard block |
||
| 653 | 652 | // On elimine les donnees non modifiees par le formulaire (mais |
| 654 | 653 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 655 | 654 | foreach ($champs as $key => $val) { |
| 656 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 655 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 657 | 656 | if (is_scalar($val) and $m == md5($val)) { |
| 658 | 657 | unset($champs[$key]); |
| 659 | 658 | } |
@@ -682,7 +681,7 @@ discard block |
||
| 682 | 681 | // de conflit. |
| 683 | 682 | $ctrh = $ctrq = $conflits = []; |
| 684 | 683 | foreach (array_keys($champs) as $key) { |
| 685 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 684 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 686 | 685 | $ctrh[$key] = $m; |
| 687 | 686 | $ctrq[] = $key; |
| 688 | 687 | } |
@@ -716,8 +715,8 @@ discard block |
||
| 716 | 715 | */ |
| 717 | 716 | function display_conflit_champ($x) { |
| 718 | 717 | if (strstr($x, "\n") or strlen($x) > 80) { |
| 719 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 718 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 720 | 719 | } else { |
| 721 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 720 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 722 | 721 | } |
| 723 | 722 | } |