|
@@ -34,23 +34,23 @@ discard block |
|
|
block discarded – undo |
|
34
|
34
|
/** gf_entries page - entries table screen */ |
|
35
|
35
|
|
|
36
|
36
|
// capture bulk actions |
|
37
|
|
- add_action( 'init', array( $this, 'process_bulk_action') ); |
|
|
37
|
+ add_action( 'init', array( $this, 'process_bulk_action' ) ); |
|
38
|
38
|
// add hidden field with approve status |
|
39
|
39
|
add_action( 'gform_entries_first_column', array( $this, 'add_entry_approved_hidden_input' ), 1, 5 ); |
|
40
|
40
|
// process ajax approve entry requests |
|
41
|
|
- add_action('wp_ajax_gv_update_approved', array( $this, 'ajax_update_approved')); |
|
|
41
|
+ add_action( 'wp_ajax_gv_update_approved', array( $this, 'ajax_update_approved' ) ); |
|
42
|
42
|
|
|
43
|
43
|
// when using the User opt-in field, check on entry submission |
|
44
|
44
|
add_action( 'gform_after_submission', array( $this, 'after_submission' ), 10, 2 ); |
|
45
|
45
|
|
|
46
|
46
|
// in case entry is edited (on admin or frontend) |
|
47
|
|
- add_action( 'gform_after_update_entry', array( $this, 'after_update_entry_update_approved_meta' ), 10, 2); |
|
|
47
|
+ add_action( 'gform_after_update_entry', array( $this, 'after_update_entry_update_approved_meta' ), 10, 2 ); |
|
48
|
48
|
|
|
49
|
49
|
|
|
50
|
50
|
add_filter( 'gravityview_tooltips', array( $this, 'tooltips' ) ); |
|
51
|
51
|
|
|
52
|
52
|
// adding styles and scripts |
|
53
|
|
- add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles') ); |
|
|
53
|
+ add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ) ); |
|
54
|
54
|
// bypass Gravity Forms no-conflict mode |
|
55
|
55
|
add_filter( 'gform_noconflict_scripts', array( $this, 'register_gform_noconflict_script' ) ); |
|
56
|
56
|
add_filter( 'gform_noconflict_styles', array( $this, 'register_gform_noconflict_style' ) ); |
|
@@ -65,9 +65,9 @@ discard block |
|
|
block discarded – undo |
|
65
|
65
|
*/ |
|
66
|
66
|
function tooltips( $tooltips ) { |
|
67
|
67
|
|
|
68
|
|
- $tooltips['form_gravityview_fields'] = array( |
|
69
|
|
- 'title' => __('GravityView Fields', 'gravityview'), |
|
70
|
|
- 'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview'), |
|
|
68
|
+ $tooltips[ 'form_gravityview_fields' ] = array( |
|
|
69
|
+ 'title' => __( 'GravityView Fields', 'gravityview' ), |
|
|
70
|
+ 'value' => __( 'Allow administrators to approve or reject entries and users to opt-in or opt-out of their entries being displayed.', 'gravityview' ), |
|
71
|
71
|
); |
|
72
|
72
|
|
|
73
|
73
|
return $tooltips; |
|
@@ -182,12 +182,12 @@ discard block |
|
|
block discarded – undo |
|
182
|
182
|
} |
|
183
|
183
|
|
|
184
|
184
|
// gforms_update_note is sent when bulk editing entry notes. We don't want to process then. |
|
185
|
|
- if ( 'bulk' === RGForms::post( 'action' ) && empty( $_POST['gforms_update_note'] ) ) { |
|
|
185
|
+ if ( 'bulk' === RGForms::post( 'action' ) && empty( $_POST[ 'gforms_update_note' ] ) ) { |
|
186
|
186
|
|
|
187
|
187
|
check_admin_referer( 'gforms_entry_list', 'gforms_entry_list' ); |
|
188
|
188
|
|
|
189
|
189
|
// The action is formatted like: approve-16 or disapprove-16, where the first word is the name of the action and the second is the ID of the form. Bulk action 2 is the bottom bulk action select form. |
|
190
|
|
- $bulk_action = ! empty( $_POST['bulk_action'] ) ? $_POST['bulk_action'] : $_POST['bulk_action2']; |
|
|
190
|
+ $bulk_action = ! empty( $_POST[ 'bulk_action' ] ) ? $_POST[ 'bulk_action' ] : $_POST[ 'bulk_action2' ]; |
|
191
|
191
|
|
|
192
|
192
|
/** |
|
193
|
193
|
* The extra '-' is to make sure that there are at *least* two items in array. |
|
@@ -203,13 +203,13 @@ discard block |
|
|
block discarded – undo |
|
203
|
203
|
} |
|
204
|
204
|
|
|
205
|
205
|
// All entries are set to be updated, not just the visible ones |
|
206
|
|
- if ( ! empty( $_POST['all_entries'] ) ) { |
|
|
206
|
+ if ( ! empty( $_POST[ 'all_entries' ] ) ) { |
|
207
|
207
|
|
|
208
|
208
|
// Convert the current entry search into GF-formatted search criteria |
|
209
|
209
|
$search = array( |
|
210
|
|
- 'search_field' => isset( $_POST['f'] ) ? $_POST['f'][0] : 0, |
|
211
|
|
- 'search_value' => isset( $_POST['v'][0] ) ? $_POST['v'][0] : '', |
|
212
|
|
- 'search_operator' => isset( $_POST['o'][0] ) ? $_POST['o'][0] : 'contains', |
|
|
210
|
+ 'search_field' => isset( $_POST[ 'f' ] ) ? $_POST[ 'f' ][ 0 ] : 0, |
|
|
211
|
+ 'search_value' => isset( $_POST[ 'v' ][ 0 ] ) ? $_POST[ 'v' ][ 0 ] : '', |
|
|
212
|
+ 'search_operator' => isset( $_POST[ 'o' ][ 0 ] ) ? $_POST[ 'o' ][ 0 ] : 'contains', |
|
213
|
213
|
); |
|
214
|
214
|
|
|
215
|
215
|
$search_criteria = GravityView_frontend::get_search_criteria( $search, $form_id ); |
|
@@ -219,7 +219,7 @@ discard block |
|
|
block discarded – undo |
|
219
|
219
|
|
|
220
|
220
|
} else { |
|
221
|
221
|
|
|
222
|
|
- $entries = $_POST['lead']; |
|
|
222
|
+ $entries = $_POST[ 'lead' ]; |
|
223
|
223
|
|
|
224
|
224
|
} |
|
225
|
225
|
|
|
@@ -260,12 +260,12 @@ discard block |
|
|
block discarded – undo |
|
260
|
260
|
*/ |
|
261
|
261
|
private static function update_bulk( $entries, $approved, $form_id ) { |
|
262
|
262
|
|
|
263
|
|
- if( empty($entries) || ( $entries !== true && !is_array($entries) ) ) { |
|
|
263
|
+ if ( empty( $entries ) || ( $entries !== true && ! is_array( $entries ) ) ) { |
|
264
|
264
|
do_action( 'gravityview_log_error', __METHOD__ . ' Entries were empty or malformed.', $entries ); |
|
265
|
265
|
return false; |
|
266
|
266
|
} |
|
267
|
267
|
|
|
268
|
|
- if( ! GVCommon::has_cap( 'gravityview_moderate_entries' ) ) { |
|
|
268
|
+ if ( ! GVCommon::has_cap( 'gravityview_moderate_entries' ) ) { |
|
269
|
269
|
do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the `gravityview_moderate_entries` capability.' ); |
|
270
|
270
|
return false; |
|
271
|
271
|
} |
|
@@ -275,7 +275,7 @@ discard block |
|
|
block discarded – undo |
|
275
|
275
|
// calculate approved field id |
|
276
|
276
|
$approved_column_id = self::get_approved_column( $form_id ); |
|
277
|
277
|
|
|
278
|
|
- foreach( $entries as $entry_id ) { |
|
|
278
|
+ foreach ( $entries as $entry_id ) { |
|
279
|
279
|
self::update_approved( (int)$entry_id, $approved, $form_id, $approved_column_id ); |
|
280
|
280
|
} |
|
281
|
281
|
} |
|
@@ -294,14 +294,14 @@ discard block |
|
|
block discarded – undo |
|
294
|
294
|
* @param int $approvedcolumn (default: 0) |
|
295
|
295
|
* @return boolean True: It worked; False: it failed |
|
296
|
296
|
*/ |
|
297
|
|
- public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0) { |
|
|
297
|
+ public static function update_approved( $entry_id = 0, $approved = 0, $form_id = 0, $approvedcolumn = 0 ) { |
|
298
|
298
|
|
|
299
|
|
- if( !class_exists( 'GFAPI' ) ) { |
|
|
299
|
+ if ( ! class_exists( 'GFAPI' ) ) { |
|
300
|
300
|
do_action( 'gravityview_log_error', __METHOD__ . 'GFAPI does not exist' ); |
|
301
|
301
|
return false; |
|
302
|
302
|
} |
|
303
|
303
|
|
|
304
|
|
- if( empty( $approvedcolumn ) ) { |
|
|
304
|
+ if ( empty( $approvedcolumn ) ) { |
|
305
|
305
|
$approvedcolumn = self::get_approved_column( $form_id ); |
|
306
|
306
|
} |
|
307
|
307
|
|
|
@@ -320,7 +320,7 @@ discard block |
|
|
block discarded – undo |
|
320
|
320
|
self::update_approved_meta( $entry_id, $approved ); |
|
321
|
321
|
|
|
322
|
322
|
// add note to entry |
|
323
|
|
- if( $result === true ) { |
|
|
323
|
+ if ( $result === true ) { |
|
324
|
324
|
|
|
325
|
325
|
$note = empty( $approved ) ? __( 'Disapproved the Entry for GravityView', 'gravityview' ) : __( 'Approved the Entry for GravityView', 'gravityview' ); |
|
326
|
326
|
|
|
@@ -331,7 +331,7 @@ discard block |
|
|
block discarded – undo |
|
331
|
331
|
*/ |
|
332
|
332
|
$add_note = apply_filters( 'gravityview/approve_entries/add-note', true ); |
|
333
|
333
|
|
|
334
|
|
- if( $add_note && class_exists( 'GravityView_Entry_Notes' ) ) { |
|
|
334
|
+ if ( $add_note && class_exists( 'GravityView_Entry_Notes' ) ) { |
|
335
|
335
|
$current_user = wp_get_current_user(); |
|
336
|
336
|
GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $current_user->display_name, $note ); |
|
337
|
337
|
} |
|
@@ -343,7 +343,7 @@ discard block |
|
|
block discarded – undo |
|
343
|
343
|
*/ |
|
344
|
344
|
do_action( 'gravityview_clear_form_cache', $form_id ); |
|
345
|
345
|
|
|
346
|
|
- } else if( is_wp_error( $result ) ) { |
|
|
346
|
+ } else if ( is_wp_error( $result ) ) { |
|
347
|
347
|
|
|
348
|
348
|
do_action( 'gravityview_log_error', __METHOD__ . sprintf( ' - Entry approval not updated: %s', $result->get_error_message() ) ); |
|
349
|
349
|
|
|
@@ -364,7 +364,7 @@ discard block |
|
|
block discarded – undo |
|
364
|
364
|
* @param $form array Gravity Forms form object |
|
365
|
365
|
*/ |
|
366
|
366
|
public function after_submission( $entry, $form ) { |
|
367
|
|
- $this->after_update_entry_update_approved_meta( $form , $entry['id'] ); |
|
|
367
|
+ $this->after_update_entry_update_approved_meta( $form, $entry[ 'id' ] ); |
|
368
|
368
|
} |
|
369
|
369
|
|
|
370
|
370
|
|
|
@@ -380,12 +380,12 @@ discard block |
|
|
block discarded – undo |
|
380
|
380
|
*/ |
|
381
|
381
|
public function after_update_entry_update_approved_meta( $form, $entry_id = NULL ) { |
|
382
|
382
|
|
|
383
|
|
- $approvedcolumn = self::get_approved_column( $form['id'] ); |
|
|
383
|
+ $approvedcolumn = self::get_approved_column( $form[ 'id' ] ); |
|
384
|
384
|
|
|
385
|
385
|
/** |
|
386
|
386
|
* If the form doesn't contain the approve field, don't assume anything. |
|
387
|
387
|
*/ |
|
388
|
|
- if( empty( $approvedcolumn ) ) { |
|
|
388
|
+ if ( empty( $approvedcolumn ) ) { |
|
389
|
389
|
return; |
|
390
|
390
|
} |
|
391
|
391
|
|
|
@@ -413,7 +413,7 @@ discard block |
|
|
block discarded – undo |
|
413
|
413
|
$is_approved = empty( $is_approved ) ? 0 : 'Approved'; |
|
414
|
414
|
|
|
415
|
415
|
// update entry meta |
|
416
|
|
- if( function_exists('gform_update_meta') ) { |
|
|
416
|
+ if ( function_exists( 'gform_update_meta' ) ) { |
|
417
|
417
|
|
|
418
|
418
|
gform_update_meta( $entry_id, 'is_approved', $is_approved ); |
|
419
|
419
|
|
|
@@ -425,7 +425,7 @@ discard block |
|
|
block discarded – undo |
|
425
|
425
|
*/ |
|
426
|
426
|
do_action( 'gravityview/approve_entries/updated', $entry_id, $is_approved ); |
|
427
|
427
|
|
|
428
|
|
- if( empty( $is_approved ) ) { |
|
|
428
|
+ if ( empty( $is_approved ) ) { |
|
429
|
429
|
|
|
430
|
430
|
/** |
|
431
|
431
|
* @action `gravityview/approve_entries/disapproved` Triggered when an entry is rejected |
|
@@ -447,7 +447,7 @@ discard block |
|
|
block discarded – undo |
|
447
|
447
|
|
|
448
|
448
|
} else { |
|
449
|
449
|
|
|
450
|
|
- do_action('gravityview_log_error', __METHOD__ . ' - `gform_update_meta` does not exist.' ); |
|
|
450
|
+ do_action( 'gravityview_log_error', __METHOD__ . ' - `gform_update_meta` does not exist.' ); |
|
451
|
451
|
|
|
452
|
452
|
} |
|
453
|
453
|
} |
|
@@ -459,21 +459,21 @@ discard block |
|
|
block discarded – undo |
|
459
|
459
|
*/ |
|
460
|
460
|
public function ajax_update_approved() { |
|
461
|
461
|
|
|
462
|
|
- if( empty( $_POST['entry_id'] ) || empty( $_POST['form_id'] ) ) { |
|
|
462
|
+ if ( empty( $_POST[ 'entry_id' ] ) || empty( $_POST[ 'form_id' ] ) ) { |
|
463
|
463
|
|
|
464
|
464
|
do_action( 'gravityview_log_error', __METHOD__ . ' entry_id or form_id are empty.', $_POST ); |
|
465
|
465
|
|
|
466
|
466
|
$result = false; |
|
467
|
467
|
} |
|
468
|
468
|
|
|
469
|
|
- else if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'gravityview_ajaxgfentries' ) ) { |
|
|
469
|
+ else if ( ! isset( $_POST[ 'nonce' ] ) || ! wp_verify_nonce( $_POST[ 'nonce' ], 'gravityview_ajaxgfentries' ) ) { |
|
470
|
470
|
|
|
471
|
471
|
do_action( 'gravityview_log_error', __METHOD__ . ' Security check failed.', $_POST ); |
|
472
|
472
|
|
|
473
|
473
|
$result = false; |
|
474
|
474
|
} |
|
475
|
475
|
|
|
476
|
|
- else if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $_POST['entry_id'] ) ) { |
|
|
476
|
+ else if ( ! GVCommon::has_cap( 'gravityview_moderate_entries', $_POST[ 'entry_id' ] ) ) { |
|
477
|
477
|
|
|
478
|
478
|
do_action( 'gravityview_log_error', __METHOD__ . ' User does not have the `gravityview_moderate_entries` capability.' ); |
|
479
|
479
|
|
|
@@ -482,11 +482,11 @@ discard block |
|
|
block discarded – undo |
|
482
|
482
|
|
|
483
|
483
|
else { |
|
484
|
484
|
|
|
485
|
|
- $result = self::update_approved( $_POST['entry_id'], $_POST['approved'], $_POST['form_id'] ); |
|
|
485
|
+ $result = self::update_approved( $_POST[ 'entry_id' ], $_POST[ 'approved' ], $_POST[ 'form_id' ] ); |
|
486
|
486
|
|
|
487
|
|
- if( is_wp_error( $result ) ) { |
|
|
487
|
+ if ( is_wp_error( $result ) ) { |
|
488
|
488
|
/** @var WP_Error $result */ |
|
489
|
|
- do_action( 'gravityview_log_error', __METHOD__ .' Error updating approval: ' . $result->get_error_message() ); |
|
|
489
|
+ do_action( 'gravityview_log_error', __METHOD__ . ' Error updating approval: ' . $result->get_error_message() ); |
|
490
|
490
|
$result = false; |
|
491
|
491
|
} |
|
492
|
492
|
|
|
@@ -506,29 +506,29 @@ discard block |
|
|
block discarded – undo |
|
506
|
506
|
*/ |
|
507
|
507
|
static public function get_approved_column( $form ) { |
|
508
|
508
|
|
|
509
|
|
- if( empty( $form ) ) { |
|
|
509
|
+ if ( empty( $form ) ) { |
|
510
|
510
|
return null; |
|
511
|
511
|
} |
|
512
|
512
|
|
|
513
|
|
- if( !is_array( $form ) ) { |
|
|
513
|
+ if ( ! is_array( $form ) ) { |
|
514
|
514
|
$form = GVCommon::get_form( $form ); |
|
515
|
515
|
} |
|
516
|
516
|
|
|
517
|
|
- foreach( $form['fields'] as $key => $field ) { |
|
|
517
|
+ foreach ( $form[ 'fields' ] as $key => $field ) { |
|
518
|
518
|
|
|
519
|
|
- $field = (array) $field; |
|
|
519
|
+ $field = (array)$field; |
|
520
|
520
|
|
|
521
|
|
- if( !empty( $field['gravityview_approved'] ) ) { |
|
522
|
|
- if( !empty($field['inputs'][0]['id']) ) { |
|
523
|
|
- return $field['inputs'][0]['id']; |
|
|
521
|
+ if ( ! empty( $field[ 'gravityview_approved' ] ) ) { |
|
|
522
|
+ if ( ! empty( $field[ 'inputs' ][ 0 ][ 'id' ] ) ) { |
|
|
523
|
+ return $field[ 'inputs' ][ 0 ][ 'id' ]; |
|
524
|
524
|
} |
|
525
|
525
|
} |
|
526
|
526
|
|
|
527
|
527
|
// Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work.. |
|
528
|
|
- if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) { |
|
529
|
|
- foreach ( $field['inputs'] as $key2 => $input ) { |
|
530
|
|
- if ( strtolower( $input['label'] ) == 'approved' ) { |
|
531
|
|
- return $input['id']; |
|
|
528
|
+ if ( 'checkbox' == $field[ 'type' ] && isset( $field[ 'inputs' ] ) && is_array( $field[ 'inputs' ] ) ) { |
|
|
529
|
+ foreach ( $field[ 'inputs' ] as $key2 => $input ) { |
|
|
530
|
+ if ( strtolower( $input[ 'label' ] ) == 'approved' ) { |
|
|
531
|
+ return $input[ 'id' ]; |
|
532
|
532
|
} |
|
533
|
533
|
} |
|
534
|
534
|
} |
|
@@ -539,18 +539,18 @@ discard block |
|
|
block discarded – undo |
|
539
|
539
|
|
|
540
|
540
|
|
|
541
|
541
|
|
|
542
|
|
- static public function add_entry_approved_hidden_input( $form_id, $field_id, $value, $entry, $query_string ) { |
|
|
542
|
+ static public function add_entry_approved_hidden_input( $form_id, $field_id, $value, $entry, $query_string ) { |
|
543
|
543
|
|
|
544
|
|
- if( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry['id'] ) ) { |
|
|
544
|
+ if ( ! GVCommon::has_cap( 'gravityview_moderate_entries', $entry[ 'id' ] ) ) { |
|
545
|
545
|
return; |
|
546
|
546
|
} |
|
547
|
547
|
|
|
548
|
|
- if( empty( $entry['id'] ) ) { |
|
|
548
|
+ if ( empty( $entry[ 'id' ] ) ) { |
|
549
|
549
|
return; |
|
550
|
550
|
} |
|
551
|
551
|
|
|
552
|
|
- if( gform_get_meta( $entry['id'], 'is_approved' ) ) { |
|
553
|
|
- echo '<input type="hidden" class="entry_approved" id="entry_approved_'. $entry['id'] .'" value="true" />'; |
|
|
552
|
+ if ( gform_get_meta( $entry[ 'id' ], 'is_approved' ) ) { |
|
|
553
|
+ echo '<input type="hidden" class="entry_approved" id="entry_approved_' . $entry[ 'id' ] . '" value="true" />'; |
|
554
|
554
|
} |
|
555
|
555
|
} |
|
556
|
556
|
|
|
@@ -559,7 +559,7 @@ discard block |
|
|
block discarded – undo |
|
559
|
559
|
|
|
560
|
560
|
function add_scripts_and_styles( $hook ) { |
|
561
|
561
|
|
|
562
|
|
- if( !class_exists( 'RGForms' ) ) { |
|
|
562
|
+ if ( ! class_exists( 'RGForms' ) ) { |
|
563
|
563
|
|
|
564
|
564
|
do_action( 'gravityview_log_error', 'GravityView_Admin_ApproveEntries[add_scripts_and_styles] RGForms does not exist.' ); |
|
565
|
565
|
|
|
@@ -568,39 +568,39 @@ discard block |
|
|
block discarded – undo |
|
568
|
568
|
|
|
569
|
569
|
// enqueue styles & scripts gf_entries |
|
570
|
570
|
// But only if we're on the main Entries page, not on reports pages |
|
571
|
|
- if( RGForms::get_page() === 'entry_list' ) { |
|
|
571
|
+ if ( RGForms::get_page() === 'entry_list' ) { |
|
572
|
572
|
|
|
573
|
|
- $form_id = RGForms::get('id'); |
|
|
573
|
+ $form_id = RGForms::get( 'id' ); |
|
574
|
574
|
|
|
575
|
575
|
// If there are no forms identified, use the first form. That's how GF does it. |
|
576
|
|
- if( empty( $form_id ) && class_exists('RGFormsModel') ) { |
|
|
576
|
+ if ( empty( $form_id ) && class_exists( 'RGFormsModel' ) ) { |
|
577
|
577
|
$forms = gravityview_get_forms(); |
|
578
|
|
- if( !empty( $forms ) ) { |
|
579
|
|
- $form_id = $forms[0]['id']; |
|
|
578
|
+ if ( ! empty( $forms ) ) { |
|
|
579
|
+ $form_id = $forms[ 0 ][ 'id' ]; |
|
580
|
580
|
} |
|
581
|
581
|
} |
|
582
|
582
|
|
|
583
|
583
|
$approvedcolumn = self::get_approved_column( $form_id ); |
|
584
|
584
|
|
|
585
|
|
- wp_register_style( 'gravityview_entries_list', plugins_url('assets/css/admin-entries-list.css', GRAVITYVIEW_FILE), array(), GravityView_Plugin::version ); |
|
|
585
|
+ wp_register_style( 'gravityview_entries_list', plugins_url( 'assets/css/admin-entries-list.css', GRAVITYVIEW_FILE ), array(), GravityView_Plugin::version ); |
|
586
|
586
|
wp_enqueue_style( 'gravityview_entries_list' ); |
|
587
|
587
|
|
|
588
|
|
- $script_debug = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
|
588
|
+ $script_debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
589
|
589
|
|
|
590
|
|
- wp_register_script( 'gravityview_gf_entries_scripts', plugins_url('assets/js/admin-entries-list'.$script_debug.'.js', GRAVITYVIEW_FILE), array( 'jquery' ), GravityView_Plugin::version ); |
|
|
590
|
+ wp_register_script( 'gravityview_gf_entries_scripts', plugins_url( 'assets/js/admin-entries-list' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery' ), GravityView_Plugin::version ); |
|
591
|
591
|
wp_enqueue_script( 'gravityview_gf_entries_scripts' ); |
|
592
|
592
|
|
|
593
|
593
|
wp_localize_script( 'gravityview_gf_entries_scripts', 'gvGlobals', array( |
|
594
|
|
- 'nonce' => wp_create_nonce( 'gravityview_ajaxgfentries'), |
|
|
594
|
+ 'nonce' => wp_create_nonce( 'gravityview_ajaxgfentries' ), |
|
595
|
595
|
'form_id' => $form_id, |
|
596
|
596
|
'show_column' => (int)$this->show_approve_entry_column( $form_id ), |
|
597
|
597
|
'add_bulk_action' => (int)GVCommon::has_cap( 'gravityview_moderate_entries' ), |
|
598
|
598
|
'bulk_actions' => $this->get_bulk_actions( $form_id ), |
|
599
|
599
|
'bulk_message' => $this->bulk_update_message, |
|
600
|
|
- 'approve_title' => __( 'Entry not approved for directory viewing. Click to approve this entry.', 'gravityview'), |
|
601
|
|
- 'unapprove_title' => __( 'Entry approved for directory viewing. Click to disapprove this entry.', 'gravityview'), |
|
602
|
|
- 'column_title' => __( 'Show entry in directory view?', 'gravityview'), |
|
603
|
|
- 'column_link' => esc_url( add_query_arg( array('sort' => $approvedcolumn) ) ), |
|
|
600
|
+ 'approve_title' => __( 'Entry not approved for directory viewing. Click to approve this entry.', 'gravityview' ), |
|
|
601
|
+ 'unapprove_title' => __( 'Entry approved for directory viewing. Click to disapprove this entry.', 'gravityview' ), |
|
|
602
|
+ 'column_title' => __( 'Show entry in directory view?', 'gravityview' ), |
|
|
603
|
+ 'column_link' => esc_url( add_query_arg( array( 'sort' => $approvedcolumn ) ) ), |
|
604
|
604
|
) ); |
|
605
|
605
|
|
|
606
|
606
|
} |
|
@@ -643,8 +643,8 @@ discard block |
|
|
block discarded – undo |
|
643
|
643
|
// Sanitize the values, just to be sure. |
|
644
|
644
|
foreach ( $bulk_actions as $key => $group ) { |
|
645
|
645
|
foreach ( $group as $i => $action ) { |
|
646
|
|
- $bulk_actions[ $key ][ $i ]['label'] = esc_html( $bulk_actions[ $key ][ $i ]['label'] ); |
|
647
|
|
- $bulk_actions[ $key ][ $i ]['value'] = esc_attr( $bulk_actions[ $key ][ $i ]['value'] ); |
|
|
646
|
+ $bulk_actions[ $key ][ $i ][ 'label' ] = esc_html( $bulk_actions[ $key ][ $i ][ 'label' ] ); |
|
|
647
|
+ $bulk_actions[ $key ][ $i ][ 'value' ] = esc_attr( $bulk_actions[ $key ][ $i ][ 'value' ] ); |
|
648
|
648
|
} |
|
649
|
649
|
} |
|
650
|
650
|
|
|
@@ -669,13 +669,13 @@ discard block |
|
|
block discarded – undo |
|
669
|
669
|
* @since 1.7.2 |
|
670
|
670
|
* @param boolean $hide_if_no_connections |
|
671
|
671
|
*/ |
|
672
|
|
- $hide_if_no_connections = apply_filters('gravityview/approve_entries/hide-if-no-connections', false ); |
|
|
672
|
+ $hide_if_no_connections = apply_filters( 'gravityview/approve_entries/hide-if-no-connections', false ); |
|
673
|
673
|
|
|
674
|
|
- if( $hide_if_no_connections ) { |
|
|
674
|
+ if ( $hide_if_no_connections ) { |
|
675
|
675
|
|
|
676
|
676
|
$connected_views = gravityview_get_connected_views( $form_id ); |
|
677
|
677
|
|
|
678
|
|
- if( empty( $connected_views ) ) { |
|
|
678
|
+ if ( empty( $connected_views ) ) { |
|
679
|
679
|
$show_approve_column = false; |
|
680
|
680
|
} |
|
681
|
681
|
} |
|
@@ -685,18 +685,18 @@ discard block |
|
|
block discarded – undo |
|
685
|
685
|
* @param boolean $show_approve_column Whether the column will be shown |
|
686
|
686
|
* @param int $form_id The ID of the Gravity Forms form for which entries are being shown |
|
687
|
687
|
*/ |
|
688
|
|
- $show_approve_column = apply_filters('gravityview/approve_entries/show-column', $show_approve_column, $form_id ); |
|
|
688
|
+ $show_approve_column = apply_filters( 'gravityview/approve_entries/show-column', $show_approve_column, $form_id ); |
|
689
|
689
|
|
|
690
|
690
|
return $show_approve_column; |
|
691
|
691
|
} |
|
692
|
692
|
|
|
693
|
693
|
function register_gform_noconflict_script( $scripts ) { |
|
694
|
|
- $scripts[] = 'gravityview_gf_entries_scripts'; |
|
|
694
|
+ $scripts[ ] = 'gravityview_gf_entries_scripts'; |
|
695
|
695
|
return $scripts; |
|
696
|
696
|
} |
|
697
|
697
|
|
|
698
|
698
|
function register_gform_noconflict_style( $styles ) { |
|
699
|
|
- $styles[] = 'gravityview_entries_list'; |
|
|
699
|
+ $styles[ ] = 'gravityview_entries_list'; |
|
700
|
700
|
return $styles; |
|
701
|
701
|
} |
|
702
|
702
|
|