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 #######################################################################
39 use CGI::Carp qw(fatalsToBrowser);
49 my $form = $main::form;
51 $form->{callback} = $form->unescape($form->{callback});
52 $form->{callback} ||= "login.pl?action=company_logo";
61 <iframe id="win1" src="$form->{callback}" width="100%" height="93%" name="main_window" style="position: absolute; border:0px;">
62 <p>Ihr Browser kann leider keine eingebetteten Frames anzeigen.
74 my $form = $main::form;
76 my $fensterlink="menujs.pl?action=display";
77 my $fenster = "["."<a href=\"$fensterlink\" target=\"_blank\">neues Fenster</a>]";
79 my $login = "[Nutzer "
81 . " - <a href=\"login.pl?action=logout\" target=\"_top\">"
82 . $::locale->text('Logout')
84 my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
85 $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
87 my $CTIME_String = localtime(time);
90 $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
91 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
93 my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
94 "Donnerstag", "Freitag", "Samstag");
95 my @Monatsnamen = ("", "Januar", "Februar", "März",
96 "April", "Mai", "Juni", "Juli",
97 "August", "September", "Oktober", "November",
100 $Wochentage[$Wochentag] . ", der "
105 #$zeit="<div id='Uhr'>".$Stunden.":".$Minuten.":".$Sekunden."</div>";
106 my $zeit = "<div id='Uhr'>" . $Stunden . ":" . $Minuten . "</div>";
108 <script type="text/javascript">
111 var now = new Date();
112 var h = now.getHours();
113 var m = now.getMinutes();
114 document.getElementById('clock_id').innerHTML = (h<10?'0'+h:h)+":"+(m<10?'0'+m:m);
115 var timer=setTimeout("clockon()", 10000);
117 window.onload=clockon
120 <table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
122 <td style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;"> $fenster [<a href="JavaScript:top.main_window.print()">drucken</a>]</td>
123 <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>
124 $login $datum <span id='clock_id' style='position:relative'></span>
133 my $form = $main::form;
134 my %myconfig = %main::myconfig;
136 my $mainlevel = $form->{level};
137 $mainlevel =~ s/$mainlevel--//g;
138 my $menu = Menu->new($::menufile);
147 border: 1px solid black
151 text-decoration: none;
153 font: 12px Arial, Helvetica
157 text-decoration: none;
159 font: 12px Arial, Helvetica
164 background:url(image/bg_css_menu.png) repeat bottom;
166 border-color:#ccc #888 #555 #bbb;
172 <script type="text/javascript">
174 var isDOM = (document.getElementById ? true : false);
175 var isIE4 = ((document.all && !isDOM) ? true : false);
176 var isNS4 = (document.layers ? true : false);
177 //var KO = (navigator.appName=="Konqueror" \|\| navigator.appName=="Opera") ;
178 var KO = ((navigator.userAgent.indexOf('Opera',0) != -1) \|\| (navigator.userAgent.indexOf('Konqueror',0) != -1));
179 function getRef(id) {
180 if (isDOM) return document.getElementById(id);
181 if (isIE4) return document.all[id];
182 if (isNS4) return document.layers[id];
184 function getSty(id) {
185 return (isNS4 ? getRef(id) : getRef(id).style);
188 var litNow = new Array();
189 function popOver(menuNum, itemNum) {
190 if (KO) document.getElementById("win1").style.visibility = "hidden";
191 clearTimeout(popTimer);
193 litNow = getTree(menuNum, itemNum);
194 changeCol(litNow, true);
195 targetNum = menu[menuNum][itemNum].target;
197 thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left);
198 thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top);
199 with (menu[targetNum][0].ref) {
200 left = parseInt(thisX + menu[targetNum][0].x);
201 top = parseInt(thisY + menu[targetNum][0].y);
202 visibility = 'visible';
206 function popOut(menuNum, itemNum) {
207 if ((menuNum == 0) && !menu[menuNum][itemNum].target)
209 if (KO) document.getElementById("win1").style.visibility = "visible";
211 popTimer = setTimeout('hideAllBut(0)', 500);
213 function getTree(menuNum, itemNum) {
214 itemArray = new Array(menu.length);
216 itemArray[menuNum] = itemNum;
217 if (menuNum == 0) return itemArray;
218 itemNum = menu[menuNum][0].parentItem;
219 menuNum = menu[menuNum][0].parentMenu;
222 function changeCol(changeArray, isOver) {
223 for (menuCount = 0; menuCount < changeArray.length; menuCount++) {
224 if (changeArray[menuCount]) {
225 newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;
226 with (menu[menuCount][changeArray[menuCount]].ref) {
227 if (isNS4) bgColor = newCol;
228 else backgroundColor = newCol;
233 function hideAllBut(menuNum) {
234 var keepMenus = getTree(menuNum, 1);
235 for (count = 0; count < menu.length; count++)
236 if (!keepMenus[count])
237 menu[count][0].ref.visibility = 'hidden';
238 changeCol(litNow, false);
241 function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
242 this.isVert = isVert;
247 this.overCol = overCol;
248 this.backCol = backCol;
249 this.borderClass = borderClass;
250 this.textClass = textClass;
251 this.parentMenu = null;
252 this.parentItem = null;
255 function Item(text, href, frame, length, spacing, target) {
259 this.length = length;
260 this.spacing = spacing;
261 this.target = target;
264 function go(link,frame) {
265 tmp=eval("top."+frame);
267 //top.main_window.location=link;
269 function writeMenus() {
270 if (!isDOM && !isIE4 && !isNS4) return;
271 for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) {
272 var str = '', itemX = 0, itemY = 0;
273 for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem]) {
274 var itemID = 'menu' + currMenu + 'item' + currItem;
275 var w = (isVert ? width : length);
276 var h = (isVert ? length : width);
277 if (isDOM \|\| isIE4) {
278 str += '<div id="' + itemID + '" style="position: absolute; left: ' + itemX + '; top: ' + itemY + '; width: ' + w + '; height: ' + h + '; visibility: inherit; ';
279 if (backCol) str += 'background: ' + backCol + '; ';
283 str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' + w + '" height="' + h + '" visibility="inherit" ';
284 if (backCol) str += 'bgcolor="' + backCol + '" ';
286 if (borderClass) str += 'class="' + borderClass + '" "';
287 str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')">';
288 str += '<table width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '">';
289 str +='<tr><td class="' + textClass + '" style="cursor:pointer;" align="left" height="' + (h - 7) + '" onClick=\\'go("' + href + '","' + frame + '")\\'>' + text + '</a></td>';
291 menu[target][0].parentMenu = currMenu;
292 menu[target][0].parentItem = currItem;
293 if (popInd) str += '<td class="' + textClass + '" align="right">' + popInd + '</td>';
295 str += '</tr></table>' + (isNS4 ? '</layer>' : '</div>');
296 if (isVert) itemY += length + spacing;
297 else itemX += length + spacing;
300 var newDiv = document.createElement('div');
301 document.getElementsByTagName('body').item(0).appendChild(newDiv);
302 newDiv.innerHTML = str;
304 ref.position = 'absolute';
305 ref.visibility = 'hidden';
308 document.body.insertAdjacentHTML('beforeEnd', '<div id="menu' + currMenu + 'div" ' + 'style="position: absolute; visibility: hidden">' + str + '</div>');
309 ref = getSty('menu' + currMenu + 'div');
313 ref.document.write(str);
314 ref.document.close();
316 for (currItem = 1; currItem < menu[currMenu].length; currItem++) {
317 itemName = 'menu' + currMenu + 'item' + currItem;
318 if (isDOM \|\| isIE4) menu[currMenu][currItem].ref = getSty(itemName);
319 if (isNS4) menu[currMenu][currItem].ref = ref.document[itemName];
325 ref.visibility = 'visible';
328 var menu = new Array();
329 var defOver = '#cccccc';
330 var defBack = '#dddddd';
332 menu[0] = new Array();
333 menu[0][0] = new Menu(false, '', 5, 18, 19, '#cccccc', '', '', 'rootItemText');
337 §ion_menu($menu);
340 var popOldWidth = window.innerWidth;
341 nsResizeHandler = new Function('if (popOldWidth != window.innerWidth) location.reload()');
342 if (isNS4) document.captureEvents(Event.CLICK);
343 document.onclick = clickHandle;
344 function clickHandle(evt) {
345 if (isNS4) document.routeEvent(evt);
347 if (KO) document.getElementById("win1").style.visibility = "visible";
349 function moveRoot() {
350 with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);
355 <BODY scrolling="no" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="margin: 0" onLoad="writeMenus(); clockon();" onResize="if (isNS4) nsResizeHandler()">
358 <table class="menu" width="100%" border="0" cellpadding="0" cellspacing="0">
359 <tr><td height="21"><font size="1"> </font></td></tr></table>
371 my ($menu, $level) = @_;
373 my $form = $main::form;
374 my %myconfig = %main::myconfig;
377 my @menuorder = $menu->access_control(\%myconfig, $level);
382 my (%mlz, $sm, $z, $pm, $mm);
384 my $item = shift @menuorder;
387 $label =~ s/$level--//g;
389 $label = $::locale->text($label);
390 $label =~ s/ / /g;
391 $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
393 if ($menu->{$item}{submenu}) {
394 $menu->{$item}{$item} = !$form->{$item};
397 if ($mlz{"s$ml"} > 1) {
405 qq|menu[$mlz{$ml}][$z] = new Item('$label', '#', '', defLength, 0, |
409 print qq|menu[$pm] = new Array();\n|;
411 qq|menu[$pm][0] = new Menu(true, '', 85, 0, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
412 map { shift @menuorder } grep /^$item/, @menuorder;
413 §ion_menu($menu, $item);
414 map { shift @menuorder } grep /^$item/, @menuorder;
416 if ($menu->{$item}{module}) {
419 my $target = $menu->{$item}{target};
420 my $uri = $menu->menuitem_js(\%myconfig, \%$form, $item, $level);
423 qq|menu[$pm][$sm] = new Item('$label', '$uri', '$target', defLength, 0, 0);\n|;
426 my $ml_ = $form->escape($ml);
429 %mlz = ($ml, $pm, "s$ml", 1);
432 my $breit = 15 + length($label) * 6;
434 qq|menu[0][$mm] = new Item(' $label', '#', '', $breit, 10, $pm); \n|;
435 print qq|menu[$pm] = new Array();\n|;
437 qq|menu[$pm][0] = new Menu(true, '>', 0, 20, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
439 §ion_menu($menu, $item);