Code Duplication    Length = 16-18 lines in 2 locations

mod/friend_request/lib/hooks.php 1 location

@@ 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(

mod/wet4/start.php 1 location

@@ 1212-1227 (lines=16) @@
1209
		}
1210
1211
		$blocked_subtypes = array('comment', 'discussion_reply');
1212
		if (in_array($object->getSubtype(), $blocked_subtypes) || elgg_instanceof($object, 'user')) {
1213
			//do not let comments or discussion replies to be reshared on the wire
1214
		} else {
1215
			$return[]= ElggMenuItem::factory(array(
1216
				'name' => 'thewire_tools_reshare',
1217
				'text' => '<i class="fa fa-share-alt fa-lg icon-unsel"><span class="wb-inv">'.$hiddenText['share'].'</span></i>',
1218
				'title' => elgg_echo('thewire_tools:reshare'),
1219
				'href' => 'ajax/view/thewire_tools/reshare?reshare_guid=' . $object->getGUID(),
1220
				'link_class' => 'elgg-lightbox',
1221
				'item_class' => '',
1222
				'is_trusted' => true,
1223
				'priority' => 500
1224
			));
1225
		}
1226
1227
		if (elgg_is_admin_logged_in()) {
1228
			$options = array(
1229
				'name' => 'delete',
1230
				'href' => elgg_add_action_tokens_to_url("action/river/delete?id=$item->id"),