|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/***************************************************************************\ |
|
4
|
|
|
* SPIP, Systeme de publication pour l'internet * |
|
5
|
|
|
* * |
|
6
|
|
|
* Copyright (c) 2001-2016 * |
|
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
|
|
|
if (!defined('_ECRIRE_INC_VERSION')) return; |
|
14
|
|
|
|
|
15
|
|
|
include_spip('inc/presentation'); |
|
16
|
|
|
include_spip('inc/forum'); |
|
17
|
|
|
|
|
18
|
|
|
// http://doc.spip.org/@exec_naviguer_dist |
|
19
|
|
|
function exec_naviguer_dist() |
|
20
|
|
|
{ |
|
21
|
|
|
exec_naviguer_args(intval(_request('id_rubrique')), |
|
22
|
|
|
_request('cherche_mot'), |
|
23
|
|
|
intval(_request('select_groupe'))); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
// http://doc.spip.org/@exec_naviguer_args |
|
27
|
|
|
function exec_naviguer_args($id_rubrique, $cherche_mot, $select_groupe) |
|
28
|
|
|
{ |
|
29
|
|
|
if (!$id_rubrique) { |
|
30
|
|
|
$lang = $statut = $titre = $extra = $id_parent=$id_secteur=''; |
|
|
|
|
|
|
31
|
|
|
$ze_logo = "racine-site-24.gif"; |
|
32
|
|
|
$row = array(); |
|
33
|
|
|
} else { |
|
34
|
|
|
$row = sql_fetsel('id_parent, id_secteur, titre, statut, lang, descriptif, texte', 'spip_rubriques', "id_rubrique=$id_rubrique"); |
|
35
|
|
|
|
|
36
|
|
|
if (!$row OR !autoriser('voir','rubrique',$id_rubrique)) { |
|
37
|
|
|
include_spip('inc/minipres'); |
|
38
|
|
|
echo minipres(); |
|
39
|
|
|
} else { |
|
40
|
|
|
$id_parent=$row['id_parent']; |
|
41
|
|
|
$id_secteur=$row['id_secteur']; |
|
42
|
|
|
$titre=$row['titre']; |
|
43
|
|
|
$statut = $row['statut']; |
|
44
|
|
|
$lang = $row["lang"]; |
|
45
|
|
|
|
|
46
|
|
|
if ($id_parent == 0) $ze_logo = "secteur-24.gif"; |
|
47
|
|
|
else $ze_logo = "rubrique-24.gif"; |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
if ($ze_logo) { |
|
52
|
|
|
pipeline('exec_init',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')); |
|
53
|
|
|
|
|
54
|
|
|
$commencer_page = charger_fonction('commencer_page', 'inc'); |
|
55
|
|
|
echo $commencer_page(($titre ? ("« ".textebrut(typo($titre))." »") : |
|
|
|
|
|
|
56
|
|
|
_T('titre_naviguer_dans_le_site')), |
|
57
|
|
|
"naviguer", |
|
58
|
|
|
"rubriques", |
|
59
|
|
|
$id_rubrique); |
|
60
|
|
|
|
|
61
|
|
|
echo debut_grand_cadre(true); |
|
62
|
|
|
if ($id_rubrique > 0) |
|
63
|
|
|
echo afficher_hierarchie($id_parent,_T('titre_cadre_interieur_rubrique'),$id_rubrique,'rubrique',$id_secteur,(!$GLOBALS['connect_toutes_rubriques'])); |
|
|
|
|
|
|
64
|
|
|
else $titre = _T('info_racine_site').": ". $GLOBALS['meta']["nom_site"]; |
|
65
|
|
|
|
|
66
|
|
|
echo fin_grand_cadre(true); |
|
67
|
|
|
|
|
68
|
|
|
echo debut_gauche('', true); |
|
69
|
|
|
|
|
70
|
|
|
$flag_editable = autoriser('publierdans','rubrique',$id_rubrique); |
|
71
|
|
|
|
|
72
|
|
|
if ($flag_editable AND !$id_parent) { |
|
73
|
|
|
list($from, $where) = critere_statut_controle_forum('prop', $id_rubrique); |
|
74
|
|
|
$n_forums = sql_countsel($from, $where); |
|
75
|
|
|
} else $n_forums = 0; |
|
76
|
|
|
|
|
77
|
|
|
changer_typo($lang); |
|
|
|
|
|
|
78
|
|
|
echo infos_naviguer($id_rubrique, $statut, $row, $n_forums); |
|
|
|
|
|
|
79
|
|
|
|
|
80
|
|
|
$iconifier = charger_fonction('iconifier', 'inc'); |
|
81
|
|
|
echo $iconifier('id_rubrique', $id_rubrique, 'naviguer', false, $flag_editable); |
|
82
|
|
|
|
|
83
|
|
|
|
|
84
|
|
|
echo pipeline('affiche_gauche',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')); |
|
85
|
|
|
|
|
86
|
|
|
echo creer_colonne_droite('', true); |
|
87
|
|
|
echo raccourcis_naviguer($id_rubrique, $id_parent); |
|
88
|
|
|
echo pipeline('affiche_droite',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')); |
|
89
|
|
|
echo debut_droite('', true); |
|
90
|
|
|
|
|
91
|
|
|
$haut = montre_naviguer($id_rubrique, $titre, $id_parent, $ze_logo, $flag_editable); |
|
|
|
|
|
|
92
|
|
|
|
|
93
|
|
|
$boucles = contenu_naviguer($id_rubrique, $id_parent, $ze_logo, $flag_editable); |
|
|
|
|
|
|
94
|
|
|
|
|
95
|
|
|
if ($id_rubrique > 0) { |
|
96
|
|
|
$editer_mots = charger_fonction('editer_mots', 'inc'); |
|
97
|
|
|
$editer_mots = $editer_mots('rubrique', $id_rubrique, $cherche_mot, $select_groupe, $flag_editable, true, 'naviguer'); |
|
98
|
|
|
} else $editer_mots = ''; |
|
99
|
|
|
|
|
100
|
|
|
echo naviguer_droite($row, $id_rubrique, $id_parent, $id_secteur, $haut, $n_forums, $editer_mots, $flag_editable, $boucles), |
|
101
|
|
|
fin_gauche(), |
|
102
|
|
|
fin_page(); |
|
103
|
|
|
} |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
// http://doc.spip.org/@naviguer_droite |
|
107
|
|
|
function naviguer_droite($row, $id_rubrique, $id_parent, $id_secteur, $haut, $n_forums, $editer_mots, $flag_editable, $boucles) |
|
|
|
|
|
|
108
|
|
|
{ |
|
109
|
|
|
global $spip_lang_right, $connect_toutes_rubriques; |
|
110
|
|
|
|
|
111
|
|
|
$onglet_proprietes = |
|
112
|
|
|
$editer_mots |
|
113
|
|
|
. langue_naviguer($id_rubrique, $id_parent, $flag_editable) |
|
114
|
|
|
. pipeline('affiche_milieu',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>'')) |
|
115
|
|
|
; |
|
116
|
|
|
|
|
117
|
|
|
$type = 'rubrique'; |
|
118
|
|
|
$contexte = array('id'=>$id_rubrique,'id_rubrique'=>$id_rubrique); |
|
119
|
|
|
$fond = recuperer_fond("prive/contenu/$type",$contexte); |
|
120
|
|
|
// permettre aux plugin de faire des modifs ou des ajouts |
|
121
|
|
|
$fond = pipeline('afficher_contenu_objet', |
|
122
|
|
|
array( |
|
123
|
|
|
'args'=>array( |
|
124
|
|
|
'type'=>$type, |
|
125
|
|
|
'id_objet'=>$id_rubrique, |
|
126
|
|
|
'contexte'=>$contexte), |
|
127
|
|
|
'data'=> $fond)); |
|
128
|
|
|
|
|
129
|
|
|
$onglet_contenu = "<div id='wysiwyg'>$fond</div>" |
|
130
|
|
|
. (_INTERFACE_ONGLETS? $boucles:""); |
|
131
|
|
|
|
|
132
|
|
|
include_spip('inc/presenter_enfants'); |
|
133
|
|
|
$onglet_enfants = |
|
134
|
|
|
afficher_enfant_rub($id_rubrique, false, true) |
|
135
|
|
|
.(_INTERFACE_ONGLETS?"": |
|
136
|
|
|
(autoriser('creerrubriquedans','rubrique',$id_rubrique)?"<div style='clear:$spip_lang_right;'>" . |
|
137
|
|
|
(!$id_rubrique |
|
138
|
|
|
? icone_inline(_T('icone_creer_rubrique'), generer_url_ecrire("rubriques_edit","new=oui&retour=nav"), "secteur-24.gif", "creer.gif",$spip_lang_right) |
|
139
|
|
|
: icone_inline(_T('icone_creer_sous_rubrique'), generer_url_ecrire("rubriques_edit","new=oui&retour=nav&id_parent=$id_rubrique"), "rubrique-24.gif", "creer.gif",$spip_lang_right)) |
|
140
|
|
|
."</div>":"")) |
|
141
|
|
|
. "<div class='nettoyeur'></div>" |
|
142
|
|
|
. $boucles; |
|
143
|
|
|
|
|
144
|
|
|
$onglet_enfants = pipeline('affiche_enfants',array('args'=>array('exec'=>'naviguer','id_rubrique'=>$id_rubrique),'data'=>$onglet_enfants)); |
|
145
|
|
|
|
|
146
|
|
|
$documenter_objet = charger_fonction('documenter_objet','inc'); |
|
147
|
|
|
$onglet_documents = |
|
148
|
|
|
($id_rubrique > 0 ? $documenter_objet($id_rubrique, "rubrique", 'naviguer', $flag_editable) :"" ) |
|
149
|
|
|
; |
|
150
|
|
|
|
|
151
|
|
|
if ($n_forums) |
|
152
|
|
|
$onglet_interactivite = icone_inline(_T('icone_suivi_forum', array('nb_forums' => $n_forums)), generer_url_ecrire("controle_forum","id_rubrique=$id_rubrique"), "suivi-forum-24.gif", "", 'center'); |
|
153
|
|
|
else $onglet_interactivite = ""; |
|
154
|
|
|
|
|
155
|
|
|
return |
|
156
|
|
|
pipeline('afficher_fiche_objet',array('args'=>array('type'=>'rubrique','id'=>$id_rubrique),'data'=> |
|
157
|
|
|
"<div class='fiche_objet'>". |
|
158
|
|
|
$haut. |
|
159
|
|
|
(_INTERFACE_ONGLETS? |
|
160
|
|
|
afficher_onglets_pages(array( |
|
161
|
|
|
'sousrub'=> _T('onglet_sous_rubriques'), |
|
162
|
|
|
'voir' => _T('onglet_contenu'), |
|
163
|
|
|
'props' => _T('onglet_proprietes'), |
|
164
|
|
|
'docs' => _T('onglet_documents'), |
|
165
|
|
|
'interactivite' => _T('onglet_interactivite')), |
|
166
|
|
|
array( |
|
167
|
|
|
'voir'=>$onglet_contenu, |
|
168
|
|
|
'sousrub'=>$onglet_enfants, |
|
169
|
|
|
'props'=>$onglet_proprietes, |
|
170
|
|
|
'docs'=>$onglet_documents, |
|
171
|
|
|
'interactivite'=>$onglet_interactivite |
|
172
|
|
|
)) |
|
173
|
|
|
:$onglet_contenu.$onglet_proprietes). |
|
174
|
|
|
"</div>". |
|
175
|
|
|
(_INTERFACE_ONGLETS?"":$onglet_enfants.$onglet_documents.$onglet_interactivite) |
|
176
|
|
|
)); |
|
177
|
|
|
} |
|
178
|
|
|
|
|
179
|
|
|
// http://doc.spip.org/@infos_naviguer |
|
180
|
|
|
function infos_naviguer($id_rubrique, $statut, $row, $n_forums) |
|
|
|
|
|
|
181
|
|
|
{ |
|
182
|
|
|
$boite = pipeline ('boite_infos', array('data' => '', |
|
183
|
|
|
'args' => array( |
|
184
|
|
|
'type'=>'rubrique', |
|
185
|
|
|
'id' => $id_rubrique, |
|
186
|
|
|
'row' => $row, |
|
187
|
|
|
'n_forums' => $n_forums |
|
188
|
|
|
) |
|
189
|
|
|
)); |
|
190
|
|
|
|
|
191
|
|
|
$navigation = |
|
192
|
|
|
($boite ?debut_boite_info(true). $boite . fin_boite_info(true):""); |
|
193
|
|
|
|
|
194
|
|
|
$res = sql_allfetsel("A.nom, A.id_auteur", "spip_auteurs AS A LEFT JOIN spip_auteurs_rubriques AS R ON A.id_auteur=R.id_auteur", "A.statut = '0minirezo' AND R.id_rubrique=$id_rubrique"); |
|
195
|
|
|
|
|
196
|
|
|
if (!$res) return $navigation; |
|
197
|
|
|
|
|
198
|
|
|
$img = http_img_pack('admin-12.gif','',''); |
|
199
|
|
|
foreach ($res as $k => $row) { |
|
200
|
|
|
$h = generer_url_ecrire('auteur_infos', "id_auteur=" .$row['id_auteur']); |
|
201
|
|
|
$res[$k] = "$img <a href='$h'>" . $row['nom'] . '</a>'; |
|
202
|
|
|
} |
|
203
|
|
|
$res = corriger_typo(join('<br />', $res)); |
|
204
|
|
|
|
|
205
|
|
|
$navigation .= debut_cadre_relief("fiche-perso-24.gif", true, '', _T('info_administrateurs')). $res . fin_cadre_relief(true); |
|
206
|
|
|
|
|
207
|
|
|
return $navigation; |
|
208
|
|
|
} |
|
209
|
|
|
|
|
210
|
|
|
|
|
211
|
|
|
// http://doc.spip.org/@raccourcis_naviguer |
|
212
|
|
|
function raccourcis_naviguer($id_rubrique, $id_parent) |
|
213
|
|
|
{ |
|
214
|
|
|
$res = icone_horizontale(_T('icone_tous_articles'), generer_url_ecrire("articles_page"), "article-24.gif", '',false); |
|
215
|
|
|
|
|
216
|
|
|
$n = sql_countsel('spip_rubriques'); |
|
217
|
|
|
if ($n) { |
|
218
|
|
View Code Duplication |
if (autoriser('creerarticledans','rubrique',$id_rubrique)) |
|
|
|
|
|
|
219
|
|
|
$res .= icone_horizontale(_T('icone_ecrire_article'), generer_url_ecrire("articles_edit","id_rubrique=$id_rubrique&new=oui"), "article-24.gif","creer.gif", false); |
|
220
|
|
|
|
|
221
|
|
|
$activer_breves = $GLOBALS['meta']["activer_breves"]; |
|
|
|
|
|
|
222
|
|
View Code Duplication |
if (autoriser('creerbrevedans','rubrique',$id_rubrique,NULL,array('id_parent'=>$id_parent))) { |
|
|
|
|
|
|
223
|
|
|
$res .= icone_horizontale(_T('icone_nouvelle_breve'), generer_url_ecrire("breves_edit","id_rubrique=$id_rubrique&new=oui"), "breve-24.gif","creer.gif", false); |
|
224
|
|
|
} |
|
225
|
|
|
} |
|
226
|
|
|
else { |
|
227
|
|
|
// Post-install = ici pas de rubrique, veuillez en creer une |
|
228
|
|
|
if (autoriser('creerrubriquedans','rubrique',$id_rubrique)) |
|
229
|
|
|
$res .= "<br />"._T('info_creation_rubrique'); |
|
230
|
|
|
} |
|
231
|
|
|
|
|
232
|
|
|
echo bloc_des_raccourcis($res); |
|
233
|
|
|
} |
|
234
|
|
|
|
|
235
|
|
|
// http://doc.spip.org/@langue_naviguer |
|
236
|
|
|
function langue_naviguer($id_rubrique, $id_parent, $flag_editable) |
|
237
|
|
|
{ |
|
238
|
|
|
$res = ""; |
|
239
|
|
|
if ($id_rubrique>0 AND $GLOBALS['meta']['multi_rubriques'] == 'oui' AND ($GLOBALS['meta']['multi_secteurs'] == 'non' OR $id_parent == 0) AND $flag_editable) { |
|
240
|
|
|
|
|
241
|
|
|
$row = sql_fetsel("lang, langue_choisie", "spip_rubriques", "id_rubrique=$id_rubrique"); |
|
242
|
|
|
$langue_rubrique = $row['lang']; |
|
243
|
|
|
$langue_choisie_rubrique = $row['langue_choisie']; |
|
|
|
|
|
|
244
|
|
|
$langue_parent = ''; |
|
245
|
|
|
if ($id_parent) { |
|
246
|
|
|
$row = sql_fetsel("lang", "spip_rubriques", "id_rubrique=$id_parent"); |
|
247
|
|
|
$langue_parent = $row['lang']; |
|
248
|
|
|
} |
|
249
|
|
|
if (!$langue_parent) |
|
250
|
|
|
$langue_parent = $GLOBALS['meta']['langue_site']; |
|
251
|
|
|
if (!$langue_rubrique) |
|
252
|
|
|
$langue_rubrique = $langue_parent; |
|
253
|
|
|
|
|
254
|
|
|
$res .= debut_cadre_enfonce('langues-24.gif', true); |
|
255
|
|
|
#$res .= bouton_block_depliable(_T('titre_langue_rubrique')." (".traduire_nom_langue($langue_rubrique).")",false,'languesrubrique'); |
|
256
|
|
|
|
|
257
|
|
|
#$res .= debut_block_depliable(false,'languesrubrique'); |
|
258
|
|
|
$res .= "<div class='langue'>"; |
|
259
|
|
|
if ($menu = liste_options_langues('changer_lang', $langue_rubrique, $langue_parent)) { |
|
260
|
|
|
$lien = redirige_action_auteur('instituer_langue_rubrique', "$id_rubrique-$id_parent","naviguer","id_rubrique=$id_rubrique"); |
|
261
|
|
|
$lien = ("\nonchange=\"document.location.href='$lien" . |
|
262
|
|
|
"&changer_lang='+this.options[this.selectedIndex].value\""); |
|
263
|
|
|
$res .= select_langues('changer_lang', $lien, $menu, _T('titre_langue_rubrique')); |
|
264
|
|
|
} |
|
265
|
|
|
$res .= "</div>\n"; |
|
266
|
|
|
#$res .= fin_block(); |
|
267
|
|
|
$res .= fin_cadre_enfonce(true); |
|
268
|
|
|
} |
|
269
|
|
|
return $res; |
|
270
|
|
|
} |
|
271
|
|
|
|
|
272
|
|
|
// http://doc.spip.org/@contenu_naviguer |
|
273
|
|
|
function contenu_naviguer($id_rubrique, $id_parent) { |
|
274
|
|
|
|
|
275
|
|
|
global $spip_lang_right; |
|
276
|
|
|
|
|
277
|
|
|
// |
|
278
|
|
|
// Verifier les boucles a mettre en relief |
|
279
|
|
|
// |
|
280
|
|
|
|
|
281
|
|
|
$relief = sql_countsel('spip_articles', "id_rubrique=$id_rubrique AND statut='prop'"); |
|
282
|
|
|
|
|
283
|
|
|
if (!$relief) { |
|
284
|
|
|
$relief = sql_countsel('spip_breves', "id_rubrique=$id_rubrique AND (statut='prepa' OR statut='prop')"); |
|
285
|
|
|
} |
|
286
|
|
|
|
|
287
|
|
|
if (!$relief AND $GLOBALS['meta']['activer_sites'] != 'non') { |
|
288
|
|
|
$relief = sql_countsel('spip_syndic', "id_rubrique=$id_rubrique AND statut='prop'"); |
|
289
|
|
|
} |
|
290
|
|
|
|
|
291
|
|
|
if (!$relief AND $GLOBALS['meta']['activer_syndic'] != 'non' |
|
292
|
|
|
AND autoriser('publierdans','rubrique',$id_rubrique)) { |
|
293
|
|
|
$relief = sql_countsel('spip_syndic', "id_rubrique=$id_rubrique AND (syndication='off' OR syndication='sus') AND statut='publie'"); |
|
294
|
|
|
} |
|
295
|
|
|
|
|
296
|
|
|
$res = ''; |
|
297
|
|
|
|
|
298
|
|
|
if ($relief) { |
|
299
|
|
|
|
|
300
|
|
|
$encours = ""; |
|
301
|
|
|
// |
|
302
|
|
|
// Les articles a valider |
|
303
|
|
|
// |
|
304
|
|
|
$encours .= afficher_objets('article',_T('info_articles_proposes'), array('WHERE' => "id_rubrique=$id_rubrique AND statut='prop'", 'ORDER BY' => "date DESC")); |
|
305
|
|
|
|
|
306
|
|
|
// |
|
307
|
|
|
// Les breves a valider |
|
308
|
|
|
// |
|
309
|
|
|
$encours .= afficher_objets('breve','<b>' . _T('info_breves_valider') . '</b>', array("FROM" => 'spip_breves', 'WHERE' => "id_rubrique=$id_rubrique AND (statut='prepa' OR statut='prop')", 'ORDER BY' => "date_heure DESC"), true); |
|
310
|
|
|
|
|
311
|
|
|
// |
|
312
|
|
|
// Les sites references a valider |
|
313
|
|
|
// |
|
314
|
|
View Code Duplication |
if ($GLOBALS['meta']['activer_sites'] != 'non') { |
|
|
|
|
|
|
315
|
|
|
$encours .= afficher_objets('site','<b>' . _T('info_site_valider') . '</b>', array("FROM" => 'spip_syndic', 'WHERE' => "id_rubrique=$id_rubrique AND statut='prop'", 'ORDER BY' => "nom_site")); |
|
316
|
|
|
} |
|
317
|
|
|
|
|
318
|
|
|
// |
|
319
|
|
|
// Les sites a probleme |
|
320
|
|
|
// |
|
321
|
|
View Code Duplication |
if ($GLOBALS['meta']['activer_sites'] != 'non' |
|
|
|
|
|
|
322
|
|
|
AND autoriser('publierdans','rubrique',$id_rubrique)) { |
|
323
|
|
|
|
|
324
|
|
|
$encours .= afficher_objets('site','<b>' . _T('avis_sites_syndiques_probleme') . '</b>', array('FROM' => 'spip_syndic', 'WHERE' => "id_rubrique=$id_rubrique AND (syndication='off' OR syndication='sus') AND statut='publie'", 'ORDER BY' => "nom_site")); |
|
325
|
|
|
} |
|
326
|
|
|
|
|
327
|
|
|
// Les articles syndiques en attente de validation |
|
328
|
|
|
if ($id_rubrique == 0 |
|
329
|
|
|
AND autoriser('publierdans','rubrique',$id_rubrique)) { |
|
330
|
|
|
|
|
331
|
|
|
$cpt = sql_countsel("spip_syndic_articles", "statut='dispo'"); |
|
332
|
|
View Code Duplication |
if ($cpt) |
|
|
|
|
|
|
333
|
|
|
$encours .= "<br /><small><a href='" . |
|
334
|
|
|
generer_url_ecrire("sites_tous") . |
|
335
|
|
|
"' style='color: black;'>" . |
|
336
|
|
|
$cpt . |
|
337
|
|
|
" " . |
|
338
|
|
|
_T('info_liens_syndiques_1') . |
|
339
|
|
|
" " . |
|
340
|
|
|
_T('info_liens_syndiques_2') . |
|
341
|
|
|
"</a></small>"; |
|
342
|
|
|
} |
|
343
|
|
|
|
|
344
|
|
|
$res .= debut_cadre_couleur_foncee("",true, "", _T('texte_en_cours_validation') |
|
345
|
|
|
. (($GLOBALS['meta']['forum_prive_objets'] != 'non') |
|
346
|
|
|
? ' '._T('texte_en_cours_validation_forum') |
|
347
|
|
|
: '' ) |
|
348
|
|
|
) |
|
349
|
|
|
. pipeline('rubrique_encours',array('args'=>array('type'=>'rubrique','id_objet'=>$id_rubrique),'data'=>$encours)) |
|
350
|
|
|
. fin_cadre_couleur(true); |
|
351
|
|
|
} |
|
352
|
|
|
|
|
353
|
|
|
$n = sql_countsel('spip_rubriques'); |
|
354
|
|
|
$bouton_article = $bouton_breves = $bouton_sites = ""; |
|
355
|
|
|
if ($n && !_INTERFACE_ONGLETS) { |
|
356
|
|
View Code Duplication |
if (autoriser('creerarticledans','rubrique',$id_rubrique)) |
|
|
|
|
|
|
357
|
|
|
$bouton_article .= icone_inline(_T('icone_ecrire_article'), generer_url_ecrire("articles_edit","id_rubrique=$id_rubrique&new=oui"), "article-24.gif","creer.gif", $spip_lang_right) |
|
358
|
|
|
. "<div class='nettoyeur'></div>"; |
|
359
|
|
|
|
|
360
|
|
|
$activer_breves = $GLOBALS['meta']["activer_breves"]; |
|
|
|
|
|
|
361
|
|
View Code Duplication |
if (autoriser('creerbrevedans','rubrique',$id_rubrique,NULL,array('id_parent'=>$id_parent))) |
|
|
|
|
|
|
362
|
|
|
$bouton_breves .= icone_inline(_T('icone_nouvelle_breve'), generer_url_ecrire("breves_edit","id_rubrique=$id_rubrique&new=oui"), "breve-24.gif","creer.gif", $spip_lang_right) |
|
363
|
|
|
. "<div class='nettoyeur'></div>"; |
|
364
|
|
|
|
|
365
|
|
View Code Duplication |
if (autoriser('creersitedans','rubrique',$id_rubrique)) |
|
|
|
|
|
|
366
|
|
|
$bouton_sites .= icone_inline(_T('info_sites_referencer'), generer_url_ecrire('sites_edit', "id_rubrique=$id_rubrique"), "site-24.gif", "creer.gif", $spip_lang_right) |
|
367
|
|
|
. "<div class='nettoyeur'></div>"; |
|
368
|
|
|
} |
|
369
|
|
|
|
|
370
|
|
|
////////// Les articles en cours de redaction |
|
371
|
|
|
///////////////////////// |
|
372
|
|
|
|
|
373
|
|
|
$res .= afficher_objets('article',_T('info_tous_articles_en_redaction'), array("WHERE" => "statut='prepa' AND id_rubrique=$id_rubrique", 'ORDER BY' => "date DESC")); |
|
374
|
|
|
|
|
375
|
|
|
|
|
376
|
|
|
////////// Les articles publies |
|
377
|
|
|
///////////////////////// |
|
378
|
|
|
|
|
379
|
|
|
define('_TRI_ARTICLES_RUBRIQUE', 'date DESC'); # 0+titre,titre |
|
380
|
|
|
$res .= afficher_objets('article',_T('info_tous_articles_presents'), array("WHERE" => "statut='publie' AND id_rubrique=$id_rubrique", 'ORDER BY' => _TRI_ARTICLES_RUBRIQUE)); |
|
381
|
|
|
|
|
382
|
|
|
// si une rubrique n'a pas/plus d'article publie, afficher les eventuels articles refuses |
|
383
|
|
|
// pour permettre de la vider et la supprimer eventuellement |
|
384
|
|
|
if (sql_countsel("spip_articles", "statut='publie' AND id_rubrique=".intval($id_rubrique), $groupby, $having)==0) |
|
|
|
|
|
|
385
|
|
|
$res .= afficher_objets('article',_T('info_tous_articles_refuses'), array("WHERE" => "statut='refuse' AND id_rubrique=$id_rubrique", 'ORDER BY' => _TRI_ARTICLES_RUBRIQUE)); |
|
386
|
|
|
|
|
387
|
|
|
$res .= $bouton_article; |
|
388
|
|
|
|
|
389
|
|
|
//// Les breves |
|
390
|
|
|
|
|
391
|
|
|
$res .= afficher_objets('breve','<b>' . _T('icone_ecrire_nouvel_article') . '</b>', array("FROM" => 'spip_breves', 'WHERE' => "id_rubrique=$id_rubrique AND statut != 'prop' AND statut != 'prepa'", 'ORDER BY' => "date_heure DESC")); |
|
392
|
|
|
$res .= $bouton_breves; |
|
393
|
|
|
|
|
394
|
|
|
//// Les sites references |
|
395
|
|
|
|
|
396
|
|
View Code Duplication |
if ($GLOBALS['meta']["activer_sites"] == 'oui') { |
|
|
|
|
|
|
397
|
|
|
$res .= afficher_objets('site','<b>' . _T('titre_sites_references_rubrique') . '</b>', array("FROM" => 'spip_syndic', 'WHERE' => "id_rubrique=$id_rubrique AND statut!='refuse' AND statut != 'prop' AND syndication NOT IN ('off','sus')", 'ORDER BY' => 'nom_site')); |
|
398
|
|
|
$res .= $bouton_sites; |
|
399
|
|
|
} |
|
400
|
|
|
return $res; |
|
401
|
|
|
} |
|
402
|
|
|
|
|
403
|
|
|
|
|
404
|
|
|
|
|
405
|
|
|
// http://doc.spip.org/@montre_naviguer |
|
406
|
|
|
function montre_naviguer($id_rubrique, $titre, $id_parent, $ze_logo, $flag_editable) |
|
407
|
|
|
{ |
|
408
|
|
|
global $spip_lang_right; |
|
409
|
|
|
|
|
410
|
|
|
if ($flag_editable |
|
411
|
|
|
AND $id_rubrique > 0) { |
|
412
|
|
|
$actions = icone_inline(_T('icone_modifier_rubrique'), |
|
413
|
|
|
generer_url_ecrire("rubriques_edit", |
|
414
|
|
|
"id_rubrique=$id_rubrique&retour=nav"), $ze_logo, "edit.gif", $spip_lang_right); |
|
415
|
|
|
|
|
416
|
|
|
// Supprimer cette rubrique (si vide) |
|
417
|
|
|
if (tester_rubrique_vide($id_rubrique)) |
|
418
|
|
|
$actions .= icone_inline(_T('icone_supprimer_rubrique'), |
|
419
|
|
|
redirige_action_auteur('supprimer', "rubrique-$id_rubrique", "naviguer","id_rubrique=$id_parent"), $ze_logo, "supprimer.gif", $spip_lang_right); |
|
420
|
|
|
} |
|
421
|
|
|
else |
|
422
|
|
|
$actions = ''; // rubrique non editable |
|
423
|
|
|
|
|
424
|
|
|
return |
|
425
|
|
|
"<div class='bandeau_actions'>$actions</div>" . |
|
426
|
|
|
gros_titre((!acces_restreint_rubrique($id_rubrique) ? '' : |
|
427
|
|
|
http_img_pack("admin-12.gif",'', "width='12' height='12'", |
|
428
|
|
|
_T('info_administrer_rubrique'))) . |
|
429
|
|
|
$titre,'', false) |
|
430
|
|
|
. "<div class='nettoyeur'></div>\n"; |
|
431
|
|
|
} |
|
432
|
|
|
|
|
433
|
|
|
// http://doc.spip.org/@tester_rubrique_vide |
|
434
|
|
|
function tester_rubrique_vide($id_rubrique) { |
|
435
|
|
|
if (sql_countsel('spip_rubriques', "id_parent=$id_rubrique")) |
|
436
|
|
|
return false; |
|
437
|
|
|
|
|
438
|
|
|
if (sql_countsel('spip_articles', "id_rubrique=$id_rubrique AND (statut<>'poubelle')")) |
|
439
|
|
|
return false; |
|
440
|
|
|
|
|
441
|
|
|
if (sql_countsel('spip_breves', "id_rubrique=$id_rubrique AND (statut='publie' OR statut='prop')")) |
|
442
|
|
|
return false; |
|
443
|
|
|
|
|
444
|
|
|
if (sql_countsel('spip_syndic', "id_rubrique=$id_rubrique AND (statut='publie' OR statut='prop')")) |
|
445
|
|
|
return false; |
|
446
|
|
|
|
|
447
|
|
|
if (sql_countsel('spip_documents_liens', "id_objet=".intval($id_rubrique)." AND objet='rubrique'")) |
|
448
|
|
|
return false; |
|
449
|
|
|
|
|
450
|
|
|
$compte = pipeline('objet_compte_enfants',array('args'=>array('objet'=>'rubrique','id_objet'=>$id_rubrique),'data'=>array())); |
|
451
|
|
|
foreach($compte as $objet => $n) |
|
452
|
|
|
if ($n) |
|
453
|
|
|
return false; |
|
454
|
|
|
|
|
455
|
|
|
return true; |
|
456
|
|
|
} |
|
457
|
|
|
|
|
458
|
|
|
// http://doc.spip.org/@bouton_supprimer_naviguer |
|
459
|
|
|
function bouton_supprimer_naviguer($id_rubrique, $id_parent, $ze_logo, $flag_editable) |
|
460
|
|
|
{ |
|
461
|
|
|
if (($id_rubrique>0) AND tester_rubrique_vide($id_rubrique) AND $flag_editable) |
|
462
|
|
|
return icone_inline(_T('icone_supprimer_rubrique'), redirige_action_auteur('supprimer', "rubrique-$id_rubrique", "naviguer","id_rubrique=$id_parent"), $ze_logo, "supprimer.gif") . "</div>"; |
|
463
|
|
|
return ""; |
|
464
|
|
|
} |
|
465
|
|
|
|
|
466
|
|
|
?> |
|
|
|
|
|
|
467
|
|
|
|
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.