affiche_milieu

This pipeline is used to add some content to SPIP’s exec/ pages. The new content is inserted after the content of the middle part of the page.

It is called as follows:

  1. echo pipeline('affiche_milieu',array(
  2. 'args'=>array('exec'=>'name_of_the_exec','id_objet'=>$object_id),
  3. 'data'=>''));

Download

Examples

The plugin "Sélection d’articles" uses it to add a form to the sections page to offer a selection of articles:

  1. function pb_selection_affiche_milieu($flux) {
  2. $exec = $flux["args"]["exec"];
  3.  
  4. if ($exec == "naviguer") {
  5. $id_rubrique = $flux["args"]["id_rubrique"];
  6. $contexte = array('id_rubrique'=>$id_rubrique);
  7. $ret = "<div id='pave_selection'>";
  8. $ret .= recuperer_fond("selection_interface", $contexte);
  9. $ret .= "</div>";
  10. $flux["data"] .= $ret;
  11. }
  12.  
  13. return $flux;
  14. }

Download

The plugin "statistiques" adds a configuration form inside SPIP’s configuration pages.

  1. function stats_affiche_milieu($flux){
  2. // displays the configuration ([de]activate the statistics).
  3. if ($flux['args']['exec'] == 'config_fonctions') {
  4. $compteur = charger_fonction('compteur', 'configuration');
  5. $flux['data'] .= $compteur();
  6. }
  7. return $flux;
  8. }

Download

Author Gilles Vincent Published : Updated : 09/02/10

Translations : English, français