1 ######################################################################
 
   2 # SQL-Ledger Accounting
 
   5 #  Author: Dieter Simader
 
   6 #   Email: dsimader@sql-ledger.org
 
   7 #     Web: http://www.sql-ledger.org
 
   9 #  Contributors: Christopher Browne
 
  11 # This program is free software; you can redistribute it and/or modify
 
  12 # it under the terms of the GNU General Public License as published by
 
  13 # the Free Software Foundation; either version 2 of the License, or
 
  14 # (at your option) any later version.
 
  16 # This program is distributed in the hope that it will be useful,
 
  17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  19 # GNU General Public License for more details.
 
  20 # You should have received a copy of the GNU General Public License
 
  21 # along with this program; if not, write to the Free Software
 
  22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
  23 #######################################################################
 
  25 # menu for text based browsers (lynx)
 
  28 #   DS. 2000-07-04  Created
 
  29 #   DS. 2001-08-07  access control
 
  30 #   CBB 2002-02-09  Refactored HTML out to subroutines
 
  31 #######################################################################
 
  33 $menufile = "menu.ini";
 
  44   $menu = new Menu "$menufile";
 
  45   $menu = new Menu "custom_$menufile" if (-f "custom_$menufile");
 
  46   $menu = new Menu "$form->{login}_$menufile" if (-f "$form->{login}_$menufile");
 
  48   @menuorder = $menu->access_control(\%myconfig);
 
  50   $form->{title} = "SQL-Ledger $form->{version}";
 
  54   $offset = int (21 - $#menuorder)/2;
 
  60   print qq|<center><table>|;
 
  62   map { print "<tr><td>".$menu->menuitem(\%myconfig, \%$form, $_).$locale->text($_).qq|</a></td></tr>|; } @menuorder;
 
  71   # display the company logo
 
  72 #  $argv = "login=$form->{login}&password=$form->{password}&path=$form->{path}&action=company_logo&noheader=1";
 
  73 #  exec "./login.pl", $argv;
 
  80   $menu = new Menu "$menufile", $form->{level};
 
  83   @menuorder = $menu->access_control(\%myconfig, $form->{level});
 
  85   foreach $item (@menuorder) {
 
  87     $item =~ s/^$form->{level}--//;
 
  88     push @neworder, $a unless ($item =~ /--/);
 
  90   @menuorder = @neworder;
 
  92   $level = $form->{level};
 
  95   $form->{title} = $locale->text($level);
 
  99   $offset = int (21 - $#menuorder)/2;
 
 101   print "\n" x $offset;
 
 104   print qq|<center><table>|;
 
 106   foreach $item (@menuorder) {
 
 108     $label =~ s/$form->{level}--//g;
 
 111     $menu->{$item}{target} = "";
 
 113     print "<tr><td>".$menu->menuitem(\%myconfig, \%$form, $item, $form->{level}).$locale->text($label)."</a></td></tr>";
 
 133   $menu = new Menu "$menufile", "";
 
 136   @menuorder = $menu->access_control(\%myconfig, "");
 
 139   map { push @neworder, $_ unless ($_ =~ /--/) } @menuorder;
 
 140   @menuorder = @neworder;
 
 143   $form->{script} = "menu.pl";
 
 145   foreach $item (@menuorder) {
 
 149     $menu->{$item}{target} = "";
 
 151     print $menu->menuitem(\%myconfig, \%$form, $item, "").$locale->text($label)." | ";