Code Duplication    Length = 13-14 lines in 5 locations

core/EE_System.core.php 5 locations

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