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:

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

Examples

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

function pb_selection_affiche_milieu($flux) {
	$exec = $flux["args"]["exec"];
 
	if ($exec == "naviguer") {
		$id_rubrique = $flux["args"]["id_rubrique"];
		$contexte = array('id_rubrique'=>$id_rubrique);
		$ret = "<div id='pave_selection'>";
		$ret .= recuperer_fond("selection_interface", $contexte);
		$ret .= "</div>";
		$flux["data"] .= $ret;
	}
 
	return $flux;
}

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

function stats_affiche_milieu($flux){
	// displays the configuration ([de]activate the statistics).
	if ($flux['args']['exec'] == 'config_fonctions') {
		$compteur = charger_fonction('compteur', 'configuration');
		$flux['data'] .= $compteur(); 
	}
	return $flux;
}

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

Translations : English, français