From 7a50d2f9964421e932313b15f5d7d3b05ded4c45 Mon Sep 17 00:00:00 2001
From: Sarah Hoffmann
There are more child objects which are not shown. There are more child objects which are not shown.Edit
diff --git a/lib/template/details-html.php b/lib/template/details-html.php
index 7d9696b8..71fcc7b3 100644
--- a/lib/template/details-html.php
+++ b/lib/template/details-html.php
@@ -7,7 +7,6 @@
-
\n";
}
- function osm_link($aFeature)
- {
- $sOSMType = ($aFeature['osm_type'] == 'N'?'node':($aFeature['osm_type'] == 'W'?'way':($aFeature['osm_type'] == 'R'?'relation':'')));
- if ($sOSMType)
- {
- return ''.$sOSMType.' '.$aFeature['osm_id'].'';
- }
- return '';
- }
-
- function wikipedia_link($aFeature)
- {
- if ($aFeature['wikipedia'])
- {
- list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aFeature['wikipedia']);
- return ''.$aFeature['wikipedia'].'';
- }
- return '';
- }
-
- function nominatim_link($aFeature, $sTitle)
- {
- return ''.$sTitle.'';
- }
function format_distance($fDistance)
{
@@ -92,10 +67,10 @@
echo '".$sTitle."
'."\n";
echo ' \n";
}
@@ -143,10 +118,10 @@
}
kv('Coverage' , ($aPointDetails['isarea']=='t'?'Polygon':'Point') );
kv('Centre Point' , $aPointDetails['lat'].','.$aPointDetails['lon'] );
- kv('OSM' , osm_link($aPointDetails) );
+ kv('OSM' , osmLink($aPointDetails) );
if ($aPointDetails['wikipedia'])
{
- kv('Wikipedia Calculated' , wikipedia_link($aPointDetails) );
+ kv('Wikipedia Calculated' , wikipediaLink($aPointDetails) );
}
kv('Extra Tags' , hash_to_subtable($aPointDetails['aExtraTags']) );
diff --git a/lib/template/search-batch-json.php b/lib/template/search-batch-json.php
index edfe3871..60d38041 100644
--- a/lib/template/search-batch-json.php
+++ b/lib/template/search-batch-json.php
@@ -14,7 +14,7 @@
'place_id'=>$aPointDetails['place_id'],
);
- $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
+ $sOSMType = formatOSMType($aPointDetails['osm_type']);
if ($sOSMType)
{
$aPlace['osm_type'] = $sOSMType;
diff --git a/lib/template/search-json.php b/lib/template/search-json.php
index 5d5ebfe8..d3dc00f3 100644
--- a/lib/template/search-json.php
+++ b/lib/template/search-json.php
@@ -9,8 +9,7 @@
'licence'=>"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
);
- $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?
- 'relation':($aPointDetails['osm_type'] == 'T'?'tiger':($aPointDetails['osm_type'] == 'I'?'interpolation':'')))));
+ $sOSMType = formatOSMType($aPointDetails['osm_type']);
if ($sOSMType)
{
$aPlace['osm_type'] = $sOSMType;
diff --git a/lib/template/search-jsonv2.php b/lib/template/search-jsonv2.php
index 251388b5..e907a081 100644
--- a/lib/template/search-jsonv2.php
+++ b/lib/template/search-jsonv2.php
@@ -7,7 +7,7 @@
'licence'=>"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
);
- $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':($aPointDetails['osm_type'] == 'T'?'tiger':($aPointDetails['osm_type'] == 'I'?'interpolation':'')))));
+ $sOSMType = formatOSMType($aPointDetails['osm_type']);
if ($sOSMType)
{
$aPlace['osm_type'] = $sOSMType;
diff --git a/lib/template/search-xml.php b/lib/template/search-xml.php
index 7cbcc04b..7a5c997f 100644
--- a/lib/template/search-xml.php
+++ b/lib/template/search-xml.php
@@ -25,8 +25,7 @@
foreach($aSearchResults as $iResNum => $aResult)
{
echo "'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'No Name')." \n";
echo ' ' . $aAddressLine['class'].':'.$aAddressLine['type'] . " \n";
- echo ' ' . osm_link($aAddressLine) . " \n";
+ echo ' ' . osmLink($aAddressLine) . " \n";
echo ' ' . (isset($aAddressLine['admin_level']) ? $aAddressLine['admin_level'] : '') . " \n";
echo ' ' . format_distance($aAddressLine['distance'])." \n";
- echo ' ' . nominatim_link($aAddressLine,'details >') . " \n";
+ echo ' ' . detailsLink($aAddressLine,'details >') . " \n";
echo "'.$sVal.' ';
+ echo ''.osmLink($aRow).' ';
break;
case 'place_id':
- echo ''.$sVal.' ';
+ echo ''.detailsLink($aRow).' ';
break;
default:
echo "".($sVal?$sVal:' ')." ";
diff --git a/website/details.php b/website/details.php
index 2891ecfc..b3c9591b 100755
--- a/website/details.php
+++ b/website/details.php
@@ -4,6 +4,7 @@
require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
require_once(CONST_BasePath.'/lib/init-website.php');
require_once(CONST_BasePath.'/lib/log.php');
+ require_once(CONST_BasePath.'/lib/output.php');
$sOutputFormat = 'html';
/*
@@ -173,5 +174,4 @@
$sTileAttribution = CONST_Map_Tile_Attribution;
}
-
include(CONST_BasePath.'/lib/template/details-'.$sOutputFormat.'.php');
diff --git a/website/hierarchy.php b/website/hierarchy.php
index 8c0ae1f5..7740abbc 100755
--- a/website/hierarchy.php
+++ b/website/hierarchy.php
@@ -5,6 +5,7 @@
require_once(CONST_BasePath.'/lib/init-website.php');
require_once(CONST_BasePath.'/lib/log.php');
require_once(CONST_BasePath.'/lib/PlaceLookup.php');
+ require_once(CONST_BasePath.'/lib/output.php');
ini_set('memory_limit', '200M');
$oDB =& getDB();
@@ -66,12 +67,17 @@
foreach($aPlaceAddress as $i => $aPlace)
{
if (!$aPlace['place_id']) continue;
- $aBreadcrums[] = array('placeId'=>$aPlace['place_id'], 'osmType'=>$aPlace['osm_type'], 'osmId'=>$aPlace['osm_id'], 'localName'=>$aPlace['localname']);
- $sPlaceUrl = 'hierarchy.php?place_id='.$aPlace['place_id'];
- $sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':'')));
- $sOSMUrl = 'http://www.openstreetmap.org/'.$sOSMType.'/'.$aPlace['osm_id'];
- if ($sOutputFormat == 'html') if ($i) echo " > ";
- if ($sOutputFormat == 'html') echo ''.$aPlace['localname'].' (osm)';
+ $aBreadcrums[] = array('placeId' => $aPlace['place_id'],
+ 'osmType' => $aPlace['osm_type'],
+ 'osmId' => $aPlace['osm_id'],
+ 'localName' => $aPlace['localname']);
+
+ if ($sOutputFormat == 'html')
+ {
+ $sPlaceUrl = 'hierarchy.php?place_id='.$aPlace['place_id'];
+ if ($i) echo " > ";
+ echo ''.$aPlace['localname'].' ('.osmLink($aPlace).')';
+ }
}
@@ -114,28 +120,29 @@
if (!isset($aGroupedAddressLines[$aAddressLine['label']])) $aGroupedAddressLines[$aAddressLine['label']] = array();
$aGroupedAddressLines[$aAddressLine['label']][] = $aAddressLine;
- }
- foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
+ }
+
+ foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
+ {
+ echo "$sGroupHeading
";
+ foreach($aParentOfLines as $aAddressLine)
{
- echo "$sGroupHeading
";
- foreach($aParentOfLines as $aAddressLine)
- {
- $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber'];
- $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
-
- echo '
'.$aRow['id'].' | '; + echo ''.osmLink($aRow).' | '; break; default: echo "".($sVal?$sVal:' ')." | "; @@ -130,10 +131,6 @@ table td { echo "