Mercurial > hg > batmud > maputils
diff www/loc.php @ 519:50ce4311214e
Sync.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 19 Jan 2008 22:27:10 +0000 |
parents | 622767fb509e |
children | e98844e26c69 |
line wrap: on
line diff
--- a/www/loc.php Sat Jan 19 22:26:16 2008 +0000 +++ b/www/loc.php Sat Jan 19 22:27:10 2008 +0000 @@ -28,7 +28,8 @@ /* Initialization */ -printPageHeader($pageTitle." - Locations"); +printPageHeader($pageTitle." - Locations", + "<script type=\"text/javascript\" src=\"tooltip.js\"></script>"); //echo "<div><b>DEVELOPMENT VERSION</b></div>"; $locTable = array(); @@ -167,14 +168,15 @@ ksort($alphaTable, SORT_STRING); - /* Print locations per first character */ + $locationTips = array(); $totalLoc = 0; $maxRow = 6; while (list($key, $value) = each($alphaTable)) { if (count($value) > 0) { asort($value); + echo "<h3><a name=\"".strtolower($key)."\"></a>".$key."</h3>\n"; echo "<table class=\"loc\" width=\"95%\">\n"; $n = 0; @@ -194,6 +196,15 @@ echo htmlentities($iv["name"])."</a>"; } + if (isset($iv["freeform"]) && strlen($iv["freeform"]) > 0) { + echo " <img src=\"question.png\" onmouseover=\"stt(".$totalLoc.");\" onmouseout=\"htt();\" />\n"; + + $locationTips[$totalLoc] = array( + "title" => $iv["name"], + "desc" => $iv["freeform"] + ); + } + if (count($iv["coders"]) > 0 && $showCoders) { $isSG = preg_match("/[SG]/", $iv["flags"]); if ((!isset($coderName) && !$isSG) || isset($coderName)) { @@ -226,8 +237,17 @@ echo "</table>\n"; } } + + echo "<p><b>".$totalLoc."</b> locations.</p>\n"; - echo "<p><b>".$totalLoc."</b> locations.</p>\n"; + /* Print out location tooltip HTML + */ + reset($locationTips); + while (list($key, $value) = each($locationTips)) { + echo "<div class=\"tooltip\" id=\"tt".$key. + "\"><div class=\"holder\"><b>".htmlentities($value["title"]). + "</b><br />".htmlentities($value["desc"])."</div></div>\n"; + } } else { echo "<p><b>No locations known!</b></p>\n"; }