PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.5.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.5.2
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / controllers / FrmEntriesController.php

FrmEntriesController.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.5.2, at classes/controllers/FrmEntriesController.php

710 lines 20.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 class FrmEntriesController {
7
8 public static function menu() {
9 FrmAppHelper::force_capability( 'frm_view_entries' );
10
11 add_submenu_page( 'formidable', 'Formidable | ' . __( 'Entries', 'formidable' ), __( 'Entries', 'formidable' ), 'frm_view_entries', 'formidable-entries', 'FrmEntriesController::route' );
12
13 $views_installed = is_callable( 'FrmProAppHelper::views_is_installed' ) ? FrmProAppHelper::views_is_installed() : FrmAppHelper::pro_is_installed();
14 if ( ! $views_installed ) {
15 add_submenu_page( 'formidable', 'Formidable | ' . __( 'Views', 'formidable' ), __( 'Views', 'formidable' ), 'frm_view_entries', 'formidable-views', 'FrmFormsController::no_views' );
16 }
17
18 if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) ) {
19 self::load_manage_entries_hooks();
20 }
21 }
22
23 /**
24 * @since 2.05.07
25 */
26 private static function load_manage_entries_hooks() {
27 if ( ! in_array( FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ), array( 'edit', 'show', 'new', 'duplicate' ), true ) ) {
28 $menu_name = FrmAppHelper::get_menu_name();
29 $base = self::base_column_key( $menu_name );
30
31 add_filter( 'manage_' . $base . '_columns', 'FrmEntriesController::manage_columns' );
32 add_filter( 'get_user_option_' . self::hidden_column_key( $menu_name ), 'FrmEntriesController::hidden_columns' );
33 add_filter( 'manage_' . $base . '_sortable_columns', 'FrmEntriesController::sortable_columns' );
34 } else {
35 add_filter( 'screen_options_show_screen', __CLASS__ . '::remove_screen_options', 10, 2 );
36 }
37 }
38
39 /* Display in Back End */
40 public static function route() {
41 $action = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' );
42 FrmAppHelper::include_svg();
43
44 switch ( $action ) {
45 case 'show':
46 case 'destroy':
47 return self::$action();
48
49 default:
50 do_action( 'frm_entry_action_route', $action );
51 if ( apply_filters( 'frm_entry_stop_action_route', false, $action ) ) {
52 return;
53 }
54
55 return self::display_list();
56 }
57 }
58
59 /**
60 * Prevent the "screen options" tab from showing when
61 * editing or creating an entry
62 *
63 * @since 3.0
64 */
65 public static function remove_screen_options( $show_screen, $screen ) {
66 $menu_name = sanitize_title( FrmAppHelper::get_menu_name() );
67 if ( $screen->id == $menu_name . '_page_formidable-entries' ) {
68 $show_screen = false;
69 }
70
71 return $show_screen;
72 }
73
74 public static function manage_columns( $columns ) {
75 global $frm_vars;
76 $form_id = FrmForm::get_current_form_id();
77
78 $columns[ $form_id . '_id' ] = 'ID';
79 $columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' );
80
81 if ( $form_id ) {
82 self::get_columns_for_form( $form_id, $columns );
83 } else {
84 $columns[ $form_id . '_form_id' ] = esc_html__( 'Form', 'formidable' );
85 $columns[ $form_id . '_name' ] = esc_html__( 'Entry Name', 'formidable' );
86 $columns[ $form_id . '_user_id' ] = esc_html__( 'Created By', 'formidable' );
87 }
88
89 $columns[ $form_id . '_is_draft' ] = esc_html__( 'Entry Status', 'formidable' );
90 $columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' );
91 $columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
92 self::maybe_add_ip_col( $form_id, $columns );
93
94 $frm_vars['cols'] = $columns;
95
96 $action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
97 if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $action, array( '', 'list', 'destroy' ) ) ) {
98 add_screen_option(
99 'per_page',
100 array(
101 'label' => esc_html__( 'Entries', 'formidable' ),
102 'default' => 20,
103 'option' => 'formidable_page_formidable_entries_per_page',
104 )
105 );
106 }
107
108 return $columns;
109 }
110
111 private static function get_columns_for_form( $form_id, &$columns ) {
112 $form_cols = FrmField::get_all_for_form( $form_id, '', 'include' );
113
114 /**
115 * Allows changing fields in the Entries list table heading.
116 *
117 * @since 5.0.04
118 *
119 * @param array $fields Array of fields.
120 * @param array $args The arguments. Contains `form_id`.
121 */
122 $form_cols = apply_filters( 'frm_fields_in_entries_list_table', $form_cols, compact( 'form_id' ) );
123
124 foreach ( $form_cols as $form_col ) {
125 if ( FrmField::is_no_save_field( $form_col->type ) ) {
126 continue;
127 }
128
129 $has_child_fields = $form_col->type == 'form' && isset( $form_col->field_options['form_select'] ) && ! empty( $form_col->field_options['form_select'] );
130 if ( $has_child_fields ) {
131 self::add_subform_cols( $form_col, $form_id, $columns );
132 } else {
133 self::add_field_cols( $form_col, $form_id, $columns );
134 }
135 }
136 }
137
138 /**
139 * @since 3.01
140 */
141 private static function add_subform_cols( $field, $form_id, &$columns ) {
142 $sub_form_cols = FrmField::get_all_for_form( $field->field_options['form_select'] );
143 if ( empty( $sub_form_cols ) ) {
144 return;
145 }
146
147 foreach ( $sub_form_cols as $k => $sub_form_col ) {
148 if ( FrmField::is_no_save_field( $sub_form_col->type ) ) {
149 unset( $sub_form_cols[ $k ] );
150 continue;
151 }
152 $columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $field->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
153 unset( $sub_form_col );
154 }
155 }
156
157 /**
158 * @since 3.01
159 */
160 private static function add_field_cols( $field, $form_id, &$columns ) {
161 $col_id = $field->field_key;
162 if ( $field->form_id != $form_id ) {
163 $col_id .= '-_-form' . $field->form_id;
164 }
165
166 $has_separate_value = ! FrmField::is_option_empty( $field, 'separate_value' );
167 $is_post_status = FrmField::is_option_true( $field, 'post_field' ) && $field->field_options['post_field'] == 'post_status';
168 if ( $has_separate_value && ! $is_post_status ) {
169 $columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
170 }
171
172 $columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $field->name, 35 );
173 }
174
175 private static function maybe_add_ip_col( $form_id, &$columns ) {
176 if ( FrmAppHelper::ips_saved() ) {
177 $columns[ $form_id . '_ip' ] = 'IP';
178 }
179 }
180
181 public static function check_hidden_cols( $check, $object_id, $meta_key, $meta_value, $prev_value ) {
182 $this_page_name = self::hidden_column_key();
183 if ( $meta_key != $this_page_name || $meta_value == $prev_value ) {
184 return $check;
185 }
186
187 if ( empty( $prev_value ) ) {
188 $prev_value = get_metadata( 'user', $object_id, $meta_key, true );
189 }
190
191 global $frm_vars;
192 //add a check so we don't create a loop
193 $frm_vars['prev_hidden_cols'] = ( isset( $frm_vars['prev_hidden_cols'] ) && $frm_vars['prev_hidden_cols'] ) ? false : $prev_value;
194
195 return $check;
196 }
197
198 /**
199 * Add hidden columns back from other forms
200 */
201 public static function update_hidden_cols( $meta_id, $object_id, $meta_key, $meta_value ) {
202 $this_page_name = self::hidden_column_key();
203 if ( $meta_key != $this_page_name ) {
204 return;
205 }
206
207 global $frm_vars;
208 if ( ! isset( $frm_vars['prev_hidden_cols'] ) || ! $frm_vars['prev_hidden_cols'] ) {
209 return; // Don't continue if there's no previous value.
210 }
211
212 foreach ( $meta_value as $mk => $mv ) {
213 // Remove blank values.
214 if ( empty( $mv ) ) {
215 unset( $meta_value[ $mk ] );
216 }
217 }
218
219 $cur_form_prefix = reset( $meta_value );
220 $cur_form_prefix = explode( '_', $cur_form_prefix );
221 $cur_form_prefix = $cur_form_prefix[0];
222 $save = false;
223
224 foreach ( (array) $frm_vars['prev_hidden_cols'] as $prev_hidden ) {
225 if ( empty( $prev_hidden ) || in_array( $prev_hidden, $meta_value ) ) {
226 // Don't add blank cols or process included cols.
227 continue;
228 }
229
230 $form_prefix = explode( '_', $prev_hidden );
231 $form_prefix = $form_prefix[0];
232 if ( $form_prefix == $cur_form_prefix ) {
233 // Don't add back columns that are meant to be hidden.
234 continue;
235 }
236
237 $meta_value[] = $prev_hidden;
238 $save = true;
239 unset( $form_prefix );
240 }
241
242 if ( $save ) {
243 $user_id = get_current_user_id();
244 update_user_option( $user_id, $this_page_name, $meta_value, true );
245 }
246 }
247
248 /**
249 * @since 2.05.07
250 */
251 private static function hidden_column_key( $menu_name = '' ) {
252 $base = self::base_column_key( $menu_name );
253
254 return 'manage' . $base . 'columnshidden';
255 }
256
257 /**
258 * @since 2.05.07
259 */
260 private static function base_column_key( $menu_name = '' ) {
261 if ( empty( $menu_name ) ) {
262 $menu_name = FrmAppHelper::get_menu_name();
263 }
264
265 return sanitize_title( $menu_name ) . '_page_formidable-entries';
266 }
267
268 public static function save_per_page( $save, $option, $value ) {
269 if ( $option == 'formidable_page_formidable_entries_per_page' ) {
270 $save = (int) $value;
271 }
272
273 return $save;
274 }
275
276 public static function sortable_columns() {
277 $form_id = FrmForm::get_current_form_id();
278 $fields = FrmField::get_all_for_form( $form_id );
279
280 $columns = array(
281 $form_id . '_id' => 'id',
282 $form_id . '_created_at' => 'created_at',
283 $form_id . '_updated_at' => 'updated_at',
284 $form_id . '_ip' => 'ip',
285 $form_id . '_item_key' => 'item_key',
286 $form_id . '_is_draft' => 'is_draft',
287 );
288
289 foreach ( $fields as $field ) {
290 if ( self::field_supports_sorting( $field ) ) {
291 $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
292 }
293 }
294
295 return $columns;
296 }
297
298 /**
299 * Can't sort on checkboxes because they are sorted serialized.
300 * Some post content can be sorted but not everything.
301 *
302 * @param stdClass $field
303 * @return bool
304 */
305 private static function field_supports_sorting( $field ) {
306 $is_sortable = 'checkbox' !== $field->type && empty( $field->field_options['post_field'] );
307 return apply_filters( 'frm_field_column_is_sortable', $is_sortable, $field );
308 }
309
310 /**
311 * @param mixed $result Option value from database for hidden columns in entries table.
312 * @return array
313 */
314 public static function hidden_columns( $result ) {
315 if ( ! is_array( $result ) ) {
316 // Force an unexpected value to be an array.
317 // Since $result is a filtered option and gets saved to the database, it's possible it could be a string.
318 // Since this code expects an array it would break with a "Uncaught Error: [] operator not supported for strings" error.
319 $result = array();
320 }
321
322 $form_id = FrmForm::get_current_form_id();
323
324 $hidden = self::user_hidden_columns_for_form( $form_id, $result );
325
326 global $frm_vars;
327 $i = isset( $frm_vars['cols'] ) ? count( $frm_vars['cols'] ) : 0;
328
329 if ( ! empty( $hidden ) ) {
330 $result = $hidden;
331 $i = $i - count( $result );
332 $max_columns = 11;
333 } else {
334 $max_columns = 8;
335 }
336
337 if ( $i <= $max_columns ) {
338 return $result;
339 }
340
341 self::remove_excess_cols( compact( 'i', 'max_columns', 'form_id' ), $result );
342
343 return $result;
344 }
345
346 /**
347 * @since 2.05.07
348 */
349 private static function user_hidden_columns_for_form( $form_id, $result ) {
350 $hidden = array();
351 foreach ( (array) $result as $r ) {
352 if ( ! empty( $r ) ) {
353 list( $form_prefix, $field_key ) = explode( '_', $r );
354
355 if ( (int) $form_prefix == (int) $form_id ) {
356 $hidden[] = $r;
357 }
358
359 unset( $form_prefix );
360 }
361 }
362
363 return $hidden;
364 }
365
366 /**
367 * Remove some columns by default when there are too many
368 *
369 * @since 2.05.07
370 */
371 private static function remove_excess_cols( $atts, &$result ) {
372 global $frm_vars;
373
374 $remove_first = array(
375 $atts['form_id'] . '_item_key' => '',
376 $atts['form_id'] . '_id' => '',
377 );
378 $cols = $remove_first + array_reverse( $frm_vars['cols'], true );
379
380 $i = $atts['i'];
381
382 foreach ( $cols as $col_key => $col ) {
383 if ( $i <= $atts['max_columns'] ) {
384 break;
385 }
386
387 if ( empty( $result ) || ! in_array( $col_key, $result, true ) ) {
388 $result[] = $col_key;
389 $i--;
390 }
391
392 unset( $col_key, $col );
393 }
394 }
395
396 public static function display_list( $message = '', $errors = array() ) {
397 global $wpdb, $frm_vars;
398
399 $form = FrmForm::maybe_get_current_form();
400 $params = FrmForm::get_admin_params( $form );
401
402 if ( $form ) {
403 $params['form'] = $form->id;
404 $frm_vars['current_form'] = $form;
405
406 self::get_delete_form_time( $form, $errors );
407 }
408
409 $table_class = apply_filters( 'frm_entries_list_class', 'FrmEntriesListHelper' );
410
411 $wp_list_table = new $table_class( array( 'params' => $params ) );
412
413 $pagenum = $wp_list_table->get_pagenum();
414
415 $wp_list_table->prepare_items();
416
417 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
418 if ( $pagenum > $total_pages && $total_pages > 0 ) {
419 $url = add_query_arg( 'paged', $total_pages );
420 if ( headers_sent() ) {
421 FrmAppHelper::js_redirect( $url, true );
422 } else {
423 wp_redirect( esc_url_raw( $url ) );
424 }
425 die();
426 }
427
428 if ( empty( $message ) && isset( $_GET['import-message'] ) ) {
429 $message = __( 'Your import is complete', 'formidable' );
430 }
431
432 require FrmAppHelper::plugin_path() . '/classes/views/frm-entries/list.php';
433 }
434
435 private static function get_delete_form_time( $form, &$errors ) {
436 if ( 'trash' == $form->status ) {
437 $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS );
438 $time_to_delete = FrmAppHelper::human_time_diff( $delete_timestamp, ( isset( $form->options['trash_time'] ) ? ( $form->options['trash_time'] ) : time() ) );
439
440 /* translators: %1$s: Time string */
441 $errors['trash'] = sprintf( __( 'This form is in the trash and is scheduled to be deleted permanently in %s along with any entries.', 'formidable' ), $time_to_delete );
442 }
443 }
444
445 /* Back End CRUD */
446 public static function show( $id = 0 ) {
447 FrmAppHelper::permission_check( 'frm_view_entries' );
448
449 if ( ! $id ) {
450 $id = FrmAppHelper::get_param( 'id', 0, 'get', 'absint' );
451
452 if ( ! $id ) {
453 $id = FrmAppHelper::get_param( 'item_id', 0, 'get', 'absint' );
454 }
455 }
456
457 $entry = FrmEntry::getOne( $id, true );
458 if ( ! $entry ) {
459 echo '<div id="form_show_entry_page" class="wrap">' .
460 esc_html__( 'You are trying to view an entry that does not exist.', 'formidable' ) .
461 '</div>';
462
463 return;
464 }
465
466 $data = $entry->description;
467 if ( ! is_array( $data ) || ! isset( $data['referrer'] ) ) {
468 $data = array( 'referrer' => $data );
469 }
470
471 $fields = FrmField::get_all_for_form( $entry->form_id, '', 'include' );
472 $form = FrmForm::getOne( $entry->form_id );
473
474 include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/show.php' );
475 }
476
477 /**
478 * Destroy an entry from the admin page.
479 * This is triggered from the entries list from the "Delete" row action, and also from the "Delete Entry" trigger in the view/edit entry sidebar.
480 *
481 * @return void
482 */
483 public static function destroy() {
484 $permission_error = FrmAppHelper::permission_nonce_error( 'frm_delete_entries', '_wpnonce', -1 );
485 if ( false !== $permission_error ) {
486 wp_die( esc_html( $permission_error ) );
487 }
488
489 $params = FrmForm::get_admin_params();
490
491 if ( isset( $params['keep_post'] ) && $params['keep_post'] ) {
492 self::unlink_post( $params['id'] );
493 }
494
495 $message = '';
496 if ( FrmEntry::destroy( $params['id'] ) ) {
497 $message = __( 'Entry was successfully deleted', 'formidable' );
498 }
499
500 self::display_list( $message );
501 }
502
503 /**
504 * @deprecated 4.02.04 - Moved to Pro since it was unused in Lite.
505 */
506 public static function destroy_all() {
507 _deprecated_function( __METHOD__, '4.02.04', 'FrmProEntriesController::destroy_all' );
508 if ( is_callable( 'FrmProEntriesController::destroy_all' ) ) {
509 FrmProEntriesController::destroy_all();
510 }
511 }
512
513 public static function process_entry( $errors = '', $ajax = false ) {
514 $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
515 if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
516 return;
517 }
518
519 global $frm_vars;
520
521 $form = FrmForm::getOne( $form_id );
522 if ( ! $form ) {
523 return;
524 }
525
526 $params = FrmForm::get_params( $form );
527
528 if ( ! isset( $frm_vars['form_params'] ) ) {
529 $frm_vars['form_params'] = array();
530 }
531 $frm_vars['form_params'][ $form->id ] = $params;
532
533 if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) {
534 return;
535 }
536
537 if ( $errors == '' && ! $ajax ) {
538 $errors = FrmEntryValidate::validate( wp_unslash( $_POST ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
539 }
540
541 /**
542 * Use this filter to add trigger actions and add errors after
543 * all other errors have been processed
544 *
545 * @since 2.0.6
546 */
547 $errors = apply_filters( 'frm_entries_before_create', $errors, $form );
548
549 $frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
550
551 if ( empty( $errors ) ) {
552 $_POST['frm_skip_cookie'] = 1;
553 $do_success = false;
554 if ( $params['action'] === 'create' ) {
555 if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
556 $frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
557
558 $params['id'] = $frm_vars['created_entries'][ $form_id ]['entry_id'];
559 $do_success = true;
560 }
561 }
562
563 do_action( 'frm_process_entry', $params, $errors, $form, array( 'ajax' => $ajax ) );
564 if ( $do_success ) {
565 FrmFormsController::maybe_trigger_redirect( $form, $params, array( 'ajax' => $ajax ) );
566 }
567 unset( $_POST['frm_skip_cookie'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
568 }
569 }
570
571 /**
572 * Escape url entities before redirect
573 *
574 * @since 3.0
575 *
576 * @param string $url
577 *
578 * @return string
579 */
580 public static function prepare_redirect_url( $url ) {
581 return str_replace( array( ' ', '[', ']', '|', '@' ), array( '%20', '%5B', '%5D', '%7C', '%40' ), $url );
582 }
583
584 public static function delete_entry_before_redirect( $url, $form, $atts ) {
585 self::_delete_entry( $atts['id'], $form );
586
587 return $url;
588 }
589
590 /**
591 * Delete entry if not redirected.
592 *
593 * @param array $atts
594 */
595 public static function delete_entry_after_save( $atts ) {
596 self::_delete_entry( $atts['entry_id'], $atts['form'] );
597 }
598
599 private static function _delete_entry( $entry_id, $form ) {
600 if ( ! $form ) {
601 return;
602 }
603
604 FrmAppHelper::unserialize_or_decode( $form->options );
605 if ( isset( $form->options['no_save'] ) && $form->options['no_save'] ) {
606 self::unlink_post( $entry_id );
607 FrmEntry::destroy( $entry_id );
608 }
609 }
610
611 /**
612 * Unlink entry from post
613 */
614 private static function unlink_post( $entry_id ) {
615 global $wpdb;
616 $wpdb->update( $wpdb->prefix . 'frm_items', array( 'post_id' => '' ), array( 'id' => $entry_id ) );
617 FrmEntry::clear_cache();
618 }
619
620 /**
621 * @param $atts
622 *
623 * @return array|string
624 */
625 public static function show_entry_shortcode( $atts ) {
626 $defaults = array(
627 'id' => false,
628 'entry' => false,
629 'fields' => false,
630 'plain_text' => false,
631 'user_info' => false,
632 'include_blank' => false,
633 'default_email' => false,
634 'form_id' => false,
635 'format' => 'text',
636 'array_key' => 'key',
637 'direction' => 'ltr',
638 'font_size' => '',
639 'text_color' => '',
640 'border_width' => '',
641 'border_color' => '',
642 'bg_color' => '',
643 'alt_bg_color' => '',
644 'class' => '',
645 'clickable' => false,
646 'exclude_fields' => '',
647 'include_fields' => '',
648 'include_extras' => '',
649 'inline_style' => 1,
650 'child_array' => false, // return embedded fields as nested array
651 'line_breaks' => true,
652 'array_separator' => ', ',
653 );
654 $defaults = apply_filters( 'frm_show_entry_defaults', $defaults );
655
656 $atts = shortcode_atts( $defaults, $atts );
657
658 if ( $atts['default_email'] ) {
659 $shortcode_atts = array(
660 'format' => $atts['format'],
661 'plain_text' => $atts['plain_text'],
662 );
663
664 $entry_formatter = FrmEntryFactory::entry_shortcode_formatter_instance( $atts['form_id'], $shortcode_atts );
665 $formatted_entry = $entry_formatter->content();
666
667 } else {
668
669 $entry_formatter = FrmEntryFactory::entry_formatter_instance( $atts );
670 $formatted_entry = $entry_formatter->get_formatted_entry_values();
671
672 }
673
674 return $formatted_entry;
675 }
676
677 public static function entry_sidebar( $entry = false ) {
678 $data = array();
679 $id = 0;
680
681 $date_format = get_option( 'date_format' );
682 $time_format = get_option( 'time_format' );
683
684 if ( $entry ) {
685 $id = $entry->id;
686 $data = $entry->description;
687 if ( isset( $data['browser'] ) ) {
688 $browser = FrmEntriesHelper::get_browser( $data['browser'] );
689 }
690 /**
691 * Add or remove information in the entry sidebar.
692 *
693 * @since 5.5.2
694 * @param array $data
695 */
696 $data = apply_filters( 'frm_sidebar_data', $data, compact( 'entry' ) );
697 }
698
699 include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/sidebar-shared.php' );
700 }
701
702 /**
703 * @deprecated 4.0
704 */
705 public static function contextual_help( $help, $screen_id, $screen ) {
706 _deprecated_function( __METHOD__, '4.0' );
707 return $help;
708 }
709 }
710