Use get_small_link().
[readifood.git] / lib / contact.php
index a5bceee..c561023 100644 (file)
     $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();