[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / exec / mots_type.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2014 *
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_mots_type_dist
18 function exec_mots_type_dist()
19 {
20 $id_groupe= intval(_request('id_groupe'));
21
22 if (!$id_groupe) {
23 $type = $titre = filtrer_entites(_T('titre_nouveau_groupe'));
24 $row = array();
25 } else {
26 $row = sql_fetsel("id_groupe,titre", "spip_groupes_mots", "id_groupe=$id_groupe");
27 if ($row) {
28 $id_groupe = $row['id_groupe'];
29 $type = $row['titre'];
30 $titre = typo($type);
31 }
32 }
33
34 if (($id_groupe AND !$row) OR
35 !autoriser($id_groupe?'modifier' : 'creer', 'groupemots', $id_groupe)) {
36 include_spip('inc/minipres');
37 echo minipres();
38 } else {
39
40 pipeline('exec_init',array('args'=>array('exec'=>'mots_type','id_groupe'=>$id_groupe),'data'=>''));
41 $commencer_page = charger_fonction('commencer_page', 'inc');
42 echo $commencer_page("&laquo; $titre &raquo;", "naviguer", "mots");
43
44 echo debut_gauche('', true);
45
46 echo pipeline('affiche_gauche',array('args'=>array('exec'=>'mots_type','id_groupe'=>$id_groupe),'data'=>''));
47 echo creer_colonne_droite('', true);
48 echo pipeline('affiche_droite',array('args'=>array('exec'=>'mots_type','id_groupe'=>$id_groupe),'data'=>''));
49 echo debut_droite('', true);
50
51 $contexte = array(
52 'icone_retour'=>icone_inline(_T('icone_retour'), generer_url_ecrire("mots_tous") . "#mots_tous-$id_groupe", "groupe-mot-24.gif", "rien.gif",$GLOBALS['spip_lang_left']),
53 'titre'=>$type,
54 'redirect'=>generer_url_ecrire("mots_tous",""),
55 'new'=>_request('new') == "oui"?"oui":$id_groupe,
56 'config_fonc'=>'groupes_mots_edit_config',
57 );
58
59 echo recuperer_fond("prive/editer/groupe_mot", $contexte);
60
61 echo pipeline('affiche_milieu',
62 array('args' => array(
63 'exec' => 'mots_type',
64 'id_groupe' => $id_groupe
65 ),
66 'data'=>'')
67 ),
68 fin_gauche(),
69 fin_page();
70 }
71 }
72 ?>