4 |
david |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************\
|
|
|
4 |
* SPIP, Systeme de publication pour l'internet *
|
|
|
5 |
* *
|
|
|
6 |
* Copyright (c) 2001-2005 *
|
|
|
7 |
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
|
|
|
8 |
* *
|
|
|
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 |
\***************************************************************************/
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
include ("inc.php3");
|
|
|
15 |
|
|
|
16 |
include_ecrire ("inc_sites.php3");
|
|
|
17 |
|
|
|
18 |
$proposer_sites = lire_meta("proposer_sites");
|
|
|
19 |
|
|
|
20 |
function premiere_rubrique(){
|
|
|
21 |
$query="SELECT * FROM spip_rubriques WHERE id_parent='0' ORDER BY titre LIMIT 0,1";
|
|
|
22 |
$result=spip_query($query);
|
|
|
23 |
|
|
|
24 |
while($row=spip_fetch_array($result)){
|
|
|
25 |
$my_rubrique=$row['id_rubrique'];
|
|
|
26 |
}
|
|
|
27 |
return $my_rubrique;
|
|
|
28 |
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
function enfant($leparent){
|
|
|
32 |
global $id_parent;
|
|
|
33 |
global $id_rubrique;
|
|
|
34 |
static $i = 0, $premier = 1;
|
|
|
35 |
global $statut;
|
|
|
36 |
global $connect_toutes_rubriques;
|
|
|
37 |
global $couleur_claire, $spip_lang_left;
|
|
|
38 |
global $browser_name;
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
$i++;
|
|
|
42 |
$query="SELECT * FROM spip_rubriques WHERE id_parent='$leparent' ORDER BY 0+titre, titre";
|
|
|
43 |
$result=spip_query($query);
|
|
|
44 |
|
|
|
45 |
while($row=spip_fetch_array($result)){
|
|
|
46 |
$my_rubrique=$row['id_rubrique'];
|
|
|
47 |
$titre=typo($row['titre']);
|
|
|
48 |
$statut_rubrique=$row['statut'];
|
|
|
49 |
$lang_rub = $row['lang'];
|
|
|
50 |
$langue_choisie_rub = $row['langue_choisie'];
|
|
|
51 |
$style = "";
|
|
|
52 |
$espace = "";
|
|
|
53 |
|
|
|
54 |
// si l'article est publie il faut etre admin pour avoir le menu
|
|
|
55 |
// sinon le menu est present en entier (proposer un article)
|
|
|
56 |
if ($statut != "publie" OR acces_rubrique($my_rubrique)) {
|
|
|
57 |
$rubrique_acceptable = true;
|
|
|
58 |
} else {
|
|
|
59 |
$rubrique_acceptable = false;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
if (eregi("mozilla", $browser_name)) {
|
|
|
63 |
$style .= "padding-$spip_lang_left: 16px; ";
|
|
|
64 |
$style .= "margin-$spip_lang_left: ".(($i-1)*16)."px;";
|
|
|
65 |
} else {
|
|
|
66 |
for ($count = 0; $count <= $i; $count ++) $espace .= " ";
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
$img = _DIR_IMG_PACK . 'rubrique-12.gif';
|
|
|
70 |
switch ($i) {
|
|
|
71 |
case 1:
|
|
|
72 |
$espace= "";
|
|
|
73 |
$img = _DIR_IMG_PACK . 'secteur-12.gif';
|
|
|
74 |
$style .= "font-weight: bold;";
|
|
|
75 |
$style .= "background-color: $couleur_claire;";
|
|
|
76 |
break;
|
|
|
77 |
case 2:
|
|
|
78 |
$style .= "color: #202020;";
|
|
|
79 |
$style .= "font-weight: bold;";
|
|
|
80 |
$style .= "border-bottom: 1px solid $couleur_claire;";
|
|
|
81 |
break;
|
|
|
82 |
case 3:
|
|
|
83 |
$style .= "color: #404040;";
|
|
|
84 |
break;
|
|
|
85 |
case 4:
|
|
|
86 |
$style .= "color: #606060;";
|
|
|
87 |
break;
|
|
|
88 |
case 5:
|
|
|
89 |
$style .= "color: #808080;";
|
|
|
90 |
break;
|
|
|
91 |
default:
|
|
|
92 |
$style .= "color: #A0A0A0;";
|
|
|
93 |
break;
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
$style .= "background: url($img) $spip_lang_left no-repeat;";
|
|
|
97 |
|
|
|
98 |
if ($rubrique_acceptable) {
|
|
|
99 |
if ($i == 1 && !$premier) echo "<OPTION VALUE='$my_rubrique'>\n"; // sert a separer les secteurs
|
|
|
100 |
$titre = couper($titre." ", 50); // largeur maxi
|
|
|
101 |
if (lire_meta('multi_rubriques') == 'oui' AND ($langue_choisie_rub == "oui" OR $leparent == 0)) $titre = $titre." [".traduire_nom_langue($lang_rub)."]";
|
|
|
102 |
echo "<OPTION".mySel($my_rubrique,$id_rubrique)." style=\"$style\">$espace".supprimer_tags($titre)."\n";
|
|
|
103 |
}
|
|
|
104 |
$premier = 0;
|
|
|
105 |
enfant($my_rubrique);
|
|
|
106 |
}
|
|
|
107 |
$i=$i-1;
|
|
|
108 |
}
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
$proposer_sites = lire_meta("proposer_sites");
|
|
|
113 |
|
|
|
114 |
$query = "SELECT * FROM spip_syndic WHERE id_syndic='$id_syndic'";
|
|
|
115 |
$result = spip_query($query);
|
|
|
116 |
if ($row = spip_fetch_array($result)) {
|
|
|
117 |
$id_syndic = $row["id_syndic"];
|
|
|
118 |
$id_rubrique = $row["id_rubrique"];
|
|
|
119 |
$nom_site = $row["nom_site"];
|
|
|
120 |
$url_site = $row["url_site"];
|
|
|
121 |
$url_syndic = $row["url_syndic"];
|
|
|
122 |
$descriptif = $row["descriptif"];
|
|
|
123 |
$syndication = $row["syndication"];
|
|
|
124 |
$extra=$row["extra"];
|
|
|
125 |
}
|
|
|
126 |
else {
|
|
|
127 |
$syndication = 'non';
|
|
|
128 |
$new = 'oui';
|
|
|
129 |
}
|
|
|
130 |
if (!$id_rubrique > 0) $id_rubrique = premiere_rubrique();
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
|
|
|
134 |
debut_page(_T('info_site_reference_2'), "documents", "sites");
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
debut_grand_cadre();
|
|
|
138 |
|
|
|
139 |
afficher_hierarchie($id_rubrique);
|
|
|
140 |
|
|
|
141 |
fin_grand_cadre();
|
|
|
142 |
|
|
|
143 |
|
|
|
144 |
debut_gauche();
|
|
|
145 |
debut_droite();
|
|
|
146 |
debut_cadre_formulaire();
|
|
|
147 |
|
|
|
148 |
|
|
|
149 |
echo "\n<table cellpadding=0 cellspacing=0 border=0 width='100%'>";
|
|
|
150 |
echo "<tr width='100%'>";
|
|
|
151 |
|
|
|
152 |
if ($new != 'oui') {
|
|
|
153 |
echo "<td>";
|
|
|
154 |
icone(_T('icone_retour'), "sites.php3?id_syndic=$id_syndic", 'site-24.gif', "rien.gif");
|
|
|
155 |
echo "</td>";
|
|
|
156 |
echo "<td>". http_img_pack('rien.gif', " ", "width='10'") . "</td>\n";
|
|
|
157 |
}
|
|
|
158 |
echo "<td width='100%'>";
|
|
|
159 |
echo _T('titre_referencer_site');
|
|
|
160 |
gros_titre($nom_site);
|
|
|
161 |
echo "</td></tr></table>";
|
|
|
162 |
echo "<p>";
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
|
166 |
if ($new == 'oui'){
|
|
|
167 |
|
|
|
168 |
$proposer_sites = lire_meta("proposer_sites");
|
|
|
169 |
if ($connect_statut == '0minirezo' OR $proposer_sites > 0) {
|
|
|
170 |
debut_cadre_relief("site-24.gif");
|
|
|
171 |
|
|
|
172 |
$link = new Link('sites.php3');
|
|
|
173 |
$link->addVar('id_rubrique', $id_rubrique);
|
|
|
174 |
$link->addVar('new', 'oui');
|
|
|
175 |
$link->addVar('redirect', $clean_link->getUrl());
|
|
|
176 |
$link->addVar('analyser_site', 'oui');
|
|
|
177 |
echo $link->getForm();
|
|
|
178 |
|
|
|
179 |
echo "<font face='Verdana,Arial,Sans,sans-serif' size=2>"._T('texte_referencement_automatique')."</font>";
|
|
|
180 |
echo "<div align='right'><input type=\"text\" name=\"url\" class='fondl' value=\"http://\">";
|
|
|
181 |
echo "<input type=\"submit\" name=\"submit\" value=\""._T('bouton_ajouter')."\" class='fondo'>";
|
|
|
182 |
|
|
|
183 |
fin_cadre_relief();
|
|
|
184 |
echo "</form>";
|
|
|
185 |
|
|
|
186 |
echo "<p><blockquote><b>"._T('texte_non_fonction_referencement')."</b>";
|
|
|
187 |
$cadre_ouvert = true;
|
|
|
188 |
debut_cadre_enfonce("site-24.gif");
|
|
|
189 |
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
}
|
|
|
193 |
|
|
|
194 |
|
|
|
195 |
$link = new Link($target);
|
|
|
196 |
$link->addVar('new');
|
|
|
197 |
$link->addVar('modifier_site', 'oui');
|
|
|
198 |
$link->addVar('syndication_old', $syndication);
|
|
|
199 |
echo $link->getForm('POST');
|
|
|
200 |
|
|
|
201 |
$nom_site = entites_html($nom_site);
|
|
|
202 |
$url_site = entites_html($url_site);
|
|
|
203 |
$url_syndic = entites_html($url_syndic);
|
|
|
204 |
|
|
|
205 |
echo _T('info_nom_site_2')."<br>";
|
|
|
206 |
echo "<input type='text' class='formo' name='nom_site' value=\"$nom_site\" size='40'><p>";
|
|
|
207 |
if (strlen($url_site)<8) $url_site="http://";
|
|
|
208 |
echo _T('entree_adresse_site')."<br>";
|
|
|
209 |
echo "<input type='text' class='formo' name='url_site' value=\"$url_site\" size='40'><p>";
|
|
|
210 |
|
|
|
211 |
|
|
|
212 |
|
|
|
213 |
if ($id_rubrique == 0) $logo_parent = "racine-site-24.gif";
|
|
|
214 |
else {
|
|
|
215 |
$query = "SELECT id_parent FROM spip_rubriques WHERE id_rubrique='$id_rubrique'";
|
|
|
216 |
$result=spip_query($query);
|
|
|
217 |
while($row=spip_fetch_array($result)){
|
|
|
218 |
$parent_parent=$row['id_parent'];
|
|
|
219 |
}
|
|
|
220 |
if ($parent_parent == 0) $logo_parent = "secteur-24.gif";
|
|
|
221 |
else $logo_parent = "rubrique-24.gif";
|
|
|
222 |
}
|
|
|
223 |
|
|
|
224 |
debut_cadre_couleur("$logo_parent", false, "", _T('entree_interieur_rubrique'));
|
|
|
225 |
|
|
|
226 |
// Integrer la recherche de rubrique au clavier
|
|
|
227 |
echo "<script language='JavaScript' type='text/javascript' src='filtery.js'></script>\n";
|
|
|
228 |
echo "<input type='text' size='10' style='font-size: 90%; width: 15%;' onkeyup=\"filtery(this.value,this.form.id_rubrique);\" onChange=\"filtery(this.value,this.form.id_rubrique);\"> ";
|
|
|
229 |
|
|
|
230 |
echo "<SELECT NAME='id_rubrique' style='font-size: 90%; width:80%; font-face:verdana,arial,helvetica,sans-serif; max-height: 24px;' SIZE=1>\n";
|
|
|
231 |
enfant(0);
|
|
|
232 |
echo "</select>\n";
|
|
|
233 |
fin_cadre_couleur();
|
|
|
234 |
|
|
|
235 |
echo "<p /><b>"._T('entree_description_site')."</b><br>";
|
|
|
236 |
echo "<textarea name='descriptif' rows='8' class='forml' cols='40' wrap=soft>";
|
|
|
237 |
echo $descriptif;
|
|
|
238 |
echo "</textarea>\n";
|
|
|
239 |
|
|
|
240 |
$activer_syndic = lire_meta("activer_syndic");
|
|
|
241 |
|
|
|
242 |
echo "<input type='hidden' name='syndication_old' value=\"$syndication\">";
|
|
|
243 |
|
|
|
244 |
if ($activer_syndic != "non") {
|
|
|
245 |
debut_cadre_enfonce();
|
|
|
246 |
if ($syndication == "non") {
|
|
|
247 |
echo "<INPUT TYPE='radio' NAME='syndication' VALUE='non' id='syndication_non' CHECKED>";
|
|
|
248 |
}
|
|
|
249 |
else {
|
|
|
250 |
echo "<INPUT TYPE='radio' NAME='syndication' VALUE='non' id='syndication_non'>";
|
|
|
251 |
}
|
|
|
252 |
echo " <b><label for='syndication_non'>"._T('bouton_radio_non_syndication')."</label></b><p>";
|
|
|
253 |
|
|
|
254 |
if ($syndication == "non") {
|
|
|
255 |
echo "<INPUT TYPE='radio' NAME='syndication' VALUE='oui' id='syndication_oui'>";
|
|
|
256 |
}
|
|
|
257 |
else {
|
|
|
258 |
echo "<INPUT TYPE='radio' NAME='syndication' VALUE='oui' id='syndication_oui' CHECKED>";
|
|
|
259 |
}
|
|
|
260 |
echo " <b><label for='syndication_oui'>"._T('bouton_radio_syndication')."</label></b>";
|
|
|
261 |
echo aide("rubsyn");
|
|
|
262 |
|
|
|
263 |
|
|
|
264 |
echo "<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td width=50> </td><td>";
|
|
|
265 |
|
|
|
266 |
if (strlen($url_syndic) < 8) $url_syndic = "http://";
|
|
|
267 |
echo _T('entree_adresse_fichier_syndication');
|
|
|
268 |
echo "<br>";
|
|
|
269 |
|
|
|
270 |
// cas d'une liste de flux detectee par feedfinder : menu
|
|
|
271 |
if (preg_match(',^select: (.+),', $url_syndic, $regs)) {
|
|
|
272 |
$feeds = explode(' ',$regs[1]);
|
|
|
273 |
echo "<select name='url_syndic'>\n";
|
|
|
274 |
foreach ($feeds as $feed) {
|
|
|
275 |
echo '<option value="'.entites_html($feed).'">'.$feed."</option>\n";
|
|
|
276 |
}
|
|
|
277 |
echo "</select>\n";
|
|
|
278 |
}
|
|
|
279 |
// cas normal
|
|
|
280 |
else {
|
|
|
281 |
echo "<INPUT TYPE='text' CLASS='formo' NAME='url_syndic' VALUE=\"$url_syndic\" SIZE='40'><P>";
|
|
|
282 |
echo "<INPUT TYPE='hidden' NAME='old_syndic' VALUE=\"$url_syndic\"";
|
|
|
283 |
}
|
|
|
284 |
echo "</td></tr></table>";
|
|
|
285 |
|
|
|
286 |
fin_cadre_enfonce();
|
|
|
287 |
}
|
|
|
288 |
else {
|
|
|
289 |
echo "<INPUT TYPE='Hidden' NAME='syndication' VALUE=\"$syndication\">";
|
|
|
290 |
echo "<INPUT TYPE='hidden' NAME='url_syndic' VALUE=\"$url_syndic\"";
|
|
|
291 |
}
|
|
|
292 |
|
|
|
293 |
|
|
|
294 |
if ($champs_extra) {
|
|
|
295 |
include_ecrire("inc_extra.php3");
|
|
|
296 |
extra_saisie($extra, 'sites', $id_secteur);
|
|
|
297 |
}
|
|
|
298 |
|
|
|
299 |
|
|
|
300 |
echo "<div ALIGN='right'><INPUT TYPE='submit' NAME='Valider' VALUE='"._T('bouton_enregistrer')."' CLASS='fondo'></div>";
|
|
|
301 |
echo "</FORM>";
|
|
|
302 |
|
|
|
303 |
if ($cadre_ouvert) {
|
|
|
304 |
fin_cadre_enfonce();
|
|
|
305 |
echo "</blockquote>\n";
|
|
|
306 |
}
|
|
|
307 |
|
|
|
308 |
fin_cadre_formulaire();
|
|
|
309 |
|
|
|
310 |
fin_page();
|
|
|
311 |
|
|
|
312 |
?>
|