This pipeline is used to add tabs to the exec pages in the private zone. It is not so nearly useful since the creation of the <onglet> tag in the plugin.xml file (see Defining page tabs).

return pipeline('ajouter_onglets', array('data'=>$onglets,'args'=>$script));

The "ajouter_onglets" pipeline accepts a table of couples of "tab identifier / tab description" (PHP class of Bouton), but also an identifier for the tab toolbar (in args).

// add a tab to SPIP's configuration page
function plugin_ajouter_onglets($flux){
	if ($flux['args']=='identifiant')
		$flux['data']['identifiant_bouton']= new Bouton("mon/image.png", "titre de l'onglet"), 'url');
	return $flux;

The third url parameter for the Bouton class is optional. By default it will be an "exec" page with the same name as the provided identifier (ecrire/?exec=identifier).

In the exec pages, a toolbar is called with two arguments: the identifier of the desired toolbar and the identifier of the active tab:

echo barre_onglets("tab toolbar identifier", "active tab identifier");
echo barre_onglets("configuration", "contents");


The "Agenda" plugin modifies the default tabs for SPIP’s calendar by using this pipeline:

function agenda_ajouter_onglets($flux) {
	$flux['data']['agenda']= new Bouton(
		_DIR_PLUGIN_AGENDA . '/img_pack/agenda-24.png',
	$flux['data']['calendrier'] = new Bouton(
		generer_url_ecrire("calendrier", "mode=editorial&type=semaine"));
return $flux;

Migration to the new system
To rewrite this example in the new system, 2 things need to be separated: the declaration of the button, and the authorisation to see it or not. The declaration is made in the plugin.xml file:

<onglet id="agenda" parent="calendrier">
<onglet id="calendrier" parent="calendrier">

The authorisation is relocated into a special function (use the autoriser pipeline to define it):

function autoriser_calendrier_onglet_dist($faire, $type, $id, $qui, $opt) {
	return true;
function autoriser_agenda_onglet_dist($faire, $type, $id, $qui, $opt) {
	return true;

Author Mark Baber Published : Updated : 12/03/23

Translations : English, français