summaryrefslogtreecommitdiff
path: root/scripts/menu.pl
blob: ec96c307245fb1c971112ebd78163055d9219a6a (plain)
  1. #!/usr/bin/perl
  2. # This file is copyright (C) 2007the LedgerSMB core team and licensed under
  3. # the GNU General Public License. For more information please see the included
  4. # LICENSE and COPYRIGHT files
  5. package LedgerSMB::Scripts::menu;
  6. our $VERSION = '0.1';
  7. $menufile = "menu.ini";
  8. use LedgerSMB::Menu;
  9. use LedgerSMB::Template;
  10. use strict;
  11. sub __default {
  12. }
  13. sub display {
  14. my ($request) = @_;
  15. my $template;
  16. if (!$request->{menubar}){
  17. $request->{main} = "splash.html" if $request->{main} eq 'company_logo';
  18. $request->{main} = "am.pl?action=recurring_transactions"
  19. if $request->{main} eq 'recurring_transactions';
  20. $template = LedgerSMB::Template->new(
  21. user =>$request->{_user},
  22. locale => $request->{_locale},
  23. path => 'UI',
  24. template => 'frameset',
  25. format => 'HTML'
  26. );
  27. } else {
  28. # TODO: Create Lynx Initial Menu
  29. }
  30. $template->render($request);
  31. }
  32. sub expanding_menu {
  33. my ($request) = @_;
  34. my $menu = LedgerSMB::Menu->new({base => $request});
  35. $menu->generate();
  36. my $template = LedgerSMB::Template->new(
  37. user => $request->{_user},
  38. locale => $request->{_locale},
  39. path => 'UI',
  40. template => 'menu_expand',
  41. format => 'HTML',
  42. );
  43. $template->render($menu);
  44. }
  45. 1;