From 78e79c0e3508a3d12c6dab29c1adc54ec35ed53c Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Wed, 19 Sep 2007 07:26:43 +0000
Subject: [PATCH] =?UTF-8?q?R=C3=A9duire=20les=20occurrences=20du=20pr?=
 =?UTF-8?q?=C3=A9fixe=20spip=5F=20dans=20le=20code.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/public/boucles.php  | 11 -----------
 ecrire/public/compiler.php |  4 ++--
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/ecrire/public/boucles.php b/ecrire/public/boucles.php
index e8dffd77b3..be4f86fd25 100644
--- a/ecrire/public/boucles.php
+++ b/ecrire/public/boucles.php
@@ -42,7 +42,6 @@ function boucle_BOUCLE_dist($id_boucle, &$boucles) {
 function boucle_ARTICLES_dist($id_boucle, &$boucles) {
 	$boucle = &$boucles[$id_boucle];
 	$id_table = $boucle->id_table;
-	$boucle->from[$id_table] =  "spip_articles";
 	$mstatut = $id_table .'.statut';
 
 	// Restreindre aux elements publies
@@ -64,7 +63,6 @@ function boucle_ARTICLES_dist($id_boucle, &$boucles) {
 function boucle_AUTEURS_dist($id_boucle, &$boucles) {
 	$boucle = &$boucles[$id_boucle];
 	$id_table = $boucle->id_table;
-	$boucle->from[$id_table] =  "spip_auteurs";
 	$mstatut = $id_table .'.statut';
 
 	// Restreindre aux elements publies
@@ -94,7 +92,6 @@ function boucle_AUTEURS_dist($id_boucle, &$boucles) {
 function boucle_BREVES_dist($id_boucle, &$boucles) {
 	$boucle = &$boucles[$id_boucle];
 	$id_table = $boucle->id_table;
-	$boucle->from[$id_table] =  "spip_breves";
 	$mstatut = $id_table .'.statut';
 
 	// Restreindre aux elements publies
@@ -116,9 +113,7 @@ function boucle_BREVES_dist($id_boucle, &$boucles) {
 function boucle_FORUMS_dist($id_boucle, &$boucles) {
 	$boucle = &$boucles[$id_boucle];
 	$id_table = $boucle->id_table;
-	$boucle->from[$id_table] =  "spip_forum";
 	$mstatut = $id_table .'.statut';
-
 	// Par defaut, selectionner uniquement les forums sans mere
 	// Les criteres {tout} et {plat} inversent ce choix
 	if (!isset($boucle->modificateur['tout']) AND !isset($boucle->modificateur['plat'])) {
@@ -145,8 +140,6 @@ function boucle_SIGNATURES_dist($id_boucle, &$boucles) {
 	$id_table = $boucle->id_table;
 	$mstatut = $id_table .'.statut';
 
-	$boucle->from[$id_table] =  "spip_signatures";
-
 	// Restreindre aux elements publies
 	if (!$boucle->modificateur['criteres']['statut']) {
 		$boucle->where[]= array("'='", "'$mstatut'", "'\\'publie\\''");
@@ -162,7 +155,6 @@ function boucle_SIGNATURES_dist($id_boucle, &$boucles) {
 function boucle_DOCUMENTS_dist($id_boucle, &$boucles) {
 	$boucle = &$boucles[$id_boucle];
 	$id_table = $boucle->id_table;
-	$boucle->from[$id_table] =  "spip_documents";
 
 	// on ne veut pas des fichiers de taille nulle,
 	// sauf s'ils sont distants (taille inconnue)
@@ -220,7 +212,6 @@ function boucle_DOCUMENTS_dist($id_boucle, &$boucles) {
 function boucle_RUBRIQUES_dist($id_boucle, &$boucles) {
 	$boucle = &$boucles[$id_boucle];
 	$id_table = $boucle->id_table;
-	$boucle->from[$id_table] =  "spip_rubriques";
 	$mstatut = $id_table .'.statut';
 
 	// Restreindre aux elements publies
@@ -271,7 +262,6 @@ function boucle_HIERARCHIE_dist($id_boucle, &$boucles) {
 function boucle_SYNDICATION_dist($id_boucle, &$boucles) {
 	$boucle = &$boucles[$id_boucle];
 	$id_table = $boucle->id_table;
-	$boucle->from[$id_table] =  "spip_syndic";
 	$mstatut = $id_table .'.statut';
 
 	// Restreindre aux elements publies
@@ -292,7 +282,6 @@ function boucle_SYNDICATION_dist($id_boucle, &$boucles) {
 function boucle_SYNDIC_ARTICLES_dist($id_boucle, &$boucles) {
 	$boucle = &$boucles[$id_boucle];
 	$id_table = $boucle->id_table;
-	$boucle->from[$id_table] =  "spip_syndic_articles" ;
 	$mstatut = $id_table .'.statut';
 
 	// Restreindre aux elements publies, sauf critere contraire
diff --git a/ecrire/public/compiler.php b/ecrire/public/compiler.php
index 0f2db1864a..700af9cd60 100644
--- a/ecrire/public/compiler.php
+++ b/ecrire/public/compiler.php
@@ -700,8 +700,8 @@ function public_compiler_dist($squelette, $nom, $gram, $sourcefile, $connect='')
 				$boucles[$id]->sql_serveur = $connect;
 			$show = trouver_table($type, $boucles[$id]);
 			if ($show) {
-				$boucle->from[$type] = $nom_table = $show['table'];
-				$boucles[$id]->id_table = $show['id_table'];
+				$boucles[$id]->id_table = $x = $show['id_table'];
+				$boucles[$id]->from[$x] = $nom_table = $show['table'];
 				$boucles[$id]->primary = $show['key']["PRIMARY KEY"];
 				$boucles[$id]->descr = &$descr;
 				if ((!$boucles[$id]->jointures)
-- 
GitLab