Code Duplication    Length = 13-14 lines in 12 locations

core/EE_System.core.php 12 locations

@@ 1012-1025 (lines=14) @@
1009
		}
1010
1011
1012
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-today' ) ) {
1013
			//Events View Today
1014
			$admin_bar->add_menu(array(
1015
					'id' => 'espresso-toolbar-events-today',
1016
					'parent' => 'espresso-toolbar-events-view',
1017
					'title' => __('Today', 'event_espresso'),
1018
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today' ), $events_admin_url ),
1019
					'meta' => array(
1020
							'title' => __('Today', 'event_espresso'),
1021
							'target' => '',
1022
							'class' => $menu_class
1023
					),
1024
			));
1025
		}
1026
1027
1028
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-month' ) ) {
@@ 1028-1041 (lines=14) @@
1025
		}
1026
1027
1028
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-month' ) ) {
1029
			//Events View This Month
1030
			$admin_bar->add_menu(array(
1031
					'id' => 'espresso-toolbar-events-month',
1032
					'parent' => 'espresso-toolbar-events-view',
1033
					'title' => __( 'This Month', 'event_espresso'),
1034
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month' ), $events_admin_url ),
1035
					'meta' => array(
1036
							'title' => __('This Month', 'event_espresso'),
1037
							'target' => '',
1038
							'class' => $menu_class
1039
					),
1040
			));
1041
		}
1042
1043
		//Registration Overview
1044
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations' ) ) {
@@ 1059-1071 (lines=13) @@
1056
		}
1057
1058
		//Registration Overview Today
1059
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today' ) ) {
1060
			$admin_bar->add_menu(array(
1061
					'id' => 'espresso-toolbar-registrations-today',
1062
					'parent' => 'espresso-toolbar-registrations',
1063
					'title' => __( 'Today', 'event_espresso'),
1064
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today' ), $reg_admin_url ),
1065
					'meta' => array(
1066
							'title' => __('Today', 'event_espresso'),
1067
							'target' => '',
1068
							'class' => $menu_class
1069
					),
1070
			));
1071
		}
1072
1073
		//Registration Overview Today Completed
1074
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-approved' ) ) {
@@ 1074-1086 (lines=13) @@
1071
		}
1072
1073
		//Registration Overview Today Completed
1074
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-approved' ) ) {
1075
			$admin_bar->add_menu(array(
1076
					'id' => 'espresso-toolbar-registrations-today-approved',
1077
					'parent' => 'espresso-toolbar-registrations-today',
1078
					'title' => __( 'Approved', 'event_espresso' ),
1079
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_approved ), $reg_admin_url ),
1080
					'meta' => array(
1081
							'title' => __('Approved', 'event_espresso' ),
1082
							'target' => '',
1083
							'class' => $menu_class
1084
					),
1085
			));
1086
		}
1087
1088
		//Registration Overview Today Pending\
1089
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-pending' ) ) {
@@ 1089-1101 (lines=13) @@
1086
		}
1087
1088
		//Registration Overview Today Pending\
1089
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-pending' ) ) {
1090
			$admin_bar->add_menu(array(
1091
					'id' => 'espresso-toolbar-registrations-today-pending',
1092
					'parent' => 'espresso-toolbar-registrations-today',
1093
					'title' => __( 'Pending', 'event_espresso' ),
1094
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', 'reg_status'=>EEM_Registration::status_id_pending_payment ), $reg_admin_url ),
1095
					'meta' => array(
1096
							'title' => __('Pending Payment', 'event_espresso' ),
1097
							'target' => '',
1098
							'class' => $menu_class
1099
					),
1100
			));
1101
		}
1102
1103
		//Registration Overview Today Incomplete
1104
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-not-approved' ) ) {
@@ 1104-1116 (lines=13) @@
1101
		}
1102
1103
		//Registration Overview Today Incomplete
1104
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-not-approved' ) ) {
1105
			$admin_bar->add_menu(array(
1106
					'id' => 'espresso-toolbar-registrations-today-not-approved',
1107
					'parent' => 'espresso-toolbar-registrations-today',
1108
					'title' => __( 'Not Approved', 'event_espresso' ),
1109
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_not_approved ), $reg_admin_url ),
1110
					'meta' => array(
1111
							'title' => __('Not Approved', 'event_espresso' ),
1112
							'target' => '',
1113
							'class' => $menu_class
1114
					),
1115
			));
1116
		}
1117
1118
		//Registration Overview Today Incomplete
1119
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-cancelled' ) ) {
@@ 1119-1131 (lines=13) @@
1116
		}
