From 251504e732e484abfb3fecff9210223950aceae7 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 16 Dec 2012 13:28:02 +0000 Subject: [PATCH] The sledrun condition is now shown in the sledrun popup. git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1239 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- wrmap.body.php | 9 +++++++-- wrmap.js | 25 +++++++++++++++++++------ wrmap.php | 2 +- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/wrmap.body.php b/wrmap.body.php index e0f7d2c..60fbf18 100644 --- a/wrmap.body.php +++ b/wrmap.body.php @@ -17,7 +17,7 @@ class WrMap { // Query database $dbr = wfGetDB(DB_SLAVE); - $res = $dbr->select('wrsledruncache', array('page_title', 'position_latitude', 'position_longitude'), array('show_in_overview', 'not under_construction')); + $res = $dbr->select(array('wrsledruncache', 'wrreportcache'), array('wrsledruncache.page_title', 'position_latitude', 'position_longitude', 'date_report', '`condition`'), array('show_in_overview', 'not under_construction'), __METHOD__, array(), array('wrreportcache' => array('left outer join', 'wrsledruncache.page_id=wrreportcache.page_id'))); $sledruns = array(); while ($sledrun = $dbr->fetchRow($res)) $sledruns[] = $sledrun; $dbr->freeResult($res); @@ -34,7 +34,12 @@ class WrMap { $lon = $sledrun['position_longitude']; if (!$lat || !$lon) continue; $title = Title::newFromText($sledrun['page_title']); - $output .= "

getText()}\" data-url=\"{$title->getLocalUrl()}\" />\n"; + $title_text = htmlspecialchars($title->getText()); + $title_url = htmlspecialchars($title->getLocalUrl()); + $output .= "

\n' + + '

\n'; var selectFeatureControl = this; - var popup = new OpenLayers.Popup.FramedCloud("sledruninfopopup_" + feature.attributes['label'], + var popup = new OpenLayers.Popup.FramedCloud('sledruninfopopup_' + feature.attributes['label'], feature.geometry.getBounds().getCenterLonLat(), null, - "

" + feature.attributes['label'] + "

\n" + - "\n", + popup_text, null, true, function(event) { // onPopupClose selectFeatureControl.unselectAll(); diff --git a/wrmap.php b/wrmap.php index 7beee19..a804a61 100644 --- a/wrmap.php +++ b/wrmap.php @@ -3,7 +3,7 @@ $wgExtensionCredits['parserhook'][] = array( 'name' => 'Winterrodeln Map', - 'version' => '2.0.0', + 'version' => '2.1.0', 'author' =>'Philipp Spitzer', 'url' => 'http://www.winterrodeln.org/trac/wiki/WrMap', 'description' => 'This extension creates a map using OpenLayers to show sledruns.' -- 2.39.5