X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/832547f192904a9ec92e173c27a91e0874fcc757..bda330a87d7e6de044d4a47e61ded8c4a49fe61e:/lib/output.php?ds=sidebyside diff --git a/lib/output.php b/lib/output.php index 6b427cf4..823a6631 100644 --- a/lib/output.php +++ b/lib/output.php @@ -1,6 +1,7 @@ '.$sOSMType.' '.($sRefText?$sRefText:$aFeature['osm_id']).''; } return ''; @@ -26,18 +28,46 @@ function osmLink($aFeature, $sRefText=false) function wikipediaLink($aFeature) { - if ($aFeature['wikipedia']) - { - list($sLanguage, $sArticle) = explode(':',$aFeature['wikipedia']); + if ($aFeature['wikipedia']) { + list($sLanguage, $sArticle) = explode(':', $aFeature['wikipedia']); return ''.$aFeature['wikipedia'].''; } return ''; } -function detailsLink($aFeature, $sTitle=false) +function detailsLink($aFeature, $sTitle = false, $sExtraProperties = false) { if (!$aFeature['place_id']) return ''; - return ''.($sTitle?$sTitle:$aFeature['place_id']).''; + $sHtml = ''.($sTitle?$sTitle:$aFeature['place_id']).''; + + return $sHtml; } +function detailsPermaLink($aFeature, $sRefText = false, $sExtraProperties = false) +{ + $sOSMType = formatOSMType($aFeature['osm_type'], false); + + if ($sOSMType) { + $sHtml = ''; + + if ($sRefText) { + $sHtml .= $sRefText.''; + } else { + $sHtml .= $sOSMType.' '.$aFeature['osm_id'].''; + } + + return $sHtml; + } + return detailsLink($aFeature, $sRefText, $sExtraProperties); +}