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&path=$form->{path}" width="100%" height="93%" name="main_window" style="position: absolute; border:0px;">
56 <p>Ihr Browser kann leider keine eingebetteten Frames anzeigen.
70 . " - <a href=\"login.pl?path="
74 . "&action=logout\" target=\"_top\">"
75 . $locale->text('Logout')
77 my ($Sekunden, $Minuten, $Stunden, $Monatstag, $Monat,
78 $Jahr, $Wochentag, $Jahrestag, $Sommerzeit)
80 my $CTIME_String = localtime(time);
83 $Monat = $Monat < 10 ? $Monat = "0" . $Monat : $Monat;
84 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
86 my @Wochentage = ("Sonntag", "Montag", "Dienstag", "Mittwoch",
87 "Donnerstag", "Freitag", "Samstag");
88 my @Monatsnamen = ("", "Januar", "Februar", "März",
89 "April", "Mai", "Juni", "Juli",
90 "August", "September", "Oktober", "November",
93 $Wochentage[$Wochentag] . ", der "
98 #$zeit="<div id='Uhr'>".$Stunden.":".$Minuten.":".$Sekunden."</div>";
99 $zeit = "<div id='Uhr'>" . $Stunden . ":" . $Minuten . "</div>";
101 <script type="text/javascript">
103 var h=$Stunden; var m=$Minuten; var s=$Sekunden;
105 s=++s%60;if(s==0){m=++m%60;if(m==0)h=++h%24;}
106 document.getElementById('clock_id').innerHTML = (h<10?'0'+h:h)+":"+(m<10?'0'+m:m)+":"+(s<10?'0'+s:s);
107 var timer=setTimeout("clockon()", 1000);
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;"> [<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 $mainlevel = $form->{level};
125 $mainlevel =~ s/$mainlevel--//g;
126 my $menu = new Menu "$menufile";
127 $menu = new Menu "custom_$menufile" if (-f "custom_$menufile");
128 $menu = new Menu "$form->{login}_$menufile"
129 if (-f "$form->{login}_$menufile");
134 <script type="text/javascript">
136 var isDOM = (document.getElementById ? true : false);
137 var isIE4 = ((document.all && !isDOM) ? true : false);
138 var isNS4 = (document.layers ? true : false);
139 //var KO = (navigator.appName=="Konqueror" \|\| navigator.appName=="Opera") ;
140 var KO = ((navigator.userAgent.indexOf('Opera',0) != -1) \|\| (navigator.userAgent.indexOf('Konqueror',0) != -1));
141 function getRef(id) {
142 if (isDOM) return document.getElementById(id);
143 if (isIE4) return document.all[id];
144 if (isNS4) return document.layers[id];
146 function getSty(id) {
147 return (isNS4 ? getRef(id) : getRef(id).style);
150 var litNow = new Array();
151 function popOver(menuNum, itemNum) {
152 if (KO) document.getElementById("win1").style.visibility = "hidden";
153 clearTimeout(popTimer);
155 litNow = getTree(menuNum, itemNum);
156 changeCol(litNow, true);
157 targetNum = menu[menuNum][itemNum].target;
159 thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left);
160 thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top);
161 with (menu[targetNum][0].ref) {
162 left = parseInt(thisX + menu[targetNum][0].x);
163 top = parseInt(thisY + menu[targetNum][0].y);
164 visibility = 'visible';
168 function popOut(menuNum, itemNum) {
169 if ((menuNum == 0) && !menu[menuNum][itemNum].target)
171 if (KO) document.getElementById("win1").style.visibility = "visible";
173 popTimer = setTimeout('hideAllBut(0)', 500);
175 function getTree(menuNum, itemNum) {
176 itemArray = new Array(menu.length);
178 itemArray[menuNum] = itemNum;
179 if (menuNum == 0) return itemArray;
180 itemNum = menu[menuNum][0].parentItem;
181 menuNum = menu[menuNum][0].parentMenu;
184 function changeCol(changeArray, isOver) {
185 for (menuCount = 0; menuCount < changeArray.length; menuCount++) {
186 if (changeArray[menuCount]) {
187 newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;
188 with (menu[menuCount][changeArray[menuCount]].ref) {
189 if (isNS4) bgColor = newCol;
190 else backgroundColor = newCol;
195 function hideAllBut(menuNum) {
196 var keepMenus = getTree(menuNum, 1);
197 for (count = 0; count < menu.length; count++)
198 if (!keepMenus[count])
199 menu[count][0].ref.visibility = 'hidden';
200 changeCol(litNow, false);
203 function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
204 this.isVert = isVert;
209 this.overCol = overCol;
210 this.backCol = backCol;
211 this.borderClass = borderClass;
212 this.textClass = textClass;
213 this.parentMenu = null;
214 this.parentItem = null;
217 function Item(text, href, frame, length, spacing, target) {
221 this.length = length;
222 this.spacing = spacing;
223 this.target = target;
226 function go(link,frame) {
227 tmp=eval("top."+frame);
229 //top.main_window.location=link;
231 function writeMenus() {
232 if (!isDOM && !isIE4 && !isNS4) return;
233 for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) {
234 var str = '', itemX = 0, itemY = 0;
235 for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem]) {
236 var itemID = 'menu' + currMenu + 'item' + currItem;
237 var w = (isVert ? width : length);
238 var h = (isVert ? length : width);
239 if (isDOM \|\| isIE4) {
240 str += '<div id="' + itemID + '" style="position: absolute; left: ' + itemX + '; top: ' + itemY + '; width: ' + w + '; height: ' + h + '; visibility: inherit; ';
241 if (backCol) str += 'background: ' + backCol + '; ';
245 str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' + w + '" height="' + h + '" visibility="inherit" ';
246 if (backCol) str += 'bgcolor="' + backCol + '" ';
248 if (borderClass) str += 'class="' + borderClass + '" "';
249 str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')">';
250 str += '<table width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '">';
251 str +='<tr><td style="cursor:pointer;" align="left" height="' + (h - 7) + '" onClick=\\'go("' + href + '","' + frame + '")\\'>' + text + '</a></td>';
253 menu[target][0].parentMenu = currMenu;
254 menu[target][0].parentItem = currItem;
255 if (popInd) str += '<td class="' + textClass + '" align="right">' + popInd + '</td>';
257 str += '</tr></table>' + (isNS4 ? '</layer>' : '</div>');
258 if (isVert) itemY += length + spacing;
259 else itemX += length + spacing;
262 var newDiv = document.createElement('div');
263 document.getElementsByTagName('body').item(0).appendChild(newDiv);
264 newDiv.innerHTML = str;
266 ref.position = 'absolute';
267 ref.visibility = 'hidden';
270 document.body.insertAdjacentHTML('beforeEnd', '<div id="menu' + currMenu + 'div" ' + 'style="position: absolute; visibility: hidden">' + str + '</div>');
271 ref = getSty('menu' + currMenu + 'div');
275 ref.document.write(str);
276 ref.document.close();
278 for (currItem = 1; currItem < menu[currMenu].length; currItem++) {
279 itemName = 'menu' + currMenu + 'item' + currItem;
280 if (isDOM \|\| isIE4) menu[currMenu][currItem].ref = getSty(itemName);
281 if (isNS4) menu[currMenu][currItem].ref = ref.document[itemName];
287 ref.visibility = 'visible';
290 var menu = new Array();
291 var defOver = '#AAAAFF', defBack = '#8888DD';
293 menu[0] = new Array();
294 menu[0][0] = new Menu(false, '', 5, 18, 19, '#AAAAFF', '#AAAAFF', '', 'itemText');
299 §ion_menu($menu);
302 var popOldWidth = window.innerWidth;
303 nsResizeHandler = new Function('if (popOldWidth != window.innerWidth) location.reload()');
304 if (isNS4) document.captureEvents(Event.CLICK);
305 document.onclick = clickHandle;
306 function clickHandle(evt) {
307 if (isNS4) document.routeEvent(evt);
309 if (KO) document.getElementById("win1").style.visibility = "visible";
311 function moveRoot() {
312 with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);
319 .itemBorder { border: 1px solid black }
320 .itemText { text-decoration: none; color: #FFFFFF; font: 12px Arial, Helvetica }
325 <!--body bgcolor="#AAAAff" text="#ffffff" link="#ffffff" vlink="#ffffff" alink="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"-->
326 <BODY scrolling="no" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="margin: 0" onLoad="writeMenus(); clockon();" onResize="if (isNS4) nsResizeHandler()">
327 <!--BODY marginwidth="0" marginheight="0" style="margin: 0" onLoad="writeMenus()" onResize="if (isNS4) nsResizeHandler()"-->
330 <table bgcolor="#AAAAFF" width="100%" border="0" cellpadding="0" cellspacing="0">
331 <tr><td height="21"><font size="1"> </font></td></tr></table>
342 my ($menu, $level) = @_;
345 my @menuorder = $menu->access_control(\%myconfig, $level);
351 $item = shift @menuorder;
354 $label =~ s/$level--//g;
356 $label = $locale->text($label);
357 $label =~ s/ / /g;
358 $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
360 if ($menu->{$item}{submenu}) {
361 $menu->{$item}{$item} = !$form->{$item};
364 if ($mlz{"s$ml"} > 1) {
372 qq|menu[$mlz{$ml}][$z] = new Item('$label', '#', '', defLength, 0, |
376 print qq|menu[$pm] = new Array();\n|;
378 qq|menu[$pm][0] = new Menu(true, '', 85, 0, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
379 map { shift @menuorder } grep /^$item/, @menuorder;
380 §ion_menu($menu, $item);
381 map { shift @menuorder } grep /^$item/, @menuorder;
383 if ($menu->{$item}{module}) {
386 $target = $menu->{$item}{target};
387 $uri = $menu->menuitemNew(\%myconfig, \%$form, $item, $level);
389 #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|;
391 qq|menu[$pm][$sm] = new Item('$label', '$uri', '$target', defLength, 0, 0);\n|;
394 my $ml_ = $form->escape($ml);
397 %mlz = ($ml, $pm, "s$ml", 1);
400 $breit = 15 + length($label) * 6;
402 qq|menu[0][$mm] = new Item(' $label', '#', '', $breit, 10, $pm); \n|;
403 print qq|menu[$pm] = new Array();\n|;
405 qq|menu[$pm][0] = new Menu(true, '>', 0, 20, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
407 #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?path=bin/mozilla&action=acc_menu&level=$ml_&login=$form->{login}&password=$form->{password}" class="nohover">$label</a> </td></tr>\n|;
408 §ion_menu($menu, $item);