From 4429121341de7727be26d56b9a1d7ada84359ea6 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Tue, 27 Aug 2013 17:21:20 +0100 Subject: [PATCH] move more code into library --- lib/template/address-json.php | 2 +- lib/template/address-jsonv2.php | 2 +- lib/template/address-xml.php | 2 +- lib/template/search-html.php | 10 +- website/reverse.php | 137 +-- website/search.php | 1602 ++----------------------------- 6 files changed, 104 insertions(+), 1651 deletions(-) diff --git a/lib/template/address-json.php b/lib/template/address-json.php index 0a1d074a..2f077818 100644 --- a/lib/template/address-json.php +++ b/lib/template/address-json.php @@ -21,7 +21,7 @@ if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat']; if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon']; $aFilteredPlaces['display_name'] = $aPlace['langaddress']; - if ($bShowAddressDetails) $aFilteredPlaces['address'] = $aAddress; + if ($bShowAddressDetails) $aFilteredPlaces['address'] = $aPlace['aAddress']; } javascript_renderData($aFilteredPlaces); diff --git a/lib/template/address-jsonv2.php b/lib/template/address-jsonv2.php index 00f8750d..baf53129 100644 --- a/lib/template/address-jsonv2.php +++ b/lib/template/address-jsonv2.php @@ -26,7 +26,7 @@ $aFilteredPlaces['display_name'] = $aPlace['langaddress']; $aFilteredPlaces['name'] = $aPlace['placename']; - if ($bShowAddressDetails && $aAddress && sizeof($aAddress)) $aFilteredPlaces['address'] = $aAddress; + if ($bShowAddressDetails && $aPlace['aAddress'] && sizeof($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress']; } javascript_renderData($aFilteredPlaces); diff --git a/lib/template/address-xml.php b/lib/template/address-xml.php index 9989bb31..0747844a 100644 --- a/lib/template/address-xml.php +++ b/lib/template/address-xml.php @@ -30,7 +30,7 @@ if ($bShowAddressDetails) { echo ""; - foreach($aAddress as $sKey => $sValue) + foreach($aPlace['aAddress'] as $sKey => $sValue) { $sKey = str_replace(' ','_',$sKey); echo "<$sKey>"; diff --git a/lib/template/search-html.php b/lib/template/search-html.php index 01647d91..b270e02f 100644 --- a/lib/template/search-html.php +++ b/lib/template/search-html.php @@ -15,14 +15,14 @@