From: Iain Patterson Date: Wed, 1 May 2013 13:37:47 +0000 (-0400) Subject: Standardise URI for showing Areas in a City. X-Git-Tag: 2013-05-13~27 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=87843f0ab772989647ce3116f2508b781f56f0b6;hp=4cdc138695252cbd34ff94ca1b9e61f833db65fb;p=readifood.git 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. --- 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());