import sql-ledger 2.4.4
[freeside.git] / sql-ledger / bin / mozilla / menu.pl
index 67c18bd..fab2905 100644 (file)
@@ -1,6 +1,6 @@
 ######################################################################
 # SQL-Ledger Accounting
-# Copyright (c) 1998-2002
+# Copyright (c) 2001
 #
 #  Author: Dieter Simader
 #   Email: dsimader@sql-ledger.org
@@ -24,8 +24,6 @@
 #
 # two frame layout with refractured menu
 #
-# CHANGE LOG:
-#   DS. 2002-03-25  Created
 #######################################################################
 
 $menufile = "menu.ini";
@@ -38,16 +36,17 @@ use SL::Menu;
 
 sub display {
 
-  $framesize = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "135";
+  $menuwidth = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "155";
+  $menuwidth = $myconfig{menuwidth} if $myconfig{menuwidth};
 
-  $form->header;
+  $form->header(1);
 
   print qq|
 
-<FRAMESET COLS="$framesize,*" BORDER="1">
+<FRAMESET COLS="$menuwidth,*" BORDER="1">
 
-  <FRAME NAME="acc_menu" SRC="$form->{script}?login=$form->{login}&password=$form->{password}&action=acc_menu&path=$form->{path}">
-  <FRAME NAME="main_window" SRC="login.pl?login=$form->{login}&password=$form->{password}&action=company_logo&path=$form->{path}">
+  <FRAME NAME="acc_menu" SRC="$form->{script}?login=$form->{login}&sessionid=$form->{sessionid}&action=acc_menu&path=$form->{path}">
+  <FRAME NAME="main_window" SRC="am.pl?login=$form->{login}&sessionid=$form->{sessionid}&action=company_logo&path=$form->{path}">
 
 </FRAMESET>
 
@@ -99,14 +98,15 @@ sub section_menu {
 
     $label =~ s/.*--//g;
     $label = $locale->text($label);
-    $label =~ s/ /&nbsp;/g;
+    $label =~ s/ /&nbsp;/g if $label !~ /<img /i;
 
     $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
     
     if ($menu->{$item}{submenu}) {
+
       $menu->{$item}{$item} = !$form->{$item};
 
-      if ($form->{level} && $item =~ /^$form->{level}/) {
+      if ($form->{level} && $item =~ $form->{level}) {
 
         # expand menu
        print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
@@ -119,42 +119,40 @@ sub section_menu {
        print qq|<br>\n|;
 
       } else {
-       
+
        print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label&nbsp;...</a>|;
 
         # remove same level items
        map { shift @menuorder } grep /^$item/, @menuorder;
 
       }
-
       
     } else {
     
       if ($menu->{$item}{module}) {
-       if ($form->{$item} && $form->{level} eq $item) {
-         $menu->{$item}{$item} = !$form->{$item};
-         print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
-         
-         # remove same level items
-         map { shift @menuorder } grep /^$item/, @menuorder;
-         
-         &section_menu($menu, $item);
-
-       } else {
-         print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
-       }
+
+       print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
        
       } else {
-       
-       print qq|<br><b>$label</b>|;
+
+        $form->{tag}++;
+       print qq|<a name="id$form->{tag}"></a>
+       <p><b>$label</b>|;
        
        &section_menu($menu, $item);
 
        print qq|<br>\n|;
-       
+
       }
     }
   }
 }
 
 
+sub menubar {
+
+  1;
+
+}
+
+