Le pipeline header_prive
permet d’ajouter des contenus dans la partie <head>
des pages de l’espace privé. Il fonctionne comme le pipeline insert_head.
Le pipeline reçoit le contenu du HEAD et le retourne :
function prefixPlugin_header_prive($flux){
$flux .= "<!-- un commentaire pour rien ! -->\n";
return $flux;
}
Exemple
Le plugin « Notations » se sert de ce point d’entrée pour ajouter une CSS dans l’espace privé et dans l’espace public (avec insert_head
) :
function notation_header_prive($flux){
$flux = notation_insert_head($flux);
return $flux;
}
function notation_insert_head($flux){
$flux .= '<link rel="stylesheet" href="' . _DIR_PLUGIN_NOTATION .'css/notation.v2.css" type="text/css" media="all" />';
return $flux;
}
Le plugin « Open Layers » permettant d’utiliser des cartes Open Street Map l’utilise pour charger les javascripts nécessaires :
function openlayer_header_prive($flux){
$flux .= '<script type="application/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script type="application/javascript" src="' . _DIR_PLUGIN_OPENLAYER . 'js/openlayers.js"></script>
<script type="application/javascript" src="http://openstreetmap.org/openlayers/OpenStreetMap.js"></script>';
return $flux;
}