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

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