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 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 clockid=new Array()
104 var clockidoutside=new Array()
106 var thistime= new Date()
107 var hours= | . $Stunden . qq|;
108 var minutes= | . $Minuten . qq|;
109 var seconds= | . $Sekunden . qq|;
110 if (eval(hours) <10) {hours="0"+hours}
111 if (eval(minutes) < 10) {minutes="0"+minutes}
112 if (seconds < 10) {seconds="0"+seconds}
113 //var thistime = hours+":"+minutes+":"+seconds
114 var thistime = hours+":"+minutes
116 function writeclock() {
118 if (document.all \|\| document.getElementById \|\| document.layers) {
119 clockid[i_clock]="clock"+i_clock
120 document.write("<font family=arial size=2><span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span></font>")
126 hours=thistime.getHours()
127 minutes=thistime.getMinutes()
128 seconds=thistime.getSeconds()
129 if (eval(hours) <10) {hours="0"+hours}
130 if (eval(minutes) < 10) {minutes="0"+minutes}
131 if (seconds < 10) {seconds="0"+seconds}
132 //thistime = hours+":"+minutes+":"+seconds
133 thistime = hours+":"+minutes
136 for (i=0;i<=clockid.length-1;i++) {
137 var thisclock=eval(clockid[i])
138 thisclock.innerHTML=thistime
142 if (document.getElementById) {
143 for (i=0;i<=clockid.length-1;i++) {
144 document.getElementById(clockid[i]).innerHTML=thistime
147 var timer=setTimeout("clockon()",60000)
149 //window.onload=clockon
152 <table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
154 <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>|
157 . qq| <script>writeclock()</script>
165 $mainlevel = $form->{level};
166 $mainlevel =~ s/$mainlevel--//g;
167 my $menu = new Menu "$menufile";
168 $menu = new Menu "custom_$menufile" if (-f "custom_$menufile");
169 $menu = new Menu "$form->{login}_$menufile"
170 if (-f "$form->{login}_$menufile");
175 <script type="text/javascript">
177 var isDOM = (document.getElementById ? true : false);
178 var isIE4 = ((document.all && !isDOM) ? true : false);
179 var isNS4 = (document.layers ? true : false);
180 function getRef(id) {
181 if (isDOM) return document.getElementById(id);
182 if (isIE4) return document.all[id];
183 if (isNS4) return document.layers[id];
185 function getSty(id) {
186 return (isNS4 ? getRef(id) : getRef(id).style);
189 var litNow = new Array();
190 function popOver(menuNum, itemNum) {
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)
210 popTimer = setTimeout('hideAllBut(0)', 500);
212 function getTree(menuNum, itemNum) {
213 itemArray = new Array(menu.length);
215 itemArray[menuNum] = itemNum;
216 if (menuNum == 0) return itemArray;
217 itemNum = menu[menuNum][0].parentItem;
218 menuNum = menu[menuNum][0].parentMenu;
221 function changeCol(changeArray, isOver) {
222 for (menuCount = 0; menuCount < changeArray.length; menuCount++) {
223 if (changeArray[menuCount]) {
224 newCol = isOver ? menu[menuCount][0].overCol : menu[menuCount][0].backCol;
225 with (menu[menuCount][changeArray[menuCount]].ref) {
226 if (isNS4) bgColor = newCol;
227 else backgroundColor = newCol;
232 function hideAllBut(menuNum) {
233 var keepMenus = getTree(menuNum, 1);
234 for (count = 0; count < menu.length; count++)
235 if (!keepMenus[count])
236 menu[count][0].ref.visibility = 'hidden';
237 changeCol(litNow, false);
239 function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
240 this.isVert = isVert;
245 this.overCol = overCol;
246 this.backCol = backCol;
247 this.borderClass = borderClass;
248 this.textClass = textClass;
249 this.parentMenu = null;
250 this.parentItem = null;
253 function Item(text, href, frame, length, spacing, target) {
257 this.length = length;
258 this.spacing = spacing;
259 this.target = target;
262 function writeMenus() {
263 if (!isDOM && !isIE4 && !isNS4) return;
264 for (currMenu = 0; currMenu < menu.length; currMenu++) with (menu[currMenu][0]) {
265 var str = '', itemX = 0, itemY = 0;
266 for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem]) {
267 var itemID = 'menu' + currMenu + 'item' + currItem;
268 var w = (isVert ? width : length);
269 var h = (isVert ? length : width);
270 if (isDOM \|\| isIE4) {
271 str += '<div id="' + itemID + '" style="position: absolute; left: ' + itemX + '; top: ' + itemY + '; width: ' + w + '; height: ' + h + '; visibility: inherit; ';
272 if (backCol) str += 'background: ' + backCol + '; ';
276 str += '<layer id="' + itemID + '" left="' + itemX + '" top="' + itemY + '" width="' + w + '" height="' + h + '" visibility="inherit" ';
277 if (backCol) str += 'bgcolor="' + backCol + '" ';
279 if (borderClass) str += 'class="' + borderClass + '" ';
280 str += 'onMouseOver="popOver(' + currMenu + ',' + currItem + ')" onMouseOut="popOut(' + currMenu + ',' + currItem + ')">';
281 str += '<table width="' + (w - 8) + '" border="0" cellspacing="0" cellpadding="' + (!isNS4 && borderClass ? 3 : 0) + '"><tr><td align="left" height="' + (h - 7) + '">' + '<a class="' + textClass + '" href="' + href + '"' + (frame ? ' target="' + frame + '">' : '>') + text + '</a></td>';
283 menu[target][0].parentMenu = currMenu;
284 menu[target][0].parentItem = currItem;
285 if (popInd) str += '<td class="' + textClass + '" align="right">' + popInd + '</td>';
287 str += '</tr></table>' + (isNS4 ? '</layer>' : '</div>');
288 if (isVert) itemY += length + spacing;
289 else itemX += length + spacing;
292 var newDiv = document.createElement('div');
293 document.getElementsByTagName('body').item(0).appendChild(newDiv);
294 newDiv.innerHTML = str;
296 ref.position = 'absolute';
297 ref.visibility = 'hidden';
300 document.body.insertAdjacentHTML('beforeEnd', '<div id="menu' + currMenu + 'div" ' + 'style="position: absolute; visibility: hidden">' + str + '</div>');
301 ref = getSty('menu' + currMenu + 'div');
305 ref.document.write(str);
306 ref.document.close();
308 for (currItem = 1; currItem < menu[currMenu].length; currItem++) {
309 itemName = 'menu' + currMenu + 'item' + currItem;
310 if (isDOM \|\| isIE4) menu[currMenu][currItem].ref = getSty(itemName);
311 if (isNS4) menu[currMenu][currItem].ref = ref.document[itemName];
317 ref.visibility = 'visible';
320 var menu = new Array();
321 var defOver = '#AAAAFF', defBack = '#8888DD';
323 menu[0] = new Array();
324 menu[0][0] = new Menu(false, '', 5, 18, 19, '#AAAAFF', '#AAAAFF', '', 'itemText');
329 §ion_menu($menu);
332 var popOldWidth = window.innerWidth;
333 nsResizeHandler = new Function('if (popOldWidth != window.innerWidth) location.reload()');
334 if (isNS4) document.captureEvents(Event.CLICK);
335 document.onclick = clickHandle;
336 function clickHandle(evt) {
337 if (isNS4) document.routeEvent(evt);
340 function moveRoot() {
341 with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);
348 .itemBorder { border: 1px solid black }
349 .itemText { text-decoration: none; color: #FFFFFF; font: 12px Arial, Helvetica }
354 <!--body bgcolor="#AAAAff" text="#ffffff" link="#ffffff" vlink="#ffffff" alink="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"-->
355 <BODY scrolling="no" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style="margin: 0" onLoad="writeMenus(); clockon();" onResize="if (isNS4) nsResizeHandler()">
356 <!--BODY marginwidth="0" marginheight="0" style="margin: 0" onLoad="writeMenus()" onResize="if (isNS4) nsResizeHandler()"-->
359 <table bgcolor="#AAAAFF" width="100%" border="0" cellpadding="0" cellspacing="0">
360 <tr><td height="21"><font size="1"> </font></td></tr></table>
371 my ($menu, $level) = @_;
374 my @menuorder = $menu->access_control(\%myconfig, $level);
379 $item = shift @menuorder;
382 $label =~ s/$level--//g;
384 $label = $locale->text($label);
385 $label =~ s/ / /g;
386 $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
388 if ($menu->{$item}{submenu}) {
389 $menu->{$item}{$item} = !$form->{$item};
392 if ($mlz{"s$ml"} > 1) { $z = $mlz{"s$ml"}++; $sm = 1; }
393 else { $z = $sm; $mlz{"s$ml"}++; }
395 qq|menu[$mlz{$ml}][$z] = new Item('$label', '#', '', defLength, 0, |
399 print qq|menu[$pm] = new Array();\n|;
401 qq|menu[$pm][0] = new Menu(true, '', 85, 0, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
402 map { shift @menuorder } grep /^$item/, @menuorder;
403 §ion_menu($menu, $item);
404 map { shift @menuorder } grep /^$item/, @menuorder;
406 if ($menu->{$item}{module}) {
409 $target = $menu->{$item}{target};
410 $uri = $menu->menuitemNew(\%myconfig, \%$form, $item, $level);
412 #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|;
414 qq|menu[$pm][$sm] = new Item('$label', '$uri', '$target', defLength, 0, 0);\n|;
417 my $ml_ = $form->escape($ml);
420 %mlz = ($ml, $pm, "s$ml", 1);
422 $breit = 15 + length($label) * 6;
424 qq|menu[0][$mm] = new Item(' $label', '#', '', $breit, 10, $pm); \n|;
425 print qq|menu[$pm] = new Array();\n|;
427 qq|menu[$pm][0] = new Menu(true, '>', 0, 22, 180, defOver, defBack, 'itemBorder', 'itemText');\n|;
429 #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|;
430 §ion_menu($menu, $item);