From 182af25edbe0f0d3f2fab4ea61465e552004c242 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 30 Aug 2007 19:25:09 +0000 Subject: Moving Menu.pm. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1476 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/DBObject/Menu.pm | 66 ++++++++++++++++++++++++++++++++++++++++++++++ LedgerSMB/Menu.pm | 66 ---------------------------------------------- 2 files changed, 66 insertions(+), 66 deletions(-) create mode 100644 LedgerSMB/DBObject/Menu.pm delete mode 100644 LedgerSMB/Menu.pm (limited to 'LedgerSMB') diff --git a/LedgerSMB/DBObject/Menu.pm b/LedgerSMB/DBObject/Menu.pm new file mode 100644 index 00000000..733d8f91 --- /dev/null +++ b/LedgerSMB/DBObject/Menu.pm @@ -0,0 +1,66 @@ +=head1 NAME + +LedgerSMB::Menu: Menu Handling Back-end Routines for LedgerSMB + +=head1 SYNOPSIS + +Provides the functions for generating the data structures for the LedgerSMB +menu. + +=head1 COPYRIGHT + +Copyright (c) 2007 The LedgerSMB Core Team. Licensed under the GNU General +Public License version 2 or at your option any later version. Please see the +included COPYRIGHT and LICENSE files for more information. + +=cut + +package LedgerSMB::DBObject::Menu; + +use Config::Std; +use base(qw(LedgerSMB::DBObject)); +1; + +=head1 METHODS + +=over + +=item LedgerSMB::Menu->new() + +Inherited from LedgerSMB::DBObject. Please see that documnetation for details. + +=item $menu->generate() + +This function returns a list of menu items. Each list item is a hashref: +keys %menu_item would return the equivalent of qw(position id level label path +args). Returns the complete list and sets $menu->{menu_items} to a referene to +th result set, This function does not return an entry for the top-level menu. + +=cut + +sub generate { + my ($self) = shift @_; + my @args; + + @{$self->{menu_items}} = $self->exec_method(funcname => 'menu_generate'); + + $self->debug({file => '/tmp/menu'}); + + shift @{$self->{menu_items}}; + + for my $attribute (@{$self->{menu_items}}){ + + @args = $self->_parse_array($attribute->{args}); + delete $attribute->{args}; + @{$attribute->{args}} = @args; + for (@{$attribute->{args}}){ + if ($_ =~ /(module|menu|action)=/){ + @elems = split(/=/, $_); + print STDERR join(','. @elems) . "\n"; + $attribute->{$elems[0]} = $elems[1]; + } + } + } + return @{$self->{menu_items}}; +} + diff --git a/LedgerSMB/Menu.pm b/LedgerSMB/Menu.pm deleted file mode 100644 index 733d8f91..00000000 --- a/LedgerSMB/Menu.pm +++ /dev/null @@ -1,66 +0,0 @@ -=head1 NAME - -LedgerSMB::Menu: Menu Handling Back-end Routines for LedgerSMB - -=head1 SYNOPSIS - -Provides the functions for generating the data structures for the LedgerSMB -menu. - -=head1 COPYRIGHT - -Copyright (c) 2007 The LedgerSMB Core Team. Licensed under the GNU General -Public License version 2 or at your option any later version. Please see the -included COPYRIGHT and LICENSE files for more information. - -=cut - -package LedgerSMB::DBObject::Menu; - -use Config::Std; -use base(qw(LedgerSMB::DBObject)); -1; - -=head1 METHODS - -=over - -=item LedgerSMB::Menu->new() - -Inherited from LedgerSMB::DBObject. Please see that documnetation for details. - -=item $menu->generate() - -This function returns a list of menu items. Each list item is a hashref: -keys %menu_item would return the equivalent of qw(position id level label path -args). Returns the complete list and sets $menu->{menu_items} to a referene to -th result set, This function does not return an entry for the top-level menu. - -=cut - -sub generate { - my ($self) = shift @_; - my @args; - - @{$self->{menu_items}} = $self->exec_method(funcname => 'menu_generate'); - - $self->debug({file => '/tmp/menu'}); - - shift @{$self->{menu_items}}; - - for my $attribute (@{$self->{menu_items}}){ - - @args = $self->_parse_array($attribute->{args}); - delete $attribute->{args}; - @{$attribute->{args}} = @args; - for (@{$attribute->{args}}){ - if ($_ =~ /(module|menu|action)=/){ - @elems = split(/=/, $_); - print STDERR join(','. @elems) . "\n"; - $attribute->{$elems[0]} = $elems[1]; - } - } - } - return @{$self->{menu_items}}; -} - -- cgit v1.2.3