Merged changes in main branch up to v.2.1.2
[fa-stable.git] / includes / ui / ui_view.inc
index 98af52cc0971042c18765dddfa1def692e97c9ec..e2265f9d62522b1454f59a0718a5ec173a15de1e 100644 (file)
@@ -586,16 +586,12 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='')
 
 function get_js_open_window($width, $height)
 {
-       $js = "\n<script type=\"text/javascript\">\n"
-               . "<!--\n"
-               . "function openWindow(url, title)\n"
+       $js ="function openWindow(url, title)\n"
                . "{\n"
                . " var left = (screen.width - $width) / 2;\n"
                . " var top = (screen.height - $height) / 2;\n"
                . " return window.open(url, title, 'width=$width,height=$height,left='+left+',top='+top+',screenX='+left+',screenY='+top+',status=no,scrollbars=yes');\n"
-               . "}\n"
-               . "-->\n"
-               . "</script>\n";
+               . "}\n";
        return $js;
 }
 
@@ -613,8 +609,9 @@ function set_focus($name, $form_no=0) {
 //     Returns unique name if $name=null
 //     
 function default_focus($name=null, $form_no=0) {
+       static $next; 
        if ($name==null) 
-               $name = uniqid('_el');
+               $name = uniqid('_el',true);
     if (!isset($_POST['_focus'])) {
          set_focus($name);
     }
@@ -623,8 +620,7 @@ function default_focus($name=null, $form_no=0) {
 
 function get_js_png_fix()
 {
-       $js = "<script type=\"text/javascript\">\n"
-               . "function fixPNG(myImage)\n"
+       $js = "function fixPNG(myImage)\n"
                . "{\n"
                . " var arVersion = navigator.appVersion.split(\"MSIE\")\n"
                . " var version = parseFloat(arVersion[1])\n"
@@ -643,8 +639,7 @@ function get_js_png_fix()
         . "    + \"(src=\'\" + myImage.src + \"\', sizingMethod='scale');\\\"></span>\"\n"
                . "  myImage.outerHTML = strNewHTML\n"
        . " }\n"
-               . "}\n"
-               . "</script>\n";
+               . "}\n";
        return $js;
 }