Code Duplication    Length = 13-14 lines in 6 locations

core/EE_System.core.php 6 locations

@@ 954-966 (lines=13) @@
951
		));
952
953
		//Events
954
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events' ) ) {
955
			$admin_bar->add_menu(array(
956
					'id' => 'espresso-toolbar-events',
957
					'parent' => 'espresso-toolbar',
958
					'title' => __( 'Events', 'event_espresso' ),
959
					'href' => $events_admin_url,
960
					'meta' => array(
961
							'title' => __('Events', 'event_espresso'),
962
							'target' => '',
963
							'class' => $menu_class
964
					),
965
			));
966
		}
967
968
969
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_events', 'ee_admin_bar_menu_espresso-toolbar-events-new' ) ) {
@@ 969-982 (lines=14) @@
966
		}
967
968
969
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_events', 'ee_admin_bar_menu_espresso-toolbar-events-new' ) ) {
970
			//Events Add New
971
			$admin_bar->add_menu(array(
972
					'id' => 'espresso-toolbar-events-new',
973
					'parent' => 'espresso-toolbar-events',
974
					'title' => __('Add New', 'event_espresso'),
975
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'create_new' ), $events_admin_url ),
976
					'meta' => array(
977
							'title' => __('Add New', 'event_espresso'),
978
							'target' => '',
979
							'class' => $menu_class
980
					),
981
			));
982
		}
983
984
		if ( is_single() && ( get_post_type() == 'espresso_events' ) ) {
985
@@ 1007-1019 (lines=13) @@
1004
		}
1005
1006
		//Events View
1007
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-view' ) ) {
1008
			$admin_bar->add_menu(array(
1009
					'id' => 'espresso-toolbar-events-view',
1010
					'parent' => 'espresso-toolbar-events',
1011
					'title' => __( 'View', 'event_espresso' ),
1012
					'href' => $events_admin_url,
1013
					'meta' => array(
1014
							'title' => __('View', 'event_espresso'),
1015
							'target' => '',
1016
							'class' => $menu_class
1017
					),
1018
			));
1019
		}
1020
1021
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all' ) ) {
1022
			//Events View All
@@ 1021-1034 (lines=14) @@
1018
			));
1019
		}
1020
1021
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-all' ) ) {
1022
			//Events View All
1023
			$admin_bar->add_menu(array(
1024
					'id' => 'espresso-toolbar-events-all',
1025
					'parent' => 'espresso-toolbar-events-view',
1026
					'title' => __( 'All', 'event_espresso' ),
1027
					'href' => $events_admin_url,
1028
					'meta' => array(
1029
							'title' => __('All', 'event_espresso'),
1030
							'target' => '',
1031
							'class' => $menu_class
1032
					),
1033
			));
1034
		}
1035
1036
1037
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-today' ) ) {
@@ 1069-1081 (lines=13) @@
1066
		}
1067
1068
		//Registration Overview
1069
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations' ) ) {
1070
			$admin_bar->add_menu(array(
1071
					'id' => 'espresso-toolbar-registrations',
1072
					'parent' => 'espresso-toolbar',
1073
					'title' => __( 'Registrations', 'event_espresso' ),
1074
					'href' => $reg_admin_url,
1075
					'meta' => array(
1076
							'title' => __('Registrations', 'event_espresso'),
1077
							'target' => '',
1078
							'class' => $menu_class
1079
					),
1080
			));
1081
		}
1082
1083
		//Registration Overview Today
1084
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today' ) ) {
@@ 1235-1247 (lines=13) @@
1232
		}
1233
1234
		//Extensions & Services
1235
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'ee_admin_bar_menu_espresso-toolbar-extensions-and-services' ) ) {
1236
			$admin_bar->add_menu(array(
1237
					'id' => 'espresso-toolbar-extensions-and-services',
1238
					'parent' => 'espresso-toolbar',
1239
					'title' => __( 'Extensions & Services', 'event_espresso' ),
1240
					'href' => $extensions_admin_url,
1241
					'meta' => array(
1242
							'title' => __('Extensions & Services', 'event_espresso'),
1243
							'target' => '',
1244
							'class' => $menu_class
1245
					),
1246
			));
1247
		}
1248
	}
1249
1250