Coding with SPIP 3.0
SPIP3.0 Technical Documentation

> > > > editer_contenu_objet

editer_contenu_objet

This pipeline is called during the display of a back-end form for a SPIP object. It is used to change the HTML content of that form. This pipeline is called as a CVT form loading parameter :

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

The pipeline passes:

  • the type (type) , the object identifier (id) and the compilation context (the contexte table) using the args table
  • the HTML code in the data key

Example

The "OpenID" plugin adds a data entry field into the author creation form:

  1. function openid_editer_contenu_objet($flux){
  2. if ($flux['args']['type']=='auteur') {
  3. $openid = recuperer_fond('formulaires/inc-openid', $flux['args']['contexte']);
  4. $flux['data'] = preg_replace('%(<li class="editer_email(.*?)</li>)%is', '<!--extra-->'."\n".$openid, $flux['data']);
  5. }
  6. return $flux;
  7. }

Download

  • Author :
  • Published :
  • Updated : 31/05/10
  • Translations : English, français