From 1dfd4dd1d3bf899ea4071f702787b1aed1f2e834 Mon Sep 17 00:00:00 2001 From: "Committo,Ergo:sum" <esj@rezo.net> Date: Wed, 25 Jan 2006 23:36:02 +0000 Subject: [PATCH] simplification de la gestion de l'ancre de retour (c'est vraiment bien urlencode) --- ecrire/inc_documents.php3 | 9 +++++---- ecrire/inc_spip_action_supprimer.php | 4 ++-- ecrire/inc_spip_action_tourner.php | 11 +++-------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/ecrire/inc_documents.php3 b/ecrire/inc_documents.php3 index 19162572ea..d0e91b51b8 100644 --- a/ecrire/inc_documents.php3 +++ b/ecrire/inc_documents.php3 @@ -807,6 +807,7 @@ function block_document($id, $id_document, $type, $titre, $descriptif, $date, $d echo "<input type='hidden' name='modif_document' value='oui' />"; echo "<input type='hidden' name='id_document' value='$id_document' />"; echo "<input type='hidden' name='show_docs' value='$id_document' />"; + echo $hidden; // modifier la date if ( #$type == 'rubrique' AND // (seulement dans les rubriques?) @@ -864,11 +865,11 @@ function afficher_rotateurs($album, $document, $type, $id_article, $id_document // si c'est une image, qu'on sait la faire tourner, qu'elle // n'est pas distante, et qu'elle n'a pas de vignette perso // et qu'on a la bibli ! - if ($document['distant']!='oui' AND !$id_vignette + /* if ($document['distant']!='oui' AND !$id_vignette AND strstr($GLOBALS['meta']['formats_graphiques'], $ftype[$document['id_type']]) AND ($process == 'imagick' OR $process == 'gd2' - OR $process == 'convert' OR $process == 'netpbm') ) { + OR $process == 'convert' OR $process == 'netpbm') ) */ { echo "\n<div class='verdana1' style='float: $spip_lang_right; text-align: $spip_lang_right;'>"; @@ -905,7 +906,7 @@ function bouton_tourner_document($id_article, $id, $album, $rot, $type) { $script = retour_a_l_envoyeur('article'); - $redirect = generer_url_ecrire($script, ("id_$type=$id_article&ancre=$album"), true); + $redirect = generer_url_ecrire($script, ("id_$type=$id_article&show_docs=$id"), true) . "#$album"; return generer_action_auteur('tourner', $id, $redirect) . ("&var_rot=$rot"); @@ -915,7 +916,7 @@ function bouton_supprime_document_et_vignette($id_article, $type, $id_v, $album, { $script = retour_a_l_envoyeur($type); - $redirect = generer_url_ecrire($script, ("id_$type=$id_article$hidden&ancre=$album" . ($id_document ? "&show_docs=$id_document" : '')), true); + $redirect = generer_url_ecrire($script, ("id_$type=$id_article"), true) . "#$album"; return generer_action_auteur('supprimer', $id_v, $redirect); } diff --git a/ecrire/inc_spip_action_supprimer.php b/ecrire/inc_spip_action_supprimer.php index 862fabfae2..4736dbd66a 100644 --- a/ecrire/inc_spip_action_supprimer.php +++ b/ecrire/inc_spip_action_supprimer.php @@ -18,7 +18,7 @@ include_ecrire("inc_abstract_sql");# spip_insert / spip_fetch... // Effacer un doc (et sa vignette) function spip_action_supprimer_dist() { - global $arg, $ancre, $redirect; + global $arg, $redirect; $arg = intval($arg); $result = spip_query("SELECT id_vignette, fichier FROM spip_documents WHERE id_document=$arg"); @@ -56,6 +56,6 @@ function spip_action_supprimer_dist() { } } - redirige_par_entete(urldecode($redirect), $ancre ? "#$ancre" : ''); + redirige_par_entete(urldecode($redirect)); } ?> diff --git a/ecrire/inc_spip_action_tourner.php b/ecrire/inc_spip_action_tourner.php index 052eb6a23a..fc086c0279 100644 --- a/ecrire/inc_spip_action_tourner.php +++ b/ecrire/inc_spip_action_tourner.php @@ -17,7 +17,7 @@ include_ecrire("inc_abstract_sql");# spip_insert / spip_fetch... function spip_action_tourner_dist() { - global $arg, $var_rot, $convert_command, $redirect, $ancre; + global $arg, $var_rot, $convert_command, $redirect; $var_rot = intval($var_rot); $arg = intval($arg); @@ -65,13 +65,8 @@ function spip_action_tourner_dist() { spip_query("UPDATE spip_documents SET largeur=$largeur, hauteur=$hauteur WHERE id_document=$arg"); } - $redirect .= '&show_docs=' . $arg; - - if ($ancre) { - $redirect .= '#' . $ancre; - } - spip_log($redirect); - redirige_par_entete($redirect); + redirige_par_entete(urldecode($redirect)); + } -- GitLab