Tidy up links from summary lines with get_small_link().
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();
}
if (count($p)) {
foreach ($p as $city) {
echo "<br>\nCity: " . $city->getStrongLink(get_city_displayname($city));
- printf(" <a class=\"small\" href=\"/area/in/city/%s/%d\">Areas</a>", urlencode($city->getName()), $city->getId());
- printf(" <a class=\"small\" href=\"/contact/in/city/%s/%d\">Contacts</a>", urlencode($city->getName()), $city->getId());
- printf(" <a class=\"small\" href=\"/donation/in/city/%s/%d\">Donations</a>", urlencode($city->getName()), $city->getId());
- printf(" <a class=\"small\" href=\"/order/in/city/%s/%d\">Orders</a>", 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();
}
if (! $city) return;
echo "<p>City: <span class=\"strong\">" . get_city_displayname($city) . "</span>";
- printf(" <a class=\"small\" href=\"/area/in/city/%s/%d\">Areas</a>", urlencode($city->getName()), $city->getId());
- printf(" <a class=\"small\" href=\"/contact/in/city/%s/%d\">Contacts</a>", urlencode($city->getName()), $city->getId());
- printf(" <a class=\"small\" href=\"/donation/in/city/%s/%d\">Donations</a>", urlencode($city->getName()), $city->getId());
- printf(" <a class=\"small\" href=\"/order/in/city/%s/%d\">Orders</a>", 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();
}
$role = $contact->getRole();
$role_string = get_contact_role_string($contact);
if ($role_string) echo " $role_string";
- if ($role & $GLOBALS['ROLE_DONOR']) printf(" <a class=\"small\" href=\"/donation/from/contact/%s/%d\">Donations</a>", urlencode($contact->getDisplayname()), $contact->getId());
- if ($role & $GLOBALS['ROLE_REQUESTER']) printf(" <a class=\"small\" href=\"/order/from/referrer/%s/%d\">Referred</a>", urlencode($contact->getDisplayname()), $contact->getId());
+ $d = urlencode($contact->getDisplayname());
+ $i = $contact->getId();
+ if ($role & $GLOBALS['ROLE_DONOR']) echo " " . get_small_link("Donations", "/donation/from/contact/%s/%d", $d, $i);
+ if ($role & $GLOBALS['ROLE_REQUESTER']) echo " " . get_small_link("Referred", "/order/from/referrer/%s/%d", $d, $i);
if ($role & $GLOBALS['ROLE_BENEFICIARY']) {
- printf(" <a class=\"small\" href=\"/order/to/beneficiary/%s/%d\">Orders</a>", urlencode($contact->getDisplayname()), $contact->getId());
- if (get_contact_area($contact)) printf(" <a class=\"small\" href=\"/order/place/for/beneficiary/%s/%d\">Place</a>", urlencode($contact->getDisplayname()), $contact->getId());
+ echo " " . get_small_link("Orders", "/order/to/beneficiary/%s/%d", $d, $contact->getId());
+ if (get_contact_area($contact)) echo " " . get_small_link("Place", "/order/place/for/beneficiary/%s/%d", $d, $i);
}
if (check_admin(1)) {
echo " " . $contact->getDeleteLink();