diff --git a/ecrire/public/debug.php b/ecrire/public/debug.php index 48d0236f3f39b9f7228e40c6aee688824ddc3c4f..2eff5c1c1e57e16057ad08b1bdaa2befa1d18d66 100644 --- a/ecrire/public/debug.php +++ b/ecrire/public/debug.php @@ -487,7 +487,7 @@ function debug_dumpfile ($texte, $fonc, $type) { function debug_affiche($fonc, $tout, $objet, $affiche) { if (!$objet) {if ($affiche == 'squelette') $objet = $fonc;} - if (!$objet OR !$res = $tout[$affiche][$objet]) return; + if (!$objet OR !$quoi = $tout[$affiche][$objet]) return; $res = "<div id=\"debug_boucle\"><fieldset>"; if ($affiche == 'resultat') { $res .= "<legend>" .$tout['pretty'][$objet] ."</legend>"; @@ -495,7 +495,7 @@ function debug_affiche($fonc, $tout, $objet, $affiche) if (function_exists('traite_query')) $req = traite_query($req); $res .= ancre_texte($req); - foreach ($res as $view) + foreach ($quoi as $view) if ($view) $res .= "\n<br /><fieldset>" .interdire_scripts($view) ."</fieldset>"; } else if ($affiche == 'code') { diff --git a/ecrire/public/vertebrer.php b/ecrire/public/vertebrer.php index cca75bd822da8b4c61f9747c9bad1e024fa7c061..dc052d27d919470d2bd2b636d183c054f4800d85 100755 --- a/ecrire/public/vertebrer.php +++ b/ecrire/public/vertebrer.php @@ -33,18 +33,45 @@ function vertebrer_sort($fields, $direction) foreach($fields as $n => $t) { $tri = $direction . ((test_sql_int($t) OR test_sql_date($r)) ? 'tri_n' : 'tri'); - $url =""; - foreach (array('tri', 'tri_n', '_tri', '_tri_n') as $c) { - if ($tri != $c) $url .= "|$c"; - } + $url = "|parametre_url{" . $tri . ",'" . $n . "'}" - . '|parametre_url{"' . substr($url,1) .'",""}'; + . vertebrer_sanstri($tri); $res .= "\n\t\t<th><a href='[(#SELF$url)]'>$n</a></th>"; } return $res; } +function vertebrer_sanstri($sauf='') +{ + $url =""; + foreach (array('tri', 'tri_n', '_tri', '_tri_n') as $c) { + if ($sauf != $c) $url .= "|$c"; + } + return '|parametre_url{"' . substr($url,1) .'",""}'; +} + +// Autant de formulaire que de champs (pour les criteres conditionnels) + +function vertebrer_form($fields) +{ + $res = '<td></td>'; + $url = join('|', array_keys($fields)); + $url = "#SELF|parametre_url{'$url',''}"; + foreach($fields as $n => $t) { + + $s = test_sql_int($t) ? 11 + : (preg_match('/char\s*\((\d)\)/i', $t, $r) ? $r[1] : ''); + spip_log("$t $s"); + $res .= "\n\t\t<td><form action='[($url)]' method='get'><div>" + . "\n\t\t\t<input name='$n'[ value='(#ENV{" . $n ."})']" + . ($s ? " size='$s'" : '') + . " />\n\t\t\t[($url|form_hidden)]" + . "\n\t\t</div></form></td>"; + } + return $res; +} + // Autant de criteres conditionnels que de champs // http://doc.spip.org/@vertebrer_crit @@ -57,6 +84,7 @@ function vertebrer_crit($v) return $res; } + // Class CSS en fonction de la parite du numero de ligne. // Si une colonne reference une table, ajoute un href sur sa page dynamique. // Ce serait encore mieux d'aller chercher sa cle primaire. @@ -103,9 +131,11 @@ function public_vertebrer_dist($desc) "href='./?page=$surnom&var_mode=debug&var_mode_affiche=squelette#debug_boucle'>squelette" . "</a>" . "\n#PAGINATION" . - "\n</p>\n<table class='spip' border='1' width='90%'>" . + "\n</p><br class='nettoyeur' />\n<table class='spip' border='1' width='90%'>" . "\n\t<tr>\n\t\t<th>Nb</th>" . vertebrer_sort($field,'') . + "\n\t</tr>\n\t\t<tr>" . + vertebrer_form($field) . "\n\t</tr>\n<BOUCLE1($surnom)" . vertebrer_crit($field) . '>' .