X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=lib%2Fcity.php;h=b90116308286a0d534e600c6e5519997bccccfb6;hb=5e3d7c056815eb5d231d4e6fdb7b82da4b677fb0;hp=d4a4a6fa49b7fbca4b0f15561c428ef02076a4ed;hpb=4cdc138695252cbd34ff94ca1b9e61f833db65fb;p=readifood.git diff --git a/lib/city.php b/lib/city.php index d4a4a6f..b901163 100644 --- a/lib/city.php +++ b/lib/city.php @@ -18,10 +18,12 @@ if (count($p)) { foreach ($p as $city) { echo "
\nCity: " . $city->getStrongLink(get_city_displayname($city)); - 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()); + $n = $city->getName(); + $i = $city->getId(); + echo " " . get_small_link("Areas", "/area/in/city/%s/%d", $n, $i); + echo " " . get_small_link("Contacts", "/contact/in/city/%s/%d", $n, $i); + echo " " . get_small_link("Donations", "/donation/in/city/%s/%d", $n, $i); + echo " " . get_small_link("Orders", "/order/in/city/%s/%d", $n, $i); if (check_admin(1)) { echo " " . $city->getDeleteLink(); } @@ -34,7 +36,7 @@ function show_new_city_form() { if (! check_admin(1)) return; - echo "
\n"; + form("noprint standout"); echo "

Add a new city \n"; echo "with postcode prefix \n"; echo "

\n"; @@ -100,10 +102,12 @@ if (! $city) return; echo "

City: " . get_city_displayname($city) . ""; - 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()); + $n = $city->getName(); + $i = $city->getId(); + echo " " . get_small_link("Areas", "/area/in/city/%s/%d", $n, $i); + echo " " . get_small_link("Contacts", "/contact/in/city/%s/%d", $n, $i); + echo " " . get_small_link("Donations", "/donation/in/city/%s/%d", $n, $i); + echo " " . get_small_link("Orders", "/order/in/city/%s/%d", $n, $i); if (check_admin(1)) { echo " " . $city->getDeleteLink(); } @@ -134,12 +138,9 @@ } } else if (isset($name)) show_city($name, $id); - else { - show_cities(0, 10); - show_new_city_form(); - } + else show_cities(0, 10); + + if (count($parameters)) echo "

Show all cities

\n"; + show_new_city_form(); - # XXX: Format URL in branch case... - if (count($parameters)) - echo "

Show all cities

\n"; ?>