#!/usr/bin/perl -w
#------------------------------------------------------------------------------
# /var/config/www/cgi-bin/show-menu.pl - displays a menu
#
# Copyright (c) 2004  eisfair webconf team
#
# Creation:     10.10.2004
# Last Update:  $Id$
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#------------------------------------------------------------------------------

use strict;
use CGI::Carp qw(fatalsToBrowser);
use webconf_base;
use navigation;
use menu;

no strict "subs";
do "conf.pl";
use strict "subs";

my @args = split(/&/,$ENV{'QUERY_STRING'});
my ($file, $package, $open) = ("", "", "");

foreach (0 .. $#args)
{
    if    ($args[$_] =~ /^package=(.*)/)   { $package = decode_string($1); }
    elsif ($args[$_] =~ /^file=(.*)/)      { $file    = decode_string($1); }
}

my $menu   = parse_menu($file, $package);
my $params = $menu->[0];
my $title  = $params->{"title"} || "eisfair setup";

print_head($title, $package, "class=\"index\"");
print_caption($title, $package, "class=\"index\"");
print_navigation("base", "setup.menu", "setup.services.menu");
render_menu($menu);
print_foot("class=\"index\"");

