X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/29b19ab4e9ae10acadbb951d91c6570c73a1657a..adf1b8cbb7c9b2b49e73256ea66c6fed00e8466e:/bin/mozilla/menuXML.pl diff --git a/bin/mozilla/menuXML.pl b/bin/mozilla/menuXML.pl deleted file mode 100644 index 1eed4edeb..000000000 --- a/bin/mozilla/menuXML.pl +++ /dev/null @@ -1,155 +0,0 @@ -#===================================================================== -# LX-Office ERP -# Copyright (C) 2004 -# Based on SQL-Ledger Version 2.1.9 -# Web http://www.lx-office.org -# -###################################################################### -# SQL-Ledger Accounting -# Copyright (c) 1998-2002 -# -# Author: Dieter Simader -# Email: dsimader@sql-ledger.org -# Web: http://www.sql-ledger.org -# -# Contributors: Christopher Browne -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -####################################################################### -# -# three frame layout with refractured menu -# -# CHANGE LOG: -# DS. 2002-03-25 Created -# 2004-12-14 - New Optik - Marco Welter -# 2007-10-14 - XMLified - Holger Will -####################################################################### - -use utf8; - -use SL::Menu; - -use CGI::Carp qw(fatalsToBrowser); -use Encode; -use URI; - -use strict; - -1; - -# end of main - -sub display { - my $form = $main::form; - my %myconfig = %main::myconfig; - - my $charset = $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-1'; - my $callback = $form->unescape($form->{callback}); - $callback = URI->new($callback)->rel($callback) if $callback; - $callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/; - - my $text = $form->create_http_response('content_type' => 'text/xml', - 'charset' => $charset) - . qq| - -{iconv_utf8}->convert('ß') . qq|"> -{iconv_utf8}->convert('ä') . qq|"> -{iconv_utf8}->convert('ö') . qq|"> -{iconv_utf8}->convert('ü') . qq|"> -]> - - -$myconfig{name} -$form->{version} -$callback -$myconfig{dbname} - -|; - - my $fav = $myconfig{favorites}; - my @favorites = split m/;/, $fav; - foreach (@favorites) { - $text .= qq||; - } - - $text .= qq|\n| - . qq|\n| - . acc_menu() - . qq|\n| - . qq|\n|; - - print $text; -} - - -sub acc_menu { - my $form = $main::form; - - my $mainlevel = $form->{level}; - $mainlevel =~ s/$mainlevel--//g; - my $menu = Menu->new("menu.ini"); - - $| = 1; - - return print_menu($menu); -} - -sub print_menu { - my ($menu, $parent, $depth) = @_; - my $html; - - my $form = $main::form; - my %myconfig = %main::myconfig; - - die if ($depth * 1 > 5); - - my @menuorder; - - @menuorder = $menu->access_control(\%myconfig, $parent); - - $parent .= "--" if ($parent); - - foreach my $item (@menuorder) { - my $menu_item_id = $item; - substr($item, 0, length($parent)) = ""; - next if (($item eq "") || ($item =~ /--/)); - - my $menu_item = $menu->{"${parent}${item}"}; - my $menu_title = $::locale->text($item); - my $menu_text = $menu_title; - - my $target = "main_window"; - $target = $menu_item->{"target"} if ($menu_item->{"target"}); - - if ($menu_item->{"submenu"} || !defined($menu_item->{"module"}) || - ($menu_item->{"module"} eq "menu.pl")) { - - my $h = print_menu($menu, "${parent}${item}", $depth * 1 + 1)."\n"; - if (!$parent) { - $html .= qq|${h}\n|; - } else { - $html .= qq|${h}\n|; - } - } else { - $html .= qq|menuitem_XML(\%myconfig, $form, "${parent}$item", - { "title" => $menu_title, - "target" => $target }); - $html .= qq| name="${menu_text}" id='${menu_item_id}'/>\n|; - } - } - - return $html; -}