Skip to content
Extraits de code Groupes Projets
Valider 3741922a rédigé par esj's avatar esj
Parcourir les fichiers

Utiliser systématiquement les squelettes inclus de ''dist/'' pour harmoniser...

Utiliser systématiquement les squelettes inclus de ''dist/'' pour harmoniser la présentation des squelettes dynamiques avec les autres et prendre en compte les vertèbres qui ne parlent pas notre langue. Le lien habituel ''squelette'' en bas de page fonctionne à présent pour elles aussi, bien que ça ne dirige pas vers la meme page (on peut d'ailleurs se demander si tous ne devrait pas pointer sur celle-ci).

Par ailleurs, le tableau retourné par la fonction '''trouver_table''' contient une entrée supplémentaire, {{{connexion}}}, ça évite de trimbaler le paramètre {{{$connect}}} partout. 
parent d2b163aa
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -45,36 +45,38 @@ function base_trouver_table_dist($nom, $serveur='') ...@@ -45,36 +45,38 @@ function base_trouver_table_dist($nom, $serveur='')
// indirection (table principale avec nom!=type) // indirection (table principale avec nom!=type)
$t = $table_des_tables[$nom]; $t = $table_des_tables[$nom];
$nom_sql = 'spip_' . $t; $nom_sql = 'spip_' . $t;
if (!isset($connexions[$s]['tables'][$nom_sql])) { if (isset($connexions[$s]['tables'][$nom_sql]))
return $connexions[$s]['tables'][$nom_sql];
else {
include_spip('base/serial'); include_spip('base/serial');
$connexions[$s]['tables'][$nom_sql] = $tables_principales[$nom_sql]; $desc = $tables_principales[$nom_sql];
$connexions[$s]['tables'][$nom_sql]['table']= $nom_sql; $nom = $t;
$connexions[$s]['tables'][$nom_sql]['id_table']= $t; }
} # table principale deja vue, ok.
} else { } else {
include_spip('base/auxiliaires'); include_spip('base/auxiliaires');
if (isset($tables_auxiliaires['spip_' .$nom])) { if (isset($tables_auxiliaires['spip_' .$nom])) {
$nom_sql = 'spip_' . $nom; $nom_sql = 'spip_' . $nom;
if (!isset($connexions[$s]['tables'][$nom_sql])) { if (isset($connexions[$s]['tables'][$nom_sql]))
$connexions[$s]['tables'][$nom_sql] = $tables_auxiliaires[$nom_sql]; return $connexions[$s]['tables'][$nom_sql];
$connexions[$s]['tables'][$nom_sql]['table']= $nom_sql; else {
$connexions[$s]['tables'][$nom_sql]['id_table']= $nom; $desc = $tables_auxiliaires[$nom_sql];
} # table locale a cote de SPIP: noms egaux }
} # auxiliaire deja vue, ok. } # table locale a cote de SPIP, comme non SPIP:
} }
} }
if (!isset($connexions[$s]['tables'][$nom_sql])) {
if (isset($connexions[$s]['tables'][$nom_sql]))
return $connexions[$s]['tables'][$nom_sql]; $desc = sql_showtable($nom_sql, $serveur, ($nom_sql != $nom));
if (!$desc OR !$desc['field']) {
$desc = sql_showtable($nom_sql, $serveur, ($nom_sql != $nom)); spip_log("table inconnue $serveur $nom");
if (!$desc OR !$desc['field']) { return null;
spip_log("table inconnue $serveur $nom"); }
return null;
} else {
$desc['table']= $nom_sql;
$desc['id_table']= $nom;
} }
return $connexions[$s]['tables'][$nom_sql] = $desc; $desc['table']= $nom_sql;
$desc['id_table']= $nom;
$desc['connexion']= $serveur;
$connexions[$s]['tables'][$nom_sql] = $desc;
return $connexions[$s]['tables'][$nom_sql];
} }
?> ?>
...@@ -34,8 +34,8 @@ function vertebrer_sort($fields, $direction) ...@@ -34,8 +34,8 @@ function vertebrer_sort($fields, $direction)
$tri = $direction $tri = $direction
. ((test_sql_int($t) OR test_sql_date($r)) ? 'tri_n' : 'tri'); . ((test_sql_int($t) OR test_sql_date($r)) ? 'tri_n' : 'tri');
$url = "|parametre_url{" . $tri . ",'" . $n . "'}" $url = vertebrer_sanstri($tri)
. vertebrer_sanstri($tri); . "|parametre_url{" . $tri . ",'" . $n . "'}";
$res .= "\n\t\t<th><a href='[(#SELF$url)]'>$n</a></th>"; $res .= "\n\t\t<th><a href='[(#SELF$url)]'>$n</a></th>";
} }
...@@ -55,7 +55,7 @@ function vertebrer_sanstri($sauf='') ...@@ -55,7 +55,7 @@ function vertebrer_sanstri($sauf='')
function vertebrer_form($fields) function vertebrer_form($fields)
{ {
$res = '<td></td>'; $res = "\t\t<td></td>";
$url = join('|', array_keys($fields)); $url = join('|', array_keys($fields));
$url = "#SELF|parametre_url{'$url',''}"; $url = "#SELF|parametre_url{'$url',''}";
foreach($fields as $n => $t) { foreach($fields as $n => $t) {
...@@ -77,10 +77,8 @@ function vertebrer_form($fields) ...@@ -77,10 +77,8 @@ function vertebrer_form($fields)
// http://doc.spip.org/@vertebrer_crit // http://doc.spip.org/@vertebrer_crit
function vertebrer_crit($v) function vertebrer_crit($v)
{ {
$res = "{pagination}" $res = "";
. "\n\t{par #ENV{tri}}{!par #ENV{_tri}}{par num #ENV{tri_n}}{!par num #ENV{_tri_n}}"; foreach($v as $n => $t) { $res .= "\n\t\t{" . $n . " ?}"; }
foreach($v as $n => $t) { $res .= "\n\t{" . $n . " ?}"; }
return $res; return $res;
} }
...@@ -111,40 +109,50 @@ function public_vertebrer_dist($desc) ...@@ -111,40 +109,50 @@ function public_vertebrer_dist($desc)
{ {
$nom = $desc['table']; $nom = $desc['table'];
$surnom = $desc['id_table']; $surnom = $desc['id_table'];
$connexion = $desc['connexion'];
$field = $desc['field']; $field = $desc['field'];
$key = $desc['key']; $key = $desc['key'];
ksort($field); ksort($field);
$form = vertebrer_form($field);
$crit = vertebrer_crit($field);
$cell = vertebrer_cell($field);
$sort = vertebrer_sort($field,'');
$tros = vertebrer_sort($field,'_');
$titre = "SPIPAdmin $connexion $surnom";
$skel = "./?page=$surnom&amp;var_mode=debug&amp;var_mode_affiche=squelette#debug_boucle";
return return
"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='#LANG' lang='#LANG' dir='#LANG_DIR'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='#LANG' lang='#LANG' dir='#LANG_DIR'>
<head> <head>
<title>SPIPAdmin $surnom [(#NOM_SITE_SPIP|textebrut)]</title> <title>[(#NOM_SITE_SPIP|textebrut)] $titre</title>
<INCLURE{fond=inc-head}> <INCLURE{fond=inc-head}>
</head> </head>
<body class='page_rubrique'><div id='page'> <body class='page_rubrique'><div id='page'>
<h1 style='text-align:center'>SPIPAdmin $surnom</h1><br />\n" . <INCLURE{fond=inc-entete}>
// au minimum: "<BOUCLE1($fond)></BOUCLE1>#TOTAL_BOUCLE<//B1>") <div id='contenu'>
// au maximum: <h1 style='text-align:center'>$titre</h1><br />
"<B1>#ANCRE_PAGINATION" . <B1>
"\n<p class='pagination'>" . <p class='pagination'>#ANCRE_PAGINATION#PAGINATION</p>
"\n<a style='float:left;' " . <table class='spip' border='1' width='90%'>
"href='./?page=$surnom&amp;var_mode=debug&amp;var_mode_affiche=squelette#debug_boucle'>squelette" . \t<tr>
"</a>" . \t\t<th><:info_numero_abbreviation:></th>$sort
"\n#PAGINATION" . \t</tr>
"\n</p><br class='nettoyeur' />\n<table class='spip' border='1' width='90%'>" . \t<tr>
"\n\t<tr>\n\t\t<th>Nb</th>" . $form
vertebrer_sort($field,'') . \t</tr>\n<BOUCLE1($surnom){pagination}
"\n\t</tr>\n\t\t<tr>" . \t\t{par #ENV{tri}}{!par #ENV{_tri}}{par num #ENV{tri_n}}{!par num #ENV{_tri_n}}$crit>$cell
vertebrer_form($field) . \t</tr>
"\n\t</tr>\n<BOUCLE1($surnom)" . </BOUCLE1>
vertebrer_crit($field) . \t<tr>\n\t\t<th><:info_numero_abbreviation:></th>
'>' . $tros
vertebrer_cell($field) . \t</tr>\n</table>
"\n\t</tr>\n</BOUCLE1>" . </B1>\n<h2 style='text-align:center'><:texte_vide:></h2>
"\n\t<tr>\n\t\t<th>Nb</th>" . <//B1></div>
vertebrer_sort($field,'_') . <INCLURE{fond=inc-pied}{skel='$skel'}>
"\n\t</tr>\n</table>" . </div></body></html>";
"\n</B1>\n<h2 style='text-align:center'><:texte_vide:></h2>" .
"\n<//B1></div></body></html>";
} }
?> ?>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter