The header_prive
pipeline is used to add content into the HTML <head>
section of pages in the private zone. It works like the insert_head pipeline.
The pipeline accepts a parameter and returns as output the contents of the HEAD section:
function prefixPlugin_header_prive($flux){
$flux .= "<!-- a comment for no reason at all! -->\n";
return $flux;
}
Example
The "Notations" plugin uses this hook to add CSS declarations for both private and public pages (it also uses 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;
}
The "Open Layers" plugin enables the use of ’Open Street Map’ maps and uses this function to load the necessary JavaScript code:
function openlayer_insert_head_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;
}