| @@ 101-118 (lines=18) @@ | ||
| 98 | // are we friends |
|
| 99 | if (!$entity->isFriendOf($user->getGUID())) { |
|
| 100 | // no, check if pending request |
|
| 101 | if (check_entity_relationship($user->getGUID(), "friendrequest", $entity->getGUID())) { |
|
| 102 | // pending request |
|
| 103 | $returnvalue[] = ElggMenuItem::factory(array( |
|
| 104 | "name" => "friend_request", |
|
| 105 | "text" => elgg_echo("friend_request:friend:add:pending"), |
|
| 106 | "href" => "friend_request/" . $user->username . "#friend_request_sent_listing", |
|
| 107 | "priority" => 500 |
|
| 108 | )); |
|
| 109 | } else { |
|
| 110 | // add as friend |
|
| 111 | $returnvalue[] = ElggMenuItem::factory(array( |
|
| 112 | "name" => "add_friend", |
|
| 113 | "text" => elgg_echo("friend:add"), |
|
| 114 | "href" => "action/friends/add?friend=" . $entity->getGUID(), |
|
| 115 | "is_action" => true, |
|
| 116 | "priority" => 500 |
|
| 117 | )); |
|
| 118 | } |
|
| 119 | } else { |
|
| 120 | // is friend, se remove friend link |
|
| 121 | $returnvalue[] = ElggMenuItem::factory(array( |
|
| @@ 1316-1331 (lines=16) @@ | ||
| 1313 | } |
|
| 1314 | ||
| 1315 | $blocked_subtypes = array('comment', 'discussion_reply'); |
|
| 1316 | if (in_array($object->getSubtype(), $blocked_subtypes) || elgg_instanceof($object, 'user')) { |
|
| 1317 | //do not let comments or discussion replies to be reshared on the wire |
|
| 1318 | } else { |
|
| 1319 | $return[]= ElggMenuItem::factory(array( |
|
| 1320 | 'name' => 'thewire_tools_reshare', |
|
| 1321 | 'text' => '<span class="fa fa-share-alt fa-lg icon-unsel"><span class="wb-inv">'.$hiddenText['share'].'</span></span>', |
|
| 1322 | 'title' => elgg_echo('thewire_tools:reshare'), |
|
| 1323 | 'href' => 'ajax/view/thewire_tools/reshare?reshare_guid=' . $object->getGUID(), |
|
| 1324 | 'link_class' => 'elgg-lightbox', |
|
| 1325 | 'item_class' => '', |
|
| 1326 | 'is_trusted' => true, |
|
| 1327 | 'priority' => 500 |
|
| 1328 | )); |
|
| 1329 | } |
|
| 1330 | ||
| 1331 | if (elgg_is_admin_logged_in()) { |
|
| 1332 | $options = array( |
|
| 1333 | 'name' => 'delete', |
|
| 1334 | 'href' => elgg_add_action_tokens_to_url("action/river/delete?id=$item->id"), |
|