Commit | Line | Data |
---|---|---|
c495c100 P |
1 | <?php |
2 | ||
3 | /***************************************************************************\ | |
4 | * SPIP, Systeme de publication pour l'internet * | |
5 | * * | |
6 | * Copyright (c) 2001-2007 * | |
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 | ||
17 | // http://doc.spip.org/@exec_breves_dist | |
18 | function exec_breves_dist() | |
19 | { | |
20 | global $couleur_foncee, $spip_lang_left, $spip_lang_right; | |
21 | ||
22 | charger_generer_url(); | |
23 | pipeline('exec_init',array('args'=>array('exec'=>'breves'),'data'=>'')); | |
24 | ||
25 | $commencer_page = charger_fonction('commencer_page', 'inc'); | |
26 | echo $commencer_page(_T('titre_page_breves'), "naviguer", "breves"); | |
27 | debut_gauche(); | |
28 | echo pipeline('affiche_gauche',array('args'=>array('exec'=>'breves'),'data'=>'')); | |
29 | creer_colonne_droite(); | |
30 | echo pipeline('affiche_droite',array('args'=>array('exec'=>'breves'),'data'=>'')); | |
31 | debut_droite(); | |
32 | ||
33 | $result=spip_query("SELECT * FROM spip_rubriques WHERE id_parent=0 ORDER BY 0+titre, titre"); | |
34 | ||
35 | while($row=spip_fetch_array($result)){ | |
36 | $id_rubrique=$row['id_rubrique']; | |
37 | $id_parent=$row['id_parent']; | |
38 | $titre=typo($row['titre']); | |
39 | $descriptif=$row['descriptif']; | |
40 | $texte=$row['texte']; | |
41 | $editable = autoriser('publierdans','rubrique',$id_rubrique); | |
42 | ||
43 | $statuts = "'prop', 'publie'" . ($editable ? ", 'refuse'": ""); | |
44 | ||
45 | $res = afficher_breves($titre.aide ("breves"), array("SELECT" => 'id_rubrique, id_breve, date_heure, titre, statut', "FROM" => 'spip_breves', 'WHERE' => "id_rubrique='$id_rubrique' AND statut IN ($statuts)", 'ORDER BY' => "date_heure DESC")); | |
46 | ||
47 | echo $res ; | |
48 | ||
49 | if ($editable) { | |
50 | if (!$res) echo bandeau_titre_boite2($titre, "breve-24.gif", $couleur_foncee, "white", false); | |
51 | echo "<div align='$spip_lang_right'>"; | |
52 | icone(_T('icone_nouvelle_breve'), generer_url_ecrire("breves_edit","new=oui&id_rubrique=$id_rubrique"), "breve-24.gif", "creer.gif"); | |
53 | echo "</div>"; | |
54 | } | |
55 | ||
56 | } | |
57 | echo pipeline('affiche_milieu',array('args'=>array('exec'=>'breves'),'data'=>'')); | |
58 | ||
59 | echo fin_gauche(), fin_page(); | |
60 | } | |
61 | ||
62 | ?> |