1117
1118
		//Registration Overview Today Incomplete
1119
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-cancelled' ) ) {
1120
			$admin_bar->add_menu(array(
1121
					'id' => 'espresso-toolbar-registrations-today-cancelled',
1122
					'parent' => 'espresso-toolbar-registrations-today',
1123
					'title' => __( 'Cancelled', 'event_espresso'),
1124
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_cancelled ), $reg_admin_url ),
1125
					'meta' => array(
1126
							'title' => __('Cancelled', 'event_espresso'),
1127
							'target' => '',
1128
							'class' => $menu_class
1129
					),
1130
			));
1131
		}
1132
1133
		//Registration Overview This Month
1134
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month' ) ) {
@@ 1134-1146 (lines=13) @@
1131
		}
1132
1133
		//Registration Overview This Month
1134
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month' ) ) {
1135
			$admin_bar->add_menu(array(
1136
					'id' => 'espresso-toolbar-registrations-month',
1137
					'parent' => 'espresso-toolbar-registrations',
1138
					'title' => __( 'This Month', 'event_espresso' ),
1139
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month' ), $reg_admin_url ),
1140
					'meta' => array(
1141
							'title' => __('This Month', 'event_espresso'),
1142
							'target' => '',
1143
							'class' => $menu_class
1144
					),
1145
			));
1146
		}
1147
1148
		//Registration Overview This Month Approved
1149
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-approved' ) ) {
@@ 1149-1161 (lines=13) @@
1146
		}
1147
1148
		//Registration Overview This Month Approved
1149
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-approved' ) ) {
1150
			$admin_bar->add_menu(array(
1151
					'id' => 'espresso-toolbar-registrations-month-approved',
1152
					'parent' => 'espresso-toolbar-registrations-month',
1153
					'title' => __( 'Approved', 'event_espresso' ),
1154
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_approved ), $reg_admin_url ),
1155
					'meta' => array(
1156
							'title' => __('Approved', 'event_espresso'),
1157
							'target' => '',
1158
							'class' => $menu_class
1159
					),
1160
			));
1161
		}
1162
1163
		//Registration Overview This Month Pending
1164
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-pending' ) ) {
@@ 1164-1176 (lines=13) @@
1161
		}
1162
1163
		//Registration Overview This Month Pending
1164
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-pending' ) ) {
1165
			$admin_bar->add_menu(array(
1166
					'id' => 'espresso-toolbar-registrations-month-pending',
1167
					'parent' => 'espresso-toolbar-registrations-month',
1168
					'title' => __( 'Pending', 'event_espresso'),
1169
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_pending_payment ), $reg_admin_url ),
1170
					'meta' => array(
1171
							'title' => __('Pending', 'event_espresso'),
1172
							'target' => '',
1173
							'class' => $menu_class
1174
					),
1175
			));
1176
		}
1177
1178
		//Registration Overview This Month Not Approved
1179
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-not-approved' ) ) {
@@ 1179-1191 (lines=13) @@
1176
		}
1177
1178
		//Registration Overview This Month Not Approved
1179
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-not-approved' ) ) {
1180
			$admin_bar->add_menu(array(
1181
					'id' => 'espresso-toolbar-registrations-month-not-approved',
1182
					'parent' => 'espresso-toolbar-registrations-month',
1183
					'title' => __( 'Not Approved', 'event_espresso'),
1184
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_not_approved ), $reg_admin_url ),
1185
					'meta' => array(
1186
							'title' => __('Not Approved', 'event_espresso' ),
1187
							'target' => '',
1188
							'class' => $menu_class
1189
					),
1190
			));
1191
		}
1192
1193
1194
		//Registration Overview This Month Cancelled
@@ 1195-1207 (lines=13) @@
1192
1193
1194
		//Registration Overview This Month Cancelled
1195
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-cancelled' ) ) {
1196
			$admin_bar->add_menu(array(
1197
					'id' => 'espresso-toolbar-registrations-month-cancelled',
1198
					'parent' => 'espresso-toolbar-registrations-month',
1199
					'title' => __('Cancelled', 'event_espresso'),
1200
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_cancelled ), $reg_admin_url ),
1201
					'meta' => array(
1202
							'title' => __('Cancelled', 'event_espresso'),
1203
							'target' => '',
1204
							'class' => $menu_class
1205
					),
1206
			));
1207
		}
1208
1209
		//Extensions & Services
1210
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_ee', 'ee_admin_bar_menu_espresso-toolbar-extensions-and-services' ) ) {