Wikilinks in the map (e.g. to huts) are now working in preview mode as well.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sat, 14 Sep 2013 13:21:01 +0000 (13:21 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sat, 14 Sep 2013 13:21:01 +0000 (13:21 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrmap/trunk@1580 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrmap.body.php

index 8723f96c0304e18d7e45cd8bc7748acc1d899309..1f2b4b0fd3da7d01bacf6550b98d21c9d2a9110c 100644 (file)
@@ -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.');