Code Duplication    Length = 13-14 lines in 12 locations

core/EE_System.core.php 12 locations

@@ 1037-1050 (lines=14) @@
1034
		}
1035
1036
1037
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-today' ) ) {
1038
			//Events View Today
1039
			$admin_bar->add_menu(array(
1040
					'id' => 'espresso-toolbar-events-today',
1041
					'parent' => 'espresso-toolbar-events-view',
1042
					'title' => __('Today', 'event_espresso'),
1043
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today' ), $events_admin_url ),
1044
					'meta' => array(
1045
							'title' => __('Today', 'event_espresso'),
1046
							'target' => '',
1047
							'class' => $menu_class
1048
					),
1049
			));
1050
		}
1051
1052
1053
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-month' ) ) {
@@ 1053-1066 (lines=14) @@
1050
		}
1051
1052
1053
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_events', 'ee_admin_bar_menu_espresso-toolbar-events-month' ) ) {
1054
			//Events View This Month
1055
			$admin_bar->add_menu(array(
1056
					'id' => 'espresso-toolbar-events-month',
1057
					'parent' => 'espresso-toolbar-events-view',
1058
					'title' => __( 'This Month', 'event_espresso'),
1059
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month' ), $events_admin_url ),
1060
					'meta' => array(
1061
							'title' => __('This Month', 'event_espresso'),
1062
							'target' => '',
1063
							'class' => $menu_class
1064
					),
1065
			));
1066
		}
1067
1068
		//Registration Overview
1069
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations' ) ) {
@@ 1084-1096 (lines=13) @@
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' ) ) {
1085
			$admin_bar->add_menu(array(
1086
					'id' => 'espresso-toolbar-registrations-today',
1087
					'parent' => 'espresso-toolbar-registrations',
1088
					'title' => __( 'Today', 'event_espresso'),
1089
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today' ), $reg_admin_url ),
1090
					'meta' => array(
1091
							'title' => __('Today', 'event_espresso'),
1092
							'target' => '',
1093
							'class' => $menu_class
1094
					),
1095
			));
1096
		}
1097
1098
		//Registration Overview Today Completed
1099
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-approved' ) ) {
@@ 1099-1111 (lines=13) @@
1096
		}
1097
1098
		//Registration Overview Today Completed
1099
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-approved' ) ) {
1100
			$admin_bar->add_menu(array(
1101
					'id' => 'espresso-toolbar-registrations-today-approved',
1102
					'parent' => 'espresso-toolbar-registrations-today',
1103
					'title' => __( 'Approved', 'event_espresso' ),
1104
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_approved ), $reg_admin_url ),
1105
					'meta' => array(
1106
							'title' => __('Approved', 'event_espresso' ),
1107
							'target' => '',
1108
							'class' => $menu_class
1109
					),
1110
			));
1111
		}
1112
1113
		//Registration Overview Today Pending\
1114
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-pending' ) ) {
@@ 1114-1126 (lines=13) @@
1111
		}
1112
1113
		//Registration Overview Today Pending\
1114
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-pending' ) ) {
1115
			$admin_bar->add_menu(array(
1116
					'id' => 'espresso-toolbar-registrations-today-pending',
1117
					'parent' => 'espresso-toolbar-registrations-today',
1118
					'title' => __( 'Pending', 'event_espresso' ),
1119
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', 'reg_status'=>EEM_Registration::status_id_pending_payment ), $reg_admin_url ),
1120
					'meta' => array(
1121
							'title' => __('Pending Payment', 'event_espresso' ),
1122
							'target' => '',
1123
							'class' => $menu_class
1124
					),
1125
			));
1126
		}
1127
1128
		//Registration Overview Today Incomplete
1129
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-not-approved' ) ) {
@@ 1129-1141 (lines=13) @@
1126
		}
1127
1128
		//Registration Overview Today Incomplete
1129
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-not-approved' ) ) {
1130
			$admin_bar->add_menu(array(
1131
					'id' => 'espresso-toolbar-registrations-today-not-approved',
1132
					'parent' => 'espresso-toolbar-registrations-today',
1133
					'title' => __( 'Not Approved', 'event_espresso' ),
1134
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_not_approved ), $reg_admin_url ),
1135
					'meta' => array(
1136
							'title' => __('Not Approved', 'event_espresso' ),
1137
							'target' => '',
1138
							'class' => $menu_class
1139
					),
1140
			));
1141
		}
1142
1143
		//Registration Overview Today Incomplete
1144
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-cancelled' ) ) {
@@ 1144-1156 (lines=13) @@
1141
		}
1142
1143
		//Registration Overview Today Incomplete
