The contents of a (PHP) exec file

In the absence of a prive/exec/name.html SPIP template file, a call from the private zone to a ?exec=name page loads a exec_name_dist() function in a exec/name.php code file.

Such functions are mostly broken down as follows: the call to the start of the page, the declaration of a left column, a right column and a page centre. There are some pipelines that exist so that plugins will be able to add data to these page blocks.

Example of an empty "name" page

  1. <?php
  2. if (!defined("_ECRIRE_INC_VERSION")) return;
  3.  
  4. include_spip('inc/presentation');
  5.  
  6. function exec_nom_dist(){
  7.  
  8. // if not authorised: error message
  9. if (!autoriser('voir', 'nom')) {
  10. include_spip('inc/minipres');
  11. echo minipres();
  12. }
  13.  
  14. // initialisation pipeline
  15. pipeline('exec_init', array('args'=>array('exec'=>'nom'),'data'=>''));
  16.  
  17. // headers
  18. $commencer_page = charger_fonction('commencer_page', 'inc');
  19. // titre, partie, sous_partie (pour le menu)
  20. echo $commencer_page(_T('plugin:titre_nom'), "editer", "editer");
  21.  
  22. // title
  23. echo "<br /><br /><br />\n"; // outch ! aie aie aie ! au secours !
  24. echo gros_titre(_T('plugin:titre_nom'),'', false);
  25.  
  26. // left column
  27. echo debut_gauche('', true);
  28. echo pipeline('affiche_gauche', array('args'=>array('exec'=>'nom'),'data'=>''));
  29.  
  30. // right column
  31. echo creer_colonne_droite('', true);
  32. echo pipeline('affiche_droite', array('args'=>array('exec'=>'nom'),'data'=>''));
  33.  
  34. // centre
  35. echo debut_droite('', true);
  36.  
  37. // contents
  38. // ...
  39. echo "display whatever you want to here!";
  40. // ...
  41. // end of contents
  42.  
  43. echo pipeline('affiche_milieu', array('args'=>array('exec'=>'nom'),'data'=>''));
  44.  
  45. echo fin_gauche(), fin_page();
  46. }
  47. ?>

Download

Author Mark Baber Published : Updated : 16/02/10

Translations : English, français