header_prive

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:

  1. function prefixPlugin_header_prive($flux){
  2. $flux .= "<!-- a comment for no reason at all! -->\n";
  3. return $flux;
  4. }

Download

Example

The "Notations" plugin uses this hook to add CSS declarations for both private and public pages (it also uses insert_head):

  1. function notation_header_prive($flux){
  2. $flux = notation_insert_head($flux);
  3. return $flux;
  4. }
  5.  
  6. function notation_insert_head($flux){
  7. $flux .= '<link rel="stylesheet" href="' . _DIR_PLUGIN_NOTATION .'css/notation.v2.css" type="text/css" media="all" />';
  8. return $flux;
  9. }

Download

The "Open Layers" plugin enables the use of ’Open Street Map’ maps and uses this function to load the necessary JavaScript code:

  1. function openlayer_insert_head_prive($flux){
  2. $flux .= '<script type="application/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script>
  3. <script type="application/javascript" src="' . _DIR_PLUGIN_OPENLAYER . 'js/openlayers.js"></script>
  4. <script type="application/javascript" src="http://openstreetmap.org/openlayers/OpenStreetMap.js"></script>';
  5. return $flux;
  6. }

Download

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

Translations : English, français