3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2014 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
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 \***************************************************************************/
13 if (!defined('_ECRIRE_INC_VERSION')) return;
16 * Un exec generique qui utilise le fond homonyme de l'exec demande
19 function exec_fond_dist(){
21 exec_fond_args(_request('exec'));
24 function exec_fond_args($exec){
26 $fond = trim(recuperer_fond("prive/exec/$exec", $_REQUEST));
28 // c'est au fond de les gerer avec #AUTORISER,
29 // et de renvoyer un fond vide le cas echeant
30 // qui declenchera un minipres acces interdit
32 include_spip('inc/minipres');
36 $titre = "exec_$exec";
40 // recuperer le titre dans le premier hn de la page
41 if (preg_match(",<h[1-6][^>]*>(.+)</h[1-6]>,Uims",$fond,$match)){
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);
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);
57 // recuperer les extras (colonne de droite)
58 if (preg_match(",<!--#extra-->.+<!--/#extra-->,Uims",$fond,$match)){
60 $fond = str_replace($extra,"",$fond);
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);
68 echo debut_grand_cadre(true);
78 echo fin_grand_cadre(true);
81 echo debut_gauche("exec_$exec",true);
82 $contexte = array('exec'=>$exec);
83 $objet = objet_type(preg_replace(",_edit$,","",$exec));
84 $id = id_table_objet($objet);
86 $contexte[$id] = _request($id);
89 echo pipeline('affiche_gauche',array('args'=>$contexte,'data'=>''));
91 echo creer_colonne_droite("exec_$exec",true);
93 echo pipeline('affiche_droite',array('args'=>$contexte,'data'=>''));
95 echo debut_droite("exec_$exec",true);
97 echo pipeline('affiche_milieu',array('args'=>$contexte,'data'=>''));
99 echo fin_gauche(),fin_page();