Code Duplication    Length = 13-14 lines in 3 locations

mod/widget_manager/lib/hooks.php 1 location

@@ 272-285 (lines=14) @@
269
	);
270
	$tab_count = elgg_get_entities($options);
271
	
272
	if ($tab_count < MULTI_DASHBOARD_MAX_TABS) {
273
274
		$params = array(
275
			"name" => "multi_dashboard",
276
			"text" => elgg_view_icon("home"),
277
			"href" => "multi_dashboard/edit/?internal_url=" . urlencode(current_page_url()),
278
			"title" => elgg_echo("widget_manager:multi_dashboard:extras"),
279
			"rel" => "nofollow",
280
			"id" => "widget-manager-multi_dashboard-extras"
281
		);
282
		$item = ElggMenuItem::factory($params);
283
		
284
		$return_value[] = $item;
285
	}
286
	
287
	return $return_value;
288
}

engine/lib/navigation.php 2 locations

@@ 492-504 (lines=13) @@
489
					);
490
					$return[] = \ElggMenuItem::factory($options);
491
492
					if(elgg_is_logged_in()){
493
494
						// delete link
495
						$options = array(
496
							'name' => 'delete',
497
							'text' => elgg_view_icon('delete'),
498
							'title' => elgg_echo('delete:this'),
499
							'href' => "action/$handler/delete?guid={$entity->getGUID()}",
500
							'confirm' => elgg_echo('deleteconfirm'),
501
							'priority' => 300,
502
						);
503
						$return[] = \ElggMenuItem::factory($options);
504
					}
505
				}
506
			}
507
			}else{
@@ 518-530 (lines=13) @@
515
				);
516
				$return[] = \ElggMenuItem::factory($options);
517
518
				if(elgg_is_logged_in()){
519
520
					// delete link
521
					$options = array(
522
						'name' => 'delete',
523
						'text' => elgg_view_icon('delete'),
524
						'title' => elgg_echo('delete:this'),
525
						'href' => "action/$handler/delete?guid={$entity->getGUID()}",
526
						'confirm' => elgg_echo('deleteconfirm'),
527
						'priority' => 300,
528
					);
529
					$return[] = \ElggMenuItem::factory($options);
530
				}
531
			}
532
		}
533