PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.0
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.0
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.0, at classes/controllers/FrmEntriesController.php

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