- if ($var_preview AND $html) {
- include_spip('inc/filtres'); // pour http_img_pack
- $x = _T('previsualisation');
- $x = http_img_pack('naviguer-site.png', $x) . ' ' . majuscules($x);
- $x = "<div class='spip-previsu'>$x</div>";
- if (!$pos = strpos($page['texte'], '</body>'))
- $pos = strlen($page['texte']);
- $page['texte'] = substr_replace($page['texte'], $x, $pos, 0);
- }
-
- $affiche_boutons_admin = ($html AND ((
- isset($_COOKIE['spip_admin'])
- AND !$flag_preserver
- ) OR $debug));
+ $affiche_boutons_admin = ((!!$debug)
+ OR ($html AND isset($_COOKIE['spip_admin']) AND !$flag_preserver)
+ OR ($html AND ($_GET['var_mode']=='preview') AND !$flag_preserver)
+ );