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 - New Optik - Marco Welter <mawe@linux-studio.de>
36 #######################################################################
38 $menufile = "menu.ini";
40 use CGI::Carp qw(fatalsToBrowser);
55 <iframe id="win1" src="login.pl?login=$form->{login}&password=$form->{password}&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="menunew.pl?login=$form->{login}&password=$form->{password}&action=display";
69 $fenster = "["."<a href=\"$fensterlink\" target=\"_blank\">neues Fenster</a>]";
73 . " - <a href=\"login.pl?password="
75 . "&action=logout\" target=\"_top\">"
76 . $locale->text('Logout')
78 my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
79 $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
81 my $CTIME_String = localtime(time);
84 $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
85 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
87 my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
88 "Donnerstag", "Freitag", "Samstag");
89 my @Monatsnamen = ("", "Januar", "Februar", "März",
90 "April", "Mai", "Juni", "Juli",
91 "August", "September", "Oktober", "November",
94 $Wochentage[$Wochentag] . ", der "
99 #$zeit="<div id='Uhr'>".$Stunden.":".$Minuten.":".$Sekunden."</div>";
100 $zeit = "<div id='Uhr'>" . $Stunden . ":" . $Minuten . "</div>";
102 <script type="text/javascript">
105 var now = new Date();
106 var h = now.getHours();
107 var m = now.getMinutes();
108 document.getElementById('clock_id').innerHTML = (h<10?'0'+h:h)+":"+(m<10?'0'+m:m);
109 var timer=setTimeout("clockon()", 10000);
111 window.onload=clockon
114 <table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
116 <td style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;"> $fenster [<a href="JavaScript:top.main_window.print()">drucken</a>]</td>
117 <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>
118 $login $datum <span id='clock_id' style='position:relative'></span>
126 $mainlevel = $form->{level};
127 $mainlevel =~ s/$mainlevel--//g;
128 my $menu = new Menu "$menufile";
137 border: 1px solid black
141 text-decoration: none;
143 font: 12px Arial, Helvetica
147 text-decoration: none;
149 font: 12px Arial, Helvetica
154 background:url(image/bg_css_menu.png) repeat bottom;
156 border-color:#ccc #888 #555 #bbb;
162 <script type="text/javascript">
164 var isDOM = (document.getElementById ? true : false);
165 var isIE4 = ((document.all && !isDOM) ? true : false);
166 var isNS4 = (document.layers ? true : false);
167 //var KO = (navigator.appName=="Konqueror" \|\| navigator.appName=="Opera") ;
168 var KO = ((navigator.userAgent.indexOf('Opera',0) != -1) \|\| (navigator.userAgent.indexOf('Konqueror',0) != -1));
169 function getRef(id) {
170 if (isDOM) return document.getElementById(id);
171 if (isIE4) return document.all[id];
172 if (isNS4) return document.layers[id];
174 function getSty(id) {
175 return (isNS4 ? getRef(id) : getRef(id).style);
178 var litNow = new Array();
179 function popOver(menuNum, itemNum) {
180 if (KO) document.getElementById("win1").style.visibility = "hidden";
181 clearTimeout(popTimer);
183 litNow = getTree(menuNum, itemNum);
184 changeCol(litNow, true);
185 targetNum = menu[menuNum][itemNum].target;
187 thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left);
188 thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top);
189 with (menu[targetNum][0].ref) {
190 left = parseInt(thisX + menu[targetNum][0].x);
191 top = parseInt(thisY + menu[targetNum][0].y);
192 visibility = 'visible';
196 function popOut(menuNum, itemNum) {
197 if ((menuNum == 0) && !menu[menuNum][itemNum].target)
199 if (KO) document.getElementById("win1").style.visibility = "visible";
201 popTimer = setTimeout('hideAllBut(0)', 500);
203 function getTree(menuNum, itemNum) {
204 itemArray = new Array(menu.length);
206 itemArray[menuNum] = itemNum;
207 if (menuNum == 0) return itemArray;
208 itemNum = menu[menuNum][0].parentItem;
209 menuNum = menu[menuNum][0].parentMenu;
212 function changeCol(changeArray, isOver) {
213 for (menuCount = 0; menuCount < changeArray.length; menuCount++) {
214 if (changeArray[menuCount]) {
215 newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;
216 with (menu[menuCount][changeArray[menuCount]].ref) {
217 if (isNS4) bgColor = newCol;
218 else backgroundColor = newCol;
223 function hideAllBut(menuNum) {
224 var keepMenus = getTree(menuNum, 1);
225 for (count = 0; count < menu.length; count++)
226 if (!keepMenus[count])
227 menu[count][0].ref.visibility = 'hidden';
228 changeCol(litNow, false);
231 function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
232 this.isVert = isVert;
237 this.overCol = overCol;
238 this.backCol = backCol;
239 this.borderClass = borderClass;
240 this.textClass = textClass;
241 this.parentMenu = null;
242 this.parentItem = null;
245 function Item(text, href, frame, length, spacing, target) {
249 this.length = length;
250 this.spacing = spacing;
251 this.target = target;
254 function go(link,frame) {
255 tmp=eval("top."+frame);
257 //top.main_window.location=link;
259 function writeMenus() {
260 if (!isDOM && !isIE4 && !isNS4) return;
261 for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) {
262 var str = '', itemX = 0, itemY = 0;
263 for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem]) {
264 var itemID = 'menu' + currMenu + 'item' + currItem;
265 var w = (isVert ? width : length);
266 var h = (isVert ? length : width);
267 if (isDOM \|\| isIE4) {
268 str += '<div id="' + itemID + '" style="position: absolute; left: ' + itemX + '; top: ' + itemY + '; width: ' + w + '; height: ' + h + '; visibility: inherit; ';
269 if (backCol) str += 'background: ' + backCol + '; ';
273 str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' + w + '" height="' + h + '" visibility="inherit" ';
274 if (backCol) str += 'bgcolor="' + backCol + '" ';
276 if (borderClass) str += 'class="' + borderClass + '" "';
277 str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')">';
278 str += '<table width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '">';
279 str +='<tr><td class="' + textClass + '" style="cursor:pointer;" align="left" height="' + (h - 7) + '" onClick=\\'go("' + href + '","' + frame + '")\\'>' + text + '</a></td>';
281 menu[target][0].parentMenu = currMenu;
282 menu[target][0].parentItem = currItem;
283 if (popInd) str += '<td class="' + textClass + '" align="right">' + popInd + '</td>';
285 str += '</tr></table>' + (isNS4 ? '</layer>' : '</div>');
286 if (isVert) itemY += length + spacing;
287 else itemX += length + spacing;
290 var newDiv = document.createElement('div');
291 document.getElementsByTagName('body').item(0).appendChild(newDiv);
292 newDiv.innerHTML = str;
294 ref.position = 'absolute';
295 ref.visibility = 'hidden';
298 document.body.insertAdjacentHTML('beforeEnd', '<div id="menu' + currMenu + 'div" ' + 'style="position: absolute; visibility: hidden">' + str + '</div>');
299 ref = getSty('menu' + currMenu + 'div');
303 ref.document.write(str);
304 ref.document.close();
306 for (currItem = 1; currItem < menu[currMenu].length; currItem++) {
307 itemName = 'menu' + currMenu + 'item' + currItem;
308 if (isDOM \|\| isIE4) menu[currMenu][currItem].ref = getSty(itemName);
309 if (isNS4) menu[currMenu][currItem].ref = ref.document[itemName];
315 ref.visibility = 'visible';
318 var menu = new Array();
319 var defOver = '#cccccc';
320 var defBack = '#dddddd';
322 menu[0] = new Array();
323 menu[0][0] = new Menu(false, '', 5, 18, 19, '#cccccc', '', '', 'rootItemText');
327 §ion_menu($menu);
330 var popOldWidth = window.innerWidth;
331 nsResizeHandler = new Function('if (popOldWidth != window.innerWidth) location.reload()');
332 if (isNS4) document.captureEvents(Event.CLICK);
333 document.onclick = clickHandle;
334 function clickHandle(evt) {
335 if (isNS4) document.routeEvent(evt);
337 if (KO) document.getElementById("win1").style.visibility = "visible";
339 function moveRoot() {
340 with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);
345 <BODY scrolling="no" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="margin: 0" onLoad="writeMenus(); clockon();" onResize="if (isNS4) nsResizeHandler()">
348 <table class="menu" width="100%" border="0" cellpadding="0" cellspacing="0">
349 <tr><td height="21"><font size="1"> </font></td></tr></table>
361 my ($menu, $level) = @_;
364 my @menuorder = $menu->access_control(\%myconfig, $level);
370 $item = shift @menuorder;
373 $label =~ s/$level--//g;
375 $label = $locale->text($label);
376 $label =~ s/ / /g;
377 $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
379 if ($menu->{$item}{submenu}) {
380 $menu->{$item}{$item} = !$form->{$item};
383 if ($mlz{"s$ml"} > 1) {
391 qq|menu[$mlz{$ml}][$z] = new Item('$label', '#', '', defLength, 0, |
395 print qq|menu[$pm] = new Array();\n|;
397 qq|menu[$pm][0] = new Menu(true, '', 85, 0, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
398 map { shift @menuorder } grep /^$item/, @menuorder;
399 §ion_menu($menu, $item);
400 map { shift @menuorder } grep /^$item/, @menuorder;
402 if ($menu->{$item}{module}) {
405 $target = $menu->{$item}{target};
406 $uri = $menu->menuitemNew(\%myconfig, \%$form, $item, $level);
408 #print qq|<tr><td class="hover" height="13" >$spacer<img src="image/unterpunkt.png" style="vertical-align:text-top">|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a></td></tr>\n|;
410 qq|menu[$pm][$sm] = new Item('$label', '$uri', '$target', defLength, 0, 0);\n|;
413 my $ml_ = $form->escape($ml);
416 %mlz = ($ml, $pm, "s$ml", 1);
419 $breit = 15 + length($label) * 6;
421 qq|menu[0][$mm] = new Item(' $label', '#', '', $breit, 10, $pm); \n|;
422 print qq|menu[$pm] = new Array();\n|;
424 qq|menu[$pm][0] = new Menu(true, '>', 0, 20, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
426 #print qq|<tr><td class="bg" height="22" align="left" valign="middle" ><img src="image/$item.png" style="vertical-align:middle"> <a href="menu.pl?action=acc_menu&level=$ml_&login=$form->{login}&password=$form->{password}" class="nohover">$label</a> </td></tr>\n|;
427 §ion_menu($menu, $item);