[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / inc / instituer_breve.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2011 *
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 // http://doc.spip.org/@inc_instituer_breve_dist
16 function inc_instituer_breve_dist($id_breve, $statut=-1)
17 {
18 if ($statut == -1) return "";
19
20 $liste_statuts = array(
21 // statut => array(titre,image)
22 'prop' => array(_T('item_breve_proposee'),''),
23 'publie' => array(_T('item_breve_validee'),''),
24 'refuse' => array(_T('item_breve_refusee'),'')
25 );
26 if (!in_array($statut, array_keys($liste_statuts)))
27 $liste_statuts[$statut] = array($statut,'');
28
29 $res =
30 "<ul id='instituer_breve-$id_breve' class='instituer_breve instituer'>"
31 . "<li>" . _T('entree_breve_publiee')
32 ."<ul>";
33
34 $href = redirige_action_auteur('editer_breve',$id_breve,'breves_voir', "id_breve=$id_breve");
35 foreach($liste_statuts as $s=>$affiche){
36 $href = parametre_url($href,'statut',$s);
37 if ($s==$statut)
38 $res .= "<li class='$s selected'>" . puce_statut($s) . $affiche[0] . '</li>';
39 else
40 $res .= "<li class='$s'><a href='$href' onclick='return confirm(confirm_changer_statut);'>" . puce_statut($s) . $affiche[0] . '</a></li>';
41 }
42
43 $res .= "</ul></li></ul>";
44 return $res;
45 }
46
47 ?>