| @@ 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( |
|
| @@ 1292-1307 (lines=16) @@ | ||
| 1289 | } |
|
| 1290 | ||
| 1291 | $blocked_subtypes = array('comment', 'discussion_reply'); |
|
| 1292 | if (in_array($object->getSubtype(), $blocked_subtypes) || elgg_instanceof($object, 'user')) { |
|
| 1293 | //do not let comments or discussion replies to be reshared on the wire |
|
| 1294 | } else { |
|
| 1295 | $return[]= ElggMenuItem::factory(array( |
|
| 1296 | 'name' => 'thewire_tools_reshare', |
|
| 1297 | 'text' => '<i class="fa fa-share-alt fa-lg icon-unsel"><span class="wb-inv">'.$hiddenText['share'].'</span></i>', |
|
| 1298 | 'title' => elgg_echo('thewire_tools:reshare'), |
|
| 1299 | 'href' => 'ajax/view/thewire_tools/reshare?reshare_guid=' . $object->getGUID(), |
|
| 1300 | 'link_class' => 'elgg-lightbox', |
|
| 1301 | 'item_class' => '', |
|
| 1302 | 'is_trusted' => true, |
|
| 1303 | 'priority' => 500 |
|
| 1304 | )); |
|
| 1305 | } |
|
| 1306 | ||
| 1307 | if (elgg_is_admin_logged_in()) { |
|
| 1308 | $options = array( |
|
| 1309 | 'name' => 'delete', |
|
| 1310 | 'href' => elgg_add_action_tokens_to_url("action/river/delete?id=$item->id"), |
|