[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / ecrire / exec / fond_monobloc.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2016 *
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 /**
16 * Un exec generique qui utilise le fond homonyme de l'exec demande
17 * dans l'url
18 * Ancien systeme transitoire base sur un squelette unique avec un
19 * pseudo balisage par commentaires html
20 * deprecie, ne plus utiliser
21 *
22 */
23 function exec_fond_monobloc_dist(){
24
25 // pas d'autorisation
26 // c'est au fond de les gerer avec #AUTORISER, et de renvoyer un fond vide le cas echeant
27 // qui declenchera un minipres acces interdit
28 $exec = _request('exec');
29 $fond = trim(recuperer_fond("prive/exec/$exec",$_REQUEST));
30 if (!$fond) {
31 include_spip('inc/minipres');
32 echo minipres();
33 } else {
34
35 $titre = "exec_$exec";
36 $hierarchie = "";
37 $navigation = "";
38 $extra = "";
39
40 // recuperer le titre dans le premier hn de la page
41 if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims",$fond,$match)){
42 $titre = $match[1];
43 }
44
45 // recuperer la hierarchie (au-dessus du contenu)
46 if (preg_match(",<!--#hierarchie-->.+<!--/#hierarchie-->,Uims",$fond,$match)){
47 $hierarchie = $match[0];
48 $fond = str_replace($hierarchie,"",$fond);
49 }
50
51 // recuperer la navigation (colonne de gauche)
52 if (preg_match(",<!--#navigation-->.+<!--/#navigation-->,Uims",$fond,$match)){
53 $navigation = $match[0];
54 $fond = str_replace($navigation,"",$fond);
55 }
56
57 // recuperer les extras (colonne de droite)
58 if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims",$fond,$match)){
59 $extra = $match[0];
60 $fond = str_replace($extra,"",$fond);
61 }
62
63 include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini
64 $commencer_page = charger_fonction('commencer_page','inc');
65 echo $commencer_page($titre);
66
67 if ($hierarchie){
68 echo debut_grand_cadre(true);
69 echo pipeline(
70 'affiche_hierarchie',
71 array(
72 'args' => array(
73 'exec' => $exec
74 ),
75 'data' => $hierarchie
76 )
77 );
78 echo fin_grand_cadre(true);
79 }
80
81 echo debut_gauche("exec_$exec",true);
82
83 $contexte = array('exec'=>$exec);
84 if ($objet_exec = trouver_objet_exec($exec)){
85 $id = $objet_exec['id_table_objet'];
86 if (_request($id))
87 $contexte[$id] = _request($id);
88 }
89
90 echo $navigation;
91 echo pipeline('affiche_gauche',array('args'=>$contexte,'data'=>''));
92
93 echo creer_colonne_droite("exec_$exec",true);
94 echo $extra;
95 echo pipeline('affiche_droite',array('args'=>$contexte,'data'=>''));
96
97 echo debut_droite("exec_$exec",true);
98 echo $fond;
99 echo pipeline('affiche_milieu',array('args'=>$contexte,'data'=>''));
100
101 echo fin_gauche(),fin_page();
102 }
103 }
104
105 ?>