# $Id$ # Common functions for the HotelGate project # Copyright (C) 2005 Jan Kratochvil # # 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; exactly version 2 of June 1991 is required # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA package product::hotelgate::Lib; require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; our $CVS_ID=q$Id$; use strict; use warnings; use My::Web; use Carp qw(cluck confess); use Exporter; our @EXPORT=qw(); Wrequire 'product::Lib'; our @ISA=qw(product::Lib Exporter); sub menu($;%) { my($class,%args)=@_; my $r=""; $r.=''."\n"; $r.=''; $r.=''."\n"; $r.='
'; $r.=''."\n"; $r.=''."\n"; $r.=''."\n"; $r.=''."\n"; $r.='
'."\n"; my $ListItem=product::Lib->name_to_hashref($W->{"product_name"}); $r.=product::Lib->title($ListItem); $r.='
'; $r.='
'; $r.=''."\n"; $r.=''."\n"; my @sections=( "Index"=>"Overview", "Case"=>"Deployment", "Screenshot"=>"Screenshots", "Spec"=>"Specification", "Order"=>"Order", ); while (@sections) { my $section_path=shift @sections; my $section_name=shift @sections; my $chosen=($My::Web::W->{"__PACKAGE__"} eq "product::hotelgate::".$section_path); $r.='\n"; } $r.=''."\n"; $r.='
'; $r.=(($chosen || "") ? "$section_name" : My::Web::a_href("./".($section_path eq "Index" ? "" : $section_path.".pm"),$section_name, "attr"=>'style="text-decoration: inherit; /* revoke underline */;"')); $r.="
'."\n"; $r.='
'."\n"; if (!$args{"novskip"}) { Wrequire 'WebConfig'; $r.=WebConfig->vskip_hr(); } return $r; } sub init($%) { my($class,%args)=@_; $args{"__PACKAGE__"}||=caller(); my $W=$class->SUPER::init( %args, "novskip"=>1, ); print $class->menu(%args); return $W; } 1;