diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-06-27 01:28:23 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-06-27 01:28:23 +0000 |
commit | 80d758a1abf3d2b696fd14521726806236a2c2b6 (patch) | |
tree | 5a36c2e4368553fc87cd760cd30875d78e49e113 /scripts | |
parent | ca4e59a9c2e455bcb05d155e81cc10520d643341 (diff) |
Committing first-run of broken infrastructure
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1333 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/menu.pl | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/scripts/menu.pl b/scripts/menu.pl new file mode 100644 index 00000000..622c0cce --- /dev/null +++ b/scripts/menu.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl + +# This file is copyright (C) 2007the LedgerSMB core team and licensed under +# the GNU General Public License. For more information please see the included +# LICENSE and COPYRIGHT files + +package LedgerSMB::Scripts::menu; +our $VERSION = '0.1'; + +$menufile = "menu.ini"; +use LedgerSMB::Menu; +use LedgerSMB::Template; +use strict; + +sub display { + my ($request) = @_; + my $template; + if (!$request->{menubar}){ + $request->{main} = "splash.html" if $request->{main} eq 'company_logo'; + $request->{main} = "am.pl?action=recurring_transactions" + if $request->{main} eq 'recurring_transactions'; + $template = LedgerSMB::Template->new( + user =>$request->{_user}, + locale => $request->{_locale}, + path => 'UI', + template => 'frameset', + format => 'HTML' + ); + } else { + # TODO: Create Lynx Initial Menu + } + $template->render($request); +} + +sub expanding_menu { + my ($request) = @_; + my $menu = new LedgerSMB::Menu( + {files => ['menu.ini'], user => $request->{_user}} + ); + my $template = LedgerSMB::Template->new( + user => $request->{_user}, + locale => $request->{_locale}, + path => 'UI', + template => 'menu_expand', + format => 'HTML', + ); + $request->{menu_items} = []; + for (keys %$menu){ + push @{$request->{menu_items}}, $menu->{$_}; + } + $menu->debug({file => '/tmp/debug-menu'}); + $request->{menu_items} = {}; + $request->{menu_items}->{subs} = $menu; + $request->debug({file => '/tmp/debug'}); + $template->render($request); +} + +1; |