Code Duplication    Length = 13-14 lines in 6 locations

core/EE_System.core.php 6 locations

@@ 947-959 (lines=13) @@
944
		));
945
946
		//Events
947
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events' ) ) {
948
			$admin_bar->add_menu(array(
949
					'id' => 'espresso-toolbar-events',
950
					'parent' => 'espresso-toolbar',
951
					'title' => __( 'Events', 'event_espresso' ),
952
					'href' => $events_admin_url,
953
					'meta' => array(
954
							'title' => __('Events', 'event_espresso'),
955
							'target' => '',
956
							'class' => $menu_class
957
					),
958
			));
959
		}
960
961
962
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_events', 'ee_admin_bar_menu_espresso-toolbar-events-new' ) ) {
@@ 962-975 (lines=14) @@
959
		}
960
961
962
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_events', 'ee_admin_bar_menu_espresso-toolbar-events-new' ) ) {
963
			//Events Add New
964
			$admin_bar->add_menu(array(
965
					'id' => 'espresso-toolbar-events-new',
966
					'parent' => 'espresso-toolbar-events',
967
					'title' => __('Add New', 'event_espresso'),
968
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'create_new' ), $events_admin_url ),
969
					'meta' => array(
970
							'title' => __('Add New', 'event_espresso'),
971
							'target' => '',
972
							'class' => $menu_class
973
					),
974
			));
975
		}
976
977
		if ( is_single() && ( get_post_type() == 'espresso_events' ) ) {
978
@@ 1000-1012 (lines=13) @@
997
		}
998
999
		//Events View
1000
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-view' ) ) {
1001
			$admin_bar->add_menu(array(
1002
					'id' => 'espresso-toolbar-events-view',
1003
					'parent' => 'espresso-toolbar-events',
1004
					'title' => __( 'View', 'event_espresso' ),
1005
					'href' => $events_admin_url,
1006
					'meta' => array(
1007
							'title' => __('View', 'event_espresso'),
1008
							'target' => '',
1009
							'class' => $menu_class
1010
					),
1011
			));
1012
		}
1013
1014
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all' ) ) {
1015
			//Events View All
@@ 1014-1027 (lines=14) @@
1011
			));
1012
		}
1013
1014
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all' ) ) {
1015
			//Events View All
1016
			$admin_bar->add_menu(array(
1017
					'id' => 'espresso-toolbar-events-all',
1018
					'parent' => 'espresso-toolbar-events-view',
1019
					'title' => __( 'All', 'event_espresso' ),
1020
					'href' => $events_admin_url,
1021
					'meta' => array(
1022
							'title' => __('All', 'event_espresso'),
1023
							'target' => '',
1024
							'class' => $menu_class
1025
					),
1026
			));
1027
		}
1028
1029
1030
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-today' ) ) {
@@ 1062-1074 (lines=13) @@
1059
		}
1060
1061
		//Registration Overview
1062
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations' ) ) {
1063
			$admin_bar->add_menu(array(
1064
					'id' => 'espresso-toolbar-registrations',
1065
					'parent' => 'espresso-toolbar',
1066
					'title' => __( 'Registrations', 'event_espresso' ),
1067
					'href' => $reg_admin_url,
1068
					'meta' => array(
1069
							'title' => __('Registrations', 'event_espresso'),
1070
							'target' => '',
1071
							'class' => $menu_class
1072
					),
1073
			));
1074
		}
1075
1076
		//Registration Overview Today
1077
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today' ) ) {
@@ 1228-1240 (lines=13) @@
1225
		}
1226
1227
		//Extensions & Services
1228
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'ee_admin_bar_menu_espresso-toolbar-extensions-and-services' ) ) {
1229
			$admin_bar->add_menu(array(
1230
					'id' => 'espresso-toolbar-extensions-and-services',
1231
					'parent' => 'espresso-toolbar',
1232
					'title' => __( 'Extensions & Services', 'event_espresso' ),
1233
					'href' => $extensions_admin_url,
1234
					'meta' => array(
1235
							'title' => __('Extensions & Services', 'event_espresso'),
1236
							'target' => '',
1237
							'class' => $menu_class
1238
					),
1239
			));
1240
		}
1241
	}
1242
1243