Exemplo n.º 1
0
    }
    print "<br/>";
    //print "<div id='configarea'><p>" . T_("Configuration settings (copy and paste in to config.inc.php)") . "</p><div id='pagesize'><div>define('PAGE_WIDTH',$fwidth);</div><div>define('PAGE_HEIGHT',$fheight);</div></div><div id='config'></div></div>";
    if (isset($_GET['pid'])) {
        $pid = intval($_GET['pid']);
        print " <a href=\"?zoom={$zoomup}&amp;pid={$pid}";
        print "&amp;qid=" . $qid;
        print "\">" . T_("Increase zoom") . "</a> <a href=\"?zoom={$zoomdown}&amp;pid={$pid}";
        print "&amp;qid=" . $qid;
        print "\">" . T_("Decrease zoom") . "</a><br/> ";
        print "<div><a href='?zoom={$zoom}&amp;pid={$pid}&amp;qid={$qid}&amp;copy=copy'>" . T_("Copy settings from this page to all other pages") . "</a><br/></div>";
        print "<div><a href='?zoom={$zoom}&amp;pid={$pid}&amp;qid={$qid}&amp;done=done'>" . T_("Finished page setup") . "</a><br/></div>";
        //show image with no coords selected
        print "<div id=\"imagearea\" style=\"position:relative;\">";
        print "<div id=\"imageboxes\">";
        definetomap($zoom, $pid, $pages[$pid]);
        print "</div>";
        $fwidth = $pages[$pid]['width'];
        $fheight = $pages[$pid]['height'];
        print "<div id=\"imageimage\">";
        $w = floor(($fwidth - 1) / $zoom);
        $h = floor(($fheight - 1) / $zoom);
        print "<img id=\"sampleid\" src=\"../showpage.php?";
        print "pid={$pid}";
        print "\" style=\"border:0; z-index:0;\" width=\"{$w}\" height=\"{$h}\" alt=\"page {$pid} image\"/>";
        print "</div>";
        print "</div>";
        print "<div><p>&nbsp;</p></div>";
        print "<script type='text/javascript'>\n//<![CDATA[\n// Using DragResize is simple!\n// You first declare a new DragResize() object, passing its own name and an object\n// whose keys constitute optional parameters/settings:\n\nvar dragresize = new DragResize('dragresize',\n { minWidth: 20, minHeight: 20, minLeft: 1, minTop: 1, maxLeft: {$w}, maxTop: {$h} });\n\n// Optional settings/properties of the DragResize object are:\n//  enabled: Toggle whether the object is active.\n//  handles[]: An array of drag handles to use (see the .JS file).\n//  minWidth, minHeight: Minimum size to which elements are resized (in pixels).\n//  minLeft, maxLeft, minTop, maxTop: Bounding box (in pixels).\n\n// Next, you must define two functions, isElement and isHandle. These are passed\n// a given DOM element, and must 'return true' if the element in question is a\n// draggable element or draggable handle. Here, I'm checking for the CSS classname\n// of the elements, but you have have any combination of conditions you like:\n\ndragresize.isElement = function(elm)\n{\n if (elm.className && elm.className.indexOf('drsElement') > -1) return true;\n};\ndragresize.isHandle = function(elm)\n{\n if (elm.className && elm.className.indexOf('drsMoveHandle') > -1) return true;\n};\n\n\nfunction getUrlVars()\n{\nvar vars = [], hash;\nvar hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n \nfor(var i = 0; i < hashes.length; i++)\n{\nhash = hashes[i].split('=');\nvars.push(hash[0]);\nvars[hash[0]] = hash[1];\n}\n \nreturn vars;\n}\n\n\n// You can define optional functions that are called as elements are dragged/resized.\n// Some are passed true if the source event was a resize, or false if it's a drag.\n// The focus/blur events are called as handles are added/removed from an object,\n// and the others are called as users drag, move and release the object's handles.\n// You might use these to examine the properties of the DragResize object to sync\n// other page elements, etc.\n\ndragresize.ondragfocus = function() {};\ndragresize.ondragstart = function(isResize) { };\ndragresize.ondragmove = function(isResize) {  };\ndragresize.ondragend = function(isResize) {\n\tvar l = \$\$('div .drsElement');\n\tvar s = 'update=update&';\n\tv = getUrlVars();\n\tvar z = v['zoom'];\n\ts += 'zoom=';\n\ts += z;\n\ts += '&';\n\tvar pid = v['pid'];\n\tvar qid = v['qid'];\n\tfor (var i=0; i < l.length; i++)\n\t{\n\t\ts += l[i].id.toUpperCase();\n\t\ts += 'TLX='\n\t\ts += parseInt(l[i].style.left.replace('px','')) * z;\n\t\ts += '&'\n\n\t\ts += l[i].id.toUpperCase();\n\t\ts += 'TLY='\n\t\ts += parseInt(l[i].style.top.replace('px','')) * z;\n\t\ts += '&'\n\n\t\ts += l[i].id.toUpperCase();\n\t\ts += 'BRX='\n\t\ts += (parseInt(l[i].style.width.replace('px','')) + parseInt(l[i].style.left.replace('px',''))) * z;\n\t\ts += '&'\n\n\t\ts += l[i].id.toUpperCase();\n\t\ts += 'BRY='\n\t\ts += (parseInt(l[i].style.height.replace('px','')) + parseInt(l[i].style.top.replace('px',''))) * z;\n\t\ts += '&'\t\t\t\n\n\t}\n\n\ts += 'pid=' + pid + '&qid=' + qid;\n\n\ts = 'pagesetup.php?' + s;\n\n\tnew Ajax.Updater('imageboxes', s, {method: 'get'});\n\n};\ndragresize.ondragblur = function() { };\n\n\n\n// Finally, you must apply() your DragResize object to a DOM node; all children of this\n// node will then be made draggable. Here, I'm applying to the entire document.\ndragresize.apply(document);\n//]]>\n</script>";
    }
} else {
Exemplo n.º 2
0
 print "<br/>";
 if (isset($_GET['pid'])) {
     $pid = intval($_GET['pid']);
     print " <a href=\"?zoom={$zoomup}&amp;pid={$pid}";
     if (isset($_GET['filename'])) {
         print "&amp;filename=" . $_GET['filename'];
     }
     print "\">" . T_("Increase zoom") . "</a> <a href=\"?zoom={$zoomdown}&amp;pid={$pid}";
     if (isset($_GET['filename'])) {
         print "&amp;filename=" . $_GET['filename'];
     }
     print "\">" . T_("Decrease zoom") . "</a><br/> ";
     //show image with no coords selected
     print "<div id=\"imagearea\" style=\"position:relative;\">";
     print "<div id=\"imageboxes\">";
     definetomap($zoom, $pid, $_GET['filename']);
     print "</div>";
     print "<div id=\"imageimage\">";
     $w = floor($fwidth / $zoom);
     $h = floor($fheight / $zoom);
     print "<img id=\"sampleid\" src=\"../showpage.php?";
     if (isset($_GET['filename'])) {
         print "filename=" . $_GET['filename'] . "{$pid}.png";
     } else {
         print "pid={$pid}";
     }
     print "\" style=\"border:0; z-index:0;\" width=\"{$w}\" height=\"{$h}\" alt=\"page {$pid} image\"/>";
     print "</div>";
     print "</div>";
     print "<div id='configarea'><h3>" . T_("Page test") . "</h3>";
     print "<ul><li>" . T_("Confirm that there is a detected unique barcode for each page and that the barcode fits inside the pink box. If not, edit the BARCODE_PORTION variables in the configuration file") . "</li>";