Code Duplication    Length = 13-14 lines in 5 locations

core/EE_System.core.php 5 locations

@@ 946-958 (lines=13) @@
943
		));
944
945
		//Events
946
		if ( $this->registry->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events' ) ) {
947
			$admin_bar->add_menu(array(
948
					'id' => 'espresso-toolbar-events',
949
					'parent' => 'espresso-toolbar',
950
					'title' => __( 'Events', 'event_espresso' ),
951
					'href' => $events_admin_url,
952
					'meta' => array(
953
							'title' => __('Events', 'event_espresso'),
954
							'target' => '',
955
							'class' => $menu_class
956
					),
957
			));
958
		}
959
960
961
		if ( $this->registry->CAP->current_user_can( 'ee_edit_events', 'ee_admin_bar_menu_espresso-toolbar-events-new' ) ) {
@@ 999-1011 (lines=13) @@
996
		}
997
998
		//Events View
999
		if ( $this->registry->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-view' ) ) {
1000
			$admin_bar->add_menu(array(
1001
					'id' => 'espresso-toolbar-events-view',
1002
					'parent' => 'espresso-toolbar-events',
1003
					'title' => __( 'View', 'event_espresso' ),
1004
					'href' => $events_admin_url,
1005
					'meta' => array(
1006
							'title' => __('View', 'event_espresso'),
1007
							'target' => '',
1008
							'class' => $menu_class
1009
					),
1010
			));
1011
		}
1012
1013
		if ( $this->registry->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all' ) ) {
1014
			//Events View All
@@ 1013-1026 (lines=14) @@
1010
			));
1011
		}
1012
1013
		if ( $this->registry->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all' ) ) {
1014
			//Events View All
1015
			$admin_bar->add_menu(array(
1016
					'id' => 'espresso-toolbar-events-all',
1017
					'parent' => 'espresso-toolbar-events-view',
1018
					'title' => __( 'All', 'event_espresso' ),
1019
					'href' => $events_admin_url,
1020
					'meta' => array(
1021
							'title' => __('All', 'event_espresso'),
1022
							'target' => '',
1023
							'class' => $menu_class
1024
					),
1025
			));
1026
		}
1027
1028
1029
		if ( $this->registry->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-today' ) ) {
@@ 1061-1073 (lines=13) @@
1058
		}
1059
1060
		//Registration Overview
1061
		if ( $this->registry->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations' ) ) {
1062
			$admin_bar->add_menu(array(
1063
					'id' => 'espresso-toolbar-registrations',
1064
					'parent' => 'espresso-toolbar',
1065
					'title' => __( 'Registrations', 'event_espresso' ),
1066
					'href' => $reg_admin_url,
1067
					'meta' => array(
1068
							'title' => __('Registrations', 'event_espresso'),
1069
							'target' => '',
1070
							'class' => $menu_class
1071
					),
1072
			));
1073
		}
1074
1075
		//Registration Overview Today
1076
		if ( $this->registry->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today' ) ) {
@@ 1227-1239 (lines=13) @@
1224
		}
1225
1226
		//Extensions & Services
1227
		if ( $this->registry->CAP->current_user_can( 'ee_read_ee', 'ee_admin_bar_menu_espresso-toolbar-extensions-and-services' ) ) {
1228
			$admin_bar->add_menu(array(
1229
					'id' => 'espresso-toolbar-extensions-and-services',
1230
					'parent' => 'espresso-toolbar',
1231
					'title' => __( 'Extensions & Services', 'event_espresso' ),
1232
					'href' => $extensions_admin_url,
1233
					'meta' => array(
1234
							'title' => __('Extensions & Services', 'event_espresso'),
1235
							'target' => '',
1236
							'class' => $menu_class
1237
					),
1238
			));
1239
		}
1240
	}
1241
1242