<?php
// ---------------------------------------------------------------
// KwsPHP kOoGar Web System
// $Id$
// ---------------------------------------------------------------
// Creation par LSI
// ---------------------------------------------------------------
if (!(defined('__KWS__'

)) {die ('Erreur d\'appel de fichier.'

;}
/****Cherche tous les elements du bandeau****/
$requete=reqmysql('
SELECT *
FROM `modules`
WHERE `type` = "menu"
AND `emplacement`="-1"
ORDER BY `position` ASC
'

;
$i=0;
while ($ligne = mysql_fetch_object($requete))
{
$bloc_id = $ligne->emplacement;
if(get_grade()>=intval($ligne->afficher))
{
if ($ligne->module == 'lien' )
{
if (($ligne->parametre3<>''

AND ($ligne->parametre3<>'____.png'

and file_exists('./themes/'.$K_theme.'/images/menu/bandeau/'.$ligne->parametre3))
{
$ligne->parametre3 = './themes/'.$K_theme.'/images/menu/bandeau/'.$ligne->parametre3;
}
else
{
$ligne->parametre3 = '';
}
$blocs_contenu{$bloc_id}[$i] = (empty($ligne->parametre3) ? '' : '<img style="padding-right:3px" src="'.$ligne->parametre3.'" alt="Menu image" >'

.'<a href="'.htmlentities($ligne->parametre2).'"'.(substr($ligne->parametre2,0,7)=='http://' ? ' target="_blank"' : ''

.' class="menu" >'.ax($ligne->parametre1).'</a> ';
}
elseif ($ligne->module == 'separateur' )
{
$blocs_contenu{$bloc_id}[$i] = ' | ';
}
elseif ($ligne->module == 'texte' )
{
$blocs_contenu{$bloc_id}[$i] = bbcode($ligne->parametre4,1,1,0,1);
}
}
$i++;
}
$menu_bandeau = '';
if(count($blocs_contenu{$id_bloc}))
{
$a=0;
foreach($blocs_contenu{$id_bloc} as $i=>$t)
{
$menu_bandeau.= $t;
$a++;
}
}
/****Affiche le bloc***/
echo $menu_bandeau;
?>