From: Michael Vogel Date: Sun, 4 Oct 2015 22:14:39 +0000 (+0200) Subject: Remove all menu entries on the contact list that are empty X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=caa9073a8f94416c7eb3bc1d03809e66f4e2e05e;p=friendica.git Remove all menu entries on the contact list that are empty --- diff --git a/include/Contact.php b/include/Contact.php index 920ec3c2b4..b0fdcbfb8a 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -219,10 +219,14 @@ function contact_photo_menu($contact) { $status_link = $profile_link . "?url=status"; $photos_link = $profile_link . "?url=photos"; $profile_link = $profile_link . "?url=profile"; - $pm_url = $a->get_baseurl() . '/message/new/' . $contact['id']; } - $poke_link = $a->get_baseurl() . '/poke/?f=&c=' . $contact['id']; + if (in_array($contact["network"], array(NETWORK_DFRN, NETWORK_DIASPORA))) + $pm_url = $a->get_baseurl() . '/message/new/' . $contact['id']; + + if ($contact["network"] == NETWORK_DFRN) + $poke_link = $a->get_baseurl() . '/poke/?f=&c=' . $contact['id']; + $contact_url = $a->get_baseurl() . '/contacts/' . $contact['id']; $posts_link = $a->get_baseurl() . '/network/0?nets=all&cid=' . $contact['id']; $contact_drop_link = $a->get_baseurl() . "/contacts/" . $contact['id'] . '/drop?confirm=1'; @@ -254,6 +258,7 @@ function contact_photo_menu($contact) { } } return $o;*/ + foreach($menu as $k=>$v){ if ($v[1]!="") { if(($v[0] !== t("Network Posts")) && ($v[0] !== t("Send PM")) && ($v[0] !== t('Edit Contact'))) @@ -262,7 +267,14 @@ function contact_photo_menu($contact) { $menu[$k][2] = 0; } } - return $menu; + + $menucondensed = array(); + + foreach ($menu AS $menuitem) + if ($menuitem[1] != "") + $menucondensed[] = $menuitem; + + return $menucondensed; }}