Merge pull request #1936 from annando/1510-contact-menu
The contact menu is now improved (for example a "Follow" link)
This commit is contained in:
commit
79391bbb62
1 changed files with 13 additions and 4 deletions
|
@ -850,7 +850,12 @@ function item_photo_menu($item){
|
||||||
$cid = $item['contact-id'];
|
$cid = $item['contact-id'];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$cid = 0;
|
$r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' ORDER BY `uid` DESC LIMIT 1",
|
||||||
|
intval($item['uid']), normalise_link($item['author-link']));
|
||||||
|
if ($r)
|
||||||
|
$cid = $r[0]["id"];
|
||||||
|
else
|
||||||
|
$cid = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(($cid) && (! $item['self'])) {
|
if(($cid) && (! $item['self'])) {
|
||||||
|
@ -877,10 +882,14 @@ function item_photo_menu($item){
|
||||||
t("View Photos") => $photos_link,
|
t("View Photos") => $photos_link,
|
||||||
t("Network Posts") => $posts_link,
|
t("Network Posts") => $posts_link,
|
||||||
t("Edit Contact") => $contact_url,
|
t("Edit Contact") => $contact_url,
|
||||||
t("Send PM") => $pm_url,
|
t("Send PM") => $pm_url
|
||||||
t("Poke") => $poke_link
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($a->contacts[$clean_url]['network'] === NETWORK_DFRN)
|
||||||
|
$menu[t("Poke")] = $poke_link;
|
||||||
|
|
||||||
|
if (($cid == 0) AND in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA)))
|
||||||
|
$menu[t("Connect/Follow")] = $a->get_baseurl($ssl_state)."/follow?url=".urlencode($item['author-link']);
|
||||||
|
|
||||||
$args = array('item' => $item, 'menu' => $menu);
|
$args = array('item' => $item, 'menu' => $menu);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue