summaryrefslogtreecommitdiff
path: root/scripts/menu.pl
blob: 4f5cbb8069879e40e7c56b42a7546ec11df28824 (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 display {
  12. my ($request) = @_;
  13. my $template;
  14. if (!$request->{menubar}){
  15. $request->{main} = "splash.html" if $request->{main} eq 'company_logo';
  16. $request->{main} = "am.pl?action=recurring_transactions"
  17. if $request->{main} eq 'recurring_transactions';
  18. $template = LedgerSMB::Template->new(
  19. user =>$request->{_user},
  20. locale => $request->{_locale},
  21. path => 'UI',
  22. template => 'frameset',
  23. format => 'HTML'
  24. );
  25. } else {
  26. # TODO: Create Lynx Initial Menu
  27. }
  28. $template->render($request);
  29. }
  30. sub expanding_menu {
  31. my ($request) = @_;
  32. my $menu = new LedgerSMB::Menu({base => $request});
  33. $menu->generate();
  34. my $template = LedgerSMB::Template->new(
  35. user => $request->{_user},
  36. locale => $request->{_locale},
  37. path => 'UI',
  38. template => 'menu_expand',
  39. format => 'HTML',
  40. );
  41. $template->render($menu);
  42. }
  43. 1;