Code Duplication    Length = 23-24 lines in 5 locations

caffeinated/admin/extend/messages/Extend_Messages_Admin_Page.core.php 1 location

@@ 170-192 (lines=23) @@
167
	 * @access public
168
	 * @return void
169
	 */
170
	public function _set_list_table_views_custom_mtps() {
171
		$this->_views = array(
172
			'in_use' => array(
173
				'slug' => 'in_use',
174
				'label' => __('In Use', 'event_espresso'),
175
				'count' => 0,
176
				'bulk_action' => array(
177
					'trash_message_template' => __('Move to Trash', 'event_espresso')
178
				)
179
			)
180
		);
181
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_messages', 'espresso_messages_trash_message_template' ) ) {
182
			$this->_views['trashed'] = array(
183
				'slug' => 'trashed',
184
				'label' => __('Trash', 'event_espresso'),
185
				'count' => 0,
186
				'bulk_action' => array(
187
					'restore_message_template' => __('Restore From Trash', 'event_espresso'),
188
					'delete_message_template' => __('Delete Permanently', 'event_espresso')
189
				)
190
			);
191
		}
192
	}
193
194
195

caffeinated/admin/extend/registration_form/Extend_Registration_Form_Admin_Page.core.php 2 locations

@@ 371-394 (lines=24) @@
368
369
370
371
	protected function _set_list_table_views_default() {
372
		$this->_views = array(
373
			'all' => array(
374
				'slug' => 'all',
375
				'label' => esc_html__('View All Questions', 'event_espresso'),
376
				'count' => 0,
377
				'bulk_action' => array(
378
					'trash_questions' => esc_html__('Trash', 'event_espresso'),
379
					)
380
				)
381
		);
382
383
		if ( EE_Registry::instance()->CAP->current_user_can('ee_delete_questions', 'espresso_registration_form_trash_questions' ) ) {
384
			$this->_views['trash'] = array(
385
				'slug' => 'trash',
386
				'label' => esc_html__('Trash', 'event_espresso'),
387
				'count' => 0,
388
				'bulk_action' => array(
389
					'delete_questions' => esc_html__('Delete Permanently', 'event_espresso'),
390
					'restore_questions' => esc_html__('Restore', 'event_espresso'),
391
					)
392
				);
393
		}
394
	}
395
396
397
@@ 401-424 (lines=24) @@
398
399
400
401
	protected function _set_list_table_views_question_groups() {
402
		$this->_views = array(
403
			'all' => array(
404
				'slug' => 'all',
405
				'label' => esc_html__('All', 'event_espresso'),
406
				'count' => 0,
407
				'bulk_action' => array(
408
					'trash_question_groups' => esc_html__('Trash', 'event_espresso'),
409
					)
410
				)
411
		);
412
413
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_question_groups', 'espresso_registration_form_trash_question_groups' ) ) {
414
			$this->_views['trash'] = array(
415
				'slug' => 'trash',
416
				'label' => esc_html__('Trash', 'event_espresso'),
417
				'count' => 0,
418
				'bulk_action' => array(
419
					'delete_question_groups' => esc_html__('Delete Permanently', 'event_espresso'),
420
					'restore_question_groups' => esc_html__('Restore', 'event_espresso'),
421
					)
422
				);
423
		}
424
	}
425
426
427

caffeinated/admin/new/pricing/Pricing_Admin_Page.core.php 2 locations

@@ 405-428 (lines=24) @@
402
403
404
405
	protected function _set_list_table_views_default() {
406
		$this->_views = array(
407
			'all' => array(
408
					'slug' => 'all',
409
					'label' => __('View All Default Pricing', 'event_espresso'),
410
					'count' => 0,
411
					'bulk_action' => array(
412
							'trash_price' => __('Move to Trash', 'event_espresso')
413
						)
414
				)
415
		);
416
417
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_prices', 'pricing_trash_price' ) ) {
418
			$this->_views['trashed'] = array(
419
					'slug' => 'trashed',
420
					'label' => __('Trash', 'event_espresso'),
421
					'count' => 0,
422
					'bulk_action' => array(
423
							'restore_price' => __('Restore from Trash', 'event_espresso'),
424
							'delete_price' => __('Delete Permanently', 'event_espresso')
425
						)
426
				);
427
		}
428
	}
429
430
431
@@ 435-458 (lines=24) @@
432
433
434
435
	protected function _set_list_table_views_price_types() {
436
		$this->_views = array(
437
			'all' => array(
438
					'slug' => 'all',
439
					'label' => __('All', 'event_espresso'),
440
					'count' => 0,
441
					'bulk_action' => array(
442
							'trash_price_type' => __('Move to Trash', 'event_espresso')
443
						)
444
				)
445
		);
446
447
		if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_types', 'pricing_trash_price_type' ) ) {
448
			 $this->_views['trashed'] = array(
449
					'slug' => 'trashed',
450
					'label' => __('Trash', 'event_espresso'),
451
					'count' => 0,
452
					'bulk_action' => array(
453
							'restore_price_type' => __('Restore from Trash', 'event_espresso'),
454
							'delete_price_type' => __('Delete Permanently', 'event_espresso')
455
						)
456
				);
457
		}
458
	}
459
460
461
	/**