3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2007 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
13 if (!defined("_ECRIRE_INC_VERSION")) return;
15 include_spip('inc/presentation');
17 // http://doc.spip.org/@exec_brouteur_frame_dist
18 function exec_brouteur_frame_dist() {
19 global $connect_statut,$connect_id_auteur, $spip_ecran, $spip_lang_left;
21 $id_rubrique = is_numeric(_request('rubrique')) ?
intval(_request('rubrique')) : "";
22 $frame = _request('frame');
23 $effacer_suivant = _request('effacer_suivant');
24 $special = _request('special');
26 include_spip('inc/headers');
30 . html_lang_attributes()
32 . "<title>brouteur_frame</title>\n"
33 . "<meta http-equiv='Content-Type' content='text/html"
34 . (($c = $GLOBALS['meta']['charset']) ?
"; charset=$c" : '')
36 . envoi_link(_T('info_mon_site_spip'))
37 . pipeline('header_prive', $head)
38 . '<script type="text/javascript"><!--
41 jQuery("a.iframe").click(function(){
42 window.open(this.href,"iframe"+this.rel);
51 if ($spip_ecran == "large") {
57 if ($effacer_suivant == "oui" && $frame < $nb_col) {
58 echo '<script type="text/javascript">';
59 for ($i = $frame+
1; $i < $nb_col; $i++
) {
60 echo "\nparent.iframe$i.location.href='", generer_url_ecrire('brouteur_frame',"frame=$i"), "'";
64 echo "\n<div class='arial2'>";
67 if ($special == "redac") {
68 $result=spip_query("SELECT articles.id_article, articles.id_rubrique, 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");
69 if (spip_num_rows($result)>0) {
70 echo "\n<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"._T("info_cours_edition")."</b></div>";
71 echo "\n<div class='plan-articles'>";
72 while($row=spip_fetch_array($result)){
73 $id_article=$row['id_article'];
74 if (autoriser('voir','article',$id_article)){
75 $titre = typo($row['titre']);
76 $statut = $row['statut'];
77 echo "<a class='$statut'\nhref='javascript:window.parent.location=\"" . generer_url_ecrire('articles',"id_article=$id_article"),"\"'>",$titre,"</a>";
84 else if ($special == "valider") {
85 $result=spip_query("SELECT id_article, id_rubrique, titre, statut FROM spip_articles WHERE statut = 'prop' ORDER BY date DESC");
86 if (spip_num_rows($result)>0) {
87 echo "\n<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"._T("info_articles_proposes")."</b></div>";
88 echo "\n<div class='plan-articles'>";
89 while($row=spip_fetch_array($result)){
90 $id_article=$row['id_article'];
91 if (autoriser('voir','article',$id_article)){
92 $titre = typo($row['titre']);
93 $statut = $row['statut'];
94 echo "<a class='$statut' href='javascript:window.parent.location=\"", generer_url_ecrire('articles',"id_article=$id_article"),"\"'>",$titre,"</a>";
100 $result=spip_query("SELECT * FROM spip_breves WHERE statut = 'prop' ORDER BY date_heure DESC LIMIT 20");
101 if (spip_num_rows($result)>0) {
102 echo "\n<div style='padding-top: 6px;'><b class='verdana2'>"._T("info_breves_valider")."</b></div>";
103 echo "\n<div class='plan-articles'>";
104 while($row=spip_fetch_array($result)){
105 $id_breve=$row['id_breve'];
106 if (autoriser('voir','breve',$id_breve)){
107 $titre = typo($row['titre']);
108 $statut = $row['statut'];
109 echo "<a class='$statut' href='javascript:window.parent.location=\"", generer_url_ecrire('breves_voir',"id_breve=$id_breve"),"\"'>",$titre,"</a>";
117 if ($id_rubrique !== "" AND autoriser('voir','rubrique',$id_rubrique)) {
119 $result=spip_query("SELECT id_parent, id_rubrique, titre FROM spip_rubriques WHERE id_rubrique='$id_rubrique' ORDER BY 0+titre, titre");
120 if ($row=spip_fetch_array($result)){
121 $titre = typo($row['titre']);
122 $id_parent=$row['id_parent'];
124 if ($id_parent == 0) $icone = "secteur-24.gif";
125 else $icone = "rubrique-24.gif";
127 echo "\n<div style='background-color: #cccccc; border: 1px solid #444444;'>";
128 icone_horizontale($titre, "javascript:window.parent.location=\"" . generer_url_ecrire('naviguer',"id_rubrique=$id_rubrique") .'"', $icone);
130 } else if ($frame == 0) {
131 echo "\n<div style='background-color: #cccccc; border: 1px solid #444444;'>";
132 icone_horizontale(_T('info_racine_site'), "javascript:window.parent.location=\"" . generer_url_ecrire('naviguer') . '"', "racine-site-24.gif","");
137 $result=spip_query("SELECT id_rubrique, id_parent, titre FROM spip_rubriques WHERE id_parent='$id_rubrique' ORDER BY 0+titre, titre");
138 while($row=spip_fetch_array($result)){
139 $ze_rubrique=$row['id_rubrique'];
140 if (autoriser('voir','rubrique',$ze_rubrique)){
141 $titre = typo($row['titre']);
142 $id_parent=$row['id_parent'];
144 echo "\n<div class='brouteur_rubrique'
145 onmouseover=\"changeclass(this, 'brouteur_rubrique_on');\"
146 onmouseout=\"changeclass(this, 'brouteur_rubrique');\">";
148 if ($id_parent == '0') {
149 echo "\n<div style='", frame_background_image("secteur-24.gif"), ";'><a href='", generer_url_ecrire('brouteur_frame', "rubrique=$ze_rubrique&frame=".($frame+
1)."&effacer_suivant=oui"), "' class='iframe' rel='", ($frame+
1), "'>",
154 if ($frame+
1 < $nb_col)
155 echo "\n<div style='",
156 frame_background_image("rubrique-24.gif"), ";'><a href='", generer_url_ecrire('brouteur_frame', "rubrique=$ze_rubrique&frame=".($frame+
1)."&effacer_suivant=oui"), "' class='iframe' rel='",
158 "'>$titre</a></div>";
159 else echo "\n<div style='",
160 frame_background_image("rubrique-24.gif"), ";'><a href='javascript:window.parent.location=\"" . generer_url_ecrire('brouteur',"id_rubrique=$ze_rubrique")."\"'>",$titre,"</a></div>";
167 if ($id_rubrique > 0) {
168 if ($connect_statut == "0minirezo")
169 $result = spip_query("SELECT id_article, id_rubrique, titre, statut FROM spip_articles WHERE id_rubrique=$id_rubrique ORDER BY date DESC");
171 $result = spip_query("SELECT articles.id_article, articles.id_rubrique, articles.titre, articles.statut FROM spip_articles AS articles LEFT JOIN spip_auteurs_articles AS lien ON articles.id_article = lien.id_article WHERE articles.id_rubrique="._q($id_rubrique)." AND (articles.statut = 'publie' OR articles.statut = 'prop' OR (articles.statut = 'prepa' AND lien.id_auteur = "._q($connect_id_auteur).")) GROUP BY id_article ORDER BY articles.date DESC");
173 if (spip_num_rows($result)>0) {
174 echo "\n<div style='padding-top: 6px; padding-bottom: 3px;'><b class='verdana2'>"._T('info_articles')."</b></div>";
175 echo "\n<div class='plan-articles'>";
176 while($row=spip_fetch_array($result)){
177 $id_article=$row['id_article'];
178 if (autoriser('voir','article',$id_article)){
179 $titre = typo($row['titre']);
180 $statut = $row['statut'];
181 echo "<a class='$statut' href='javascript:window.parent.location=\"" . generer_url_ecrire('articles',"id_article=$id_article")."\"'>",$titre,"</a>";
187 $result=spip_query("SELECT * FROM spip_breves WHERE id_rubrique=$id_rubrique ORDER BY date_heure DESC LIMIT 20");
188 if (spip_num_rows($result)>0) {
189 echo "\n<div style='padding-top: 6px;'><b class='verdana2'>"._T('info_breves_02')."</b></div>";
190 echo "\n<div class='plan-articles'>";
191 while($row=spip_fetch_array($result)){
192 $id_breve=$row['id_breve'];
193 if (autoriser('voir','breve',$id_breve)){
194 $titre = typo($row['titre']);
195 $statut = $row['statut'];
196 echo "<a class='$statut' href='javascript:window.parent.location=\"", generer_url_ecrire('breves_voir',"id_breve=$id_breve")."\"'>",$titre,"</a>";
204 $result=spip_query("SELECT * FROM spip_syndic WHERE id_rubrique='$id_rubrique' AND statut!='refuse' ORDER BY nom_site");
205 if (spip_num_rows($result)>0) {
206 echo "\n<div style='padding-top: 6px;'><b class='verdana2'>"._T('icone_sites_references')."</b></div>";
207 while($row=spip_fetch_array($result)){
208 $id_syndic=$row['id_syndic'];
209 if (autoriser('voir','site',$id_syndic)){
210 $titre = typo($row['nom_site']);
211 $statut = $row['statut'];
212 echo "\n<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=\"", generer_url_ecrire('sites',"id_syndic=$id_syndic"),"\"'>",$titre,"</a></b></div>";
218 // en derniere colonne, afficher articles et breves
219 if ($frame == 0 AND $id_rubrique==0) {
221 $cpt=spip_fetch_array(spip_query("SELECT COUNT(*) AS n 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 articles.id_article"));
224 echo "\n<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"),
225 "><b class='verdana2'><a href='", generer_url_ecrire('brouteur_frame', "special=redac&frame=".($frame+
1)."&effacer_suivant=oui"), "' class='iframe' rel='",($frame+
1),"'>",
226 _T("info_cours_edition"),"</a></b></div>";
229 $cpt = spip_fetch_array(spip_query("SELECT COUNT(*) AS n FROM spip_articles AS articles WHERE articles.statut = 'prop'"));
231 $cpt = spip_fetch_array(spip_query("SELECT COUNT(*) AS n FROM spip_breves WHERE statut = 'prop'"));
233 echo "\n<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"),
234 "><b class='verdana2'><a href='", generer_url_ecrire('brouteur_frame', "special=valider&frame=".($frame+
1)."&effacer_suivant=oui"), "' class='iframe' rel='",
236 _T("info_articles_proposes"),
237 " / "._T("info_breves_valider")."</a></b></div>";
243 echo "</body></html>";
246 // http://doc.spip.org/@frame_background_image
247 function frame_background_image($f)
249 return "background-image: url(" .