Use get_small_link().
[readifood.git] / lib / area.php
index 9670a86..b2ac8c8 100644 (file)
@@ -9,7 +9,7 @@
   }
   else if ($_POST['city_id']) {
     /* XXX: city_id is actually a string $city_name/$city_id */
-    header(sprintf("Location: http%s://%s/%s/in/%s", ($_SERVER['HTTPS']) ? "s" : "", $_SERVER['HTTP_HOST'], $module, $_POST['city_id']));
+    header(sprintf("Location: http%s://%s/%s/in/city/%s", ($_SERVER['HTTPS']) ? "s" : "", $_SERVER['HTTP_HOST'], $module, $_POST['city_id']));
     exit;
   }
   else if ($_POST['update_area']) {
 
         if (count($areas)) {
           foreach ($areas as $area) {
-            echo "<br>\nArea: " . $area->getStrongLink();
-            printf(" <a class=\"small\" href=\"/contact/in/area/%s/%d\">Contacts</a>", urlencode($area->getName()), $area->getId());
-            printf(" <a class=\"small\" href=\"/donation/in/area/%s/%d\">Donations</a>", urlencode($area->getName()), $area->getId());
-            printf(" <a class=\"small\" href=\"/order/in/area/%s/%d\">Orders</a>", urlencode($area->getName()), $area->getId());
+            echo "<br>\nArea: " . $area->getStrongLink() . "\n";
+            $n = urlencode($area->getName());
+            $i = $area->getId();
+            echo " " . get_small_link("Contacts", "/contact/in/area/%s/%d", $n, $i);
+            echo " " . get_small_link("Donations", "/donation/in/area/%s/%d", $n, $i);
+            echo " " . get_small_link("Orders", "/order/in/area/%s/%d", $n, $i);
             if (check_admin(1)) {
               echo " " . $area->getDeleteLink();
             }
 
     echo "<form method=\"POST\" action=\"" . $_SERVER['REQUEST_URI'] . "\">\n";
     echo "<p>Area: <span class=\"strong\">" . $area->getName() . "</span>";
-    printf(" <a class=\"small\" href=\"/contact/in/area/%s/%d\">Contacts</a>", urlencode($area->getName()), $area->getId());
-    printf(" <a class=\"small\" href=\"/donation/in/area/%s/%d\">Donations</a>", urlencode($area->getName()), $area->getId());
-    printf(" <a class=\"small\" href=\"/order/in/area/%s/%d\">Orders</a>", urlencode($area->getName()), $area->getId());
+    $n = $area->getName();
+    $i = $area->getId();
+    echo " " . get_small_link("Contacts", "/contact/in/area/%s/%d", $n, $i);
+    echo " " . get_small_link("Donations", "/donation/in/area/%s/%d", $n, $i);
+    echo " " . get_small_link("Orders", "/order/in/area/%s/%d", $n, $i);
     if (check_admin(1)) {
       echo " " . $area->getDeleteLink();
     }