Coding with SPIP 2.1
SPIP 2.1 Technical Documentation

> > > > Pipelines used for loading

Pipelines used for loading

formulaire_charger

This pipeline makes it possible to modify the table of values returned by the charger function for a form. It is more fully described in the chapter about pipelines: formulaire_charger

paramètre _pipeline

This parameter makes it possible to modify the HTML code published by making it pass through a specific pipeline. This data, sent in the loading table, makes it possible to specify the name of a pipeline and the arguments to be passed to it. It will be called at the time the form text is displayed.

Example

SPIP uses the parameter in a generic fashion by making all publication forms that call the formulaires_editer_objet_charger() function pass through a pipeline named editer_contenu_objet. This pipeline is described in its own special article: editer_contenu_objet.

  1. $contexte['_pipeline'] = array('editer_contenu_objet', array('type'=>$type, 'id'=>$id));

The CFG plugin uses this parameter to make all the CFG forms written as CVT forms pass through the editer_contenu_formulaire_cfg pipeline.

  1. $valeurs['_pipeline'] = array('editer_contenu_formulaire_cfg',
  2. 'args'=>array(
  3. 'nom'=>$form,
  4. 'contexte'=>$valeurs,
  5. 'ajouter'=>$config->param['inline'])
  6. );

Download

The pipeline that CFG then uses to collect the contents not necessary in the transmitted HTML:

  1. // pipeline for the display of content
  2. // to delete the CFG parameters from the form
  3. function cfg_editer_contenu_formulaire_cfg($flux){
  4. $flux['data'] = preg_replace('/(<!-- ([a-z0-9_]\w+)(\*)?=)(.*?)-->/sim', '', $flux['data']);
  5. $flux['data'] .= $flux['args']['ajouter'];
  6. return $flux;
  7. }

Download

  • Author :
  • Published :
  • Updated : 02/06/10
  • Translations : English, français