diff --git a/ecrire/inc_documents.php3 b/ecrire/inc_documents.php3 index 6e4e8019c0aa64fff67293ecceb0c0aa8024bbed..19162572ea42e997ef27e97006b0af798a9dd2b0 100644 --- a/ecrire/inc_documents.php3 +++ b/ecrire/inc_documents.php3 @@ -712,7 +712,8 @@ entites_html($document['fichier'])."\" />\n"; // bloc vignette + rotation echo "<div style='text-align:center;'>"; - afficher_rotateurs($album, $document, $flag_modif, $id_article, $id_document, $id_vignette); + if ($flag_modif) + afficher_rotateurs($album, $document, $type, $id_article, $id_document, $id_vignette); // // Recuperer la vignette et afficher le doc @@ -853,7 +854,7 @@ function block_document($id, $id_document, $type, $titre, $descriptif, $date, $d icone_horizontale(_T('icone_supprimer_document'), bouton_supprime_document_et_vignette($id, $type, $id_document, $album), "image-24.gif", "supprimer.gif"); } -function afficher_rotateurs($album, $document, $flag_modif, $id_article, $id_document, $id_vignette) { +function afficher_rotateurs($album, $document, $type, $id_article, $id_document, $id_vignette) { global $spip_lang_right; static $ftype = array(1 => 'jpg', 2 => 'png', 3 => 'gif'); @@ -863,26 +864,26 @@ function afficher_rotateurs($album, $document, $flag_modif, $id_article, $id_do // 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 ($flag_modif AND $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;'>"; // tournerr a gauche - echo http_href_img(bouton_tourner_document($id_article, $id_document, $album, -90), 'tourner-gauche.gif', "style='border-width: 0px;'", _T('image_tourner_gauche'), '', 'bouton_rotation'); + echo http_href_img(bouton_tourner_document($id_article, $id_document, $album, -90, $type), 'tourner-gauche.gif', "style='border-width: 0px;'", _T('image_tourner_gauche'), '', 'bouton_rotation'); echo "<br />"; // tourner a droite - echo http_href_img(bouton_tourner_document($id_article, $id_document, $album, 90), + echo http_href_img(bouton_tourner_document($id_article, $id_document, $album, 90, $type), 'tourner-droite.gif', "style='border-width: 0px;'", _T('image_tourner_droite'), '', 'bouton_rotation'); echo "<br />"; // tourner 180 - echo http_href_img(bouton_tourner_document($id_article, $id_document, $album, 180), + echo http_href_img(bouton_tourner_document($id_article, $id_document, $album, 180, $type), 'tourner-180.gif', "style='border-width: 0px;'", _T('image_tourner_180'), '', 'bouton_rotation'); @@ -900,11 +901,11 @@ function retour_a_l_envoyeur($type) } } -function bouton_tourner_document($id_article, $id, $album, $rot) +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")); + $redirect = generer_url_ecrire($script, ("id_$type=$id_article&ancre=$album"), true); return generer_action_auteur('tourner', $id, $redirect) . ("&var_rot=$rot"); @@ -914,7 +915,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" : ''))); + $redirect = generer_url_ecrire($script, ("id_$type=$id_article$hidden&ancre=$album" . ($id_document ? "&show_docs=$id_document" : '')), true); return generer_action_auteur('supprimer', $id_v, $redirect); } diff --git a/ecrire/inc_spip_action_tourner.php b/ecrire/inc_spip_action_tourner.php index 6aceea041c3169ab9f80f1a551bc5b1fb6038b08..052eb6a23a8042ab2079ae6b1a7ef886311ad718 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; + global $arg, $var_rot, $convert_command, $redirect, $ancre; $var_rot = intval($var_rot); $arg = intval($arg); @@ -65,11 +65,13 @@ function spip_action_tourner_dist() { spip_query("UPDATE spip_documents SET largeur=$largeur, hauteur=$hauteur WHERE id_document=$arg"); } - $redirect .= '&show_docs=' . $args; + $redirect .= '&show_docs=' . $arg; if ($ancre) { $redirect .= '#' . $ancre; } + spip_log($redirect); + redirige_par_entete($redirect); }