commit 40255f36b6d4986caa11f5136a3d18857c2231a7
Author: Sven Schöling <s.schoeling@googlemail.com>
Date:   Fri Sep 4 18:40:02 2009 +0200

    Fenster und Tabtitle im XUL Menü gefixt.
    
    Ausserdem unterstützt login.pl jetzt den Parameter callback in allen
    Menüs. Solange keiner angegeben ist, wird nach wie vor company_logo
    aufegrufen, ansonsten die übergebene relative oder absolute url, und im
    iframe aufgerufen.

diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl
index 22c37bf85..92fa25db3 100644
--- a/bin/mozilla/login.pl
+++ b/bin/mozilla/login.pl
@@ -144,7 +144,7 @@ sub login {
   my $menu_script = $style_to_script_map{$user->{menustyle}} || '';
 
   # made it this far, execute the menu
-  $form->{callback} = build_std_url("script=menu${menu_script}.pl", 'action=display');
+  $form->{callback} = build_std_url("script=menu${menu_script}.pl", 'action=display', "callback=" . $form->escape($form->{callback}));
 
   $auth->set_cookie_environment_variable();
 
diff --git a/bin/mozilla/menu.pl b/bin/mozilla/menu.pl
index 976e27e79..6046337be 100644
--- a/bin/mozilla/menu.pl
+++ b/bin/mozilla/menu.pl
@@ -48,6 +48,9 @@ $framesize = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "190";
 sub display {
   $lxdebug->enter_sub();
 
+  $form->{callback}   = $form->unescape($form->{callback});
+  $form->{callback} ||= "login.pl?action=company_logo";
+
   $form->header;
 
   print qq|
@@ -55,7 +58,7 @@ sub display {
   <frame  src="kopf.pl" name="kopf"  scrolling="NO">
   <frameset cols="$framesize,*" framespacing="0" frameborder="0" border="0" >
     <frame src="$form->{script}?action=acc_menu" name="acc_menu"  scrolling="auto" noresize marginwidth="0">
-    <frame src="login.pl?action=company_logo" name="main_window" scrolling="auto">
+    <frame src="$form->{callback}" name="main_window" scrolling="auto">
   </frameset>
   <noframes>
   You need a browser that can read frames to see this page.
@@ -115,9 +118,9 @@ sub section_menu {
     $label_icon = $label . ".gif";
     $mlab       = $label;
     $label      = $locale->text($label);
- 
+
     # multi line hack, sschoeling jul06
-    # if a label is too long, try to split it at whitespaces, then join it to chunks of less 
+    # if a label is too long, try to split it at whitespaces, then join it to chunks of less
     # than 20 chars and store it in an array.
     # use this array later instead of the &nbsp;-ed label
     @chunks = ();
@@ -125,9 +128,10 @@ sub section_menu {
     map {
       if (($l += length $_) < 20) {
         $chunks[$i] .= " $_";
-      } else { 
-        $l = length $_; 
-        $chunks[++$i] = $_; 
+      } else {
+        $l = length $_;
+        $chunks[++$i] = $_;
+
       }
     } split / /, $label;
     map { s/ /&nbsp;/ } @chunks;
diff --git a/bin/mozilla/menuXML.pl b/bin/mozilla/menuXML.pl
index 449a92bdd..287ea32c5 100644
--- a/bin/mozilla/menuXML.pl
+++ b/bin/mozilla/menuXML.pl
@@ -48,6 +48,7 @@ use Encode;
 sub display {
   $locale     = Locale->new($language, "menu");
   my $charset = $dbcharset || 'ISO-8859-1';
+  my $callback = $form->unescape($form->{callback}) || "login.pl?action=company_logo";
 
   my $text    = $form->create_http_response('content_type' => 'text/xml',
                                             'charset'      => $charset)
@@ -62,7 +63,7 @@ sub display {
 
 <doc>
 <name>$myconfig{name}</name>
-
+<callback>$callback</callback>
 <db>$myconfig{dbname}</db>
 
 <favorites>|;
diff --git a/bin/mozilla/menujs.pl b/bin/mozilla/menujs.pl
index 6e5b43388..fd608fc04 100644
--- a/bin/mozilla/menujs.pl
+++ b/bin/mozilla/menujs.pl
@@ -44,6 +44,8 @@ use CGI::Carp qw(fatalsToBrowser);
 # end of main
 
 sub display {
+  $form->{callback}   = $form->unescape($form->{callback});
+  $form->{callback} ||= "login.pl?action=company_logo";
 
   $form->header;
 
@@ -52,7 +54,7 @@ sub display {
   &acc_menu;
 
   print qq|
-<iframe id="win1" src="login.pl?action=company_logo" width="100%" height="93%" name="main_window" style="position: absolute; border:0px;">
+<iframe id="win1" src="$form->{callback}" width="100%" height="93%" name="main_window" style="position: absolute; border:0px;">
 <p>Ihr Browser kann leider keine eingebetteten Frames anzeigen.
 </p>
 </iframe>
@@ -160,7 +162,7 @@ sub acc_menu {
 
 <script type="text/javascript">
 <!--
-var isDOM = (document.getElementById ? true : false); 
+var isDOM = (document.getElementById ? true : false);
 var isIE4 = ((document.all && !isDOM) ? true : false);
 var isNS4 = (document.layers ? true : false);
 //var KO = (navigator.appName=="Konqueror" \|\| navigator.appName=="Opera") ;
@@ -172,7 +174,7 @@ function getRef(id) {
 }
 function getSty(id) {
 	return (isNS4 ? getRef(id) : getRef(id).style);
-} 
+}
 var popTimer = 0;
 var litNow = new Array();
 function popOver(menuNum, itemNum) {
@@ -351,7 +353,7 @@ function moveRoot() {
 |;
 
   print qq|
-  
+
 |;
 
 }
@@ -379,12 +381,12 @@ sub section_menu {
       $menu->{$item}{$item} = !$form->{$item};
 
       # Untermen
-      if ($mlz{"s$ml"} > 1) { 
-		$z++; 
-		$sm = 1; 
-      } else { 
-		$z = $sm; 
-		$mlz{"s$ml"}++; 
+      if ($mlz{"s$ml"} > 1) {
+		$z++;
+		$sm = 1;
+      } else {
+		$z = $sm;
+		$mlz{"s$ml"}++;
       }
       print
         qq|menu[$mlz{$ml}][$z] = new Item('$label', '#', '', defLength, 0, |
diff --git a/bin/mozilla/menunew.pl b/bin/mozilla/menunew.pl
index afce1cf7c..ffb9afd8a 100644
--- a/bin/mozilla/menunew.pl
+++ b/bin/mozilla/menunew.pl
@@ -49,6 +49,7 @@ sub display {
   $form->{force_ul_width} = 1;
   $form->{date}           = clock_line();
   $form->{menu_items}     = acc_menu();
+  $form->{callback}       = $form->unescape($form->{callback}) || "login.pl?action=company_logo";
 
   print $form->parse_html_template("menu/menunew");
 }
diff --git a/bin/mozilla/menuv3.pl b/bin/mozilla/menuv3.pl
index c2fef5df4..43b9fc531 100644
--- a/bin/mozilla/menuv3.pl
+++ b/bin/mozilla/menuv3.pl
@@ -42,8 +42,9 @@ use SL::Menu;
 sub display {
   $form->header(qq|<link rel="stylesheet" href="css/menuv3.css?id=" type="text/css">|);
 
-  $form->{date} = clock_line();
-  $form->{menu} = acc_menu();
+  $form->{date}     = clock_line();
+  $form->{menu}     = acc_menu();
+  $form->{callback} = $form->unescape($form->{callback}) || "login.pl?action=company_logo";
 
   print $form->parse_html_template("menu/menuv3");
 
diff --git a/bin/mozilla/menuv4.pl b/bin/mozilla/menuv4.pl
index ffe3e82c9..0980ff6c7 100644
--- a/bin/mozilla/menuv4.pl
+++ b/bin/mozilla/menuv4.pl
@@ -42,8 +42,9 @@ use SL::Menu;
 sub display {
   $form->header(qq|<link rel="stylesheet" href="css/menuv4.css?id=" type="text/css">|);
 
-  $form->{date} = clock_line();
-  $form->{menu} = acc_menu();
+  $form->{date}     = clock_line();
+  $form->{menu}     = acc_menu();
+  $form->{callback} = $form->unescape($form->{callback}) || "login.pl?action=company_logo";
 
   print $form->parse_html_template("menu/menuv4");
 
diff --git a/templates/webpages/menu/menunew_de.html b/templates/webpages/menu/menunew_de.html
index 9d5240340..df69700f5 100644
--- a/templates/webpages/menu/menunew_de.html
+++ b/templates/webpages/menu/menunew_de.html
@@ -95,7 +95,7 @@ function open_url(url, target) {
     -->
  </script>
 
- <iframe id="win1" src="login.pl?action=company_logo" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
+ <iframe id="win1" src="[% callback %]" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
   <p>Ihr Browser kann leider keine eingebetteten Frames anzeigen. Bitte w&auml;hlen Sie ein anderes Men&uuml; in der Benutzerkonfiguration im Administrationsmen&uuml; aus.</p>
  </iframe>
 </body>
diff --git a/templates/webpages/menu/menunew_master.html b/templates/webpages/menu/menunew_master.html
index c21c6529a..48572163d 100644
--- a/templates/webpages/menu/menunew_master.html
+++ b/templates/webpages/menu/menunew_master.html
@@ -95,7 +95,7 @@ function open_url(url, target) {
     -->
  </script>
 
- <iframe id="win1" src="login.pl?action=company_logo" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
+ <iframe id="win1" src="[% callback %]" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
   <p><translate>MSG_BROWSER_DOES_NOT_SUPPORT_IFRAMES</translate></p>
  </iframe>
 </body>
diff --git a/templates/webpages/menu/menuv3_de.html b/templates/webpages/menu/menuv3_de.html
index 5171ee31b..4687de29e 100644
--- a/templates/webpages/menu/menuv3_de.html
+++ b/templates/webpages/menu/menuv3_de.html
@@ -38,7 +38,7 @@ window.onload=clockon
 
  <div style="clear: both;"></div>
 
- <iframe id="win1" src="login.pl?action=company_logo" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
+ <iframe id="win1" src="[% callback %]" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
   <p>Ihr Browser kann leider keine eingebetteten Frames anzeigen. Bitte w&auml;hlen Sie ein anderes Men&uuml; in der Benutzerkonfiguration im Administrationsmen&uuml; aus.</p>
  </iframe>
 </body>
diff --git a/templates/webpages/menu/menuv3_master.html b/templates/webpages/menu/menuv3_master.html
index 8240287b7..00f76d88a 100644
--- a/templates/webpages/menu/menuv3_master.html
+++ b/templates/webpages/menu/menuv3_master.html
@@ -38,7 +38,7 @@ window.onload=clockon
 
  <div style="clear: both;"></div>
 
- <iframe id="win1" src="login.pl?action=company_logo" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
+ <iframe id="win1" src="[% callback %]" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
   <p><translate>MSG_BROWSER_DOES_NOT_SUPPORT_IFRAMES</translate></p>
  </iframe>
 </body>
diff --git a/templates/webpages/menu/menuv4_master.html b/templates/webpages/menu/menuv4_master.html
index 5002c4879..43d244be1 100644
--- a/templates/webpages/menu/menuv4_master.html
+++ b/templates/webpages/menu/menuv4_master.html
@@ -38,7 +38,7 @@ window.onload=clockon
 
  <div style="clear: both;"></div>
 
- <iframe id="win1" src="login.pl?action=company_logo" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
+ <iframe id="win1" src="[% callback %]" width="100%" height="94%" name="main_window" style="position: absolute; border: 0px; z-index: 99; ">
   <p><translate>MSG_BROWSER_DOES_NOT_SUPPORT_IFRAMES</translate></p>
  </iframe>
 </body>
diff --git a/xslt/xulmenu.xsl b/xslt/xulmenu.xsl
index dd8a1b587..c4b5dde9d 100644
--- a/xslt/xulmenu.xsl
+++ b/xslt/xulmenu.xsl
@@ -1,5 +1,5 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-    xmlns:html="http://www.w3.org/1999/xhtml" 
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:html="http://www.w3.org/1999/xhtml"
     xmlns:svg="http://www.w3.org/2000/svg"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 <xsl:output media-type="application/vnd.mozilla.xul+xml"/>
@@ -30,15 +30,16 @@ wenn die automatische weiterleitung nicht funktioniert klicken sie <a href="menu
 <!-- main document structure -->
 <!-- ******************************************************************* -->
 <xsl:template match="doc">
-<xsl:processing-instruction
-name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-instruction>
-  <window>
-    <html:title>
-      LX-Office Version <xsl:value-of select='/doc/version'/> 
-      - <xsl:value-of select='/doc/name'/> 
+<xsl:processing-instruction name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-instruction>
+  <xsl:variable name="callback"><xsl:value-of select='/doc/callback'/></xsl:variable>
+  <xsl:variable name="title">
+      LX-Office Version <xsl:value-of select='/doc/version'/>
+      - <xsl:value-of select='/doc/name'/>
       - <xsl:value-of select='/doc/db'/>
-    </html:title>
+    </xsl:variable>
    <!-- <xsl:call-template name="style"/>-->
+  <window title="{$title}">
+  <html:title/>
     <xsl:call-template name="script"/>
     <toolbox>
       <xsl:apply-templates select="menu"/>
@@ -53,7 +54,7 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
         <!--<iframe src="xslt/trans.xml" flex="1" id="uhr"/>-->
       </vbox>
       <splitter state="open" collapse="before" resizeafter="farthest"><grippy/></splitter>
-          <html:iframe id="main_window" src="login.pl?action=company_logo" flex="1" style="border:0px"/>
+          <html:iframe id="main_window" src="{$callback}" flex="1" style="border:0px"/>
     </hbox>
   </window>
 </xsl:template>
@@ -117,7 +118,7 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
 <!-- ***************************************************************************  -->
 
 
-<!-- templates for the treeview 
+<!-- templates for the treeview
 **********************************************************************************   -->
 <xsl:template match="menu" mode="tree">
 <toolbar>
@@ -165,11 +166,11 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
 <!-- ***************************************************************************  -->
 
 
-<!-- scripts 
+<!-- scripts
 ********************************************************************************  -->
 <xsl:template name="script">
   <html:script type="text/ecmascript">
-  
+
   function openLink(event)
     {
     var path=event.target.getAttribute("link")
@@ -183,7 +184,7 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
         bf.setAttribute("src",path)
       }
     }
-    
+
   function openLinkNewTab(event)
     {
     if(event.button!=1) return
@@ -195,17 +196,17 @@ name="xml-stylesheet">href="xslt/style1.css" type="text/css"</xsl:processing-ins
       else
       {
 window.open(path,"_new","")
- 
+
       }
     }
-    
-    
+
+
   function openLinkNewWindow(event)
     {
       var path=event.target.getAttribute("link")
       window.open(path,"_blank","")
     }
-  
+
   function openTreeLink(event)
     {
       var tree=event.target
@@ -213,29 +214,29 @@ window.open(path,"_new","")
       var item=tree.view.getItemAtIndex(selIndex)
       var link=item.getAttribute("link")
       if(link) document.getElementById("main_window").setAttribute("src",link)
-    }  
-  
+    }
+
   function updateClock()
     {
       var d= new Date()
-      var sec=d.getSeconds() 
-      var min=d.getMinutes() 
+      var sec=d.getSeconds()
+      var min=d.getMinutes()
       var std=(d.getHours() % 12 ) + min/60
       document.getElementById("std").setAttribute("transform","rotate("+std*30+",20,20)")
       document.getElementById("min").setAttribute("transform","rotate("+min*6+",20,20)")
       document.getElementById("sec").setAttribute("transform","rotate("+sec*6+",20,20)")
     }
-  
+
   function PrintW()
     {
       document.getElementById("main_window").contentWindow.print()
     }
-  
+
   function doSearch(){
   var t=document.getElementById("searchboxtext").value
   document.getElementById("desc").value=t
   document.getElementById("sb").click()
-  
+
   }
   function checkEnter(event){
   if(event.keyCode==13) doSearch()
@@ -291,10 +292,10 @@ image="image/icons/16x16/CRM--Schnellsuche.png" flex="0" oncommand="doSearch()"/
   <input name="partsgroup" size="20"/>
   <input name="make" size="20"/>
   <input class="submit" type="submit" name="action" value="Weiter" id="sb"/>
-  <div style="display:none" >    
-  <input class="submit" type="submit" name="action" value="Top 100"/> 
-    <input type="hidden" name="serialnumber" size="20"/>  
-    <input type="hidden" name="ean" size="20"/>     
+  <div style="display:none" >
+  <input class="submit" type="submit" name="action" value="Top 100"/>
+    <input type="hidden" name="serialnumber" size="20"/>
+    <input type="hidden" name="ean" size="20"/>
     <input type="hidden" name="searchitems" value="part"/>
     <input type="hidden" name="title" value="Waren"/>
     <input type="hidden" name="revers" value="0"/>
@@ -312,9 +313,9 @@ image="image/icons/16x16/CRM--Schnellsuche.png" flex="0" oncommand="doSearch()"/
     <input  name="onorder" class="checkbox" type="checkbox" value="1"/>
     <input  name="ordered" class="checkbox" type="checkbox" value="1"/>
     <input  name="rfq" class="checkbox" type="checkbox" value="1"/>Anfrage
-    <input  name="quoted" class="checkbox" type="checkbox" value="1"/>Angeboten  
+    <input  name="quoted" class="checkbox" type="checkbox" value="1"/>Angeboten
     <input type="hidden" name="transdatefrom" id="transdatefrom" size="11" title="dd.mm.yy"/>
-    <input  type="button" name="transdatefrom" id="trigger1" value="?"/> 
+    <input  type="button" name="transdatefrom" id="trigger1" value="?"/>
     <input name="transdateto" id="transdateto" size="11" title="dd.mm.yy"/>
     <input type="button" name="transdateto" id="trigger2" value="?"/>
     <input name="l_partnumber" class="checkbox" type="checkbox" value="Y" checked="true"/>Artikelnummer
