1 #=====================================================================
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
7 ######################################################################
8 # SQL-Ledger Accounting
9 # Copyright (c) 1998-2002
11 # Author: Dieter Simader
12 # Email: dsimader@sql-ledger.org
13 # Web: http://www.sql-ledger.org
15 # Contributors: Christopher Browne
17 # This program is free software; you can redistribute it and/or modify
18 # it under the terms of the GNU General Public License as published by
19 # the Free Software Foundation; either version 2 of the License, or
20 # (at your option) any later version.
22 # This program is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write to the Free Software
28 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #######################################################################
31 # thre frame layout with refractured menu
34 # DS. 2002-03-25 Created
35 # 2004-12-14 - Holger Lindemann
36 #######################################################################
38 $menufile = "menu.ini";
40 use CGI::Carp qw(fatalsToBrowser);
55 <iframe id="win1" src="login.pl?action=company_logo" width="100%" height="93%" name="main_window" style="position: absolute; border:0px;">
56 <p>Ihr Browser kann leider keine eingebetteten Frames anzeigen.
68 $fensterlink="menujs.pl?action=display";
69 $fenster = "["."<a href=\"$fensterlink\" target=\"_blank\">neues Fenster</a>]";
73 . " - <a href=\"login.pl?action=logout\" target=\"_top\">"
74 . $locale->text('Logout')
76 my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
77 $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
79 my $CTIME_String = localtime(time);
82 $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
83 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
85 my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
86 "Donnerstag", "Freitag", "Samstag");
87 my @Monatsnamen = ("", "Januar", "Februar", "März",
88 "April", "Mai", "Juni", "Juli",
89 "August", "September", "Oktober", "November",
92 $Wochentage[$Wochentag] . ", der "
97 #$zeit="<div id='Uhr'>".$Stunden.":".$Minuten.":".$Sekunden."</div>";
98 $zeit = "<div id='Uhr'>" . $Stunden . ":" . $Minuten . "</div>";
100 <script type="text/javascript">
103 var now = new Date();
104 var h = now.getHours();
105 var m = now.getMinutes();
106 document.getElementById('clock_id').innerHTML = (h<10?'0'+h:h)+":"+(m<10?'0'+m:m);
107 var timer=setTimeout("clockon()", 10000);
109 window.onload=clockon
112 <table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
114 <td style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;"> $fenster [<a href="JavaScript:top.main_window.print()">drucken</a>]</td>
115 <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>
116 $login $datum <span id='clock_id' style='position:relative'></span>
124 $locale = Locale->new($language, "menu");
125 $mainlevel = $form->{level};
126 $mainlevel =~ s/$mainlevel--//g;
127 my $menu = new Menu "$menufile";
136 border: 1px solid black
140 text-decoration: none;
142 font: 12px Arial, Helvetica
146 text-decoration: none;
148 font: 12px Arial, Helvetica
153 background:url(image/bg_css_menu.png) repeat bottom;
155 border-color:#ccc #888 #555 #bbb;
161 <script type="text/javascript">
163 var isDOM = (document.getElementById ? true : false);
164 var isIE4 = ((document.all && !isDOM) ? true : false);
165 var isNS4 = (document.layers ? true : false);
166 //var KO = (navigator.appName=="Konqueror" \|\| navigator.appName=="Opera") ;
167 var KO = ((navigator.userAgent.indexOf('Opera',0) != -1) \|\| (navigator.userAgent.indexOf('Konqueror',0) != -1));
168 function getRef(id) {
169 if (isDOM) return document.getElementById(id);
170 if (isIE4) return document.all[id];
171 if (isNS4) return document.layers[id];
173 function getSty(id) {
174 return (isNS4 ? getRef(id) : getRef(id).style);
177 var litNow = new Array();
178 function popOver(menuNum, itemNum) {
179 if (KO) document.getElementById("win1").style.visibility = "hidden";
180 clearTimeout(popTimer);
182 litNow = getTree(menuNum, itemNum);
183 changeCol(litNow, true);
184 targetNum = menu[menuNum][itemNum].target;
186 thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left);
187 thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top);
188 with (menu[targetNum][0].ref) {
189 left = parseInt(thisX + menu[targetNum][0].x);
190 top = parseInt(thisY + menu[targetNum][0].y);
191 visibility = 'visible';
195 function popOut(menuNum, itemNum) {
196 if ((menuNum == 0) && !menu[menuNum][itemNum].target)
198 if (KO) document.getElementById("win1").style.visibility = "visible";
200 popTimer = setTimeout('hideAllBut(0)', 500);
202 function getTree(menuNum, itemNum) {
203 itemArray = new Array(menu.length);
205 itemArray[menuNum] = itemNum;
206 if (menuNum == 0) return itemArray;
207 itemNum = menu[menuNum][0].parentItem;
208 menuNum = menu[menuNum][0].parentMenu;
211 function changeCol(changeArray, isOver) {
212 for (menuCount = 0; menuCount < changeArray.length; menuCount++) {
213 if (changeArray[menuCount]) {
214 newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;
215 with (menu[menuCount][changeArray[menuCount]].ref) {
216 if (isNS4) bgColor = newCol;
217 else backgroundColor = newCol;
222 function hideAllBut(menuNum) {
223 var keepMenus = getTree(menuNum, 1);
224 for (count = 0; count < menu.length; count++)
225 if (!keepMenus[count])
226 menu[count][0].ref.visibility = 'hidden';
227 changeCol(litNow, false);
230 function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
231 this.isVert = isVert;
236 this.overCol = overCol;
237 this.backCol = backCol;
238 this.borderClass = borderClass;
239 this.textClass = textClass;
240 this.parentMenu = null;
241 this.parentItem = null;
244 function Item(text, href, frame, length, spacing, target) {
248 this.length = length;
249 this.spacing = spacing;
250 this.target = target;
253 function go(link,frame) {
254 tmp=eval("top."+frame);
256 //top.main_window.location=link;
258 function writeMenus() {
259 if (!isDOM && !isIE4 && !isNS4) return;
260 for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) {
261 var str = '', itemX = 0, itemY = 0;
262 for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem]) {
263 var itemID = 'menu' + currMenu + 'item' + currItem;
264 var w = (isVert ? width : length);
265 var h = (isVert ? length : width);
266 if (isDOM \|\| isIE4) {
267 str += '<div id="' + itemID + '" style="position: absolute; left: ' + itemX + '; top: ' + itemY + '; width: ' + w + '; height: ' + h + '; visibility: inherit; ';
268 if (backCol) str += 'background: ' + backCol + '; ';
272 str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' + w + '" height="' + h + '" visibility="inherit" ';
273 if (backCol) str += 'bgcolor="' + backCol + '" ';
275 if (borderClass) str += 'class="' + borderClass + '" "';
276 str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')">';
277 str += '<table width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '">';
278 str +='<tr><td class="' + textClass + '" style="cursor:pointer;" align="left" height="' + (h - 7) + '" onClick=\\'go("' + href + '","' + frame + '")\\'>' + text + '</a></td>';
280 menu[target][0].parentMenu = currMenu;
281 menu[target][0].parentItem = currItem;
282 if (popInd) str += '<td class="' + textClass + '" align="right">' + popInd + '</td>';
284 str += '</tr></table>' + (isNS4 ? '</layer>' : '</div>');
285 if (isVert) itemY += length + spacing;
286 else itemX += length + spacing;
289 var newDiv = document.createElement('div');
290 document.getElementsByTagName('body').item(0).appendChild(newDiv);
291 newDiv.innerHTML = str;
293 ref.position = 'absolute';
294 ref.visibility = 'hidden';
297 document.body.insertAdjacentHTML('beforeEnd', '<div id="menu' + currMenu + 'div" ' + 'style="position: absolute; visibility: hidden">' + str + '</div>');
298 ref = getSty('menu' + currMenu + 'div');
302 ref.document.write(str);
303 ref.document.close();
305 for (currItem = 1; currItem < menu[currMenu].length; currItem++) {
306 itemName = 'menu' + currMenu + 'item' + currItem;
307 if (isDOM \|\| isIE4) menu[currMenu][currItem].ref = getSty(itemName);
308 if (isNS4) menu[currMenu][currItem].ref = ref.document[itemName];
314 ref.visibility = 'visible';
317 var menu = new Array();
318 var defOver = '#cccccc';
319 var defBack = '#dddddd';
321 menu[0] = new Array();
322 menu[0][0] = new Menu(false, '', 5, 18, 19, '#cccccc', '', '', 'rootItemText');
326 §ion_menu($menu);
329 var popOldWidth = window.innerWidth;
330 nsResizeHandler = new Function('if (popOldWidth != window.innerWidth) location.reload()');
331 if (isNS4) document.captureEvents(Event.CLICK);
332 document.onclick = clickHandle;
333 function clickHandle(evt) {
334 if (isNS4) document.routeEvent(evt);
336 if (KO) document.getElementById("win1").style.visibility = "visible";
338 function moveRoot() {
339 with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);
344 <BODY scrolling="no" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="margin: 0" onLoad="writeMenus(); clockon();" onResize="if (isNS4) nsResizeHandler()">
347 <table class="menu" width="100%" border="0" cellpadding="0" cellspacing="0">
348 <tr><td height="21"><font size="1"> </font></td></tr></table>
360 my ($menu, $level) = @_;
363 my @menuorder = $menu->access_control(\%myconfig, $level);
369 $item = shift @menuorder;
372 $label =~ s/$level--//g;
374 $label = $locale->text($label);
375 $label =~ s/ / /g;
376 $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
378 if ($menu->{$item}{submenu}) {
379 $menu->{$item}{$item} = !$form->{$item};
382 if ($mlz{"s$ml"} > 1) {
390 qq|menu[$mlz{$ml}][$z] = new Item('$label', '#', '', defLength, 0, |
394 print qq|menu[$pm] = new Array();\n|;
396 qq|menu[$pm][0] = new Menu(true, '', 85, 0, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
397 map { shift @menuorder } grep /^$item/, @menuorder;
398 §ion_menu($menu, $item);
399 map { shift @menuorder } grep /^$item/, @menuorder;
401 if ($menu->{$item}{module}) {
404 $target = $menu->{$item}{target};
405 $uri = $menu->menuitem_js(\%myconfig, \%$form, $item, $level);
408 qq|menu[$pm][$sm] = new Item('$label', '$uri', '$target', defLength, 0, 0);\n|;
411 my $ml_ = $form->escape($ml);
414 %mlz = ($ml, $pm, "s$ml", 1);
417 $breit = 15 + length($label) * 6;
419 qq|menu[0][$mm] = new Item(' $label', '#', '', $breit, 10, $pm); \n|;
420 print qq|menu[$pm] = new Array();\n|;
422 qq|menu[$pm][0] = new Menu(true, '>', 0, 20, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
424 §ion_menu($menu, $item);