From f8590a0535bc03924d53a46d8f77a842669c4d76 Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Thu, 10 Nov 2005 23:13:46 +0000
Subject: [PATCH] permettre la surcharge

---
 .gitattributes                |   1 +
 ecrire/brouteur_frame.php3    | 249 ++--------------------------------
 ecrire/inc_brouteur_frame.php | 244 +++++++++++++++++++++++++++++++++
 ecrire/inc_calendrier.php     |   1 -
 4 files changed, 258 insertions(+), 237 deletions(-)
 create mode 100644 ecrire/inc_brouteur_frame.php

diff --git a/.gitattributes b/.gitattributes
index 9118352322..7e78d61451 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -266,6 +266,7 @@ ecrire/inc_auteur_infos.php -text
 ecrire/inc_auteurs_edit.php -text
 ecrire/inc_barre.php3 -text
 ecrire/inc_breves.php -text
+ecrire/inc_brouteur_frame.php -text
 ecrire/inc_config-fonctions.php -text
 ecrire/inc_controle_forum.php -text
 ecrire/inc_cookie.php -text
diff --git a/ecrire/brouteur_frame.php3 b/ecrire/brouteur_frame.php3
index f2ed6ba2bf..88e6a96c20 100644
--- a/ecrire/brouteur_frame.php3
+++ b/ecrire/brouteur_frame.php3
@@ -11,245 +11,22 @@
 \***************************************************************************/
 
 
-
 include ("inc.php3");
