1 | <?php |
---|
2 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
3 | include_spip('inc/presentation'); |
---|
4 | include_spip('boussole_fonctions'); |
---|
5 | |
---|
6 | function exec_boussoles_dist() |
---|
7 | { |
---|
8 | if (!autoriser('configurer')) { |
---|
9 | include_spip('inc/minipres'); |
---|
10 | echo minipres(); |
---|
11 | die(); |
---|
12 | } |
---|
13 | |
---|
14 | $alias = _request('alias'); |
---|
15 | |
---|
16 | pipeline('exec_init',array('args'=>array('exec'=>'depots','id_depot'=>$id_depot),'data'=>'')); |
---|
17 | |
---|
18 | if (!$meta = sql_fetsel("valeur, maj", "spip_meta", "nom=" . sql_quote('boussole_infos_' . $alias))) { |
---|
19 | include_spip('inc/minipres'); |
---|
20 | echo minipres(_T('boussole:message_nok_boussole_inconnue', array('alias' => $alias))); |
---|
21 | } |
---|
22 | else { |
---|
23 | $boussole = unserialize($meta['valeur']); |
---|
24 | $boussole['maj'] = $meta['maj']; |
---|
25 | |
---|
26 | $commencer_page = charger_fonction('commencer_page', 'inc'); |
---|
27 | $entete = $commencer_page('« ' . boussole_traduire($boussole['alias'], 'nom_boussole') . ' »', 'configuration', 'boussoles'); |
---|
28 | $entete .= "<br />\n"; |
---|
29 | $entete .= "<br />\n"; |
---|
30 | |
---|
31 | // titre |
---|
32 | $entete .= gros_titre(_T('boussole:titre_page_edition_boussole'),'', false); |
---|
33 | |
---|
34 | // barre d'onglets |
---|
35 | $entete .= barre_onglets("boussoles", ""); |
---|
36 | |
---|
37 | $page = debut_gauche('accueil', true) |
---|
38 | . afficher_boussole($alias, $boussole) |
---|
39 | . "<br /><br /><div class='centered'>" |
---|
40 | . "</div>" |
---|
41 | . fin_gauche(); |
---|
42 | |
---|
43 | |
---|
44 | echo $entete, |
---|
45 | debut_grand_cadre(true), |
---|
46 | fin_grand_cadre(true), |
---|
47 | $page, |
---|
48 | fin_page(); |
---|
49 | } |
---|
50 | } |
---|
51 | |
---|
52 | |
---|
53 | function afficher_boussole($alias, $boussole) { |
---|
54 | global $spip_lang_right, $logo_libelles; |
---|
55 | |
---|
56 | $nom = boussole_traduire($alias, 'nom_boussole'); |
---|
57 | $slogan = boussole_traduire($alias, 'slogan_boussole'); |
---|
58 | $descriptif = boussole_traduire($alias, 'descriptif_boussole'); |
---|
59 | $url = $boussole['xml']; |
---|
60 | $version = $boussole['version']; |
---|
61 | $nbr_sites = $boussole['nbr_sites']; |
---|
62 | $maj = $boussole['maj']; |
---|
63 | |
---|
64 | $boite = pipeline ('boite_infos', |
---|
65 | array('data' => '', 'args' => array('type'=>'boussole', |
---|
66 | 'alias' => $alias, |
---|
67 | 'version' => $version, |
---|
68 | 'nbr_sites' => $nbr_sites, |
---|
69 | 'maj' => $maj))); |
---|
70 | |
---|
71 | $logo = recuperer_fond("prive/logo/boussole", array('alias' => $alias)); |
---|
72 | $navigation = debut_boite_info(true). $boite . fin_boite_info(true) |
---|
73 | . $logo |
---|
74 | . pipeline('affiche_gauche',array('args'=>array('exec'=>'boussoles', 'alias' => $alias),'data'=>'')); |
---|
75 | |
---|
76 | $extra = creer_colonne_droite('', true) |
---|
77 | . afficher_autres_boussoles($alias) |
---|
78 | . pipeline('affiche_droite',array('args'=>array('exec'=>'boussoles', 'alias' => $alias),'data'=>'')) |
---|
79 | . debut_droite('',true); |
---|
80 | |
---|
81 | $actions = ''; |
---|
82 | $haut = "<div class='bandeau_actions'>$actions</div>" . gros_titre($nom, '' , false); |
---|
83 | |
---|
84 | $onglet_contenu = afficher_corps_boussole($alias, $slogan, $descriptif, $url); |
---|
85 | $onglet_proprietes = ((!_INTERFACE_ONGLETS) ? "" :"") |
---|
86 | . pipeline('affiche_milieu',array('args'=>array('exec'=>'boussoles', 'alias' => $alias),'data'=>'')); |
---|
87 | |
---|
88 | $page = $navigation |
---|
89 | . $extra |
---|
90 | . "<div class='fiche_objet'>" |
---|
91 | . $haut |
---|
92 | . afficher_onglets_pages( |
---|
93 | array( |
---|
94 | 'voir' => _T('onglet_contenu'), |
---|
95 | 'props' => _T('onglet_proprietes') |
---|
96 | ), |
---|
97 | array( |
---|
98 | 'props' => $onglet_proprietes, |
---|
99 | 'voir' => $onglet_contenu) |
---|
100 | ) |
---|
101 | . "</div>"; |
---|
102 | |
---|
103 | $page .= recuperer_fond("prive/contenu/boussole_editer", array('alias' => $alias)); |
---|
104 | |
---|
105 | $page .= pipeline('affiche_enfants', array('args'=>array('exec'=>'boussoles', 'alias' => $alias),'data'=>'')); |
---|
106 | |
---|
107 | return $page; |
---|
108 | } |
---|
109 | |
---|
110 | function afficher_autres_boussoles($alias) { |
---|
111 | $bloc = recuperer_fond("prive/navigation/boussoles_autres", array('alias' => $alias)); |
---|
112 | return $bloc; |
---|
113 | } |
---|
114 | |
---|
115 | function afficher_corps_boussole($alias, $slogan, $descriptif, $url) { |
---|
116 | $corps = ''; |
---|
117 | $type = 'boussole'; |
---|
118 | $contexte = array('alias' => $alias, 'slogan'=>$slogan, 'descriptif'=>$descriptif, 'url'=>$url); |
---|
119 | $fond = recuperer_fond("prive/contenu/$type",$contexte); |
---|
120 | // Permettre a d'autres plugins de faire des modifs ou des ajouts |
---|
121 | $fond = pipeline('afficher_contenu_objet', |
---|
122 | array('args'=>array('type'=>$type, 'contexte'=>$contexte), 'data'=> $fond)); |
---|
123 | $corps .= "<div id='wysiwyg'>$fond</div>"; |
---|
124 | |
---|
125 | return $corps; |
---|
126 | } |
---|
127 | |
---|
128 | ?> |
---|