[SPIP] +spip v3.0.17
[lhc/web/clavette_www.git] / www / plugins-dist / compagnon / compagnon_messages.php
1 <?php
2
3 if (!defined('_ECRIRE_INC_VERSION')) return;
4
5
6 function compagnon_compagnon_messages($flux) {
7
8 $exec = $flux['args']['exec'];
9 $pipeline = $flux['args']['pipeline'];
10 $vus = $flux['args']['deja_vus'];
11 $aides = &$flux['data'];
12
13 switch ($pipeline) {
14
15 case 'affiche_milieu':
16 switch ($exec) {
17
18
19 case 'accueil':
20 $aides[] = array(
21 'id' => 'accueil',
22 'inclure' => 'compagnon/accueil',
23 'statuts'=> array('1comite', '0minirezo', 'webmestre')
24 );
25 $aides[] = array(
26 'id' => 'accueil_configurer',
27 'titre' => _T('compagnon:c_accueil_configurer_site'),
28 'texte' => _T('compagnon:c_accueil_configurer_site_texte', array('nom'=>$GLOBALS['meta']['nom_site'])),
29 'statuts'=> array('webmestre'),
30 'target' => '#bando_identite .nom_site_spip .nom',
31 );
32 $aides[] = array(
33 'id' => 'accueil_publication',
34 'titre' => _T('compagnon:c_accueil_publication'),
35 'texte' => _T('compagnon:c_accueil_publication_texte'),
36 'statuts'=> array('webmestre'),
37 'target'=> '#bando1_menu_edition',
38 );
39 break;
40
41
42 case 'rubriques':
43 // eviter si possible une requete sql.
44 if (!isset($vus['rubriques']) and !sql_countsel('spip_rubriques')) {
45 $aides[] = array(
46 'id' => 'rubriques',
47 'titre' => _T('compagnon:c_rubriques_creer'),
48 'texte' => _T('compagnon:c_rubriques_creer_texte'),
49 'statuts'=> array('webmestre'),
50 'target'=> '#contenu .icone:first-of-type',
51 );
52 }
53 break;
54
55
56 case 'rubrique':
57 // eviter si possible une requete sql.
58 if (!isset($vus['rubrique'])) {
59 $statut = sql_getfetsel('statut', 'spip_rubriques', 'id_rubrique='.$flux['args']['id_rubrique']);
60 if ($statut != 'publie') {
61 $aides[] = array(
62 'id' => 'rubrique',
63 'titre' => _T('compagnon:c_rubrique_publier'),
64 'texte' => _T('compagnon:c_rubrique_publier_texte'),
65 'statuts'=> array('webmestre'),
66 'target'=> '#contenu .icone.article-new-24'
67 );
68 }
69 }
70 break;
71
72 case 'articles':
73 // eviter si possible une requete sql.
74 if (!isset($vus['articles']) and !sql_countsel('spip_rubriques')) {
75 $aides[] = array(
76 'id' => 'articles',
77 'titre' => _T('compagnon:c_articles_creer'),
78 'texte' => _T('compagnon:c_articles_creer_texte'),
79 'statuts'=> array('webmestre')
80 );
81 }
82 break;
83
84 case 'article':
85 $aides[] = array(
86 'id' => 'article_redaction',
87 'inclure' => 'compagnon/article_redaction',
88 'statuts'=> array('0minirezo', 'webmestre')
89 );
90 $aides[] = array(
91 'id' => 'article_redaction_redacteur',
92 'inclure' => 'compagnon/article_redaction_redacteur',
93 'statuts'=> array('1comite')
94 );
95 break;
96 }
97 break;
98
99 case 'affiche_gauche':
100 switch ($exec) {
101 case 'job_queue':
102 $aides[] = array(
103 'id' => 'job_queue',
104 'titre' => _T('compagnon:c_job'),
105 'texte' => _T('compagnon:c_job_texte'),
106 'statuts'=> array('webmestre')
107 );
108 break;
109 }
110 break;
111 }
112
113
114 return $flux;
115 }
116
117 ?>