Visualisation du fichier func_menu.php
<?php
function list_attr ($tab_attributs) {
$liste = "";
foreach($tab_attributs as $cle => $valeur)
{$liste = $liste." ".strtolower($cle)."=\"".$valeur."\"";}
return $liste;
}
function startElement ($parser, $name, $attrs){
switch ($name) {
case "MENU":
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"158\"> \n";
echo "<tr> <td width=\"11\"><img src=\"img/haut_gauche.jpg\" width=\"11\" height=\"15\" alt=\"\"></td>\n";
echo "<td width=\"142\" class=\"btiny\">".array_shift($attrs)."</td>\n"; // Le titre
echo "<td width=\"7\" align=\"right\"><img src=\"img/dh.gif\" width=\"7\" height=\"15\" alt=\"\"></td> </tr>\n";
break;
case "ITEM":
echo "<tr> <td width=\"10\"><img src=\"img/bg.jpg\" width=\"11\" height=\"15\" alt=\"\"></td>\n";
echo "<td width=\"138\"><a ".list_attr($attrs).">"; // Les éléments du lien
break;
}
}
function endElement ($parser, $name){
switch ($name) {
case "MENU":
echo "<tr>";
echo "<td><img src=\"img/bas_gauche.jpg\" width=\"11\" height=\"4\" alt=\"\"/></td>";
echo "<td colspan=\"2\" valign=\"bottom\"><img src=\"img/bas.jpg\" width=\"148\" height=\"4\" alt=\"\"/></td></tr>\n";
echo "<tr><td><br></td></tr></table>\n";
break;
case "ITEM":
echo "</a></td>\n<td align=\"right\" width=\"7\"><img src=\"img/db.gif\" width=\"1\" height=\"15\" alt=\"\"></td> </tr>\n";
break;
}
}
function cdata ($parser, $data_text){
echo $data_text;
}
function defaut (){return true;}
?>