From: philipp Date: Sat, 14 Sep 2013 13:21:01 +0000 (+0000) Subject: Wikilinks in the map (e.g. to huts) are now working in preview mode as well. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/mediawiki_extensions/wrmap.git/commitdiff_plain/7e94913cb398af73e5d525e5f76b04b215279b3f Wikilinks in the map (e.g. to huts) are now working in preview mode as well. git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1580 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- diff --git a/wrmap.body.php b/wrmap.body.php index 8723f96..1f2b4b0 100644 --- a/wrmap.body.php +++ b/wrmap.body.php @@ -74,7 +74,12 @@ function xml_to_json_features($input) { $wrong_properties = array_diff($given_properties, $allowed_properties); if (count($wrong_properties) > 0) throw new Exception("Das Attribut '" . reset($wrong_properties) . "' ist nicht erlaubt bei <" . $feature->getName() . ">. Erlaubt sind: '" . implode("', '", $allowed_properties) . "'."); foreach ($given_properties as $property) { - $properties[$property] = (string) $feature[$property]; + $propval = (string) $feature[$property]; + if ($property == 'wiki') { + $title = Title::newFromText($propval); + $propval = $title->getLocalUrl(); + } + $properties[$property] = $propval; } $coordinates = geo_to_coordinates($feature); if (count($coordinates) != 1) throw new Exception('Das Element <' . $feature->getName() . '> muss genau ein Koordinatenpaar haben.');