-include_ecrire("inc_presentation.php3");
-include_ecrire("inc_texte.php3");
-include_ecrire("inc_urls.php3");
-include_ecrire("inc_rubriques.php3");
-include_ecrire('inc_headers.php');
-
-http_no_cache();
-echo '<html lang="', 
-  $GLOBALS['spip_lang'],
-  '" dir="',
-  ($GLOBALS['spip_lang_rtl'] ? 'rtl' : 'ltr'),
-  '">
-<head>',
-  envoi_link("",""),
-'</head>',
-"\n<body $attributes_body
-	 onLoad=\"setActiveStyleSheet('invisible');$browser_verifForm$onLoad\">";
-
-	if ($spip_ecran == "large") {
-		$nb_col = 4;
-	} else {
-		$nb_col = 3;
-	}
-
-	if ($effacer_suivant == "oui") {
-		for ($i = $frame+1; $i < $nb_col; $i++) {
-			echo "<script>parent.iframe$i.location.href='brouteur_frame.php3?frame=$i'</script>";
-		}
-	}
-	echo "<div class='arial2'>";
-
-
-	if ($special == "redac") {
-		$query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles, spip_auteurs_articles AS lien WHERE articles.statut = 'prepa' AND articles.id_article = lien.id_article AND lien.id_auteur = $connect_id_auteur GROUP BY id_article ORDER BY articles.date DESC";
-		$result=spip_query($query);
-		if (spip_num_rows($result)>0) {
-			echo "<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"._T("info_cours_edition")."</b></div>";
-			echo "<div class='plan-articles'>";
-			while($row=spip_fetch_array($result)){
-				$id_article=$row['id_article'];
-				$titre = typo($row['titre']);
-				$statut = $row['statut'];
-				echo "<a class='$statut' href='javascript:window.parent.location=\"articles.php3?id_article=$id_article\"'>$titre</a>";
-			}
-			echo "</div>";
-		}
-	
-	}
-	else if ($special == "valider") {
-		$query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles WHERE articles.statut = 'prop' ORDER BY articles.date DESC";
-		$result=spip_query($query);
-		if (spip_num_rows($result)>0) {
-			echo "<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"._T("info_articles_proposes")."</b></div>";
-			echo "<div class='plan-articles'>";
-			while($row=spip_fetch_array($result)){
-				$id_article=$row['id_article'];
-				$titre = typo($row['titre']);
-				$statut = $row['statut'];
-				echo "<a class='$statut' href='javascript:window.parent.location=\"articles.php3?id_article=$id_article\"'>$titre</a>";
-			}
-			echo "</div>";
-		}
-	
-		$query = "SELECT * FROM spip_breves WHERE statut = 'prop' ORDER BY date_heure DESC LIMIT  20";
-		$result=spip_query($query);
-		if (spip_num_rows($result)>0) {
-			echo "<div style='padding-top: 6px;'><b class='verdana2'>"._T("info_breves_valider")."</b></div>";
-			echo "<div class='plan-articles'>";
-			while($row=spip_fetch_array($result)){
-				$id_breve=$row['id_breve'];
-				$titre = typo($row['titre']);
-				$statut = $row['statut'];
-				$puce = "puce-orange-breve.gif";
-				echo "<a class='$statut' href='javascript:window.parent.location=\"breves_voir.php3?id_breve=$id_breve\"'>$titre</a>";
-			}
-			echo "</div>";
-		}
-
-	}
-	else {
-	  if (isset($id_rubrique) && ($id_rubrique !== ''))
- {
-
-		$query = "SELECT * FROM spip_rubriques WHERE id_rubrique='$id_rubrique' ORDER BY 0+titre, titre";
-		$result=spip_query($query);
-		if ($row=spip_fetch_array($result)){
-			$ze_rubrique=$row['id_rubrique'];
-			$titre = typo($row['titre']);
-			$id_parent=$row['id_parent'];
-			
-			if ($id_parent == 0) $icone = "secteur-24.gif";
-			else $icone = "rubrique-24.gif";
-			
-			echo "<div style='background-color: #cccccc; border: 1px solid #444444;'>";
-			icone_horizontale("$titre", "javascript:window.parent.location=\"naviguer.php3?id_rubrique=$id_rubrique\"", "$icone","");
-			echo "</div>";
-		}  else if ($frame == 0) {
-			echo "<div style='background-color: #cccccc; border: 1px solid #444444;'>";
-			icone_horizontale(_T('info_racine_site'), "javascript:window.parent.location=\"naviguer.php3\"", "racine-site-24.gif","");
-			echo "</div>";
-		}
-
-	
-		$query = "SELECT * FROM spip_rubriques WHERE id_parent='$id_rubrique' ORDER BY 0+titre, titre";
-		$result=spip_query($query);
-		while($row=spip_fetch_array($result)){
-			$ze_rubrique=$row['id_rubrique'];
-			$titre = typo($row['titre']);
-			$id_parent=$row['id_parent'];
-			
-			echo "<div class='brouteur_rubrique' onMouseOver=\"changeclass(this, 'brouteur_rubrique_on');\" onMouseOut=\"changeclass(this, 'brouteur_rubrique');\">";
-
-			if ($id_parent == '0') 	{
-			  echo "<div style='background-image: url(" . _DIR_IMG_PACK . "secteur-24.gif);'><a href='brouteur_frame.php3?id_rubrique=$ze_rubrique&frame=".($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>$titre</a></div>";
-			}
-			else {
-				if ($frame+1 < $nb_col)
-				  echo "<div style='background-image: url(" . _DIR_IMG_PACK . "rubrique-24.gif);'><a href='brouteur_frame.php3?id_rubrique=$ze_rubrique&frame=".($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>$titre</a></div>";
-				else  echo "<div style='background-image: url(" . _DIR_IMG_PACK . "rubrique-24.gif);'><a href='javascript:window.parent.location=\"brouteur.php3?id_rubrique=$ze_rubrique\"'>$titre</a></div>";
-			}
-			echo "</div>\n";
-		}
-
-	
-		if ($id_rubrique > 0) {
-			if ($connect_statut == "0minirezo") $query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles WHERE id_rubrique=$id_rubrique ORDER BY date DESC";
-			else $query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles, spip_auteurs_articles AS lien WHERE articles.id_rubrique=$id_rubrique AND (articles.statut = 'publie' OR articles.statut = 'prop' OR (articles.statut = 'prepa' AND articles.id_article = lien.id_article AND lien.id_auteur = $connect_id_auteur)) GROUP BY id_article ORDER BY articles.date DESC";
-			$result=spip_query($query);
-			if (spip_num_rows($result)>0) {
-				echo "<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"._T('info_articles')."</b></div>";
-				echo "<div class='plan-articles'>";
-				while($row=spip_fetch_array($result)){
-					$id_article=$row['id_article'];
-					$titre = typo($row['titre']);
-					$statut = $row['statut'];
-					echo "<a class='$statut' href='javascript:window.parent.location=\"articles.php3?id_article=$id_article\"'>$titre</a>";
-				}
-				echo "</div>";
-			}
-	
-			$query = "SELECT * FROM spip_breves WHERE id_rubrique=$id_rubrique ORDER BY date_heure DESC LIMIT  20";
-			$result=spip_query($query);
-			if (spip_num_rows($result)>0) {
-				echo "<div style='padding-top: 6px;'><b class='verdana2'>"._T('info_breves_02')."</b></div>";
-				echo "<div class='plan-articles'>";
-				while($row=spip_fetch_array($result)){
-					$id_breve=$row['id_breve'];
-					$titre = typo($row['titre']);
-					$statut = $row['statut'];
-					switch ($statut) {
-						case 'publie':
-							$puce = 'verte';
-								break;
-						case 'prepa':
-							$puce = 'blanche';
-							break;
-						case 'prop':
-							$puce = 'orange';
-							break;
-						case 'refuse':
-							$puce = 'rouge';
-							break;
-						case 'poubelle':
-							$puce = 'poubelle';
-							break;
-					}
-					$puce = "puce-$puce-breve.gif";
-					echo "<a class='$statut' href='javascript:window.parent.location=\"breves_voir.php3?id_breve=$id_breve\"'>$titre</a>";
-				}
-				echo "</div>";
-
-
-			}
-
-
-
-	
-			$query = "SELECT * FROM spip_syndic WHERE id_rubrique='$id_rubrique' AND statut!='refuse' ORDER BY nom_site";
-			$result=spip_query($query);
-			if (spip_num_rows($result)>0) {
-				echo "<div style='padding-top: 6px;'><b class='verdana2'>"._T('icone_sites_references')."</b></div>";
-				while($row=spip_fetch_array($result)){
-					$id_syndic=$row['id_syndic'];
-					$titre = typo($row['nom_site']);
-					$statut = $row['statut'];
-					switch ($statut) {
-						case 'publie':
-							$puce = 'verte';
-								break;
-						case 'prepa':
-							$puce = 'blanche';
-							break;
-						case 'prop':
-							$puce = 'orange';
-							break;
-						case 'refuse':
-							$puce = 'rouge';
-							break;
-						case 'poubelle':
-							$puce = 'poubelle';
-							break;
-					}
-					echo "<div " . http_style_background('site-24.gif',  "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px") . "><b><a href='javascript:window.parent.location=\"sites.php3?id_syndic=$id_syndic\"'>$titre</a></b></div>";
-				}
-			}
-		}
-
-
-		if ($frame == 0 AND $id_rubrique==0) {
-	
-			$query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles, spip_auteurs_articles AS lien WHERE articles.statut = 'prepa' AND articles.id_article = lien.id_article AND lien.id_auteur = $connect_id_auteur GROUP BY id_article ORDER BY articles.date DESC";
-			$result=spip_query($query);
-			if (spip_num_rows($result)>0) {
-			  echo "<div ", http_style_background('article-24.gif',  "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px"),"><b class='verdana2'><a href='brouteur_frame.php3?special=redac&frame=".($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>"._T("info_cours_edition")."</a></b></div>";
-			}
-			
-			$query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles WHERE articles.statut = 'prop' ORDER BY articles.date DESC";
-			$result = spip_query($query);
-			$total_articles = spip_num_rows($result);
-			
-			$query = "SELECT * FROM spip_breves WHERE statut = 'prop' ORDER BY date_heure DESC LIMIT  20";
-			$result=spip_query($query);
-			$total_breves = spip_num_rows($result);
-			
-			if ($total_articles + $total_breves > 0)
-			  echo "<div ", http_style_background('article-24.gif',  "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px"),
-					  "><b class='verdana2'><a href='brouteur_frame.php3?special=valider&frame=".($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>"._T("info_articles_proposes")." / "._T("info_breves_valider")."</a></b></div>";
-			
-
-
-		}
 
-	}
-   }
-	echo "</div>";
+// prendre $var_* comme variables pour eviter les conflits avec les http_vars
 
-echo "</body></html>";
+$var_nom = "brouteur_frame";
+$var_f = find_in_path('inc_' . $var_nom . '.php');
 
+if ($var_f) 
+  include($var_f);
+else
+  include_ecrire('inc_' . $var_nom . '.php');
 
+if (function_exists($var_nom))
+  $var_nom($id_rubrique, $frame, $effacer_suivant, $special);
+elseif (function_exists($var_f = $var_nom . "_dist"))
+  $var_f($id_rubrique, $frame, $effacer_suivant, $special);
+else
+   spip_log("fonction $var_nom indisponible");
 ?>
diff --git a/ecrire/inc_brouteur_frame.php b/ecrire/inc_brouteur_frame.php
new file mode 100644
index 0000000000..77a8185c52
--- /dev/null
+++ b/ecrire/inc_brouteur_frame.php
@@ -0,0 +1,244 @@
+<?php
+
+/***************************************************************************\
+ *  SPIP, Systeme de publication pour l'internet                           *
+ *                                                                         *
+ *  Copyright (c) 2001-2005                                                *
+ *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
+ *                                                                         *
+ *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
+ *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
+\***************************************************************************/
+
+if (!defined("_ECRIRE_INC_VERSION")) return;
+
+include_ecrire("inc_presentation.php3");
+include_ecrire("inc_texte.php3");
+
+function brouteur_frame_dist($id_rubrique, $frame, $effacer_suivant, $special)
+{
+	global $connect_statut,$connect_id_auteur, $spip_ecran, $spip_lang_left;
+	init_entete("","","");
+
+	if ($spip_ecran == "large") {
+		$nb_col = 4;
+	} else {
+		$nb_col = 3;
+	}
+
+	if ($effacer_suivant == "oui") {
+		for ($i = $frame+1; $i < $nb_col; $i++) {
+			echo "<script>parent.iframe$i.location.href='brouteur_frame.php3?frame=$i'</script>";
+		}
+	}
+	echo "<div class='arial2'>";
+
+
+	if ($special == "redac") {
+		$query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles, spip_auteurs_articles AS lien WHERE articles.statut = 'prepa' AND articles.id_article = lien.id_article AND lien.id_auteur = $connect_id_auteur GROUP BY id_article ORDER BY articles.date DESC";
+		$result=spip_query($query);
+		if (spip_num_rows($result)>0) {
+			echo "<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"._T("info_cours_edition")."</b></div>";
+			echo "<div class='plan-articles'>";
+			while($row=spip_fetch_array($result)){
+				$id_article=$row['id_article'];
+				$titre = typo($row['titre']);
+				$statut = $row['statut'];
+				echo "<a class='$statut' href='javascript:window.parent.location=\"articles.php3?id_article=$id_article\"'>$titre</a>";
+			}
+			echo "</div>";
+		}
+	
+	}
+	else if ($special == "valider") {
+		$query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles WHERE articles.statut = 'prop' ORDER BY articles.date DESC";
+		$result=spip_query($query);
+		if (spip_num_rows($result)>0) {
+			echo "<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"._T("info_articles_proposes")."</b></div>";
+			echo "<div class='plan-articles'>";
+			while($row=spip_fetch_array($result)){
+				$id_article=$row['id_article'];
+				$titre = typo($row['titre']);
+				$statut = $row['statut'];
+				echo "<a class='$statut' href='javascript:window.parent.location=\"articles.php3?id_article=$id_article\"'>$titre</a>";
+			}
+			echo "</div>";
+		}
+	
+		$query = "SELECT * FROM spip_breves WHERE statut = 'prop' ORDER BY date_heure DESC LIMIT  20";
+		$result=spip_query($query);
+		if (spip_num_rows($result)>0) {
+			echo "<div style='padding-top: 6px;'><b class='verdana2'>"._T("info_breves_valider")."</b></div>";
+			echo "<div class='plan-articles'>";
+			while($row=spip_fetch_array($result)){
+				$id_breve=$row['id_breve'];
+				$titre = typo($row['titre']);
+				$statut = $row['statut'];
+				$puce = "puce-orange-breve.gif";
+				echo "<a class='$statut' href='javascript:window.parent.location=\"breves_voir.php3?id_breve=$id_breve\"'>$titre</a>";
+			}
+			echo "</div>";
+		}
+
+	}
+	else {
+	  if (isset($id_rubrique) && ($id_rubrique !== ''))
+ {
+
+		$query = "SELECT * FROM spip_rubriques WHERE id_rubrique='$id_rubrique' ORDER BY 0+titre, titre";
+		$result=spip_query($query);
+		if ($row=spip_fetch_array($result)){
+			$ze_rubrique=$row['id_rubrique'];
+			$titre = typo($row['titre']);
+			$id_parent=$row['id_parent'];
+			
+			if ($id_parent == 0) $icone = "secteur-24.gif";
+			else $icone = "rubrique-24.gif";
+			
+			echo "<div style='background-color: #cccccc; border: 1px solid #444444;'>";
+			icone_horizontale("$titre", "javascript:window.parent.location=\"naviguer.php3?id_rubrique=$id_rubrique\"", "$icone","");
+			echo "</div>";
+		}  else if ($frame == 0) {
+			echo "<div style='background-color: #cccccc; border: 1px solid #444444;'>";
+			icone_horizontale(_T('info_racine_site'), "javascript:window.parent.location=\"naviguer.php3\"", "racine-site-24.gif","");
+			echo "</div>";
+		}
+
+	
+		$query = "SELECT * FROM spip_rubriques WHERE id_parent='$id_rubrique' ORDER BY 0+titre, titre";
+		$result=spip_query($query);
+		while($row=spip_fetch_array($result)){
+			$ze_rubrique=$row['id_rubrique'];
+			$titre = typo($row['titre']);
+			$id_parent=$row['id_parent'];
+			
+			echo "<div class='brouteur_rubrique' onMouseOver=\"changeclass(this, 'brouteur_rubrique_on');\" onMouseOut=\"changeclass(this, 'brouteur_rubrique');\">";
+
+			if ($id_parent == '0') 	{
+			  echo "<div style='background-image: url(" . _DIR_IMG_PACK . "secteur-24.gif);'><a href='brouteur_frame.php3?id_rubrique=$ze_rubrique&frame=".($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>$titre</a></div>";
+			}
+			else {
+				if ($frame+1 < $nb_col)
+				  echo "<div style='background-image: url(" . _DIR_IMG_PACK . "rubrique-24.gif);'><a href='brouteur_frame.php3?id_rubrique=$ze_rubrique&frame=".($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>$titre</a></div>";
+				else  echo "<div style='background-image: url(" . _DIR_IMG_PACK . "rubrique-24.gif);'><a href='javascript:window.parent.location=\"brouteur.php3?id_rubrique=$ze_rubrique\"'>$titre</a></div>";
+			}
+			echo "</div>\n";
+		}
+
+	
+		if ($id_rubrique > 0) {
+			if ($connect_statut == "0minirezo") $query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles WHERE id_rubrique=$id_rubrique ORDER BY date DESC";
+			else $query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles, spip_auteurs_articles AS lien WHERE articles.id_rubrique=$id_rubrique AND (articles.statut = 'publie' OR articles.statut = 'prop' OR (articles.statut = 'prepa' AND articles.id_article = lien.id_article AND lien.id_auteur = $connect_id_auteur)) GROUP BY id_article ORDER BY articles.date DESC";
+			$result=spip_query($query);
+			if (spip_num_rows($result)>0) {
+				echo "<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"._T('info_articles')."</b></div>";
+				echo "<div class='plan-articles'>";
+				while($row=spip_fetch_array($result)){
+					$id_article=$row['id_article'];
+					$titre = typo($row['titre']);
+					$statut = $row['statut'];
+					echo "<a class='$statut' href='javascript:window.parent.location=\"articles.php3?id_article=$id_article\"'>$titre</a>";
+				}
+				echo "</div>";
+			}
+	
+			$query = "SELECT * FROM spip_breves WHERE id_rubrique=$id_rubrique ORDER BY date_heure DESC LIMIT  20";
+			$result=spip_query($query);
+			if (spip_num_rows($result)>0) {
+				echo "<div style='padding-top: 6px;'><b class='verdana2'>"._T('info_breves_02')."</b></div>";
+				echo "<div class='plan-articles'>";
+				while($row=spip_fetch_array($result)){
+					$id_breve=$row['id_breve'];
+					$titre = typo($row['titre']);
+					$statut = $row['statut'];
+					switch ($statut) {
+						case 'publie':
+							$puce = 'verte';
+								break;
+						case 'prepa':
+							$puce = 'blanche';
+							break;
+						case 'prop':
+							$puce = 'orange';
+							break;
+						case 'refuse':
+							$puce = 'rouge';
+							break;
+						case 'poubelle':
+							$puce = 'poubelle';
+							break;
+					}
+					$puce = "puce-$puce-breve.gif";
+					echo "<a class='$statut' href='javascript:window.parent.location=\"breves_voir.php3?id_breve=$id_breve\"'>$titre</a>";
+				}
+				echo "</div>";
+
+
+			}
+
+
+
+	
+			$query = "SELECT * FROM spip_syndic WHERE id_rubrique='$id_rubrique' AND statut!='refuse' ORDER BY nom_site";
+			$result=spip_query($query);
+			if (spip_num_rows($result)>0) {
+				echo "<div style='padding-top: 6px;'><b class='verdana2'>"._T('icone_sites_references')."</b></div>";
+				while($row=spip_fetch_array($result)){
+					$id_syndic=$row['id_syndic'];
+					$titre = typo($row['nom_site']);
+					$statut = $row['statut'];
+					switch ($statut) {
+						case 'publie':
+							$puce = 'verte';
+								break;
+						case 'prepa':
+							$puce = 'blanche';
+							break;
+						case 'prop':
+							$puce = 'orange';
+							break;
+						case 'refuse':
+							$puce = 'rouge';
+							break;
+						case 'poubelle':
+							$puce = 'poubelle';
+							break;
+					}
+					echo "<div " . http_style_background('site-24.gif',  "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px") . "><b><a href='javascript:window.parent.location=\"sites.php3?id_syndic=$id_syndic\"'>$titre</a></b></div>";
+				}
+			}
+		}
+
+
+		if ($frame == 0 AND $id_rubrique==0) {
+	
+			$query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles, spip_auteurs_articles AS lien WHERE articles.statut = 'prepa' AND articles.id_article = lien.id_article AND lien.id_auteur = $connect_id_auteur GROUP BY id_article ORDER BY articles.date DESC";
+			$result=spip_query($query);
+			if (spip_num_rows($result)>0) {
+			  echo "<div ", http_style_background('article-24.gif',  "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px"),"><b class='verdana2'><a href='brouteur_frame.php3?special=redac&frame=".($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>"._T("info_cours_edition")."</a></b></div>";
+			}
+			
+			$query = "SELECT articles.id_article, articles.titre, articles.statut FROM spip_articles AS articles WHERE articles.statut = 'prop' ORDER BY articles.date DESC";
+			$result = spip_query($query);
+			$total_articles = spip_num_rows($result);
+			
+			$query = "SELECT * FROM spip_breves WHERE statut = 'prop' ORDER BY date_heure DESC LIMIT  20";
+			$result=spip_query($query);
+			$total_breves = spip_num_rows($result);
+			
+			if ($total_articles + $total_breves > 0)
+			  echo "<div ", http_style_background('article-24.gif',  "$spip_lang_left center no-repeat; margin:3px; padding-top: 5px; padding-bottom: 5px; padding-$spip_lang_left: 28px"),
+					  "><b class='verdana2'><a href='brouteur_frame.php3?special=valider&frame=".($frame+1)."&effacer_suivant=oui' target='iframe".($frame+1)."'>"._T("info_articles_proposes")." / "._T("info_breves_valider")."</a></b></div>";
+			
+
+
+		}
+
+	}
+   }
+	echo "</div>";
+
+echo "</body></html>";
+}
+?>
+
diff --git a/ecrire/inc_calendrier.php b/ecrire/inc_calendrier.php
index 1f70ca6336..d888ff0704 100644
--- a/ecrire/inc_calendrier.php
+++ b/ecrire/inc_calendrier.php
@@ -19,7 +19,6 @@ charger_generer_url();
 
 function calendrier_dist($type, $css="")
 {
-  global $attributes_body, $browser_verifForm;
   $date = date("Y-m-d", time()); 
   if ($type == 'semaine') {
 
-- 
GitLab