diff options
Diffstat (limited to 'sql-ledger/bin/lynx')
| -rw-r--r-- | sql-ledger/bin/lynx/menu.pl | 47 | 
1 files changed, 35 insertions, 12 deletions
diff --git a/sql-ledger/bin/lynx/menu.pl b/sql-ledger/bin/lynx/menu.pl index 559971685..16abe975e 100644 --- a/sql-ledger/bin/lynx/menu.pl +++ b/sql-ledger/bin/lynx/menu.pl @@ -1,12 +1,12 @@  ######################################################################  # SQL-Ledger Accounting -# Copyright (c) 2001 +# Copyright (c) 2000  #  #  Author: Dieter Simader  #   Email: dsimader@sql-ledger.org  #     Web: http://www.sql-ledger.org  # -#  Contributors: Christopher Browne +#  Contributors: Christopher Browne <cbrowne@acm.org>  #  # 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 @@ -24,10 +24,6 @@  #  # menu for text based browsers (lynx)  # -# CHANGE LOG: -#   DS. 2000-07-04  Created -#   DS. 2001-08-07  access control -#   CBB 2002-02-09  Refactored HTML out to subroutines  #######################################################################  $menufile = "menu.ini"; @@ -42,12 +38,14 @@ use SL::Menu;  sub display {    $menu = new Menu "$menufile"; +  $menu = new Menu "custom_$menufile" if (-f "custom_$menufile"); +  $menu = new Menu "$form->{login}_$menufile" if (-f "$form->{login}_$menufile");    @menuorder = $menu->access_control(\%myconfig);    $form->{title} = "SQL-Ledger $form->{version}"; -  $form->header; +  $form->header(1);    $offset = int (21 - $#menuorder)/2; @@ -66,17 +64,15 @@ sub display {  </html>  '; -  # display the company logo -#  $argv = "login=$form->{login}&password=$form->{password}&path=$form->{path}&action=company_logo&noheader=1"; -#  exec "./login.pl", $argv; -    }  sub section_menu {    $menu = new Menu "$menufile", $form->{level}; -   +  $menu = new Menu "custom_$menufile", $form->{level} if (-f "custom_$menufile"); +  $menu = new Menu "$form->{login}_$menufile", $form->{level} if (-f "$form->{login}_$menufile"); +    # build tiered menus    @menuorder = $menu->access_control(\%myconfig, $form->{level}); @@ -126,3 +122,30 @@ sub acc_menu {  } + +sub menubar { +  $menu = new Menu "$menufile", ""; +   +  # build menubar +  @menuorder = $menu->access_control(\%myconfig, ""); + +  @neworder = (); +  map { push @neworder, $_ unless ($_ =~ /--/) } @menuorder; +  @menuorder = @neworder; + +  print "<p>"; +  $form->{script} = "menu.pl"; + +  print "| "; +  foreach $item (@menuorder) { +    $label = $item; + +    # remove target +    $menu->{$item}{target} = ""; + +    print $menu->menuitem(\%myconfig, \%$form, $item, "").$locale->text($label)."</a> | "; +  } +   +} + +  | 
