From 88619dbdbedf58af0b88503d0686bd54525d0cc4 Mon Sep 17 00:00:00 2001 From: "Committo,Ergo:sum" <esj@rezo.net> Date: Tue, 18 Sep 2007 21:38:28 +0000 Subject: [PATCH] =?UTF-8?q?Limitation=20des=20occurrences=20de=20la=20glob?= =?UTF-8?q?ale=20{{{=C2=A0table=5Fdes=5Ftables=20}}},=20qui=20doit=20?= =?UTF-8?q?=C3=AAtre=20consid=C3=A9r=C3=A9e=20comme=20une=20facilit=C3=A9?= =?UTF-8?q?=20d'abr=C3=A9viation=20du=20nom=20des=20tables=20SQL=20et=20ri?= =?UTF-8?q?en=20d'autre.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/inc/export.php | 3 +-- ecrire/inc/import.php | 1 - ecrire/public/boucles.php | 15 +-------------- ecrire/public/compiler.php | 2 +- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/ecrire/inc/export.php b/ecrire/inc/export.php index bc193ebee6..bc8e5b536d 100644 --- a/ecrire/inc/export.php +++ b/ecrire/inc/export.php @@ -13,7 +13,7 @@ if (!defined("_ECRIRE_INC_VERSION")) return; include_spip('base/serial'); include_spip('base/auxiliaires'); -include_spip('public/interfaces'); // pour table_des_tables +include_spip('public/interfaces'); // pour table_jointures $GLOBALS['version_archive'] = '1.3'; // NB: Ce fichier peut ajouter des tables (old-style) @@ -64,7 +64,6 @@ function export_all_list_tables() global $EXPORT_tables_noexport; global $tables_principales; global $tables_auxiliaires; - global $table_des_tables; global $tables_jointures; // on construit un index des tables de liens diff --git a/ecrire/inc/import.php b/ecrire/inc/import.php index 4061d2b1c5..e84cc13b99 100644 --- a/ecrire/inc/import.php +++ b/ecrire/inc/import.php @@ -375,7 +375,6 @@ function import_table_choix($request) global $IMPORT_tables_noimport; global $tables_principales; global $tables_auxiliaires; - global $table_des_tables; global $tables_jointures; if (!isset($IMPORT_tables_noimport)) $IMPORT_tables_noimport=array(); diff --git a/ecrire/public/boucles.php b/ecrire/public/boucles.php index 79aa71f0aa..808e7bb2ee 100644 --- a/ecrire/public/boucles.php +++ b/ecrire/public/boucles.php @@ -20,21 +20,8 @@ if (!defined("_ECRIRE_INC_VERSION")) return; // // Boucle standard, sans condition rajoutee // -// http://doc.spip.org/@boucle_DEFAUT_dist +// http://doc.spip.org/@boucle_DEFAUT_dist function boucle_DEFAUT_dist($id_boucle, &$boucles) { - global $table_des_tables, $tables_auxiliaires; - $boucle = &$boucles[$id_boucle]; - $type = $boucle->type_requete; - ; - if (isset($table_des_tables[$type])) - // les tables principales de spip ont un prefixe et un surnom - $boucle->from[$table_des_tables[$type]] = 'spip_' . $type ; - else if (isset($tables_auxiliaires['spip_' .$type])) - // les tables auxiliaires de spip ont un prefixe et pas de surnom - $boucle->from[$type] = 'spip_' . $type ; - // table hors SPIP - else $boucle->from[$type] = $type; - return calculer_boucle($id_boucle, $boucles); } diff --git a/ecrire/public/compiler.php b/ecrire/public/compiler.php index 6b179b3c5e..0f2db1864a 100644 --- a/ecrire/public/compiler.php +++ b/ecrire/public/compiler.php @@ -700,7 +700,7 @@ function public_compiler_dist($squelette, $nom, $gram, $sourcefile, $connect='') $boucles[$id]->sql_serveur = $connect; $show = trouver_table($type, $boucles[$id]); if ($show) { - $nom_table = $show['table']; + $boucle->from[$type] = $nom_table = $show['table']; $boucles[$id]->id_table = $show['id_table']; $boucles[$id]->primary = $show['key']["PRIMARY KEY"]; $boucles[$id]->descr = &$descr; -- GitLab