X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2613ebfa0143cdd1e3220577d48d9aa8341dbf38..e70f405abddfe5a8a7400424558071ebba769eda:/website/hierarchy.php
diff --git a/website/hierarchy.php b/website/hierarchy.php
old mode 100755
new mode 100644
index 9b488f83..419a0474
--- a/website/hierarchy.php
+++ b/website/hierarchy.php
@@ -1,10 +1,8 @@
setLanguagePreference($aLangPrefOrder);
-$oPlaceLookup->setIncludeAddressDetails(true);
-$aPlaceAddress = array_reverse($oPlaceLookup->getAddressDetails($iPlaceID));
+$oAddressLookup = new AddressDetails($oDB, $iPlaceID, -1, $aLangPrefOrder);
+$aPlaceAddress = array_reverse($oAddressLookup->getAddressDetails());
if (empty($aPlaceAddress)) userError('Unknown place id.');
@@ -102,18 +98,12 @@ $aParentOfLines = chksql($oDB->getAll($sSQL));
if (!empty($aParentOfLines)) {
echo '
Parent Of:
';
- $aClassType = getClassTypesWithImportance();
$aGroupedAddressLines = array();
foreach ($aParentOfLines as $aAddressLine) {
- if (isset($aClassType[$aAddressLine['class'].':'.$aAddressLine['type'].':'.$aAddressLine['admin_level']]['label'])
- && $aClassType[$aAddressLine['class'].':'.$aAddressLine['type'].':'.$aAddressLine['admin_level']]['label']
- ) {
- $aAddressLine['label'] = $aClassType[$aAddressLine['class'].':'.$aAddressLine['type'].':'.$aAddressLine['admin_level']]['label'];
- } elseif (isset($aClassType[$aAddressLine['class'].':'.$aAddressLine['type']]['label'])
- && $aClassType[$aAddressLine['class'].':'.$aAddressLine['type']]['label']
- ) {
- $aAddressLine['label'] = $aClassType[$aAddressLine['class'].':'.$aAddressLine['type']]['label'];
- } else $aAddressLine['label'] = ucwords($aAddressLine['type']);
+ $aAddressLine['label'] = Nominatim\ClassTypes\getProperty($aAddressLine, 'label');
+ if (!$aAddressLine['label']) {
+ $aAddressLine['label'] = ucwords($aAddressLine['type']);
+ }
if (!isset($aGroupedAddressLines[$aAddressLine['label']])) $aGroupedAddressLines[$aAddressLine['label']] = array();
$aGroupedAddressLines[$aAddressLine['label']][] = $aAddressLine;