From 87843f0ab772989647ce3116f2508b781f56f0b6 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 1 May 2013 09:37:47 -0400 Subject: [PATCH] Standardise URI for showing Areas in a City. Other entities such as Contacts and Donations use URIs of the form /contact/in/city/ to show entities associated with a particular City. Areas, however, were using /area/in/. Change links and parameter handling for consistency. --- lib/area.php | 8 +++++--- lib/city.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/area.php b/lib/area.php index 5785ed2..9670a86 100644 --- a/lib/area.php +++ b/lib/area.php @@ -236,9 +236,11 @@ /* /area/in/Cambridge/1 */ if (count($parameters)) { if ($parameters[0] == "in") { - $city_id = $parameters[2]; - show_areas(0, 10, $parameters[1], $city_id); - show_new_area_form($city_id); + if ($parameters[1] == "city") { + $city_id = $parameters[3]; + show_areas(0, 10, $parameters[2], $city_id); + show_new_area_form($city_id); + } } } list($name, $id, $args) = parse_parameters($parameters); diff --git a/lib/city.php b/lib/city.php index d4a4a6f..6143bd2 100644 --- a/lib/city.php +++ b/lib/city.php @@ -18,7 +18,7 @@ if (count($p)) { foreach ($p as $city) { echo "
\nCity: " . $city->getStrongLink(get_city_displayname($city)); - printf(" Areas", urlencode($city->getName()), $city->getID()); + printf(" Areas", urlencode($city->getName()), $city->getID()); printf(" Contacts", urlencode($city->getName()), $city->getId()); printf(" Donations", urlencode($city->getName()), $city->getId()); printf(" Orders", urlencode($city->getName()), $city->getId()); -- 2.20.1