Bundesländernamen mit Bindestrichen schreiben
[kivitendo-erp.git] / SL / Form.pm
index 707540e..2647cec 100644 (file)
@@ -265,7 +265,11 @@ sub new {
   $self->{action}  =  lc $self->{action};
   $self->{action}  =~ s/( |-|,|\#)/_/g;
 
-  $self->{version} =  "2.6.1";
+  #$self->{version} =  "2.6.1";                 # Old hardcoded but secure style
+  open VERSION_FILE, "VERSION";                 # New but flexible code reads version from VERSION-file
+  $self->{version} =  <VERSION_FILE>;
+  close VERSION_FILE;                                                  
+  $self->{version}  =~ s/[^0-9A-Za-z\.\_\-]//g; # only allow numbers, letters, points, underscores and dashes. Prevents injecting of malicious code.
 
   $main::lxdebug->leave_sub();
 
@@ -474,7 +478,10 @@ sub info {
     
     <script type="text/javascript">
     <!--
-    setTimeout("parent.frames.main_window.location.href='login.pl?action=company_logo'",1000);
+    // If JavaScript is enabled, the whole thing will be reloaded.
+    // The reason is: When one changes his menu setup (HTML / XUL / CSS ...)
+    // it now loads the correct code into the browser instead of do nothing.
+    setTimeout("top.frames.location.href='login.pl'",500);
     //-->
     </script>
     
@@ -665,6 +672,20 @@ sub header {
     </script>
     | if $self->{"fokus"};
 
+  # if there is a title, we put some JavaScript in to the page, wich writes a 
+  # meaningful title-tag for our frameset.
+    my $title_hack;          
+    if ($self->{"title"}){
+               $title_hack = qq|
+               <script type="text/javascript">
+               <!--
+                 // Write a meaningful title-tag for our frameset.
+                 top.document.title="| . $self->{"title"} . qq| - | . $self->{"login"} . qq| - | . $::myconfig{dbname} . qq| - V| . $self->{"version"} . qq|";
+               //-->
+               </script>
+               |;
+       }
+    
     #Set Calendar
     my $jsscript = "";
     if ($self->{jsscript} == 1) {
@@ -700,9 +721,9 @@ sub header {
   $favicon
   $jsscript
   $ajax
-
   $fokus
-
+  $title_hack
+  
   <link rel="stylesheet" href="css/jquery.autocomplete.css" type="text/css" />
 
   <meta name="robots" content="noindex,nofollow" />