<?php
/*
Copyright (C) 2008 by oscim   Project lossim  [ 15.09.2009, 09:17:59] @oscim
// kate: replace-trailing-space-save true; space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; word-wrap-marker-color #41C2A4
ENCODE UTF-8
*/
/**
  Gestion du fil d'ariane

  @package lossim <web http://www.lossim.org>
  @author oscim <mail dom@oscim.fr > <web http://www.oscim.fr>

  NOTE:
*/
function fil_rouge ($dest_actuel,$max_liste=3) {
  $cache = new HDAcache( 3600 ,'filrouge'._USER_PERSO__LOGIN , 86400 );
  if (! $cache->start_cache() ) {
  $form = " >> <a class='localisation' href='".URL_ADMIN."%1\$s' >%2\$s</a>";
  $g='<a class="localisation" href="'.URL_ADMIN._FILENAME_ADMIN.'">'.LOCALISATION.'</a> |';
  $local=array();$var='';$i=0;
  $dest_actuel.= (isset($_GET['module'])) ? '.php?module='.$_GET['module'] : '.php';

  if (is_register_session('localisation')) {
    $t=value_in_session('localisation');
    $max=count($t);
    $tep=($max>$max_liste) ? array_slice ($t,($max-$max_liste)) : $t ;
    while ($row = each($tep)){
      $g .= sprintf($form,$row['value'],  str_replace('.php','',$row['value']));
      $local[$i] = $row['value'];
      $i++;
    }
    if (!in_array($dest_actuel,$tep)) array_push($local,$dest_actuel);
  } else{
    $g .= sprintf($form,$dest_actuel,  str_replace('.php','',$dest_actuel));
    array_push($local,$dest_actuel);
  }
  add_in_session('localisation',$local);
  print $g;
  $cache->end_cache();
  }
}
?>