]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/output.php
return place_id link to details when not an OSM object
[nominatim.git] / lib / output.php
index fd6226bc503b08d9bd2f6d1c6aa742a37a8c8b83..8715efbc49b61d5fa83aa7d37c9f4d27955634dc 100644 (file)
@@ -39,3 +39,14 @@ function detailsLink($aFeature, $sTitle = false)
 
     return '<a href="details.php?place_id='.$aFeature['place_id'].'">'.($sTitle?$sTitle:$aFeature['place_id']).'</a>';
 }
+
+function detailsPermaLink($aFeature, $sRefText = false)
+{
+    $sOSMType = formatOSMType($aFeature['osm_type'], false);
+
+    if ($sOSMType) {
+        $sLabel = $sRefText ? $sRefText : $sOSMType.' '.$aFeature['osm_id'];
+        return '<a href="details.php?osmtype='.$aFeature['osm_type'].'&osmid='.$aFeature['osm_id'].'&class='.$aFeature['class'].'">'.$sLabel.'</a>';
+    }
+    return detailsLink($aFeature, $sRefText);
+}