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 :

$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:

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

Author Mark Baber Published : Updated : 31/05/10

Translations : English, français