affiche_hierarchie

The "affiche_hierarchie" pipeline is used to modify or add to the HTML code for the breadcrumb path in the private zone. It accepts a certain number of data items in the args: the subject of its current identifier, if there is one, and possibly the identifier of the sector.

  1. $out = pipeline('affiche_hierarchie', array(
  2. 'args'=>array(
  3. 'id_parent'=>$id_parent,
  4. 'message'=>$message,
  5. 'id_objet'=>$id_objet,
  6. 'objet'=>$type,
  7. 'id_secteur'=>$id_secteur,
  8. 'restreint'=>$restreint),
  9. 'data'=>$out));

Download

Example

The "polyhiérarchie" plugin, which enables a section or article to have multiple parents, uses this pipeline to list the various parents for the section or article currently displayed:

  1. function polyhier_affiche_hierarchie($flux){
  2. $objet = $flux['args']['objet'];
  3. if (in_array($objet,array('article','rubrique'))){
  4. $id_objet = $flux['args']['id_objet'];
  5. include_spip('inc/polyhier');
  6. $parents = polyhier_get_parents($id_objet,$objet,$serveur='');
  7. $out = array();
  8. foreach($parents as $p)
  9. $out[] = "[->rubrique$p]";
  10. if (count($out)){
  11. $out = implode(', ',$out);
  12. $out = _T('polyhier:label_autres_parents')." ".$out;
  13. $out = PtoBR(propre($out));
  14. $flux['data'] .= "<div id='chemins_transverses'>$out</div>";
  15. }
  16.  
  17. }
  18. return $flux;
  19. }

Download

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

Translations : English, français