1144
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-today-cancelled' ) ) {
1145
			$admin_bar->add_menu(array(
1146
					'id' => 'espresso-toolbar-registrations-today-cancelled',
1147
					'parent' => 'espresso-toolbar-registrations-today',
1148
					'title' => __( 'Cancelled', 'event_espresso'),
1149
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'today', '_reg_status'=>EEM_Registration::status_id_cancelled ), $reg_admin_url ),
1150
					'meta' => array(
1151
							'title' => __('Cancelled', 'event_espresso'),
1152
							'target' => '',
1153
							'class' => $menu_class
1154
					),
1155
			));
1156
		}
1157
1158
		//Registration Overview This Month
1159
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month' ) ) {
@@ 1159-1171 (lines=13) @@
1156
		}
1157
1158
		//Registration Overview This Month
1159
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month' ) ) {
1160
			$admin_bar->add_menu(array(
1161
					'id' => 'espresso-toolbar-registrations-month',
1162
					'parent' => 'espresso-toolbar-registrations',
1163
					'title' => __( 'This Month', 'event_espresso' ),
1164
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month' ), $reg_admin_url ),
1165
					'meta' => array(
1166
							'title' => __('This Month', 'event_espresso'),
1167
							'target' => '',
1168
							'class' => $menu_class
1169
					),
1170
			));
1171
		}
1172
1173
		//Registration Overview This Month Approved
1174
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-approved' ) ) {
@@ 1174-1186 (lines=13) @@
1171
		}
1172
1173
		//Registration Overview This Month Approved
1174
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-approved' ) ) {
1175
			$admin_bar->add_menu(array(
1176
					'id' => 'espresso-toolbar-registrations-month-approved',
1177
					'parent' => 'espresso-toolbar-registrations-month',
1178
					'title' => __( 'Approved', 'event_espresso' ),
1179
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_approved ), $reg_admin_url ),
1180
					'meta' => array(
1181
							'title' => __('Approved', 'event_espresso'),
1182
							'target' => '',
1183
							'class' => $menu_class
1184
					),
1185
			));
1186
		}
1187
1188
		//Registration Overview This Month Pending
1189
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-pending' ) ) {
@@ 1189-1201 (lines=13) @@
1186
		}
1187
1188
		//Registration Overview This Month Pending
1189
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-pending' ) ) {
1190
			$admin_bar->add_menu(array(
1191
					'id' => 'espresso-toolbar-registrations-month-pending',
1192
					'parent' => 'espresso-toolbar-registrations-month',
1193
					'title' => __( 'Pending', 'event_espresso'),
1194
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_pending_payment ), $reg_admin_url ),
1195
					'meta' => array(
1196
							'title' => __('Pending', 'event_espresso'),
1197
							'target' => '',
1198
							'class' => $menu_class
1199
					),
1200
			));
1201
		}
1202
1203
		//Registration Overview This Month Not Approved
1204
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-not-approved' ) ) {
@@ 1204-1216 (lines=13) @@
1201
		}
1202
1203
		//Registration Overview This Month Not Approved
1204
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-not-approved' ) ) {
1205
			$admin_bar->add_menu(array(
1206
					'id' => 'espresso-toolbar-registrations-month-not-approved',
1207
					'parent' => 'espresso-toolbar-registrations-month',
1208
					'title' => __( 'Not Approved', 'event_espresso'),
1209
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_not_approved ), $reg_admin_url ),
1210
					'meta' => array(
1211
							'title' => __('Not Approved', 'event_espresso' ),
1212
							'target' => '',
1213
							'class' => $menu_class
1214
					),
1215
			));
1216
		}
1217
1218
1219
		//Registration Overview This Month Cancelled
@@ 1220-1232 (lines=13) @@
1217
1218
1219
		//Registration Overview This Month Cancelled
1220
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'ee_admin_bar_menu_espresso-toolbar-registrations-month-cancelled' ) ) {
1221
			$admin_bar->add_menu(array(
1222
					'id' => 'espresso-toolbar-registrations-month-cancelled',
1223
					'parent' => 'espresso-toolbar-registrations-month',
1224
					'title' => __('Cancelled', 'event_espresso'),
1225
					'href' => EEH_URL::add_query_args_and_nonce( array( 'action'=>'default', 'status'=>'month', '_reg_status'=>EEM_Registration::status_id_cancelled ), $reg_admin_url ),
1226
					'meta' => array(
1227
							'title' => __('Cancelled', 'event_espresso'),
1228
							'target' => '',
1229
							'class' => $menu_class
1230
					),
1231
			));
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' ) ) {