diff --git a/iplookup/functions.js b/iplookup/functions.js index 2ee5802a236fc..529e01070ecab 100644 --- a/iplookup/functions.js +++ b/iplookup/functions.js @@ -23,19 +23,21 @@ */ function iplookup_load(latitude, longitude) { - if (GBrowserIsCompatible()) { - var map = new GMap2(document.getElementById("map")); - map.addControl(new GSmallMapControl()); - map.addControl(new GMapTypeControl()); - var point = new GLatLng(latitude, longitude); - map.setCenter(point, 4); - map.addOverlay(new GMarker(point)); - map.setMapType(G_HYBRID_MAP); - } + if (GBrowserIsCompatible()) { + var map = new GMap2(document.getElementById("map")); + map.addControl(new GSmallMapControl()); + map.addControl(new GMapTypeControl()); + var point = new GLatLng(latitude, longitude); + map.setCenter(point, 4); + map.addOverlay(new GMarker(point)); + map.setMapType(G_HYBRID_MAP); + + YAHOO.utils.Event.addListener(document.body, 'unload', iplookup_unload); + } } function iplookup_unload() { - if (GBrowserIsCompatible()) { - GUnload(); - } + if (GBrowserIsCompatible()) { + GUnload(); + } } diff --git a/iplookup/index.php b/iplookup/index.php index dfa6b88a6ae45..1cc15aed113f1 100644 --- a/iplookup/index.php +++ b/iplookup/index.php @@ -137,14 +137,17 @@ $dx = round((($longitude + 180) * ($imgwidth / 360)) - $imgwidth - $dotwidth/2); $dy = round((($latitude + 90) * ($imgheight / 180))); - print_header(get_string('iplookup', 'admin').': '.$info, $info); + $PAGE->set_title(get_string('iplookup', 'admin').': '.$info); + $PAGE->set_heading($info); + echo $OUTPUT->header(); echo '