Completed
Push — master ( 078d82...c7b9e4 )
by Stephanie
02:38
created

FrmEntriesController::manage_columns()   B

Complexity

Conditions 4
Paths 4

Size

Total Lines 28
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 19
nc 4
nop 1
dl 0
loc 28
rs 8.5806
c 0
b 0
f 0
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
		if ( ! in_array( FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' ), array( 'edit', 'show' ) ) ) {
11
			$menu_name = FrmAppHelper::get_menu_name();
12
			add_filter( 'manage_' . sanitize_title( $menu_name ) . '_page_formidable-entries_columns', 'FrmEntriesController::manage_columns' );
13
			add_filter( 'get_user_option_manage' . sanitize_title( $menu_name ) . '_page_formidable-entriescolumnshidden', 'FrmEntriesController::hidden_columns' );
14
			add_filter( 'manage_' . sanitize_title( $menu_name ) . '_page_formidable-entries_sortable_columns', 'FrmEntriesController::sortable_columns' );
15
        }
16
    }
17
18
    /* Display in Back End */
19
    public static function route() {
20
		$action = FrmAppHelper::get_param( 'frm_action', '', 'get', 'sanitize_title' );
21
22
        switch ( $action ) {
23
            case 'show':
24
            case 'destroy':
25
            case 'destroy_all':
26
                return self::$action();
27
28
            default:
29
                do_action( 'frm_entry_action_route', $action );
30
                if ( apply_filters( 'frm_entry_stop_action_route', false, $action ) ) {
31
                    return;
32
                }
33
34
                return self::display_list();
35
        }
36
    }
37
38
	public static function contextual_help( $help, $screen_id, $screen ) {
39
        // Only add to certain screens. add_help_tab was introduced in WordPress 3.3
40
        if ( ! method_exists( $screen, 'add_help_tab' ) ) {
41
            return $help;
42
        }
43
44
		$action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
45
		$page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
46
		if ( $page != 'formidable-entries' || ( ! empty( $action ) && $action != 'list' ) ) {
47
            return $help;
48
        }
49
50
		unset( $action, $page );
51
52
        $screen->add_help_tab( array(
53
            'id'      => 'formidable-entries-tab',
54
            'title'   => __( 'Overview', 'formidable' ),
55
			'content' => '<p>' . esc_html__( 'This screen provides access to all of your entries. You can customize the display of this screen to suit your workflow.', 'formidable' ) . '</p> <p>' . esc_html__( 'Hovering over a row in the entries list will display action links that allow you to manage your entry.', 'formidable' ) . '</p>',
56
        ));
57
58
        $screen->set_help_sidebar(
59
			'<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
60
			'<p><a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/knowledgebase/manage-entries-from-the-back-end/' ) ) . '" target="_blank">' . esc_html__( 'Documentation on Entries', 'formidable' ) . '</a></p>' .
61
			'<p><a href="' . esc_url( FrmAppHelper::make_affiliate_url( 'https://formidableforms.com/help-desk/' ) ) . '" target="_blank">' . esc_html__( 'Support', 'formidable' ) . '</a></p>'
62
    	);
63
64
        return $help;
65
    }
66
67
	public static function manage_columns( $columns ) {
68
        global $frm_vars;
69
		$form_id = FrmForm::get_current_form_id();
70
71
		$columns[ $form_id . '_id' ] = 'ID';
72
		$columns[ $form_id . '_item_key' ] = esc_html__( 'Entry Key', 'formidable' );
73
74
		if ( $form_id ) {
75
			self::get_columns_for_form( $form_id, $columns );
76
		} else {
77
			$columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' );
78
			$columns[ $form_id . '_name' ] = __( 'Entry Name', 'formidable' );
79
			$columns[ $form_id . '_user_id' ] = __( 'Created By', 'formidable' );
80
		}
81
82
		$columns[ $form_id . '_created_at' ] = __( 'Entry creation date', 'formidable' );
83
		$columns[ $form_id . '_updated_at' ] = __( 'Entry update date', 'formidable' );
84
		self::maybe_add_ip_col( $form_id, $columns );
85
86
        $frm_vars['cols'] = $columns;
87
88
		$action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
89
		if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $action, array( '', 'list', 'destroy' ) ) ) {
90
			add_screen_option( 'per_page', array( 'label' => __( 'Entries', 'formidable' ), 'default' => 20, 'option' => 'formidable_page_formidable_entries_per_page' ) );
91
        }
92
93
        return $columns;
94
    }
95
96
	private static function get_columns_for_form( $form_id, &$columns ) {
97
		$form_cols = FrmField::get_all_for_form( $form_id, '', 'include' );
98
99
		foreach ( $form_cols as $form_col ) {
100
			if ( FrmField::is_no_save_field( $form_col->type ) ) {
101
				continue;
102
			}
103
104
			if ( $form_col->type == 'form' && isset( $form_col->field_options['form_select'] ) && ! empty( $form_col->field_options['form_select'] ) ) {
105
				$sub_form_cols = FrmField::get_all_for_form( $form_col->field_options['form_select'] );
106
107
				if ( $sub_form_cols ) {
108
					foreach ( $sub_form_cols as $k => $sub_form_col ) {
109
						if ( FrmField::is_no_save_field( $sub_form_col->type ) ) {
110
							unset( $sub_form_cols[ $k ] );
111
							continue;
112
						}
113
						$columns[ $form_id . '_' . $sub_form_col->field_key . '-_-' . $form_col->id ] = FrmAppHelper::truncate( $sub_form_col->name, 35 );
114
						unset($sub_form_col);
115
					}
116
				}
117
				unset($sub_form_cols);
118
			} else {
119
				$col_id = $form_col->field_key;
120
				if ( $form_col->form_id != $form_id ) {
121
					$col_id .= '-_-form' . $form_col->form_id;
122
				}
123
				
124
				$has_separate_value = ! FrmField::is_option_empty( $form_col, 'separate_value' );
125
				$is_post_status     = FrmField::is_option_true( $form_col, 'post_field' ) && $form_col->field_options['post_field'] == 'post_status';
126
				if ( $has_separate_value && ! $is_post_status ) {
127
					$columns[ $form_id . '_frmsep_' . $col_id ] = FrmAppHelper::truncate( $form_col->name, 35 );
128
				}
129
				$columns[ $form_id . '_' . $col_id ] = FrmAppHelper::truncate( $form_col->name, 35 );
130
			}
131
		}
132
	}
133
134
	private static function maybe_add_ip_col( $form_id, &$columns ) {
135
		if ( FrmAppHelper::ips_saved() ) {
136
			$columns[ $form_id . '_ip' ] = 'IP';
137
		}
138
	}
139
140
	public static function check_hidden_cols( $check, $object_id, $meta_key, $meta_value, $prev_value ) {
141
		$menu_name = FrmAppHelper::get_menu_name();
142
		$this_page_name = 'manage' . sanitize_title( $menu_name ) . '_page_formidable-entriescolumnshidden';
143
		if ( $meta_key != $this_page_name || $meta_value == $prev_value ) {
144
            return $check;
145
        }
146
147
		if ( empty( $prev_value ) ) {
148
			$prev_value = get_metadata( 'user', $object_id, $meta_key, true );
149
		}
150
151
        global $frm_vars;
152
        //add a check so we don't create a loop
153
        $frm_vars['prev_hidden_cols'] = ( isset($frm_vars['prev_hidden_cols']) && $frm_vars['prev_hidden_cols'] ) ? false : $prev_value;
154
155
        return $check;
156
    }
157
158
    //add hidden columns back from other forms
159
	public static function update_hidden_cols( $meta_id, $object_id, $meta_key, $meta_value ) {
160
		$menu_name = FrmAppHelper::get_menu_name();
161
		$sanitized = sanitize_title( $menu_name );
162
		$this_page_name = 'manage' . $sanitized . '_page_formidable-entriescolumnshidden';
163
		if ( $meta_key != $this_page_name ) {
164
            return;
165
        }
166
167
        global $frm_vars;
168
        if ( ! isset($frm_vars['prev_hidden_cols']) || ! $frm_vars['prev_hidden_cols'] ) {
169
            return; //don't continue if there's no previous value
170
        }
171
172
        foreach ( $meta_value as $mk => $mv ) {
173
            //remove blank values
174
            if ( empty( $mv ) ) {
175
                unset( $meta_value[ $mk ] );
176
            }
177
        }
178
179
        $cur_form_prefix = reset($meta_value);
180
        $cur_form_prefix = explode('_', $cur_form_prefix);
181
        $cur_form_prefix = $cur_form_prefix[0];
182
        $save = false;
183
184
        foreach ( (array) $frm_vars['prev_hidden_cols'] as $prev_hidden ) {
185
			if ( empty( $prev_hidden ) || in_array( $prev_hidden, $meta_value ) ) {
186
                //don't add blank cols or process included cols
187
                continue;
188
            }
189
190
			$form_prefix = explode( '_', $prev_hidden );
191
            $form_prefix = $form_prefix[0];
192
            if ( $form_prefix == $cur_form_prefix ) {
193
                //don't add back columns that are meant to be hidden
194
                continue;
195
            }
196
197
            $meta_value[] = $prev_hidden;
198
            $save = true;
199
            unset($form_prefix);
200
        }
201
202
		if ( $save ) {
203
            $user = wp_get_current_user();
204
			update_user_option( $user->ID, $this_page_name, $meta_value, true );
205
        }
206
    }
207
208
	public static function save_per_page( $save, $option, $value ) {
209
        if ( $option == 'formidable_page_formidable_entries_per_page' ) {
210
            $save = (int) $value;
211
        }
212
        return $save;
213
    }
214
215
	public static function sortable_columns() {
216
		$form_id = FrmForm::get_current_form_id();
217
		$fields = FrmField::get_all_for_form( $form_id );
218
219
		$columns = array(
220
			$form_id . '_id'         => 'id',
221
			$form_id . '_created_at' => 'created_at',
222
			$form_id . '_updated_at' => 'updated_at',
223
			$form_id . '_ip'         => 'ip',
224
			$form_id . '_item_key'   => 'item_key',
225
			$form_id . '_is_draft'   => 'is_draft',
226
		);
227
228
		foreach ( $fields as $field ) {
229
			if ( $field->type != 'checkbox' && ( ! isset( $field->field_options['post_field'] ) || $field->field_options['post_field'] == '' ) ) {
230
				// Can't sort on checkboxes because they are stored serialized, or post fields
231
				$columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
232
			}
233
		}
234
235
		return $columns;
236
	}
237
238
	public static function hidden_columns( $result ) {
239
        global $frm_vars;
240
241
		$form_id = FrmForm::get_current_form_id();
242
243
        $return = false;
244
        foreach ( (array) $result as $r ) {
245
            if ( ! empty( $r ) ) {
246
                $form_prefix = explode( '_', $r );
247
                $form_prefix = $form_prefix[0];
248
249
                if ( (int) $form_prefix == (int) $form_id ) {
250
                    $return = true;
251
                    break;
252
                }
253
254
                unset($form_prefix);
255
            }
256
        }
257
258
        if ( $return ) {
259
			return $result;
260
		}
261
262
        $i = isset($frm_vars['cols']) ? count($frm_vars['cols']) : 0;
263
        $max_columns = 8;
264
        if ( $i <= $max_columns ) {
265
			return $result;
266
		}
267
268
        global $frm_vars;
269
        if ( isset($frm_vars['current_form']) && $frm_vars['current_form'] ) {
270
            $frm_vars['current_form']->options = maybe_unserialize($frm_vars['current_form']->options);
271
        }
272
273
		$has_custom_hidden_columns = ( isset( $frm_vars['current_form'] ) && $frm_vars['current_form'] && isset( $frm_vars['current_form']->options['hidden_cols'] ) && ! empty( $frm_vars['current_form']->options['hidden_cols'] ) );
274
		if ( $has_custom_hidden_columns ) {
275
            $result = $frm_vars['current_form']->options['hidden_cols'];
276
        } else {
277
            $cols = $frm_vars['cols'];
278
            $cols = array_reverse($cols, true);
279
280
			if ( $form_id ) {
281
				$result[] = $form_id . '_id';
282
				$i--;
283
			}
284
285
			$result[] = $form_id . '_item_key';
286
            $i--;
287
288
			foreach ( $cols as $col_key => $col ) {
289
                if ( $i > $max_columns ) {
290
					$result[] = $col_key;
291
				}
292
                //remove some columns by default
293
                $i--;
294
                unset($col_key, $col);
295
            }
296
        }
297
298
        return $result;
299
    }
300
301
	public static function display_list( $message = '', $errors = array() ) {
302
        global $wpdb, $frm_vars;
303
304
		$form = FrmForm::maybe_get_current_form();
305
		$params = FrmForm::get_admin_params( $form );
306
307
        if ( $form ) {
308
            $params['form'] = $form->id;
309
            $frm_vars['current_form'] = $form;
310
311
			self::get_delete_form_time( $form, $errors );
312
		}
313
314
        $table_class = apply_filters( 'frm_entries_list_class', 'FrmEntriesListHelper' );
315
316
        $wp_list_table = new $table_class( array( 'params' => $params ) );
317
318
        $pagenum = $wp_list_table->get_pagenum();
319
320
        $wp_list_table->prepare_items();
321
322
        $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
323
        if ( $pagenum > $total_pages && $total_pages > 0 ) {
324
			$url = add_query_arg( 'paged', $total_pages );
325
            if ( headers_sent() ) {
326
                echo FrmAppHelper::js_redirect($url);
0 ignored issues
show
introduced by
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw 'FrmAppHelper'
Loading history...
327
            } else {
328
                wp_redirect( esc_url_raw( $url ) );
329
            }
330
            die();
331
        }
332
333
        if ( empty($message) && isset($_GET['import-message']) ) {
334
            $message = __( 'Your import is complete', 'formidable' );
335
        }
336
337
		require( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/list.php' );
338
    }
339
340
	private static function get_delete_form_time( $form, &$errors ) {
341
		if ( 'trash' == $form->status ) {
342
			$delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS );
343
			$time_to_delete = FrmAppHelper::human_time_diff( $delete_timestamp, ( isset( $form->options['trash_time'] ) ? ( $form->options['trash_time'] ) : time() ) );
344
			$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 );
345
		}
346
	}
347
348
    /* Back End CRUD */
349
	public static function show( $id = 0 ) {
350
        FrmAppHelper::permission_check('frm_view_entries');
351
352
        if ( ! $id ) {
353
			$id = FrmAppHelper::get_param( 'id', 0, 'get', 'absint' );
354
355
            if ( ! $id ) {
356
				$id = FrmAppHelper::get_param( 'item_id', 0, 'get', 'absint' );
357
            }
358
        }
359
360
        $entry = FrmEntry::getOne($id, true);
361
		if ( ! $entry ) {
362
			echo '<div id="form_show_entry_page" class="wrap">' .
363
				__( 'You are trying to view an entry that does not exist.', 'formidable' ) .
0 ignored issues
show
introduced by
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw '__'
Loading history...
364
				'</div>';
365
			return;
366
		}
367
368
        $data = maybe_unserialize($entry->description);
369
		if ( ! is_array( $data ) || ! isset( $data['referrer'] ) ) {
370
			$data = array( 'referrer' => $data );
371
		}
372
373
		$fields = FrmField::get_all_for_form( $entry->form_id, '', 'include' );
374
        $to_emails = array();
375
376
		include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/show.php' );
377
    }
378
379
    public static function destroy() {
380
        FrmAppHelper::permission_check('frm_delete_entries');
381
382
		$params = FrmForm::get_admin_params();
383
384
        if ( isset($params['keep_post']) && $params['keep_post'] ) {
385
            //unlink entry from post
386
            global $wpdb;
387
			$wpdb->update( $wpdb->prefix . 'frm_items', array( 'post_id' => '' ), array( 'id' => $params['id'] ) );
388
        }
389
390
        $message = '';
391
        if ( FrmEntry::destroy( $params['id'] ) ) {
392
            $message = __( 'Entry was Successfully Destroyed', 'formidable' );
393
        }
394
395
        self::display_list( $message );
396
    }
397
398
    public static function destroy_all() {
399
        if ( ! current_user_can( 'frm_delete_entries' ) ) {
400
            $frm_settings = FrmAppHelper::get_settings();
401
            wp_die( $frm_settings->admin_permission );
402
        }
403
404
        global $wpdb;
405
		$params = FrmForm::get_admin_params();
406
        $message = '';
407
        $errors = array();
408
        $form_id = (int) $params['form'];
409
410
        if ( $form_id ) {
411
            $entry_ids = FrmDb::get_col( 'frm_items', array( 'form_id' => $form_id ) );
412
			$action = FrmFormAction::get_action_for_form( $form_id, 'wppost', 1 );
413
414
            if ( $action ) {
415
                // this action takes a while, so only trigger it if there are posts to delete
416
                foreach ( $entry_ids as $entry_id ) {
0 ignored issues
show
Bug introduced by
The expression $entry_ids of type array|null|string|object is not guaranteed to be traversable. How about adding an additional type check?

There are different options of fixing this problem.

  1. If you want to be on the safe side, you can add an additional type-check:

    $collection = json_decode($data, true);
    if ( ! is_array($collection)) {
        throw new \RuntimeException('$collection must be an array.');
    }
    
    foreach ($collection as $item) { /** ... */ }
    
  2. If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:

    /** @var array $collection */
    $collection = json_decode($data, true);
    
    foreach ($collection as $item) { /** .. */ }
    
  3. Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.

Loading history...
417
                    do_action( 'frm_before_destroy_entry', $entry_id );
418
                    unset( $entry_id );
419
                }
420
            }
421
422
            $wpdb->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) and form_id=%d", $form_id ) );
423
            $results = $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}frm_items WHERE form_id=%d", $form_id ) );
424
            if ( $results ) {
425
				FrmEntry::clear_cache();
426
                $message = __( 'Entries were Successfully Destroyed', 'formidable' );
427
            }
428
        } else {
429
            $errors = __( 'No entries were specified', 'formidable' );
430
        }
431
432
        self::display_list( $message, $errors );
433
    }
434
435
    public static function show_form( $id = '', $key = '', $title = false, $description = false ) {
436
        _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::show_form()' );
437
        return FrmFormsController::show_form( $id, $key, $title, $description );
438
    }
439
440
    public static function get_form( $filename, $form, $title, $description ) {
441
        _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form()' );
442
        return FrmFormsController::get_form( $form, $title, $description );
443
    }
444
445
    public static function process_entry( $errors = '', $ajax = false ) {
446
		$form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
447
		if ( FrmAppHelper::is_admin() || empty( $_POST ) || empty( $form_id ) || ! isset( $_POST['item_key'] ) ) {
448
            return;
449
        }
450
451
        global $frm_vars;
452
453
		$form = FrmForm::getOne( $form_id );
454
        if ( ! $form ) {
455
            return;
456
        }
457
458
		$params = FrmForm::get_params( $form );
459
460
        if ( ! isset( $frm_vars['form_params'] ) ) {
461
            $frm_vars['form_params'] = array();
462
        }
463
		$frm_vars['form_params'][ $form->id ] = $params;
464
465
		if ( isset( $frm_vars['created_entries'][ $form_id ] ) ) {
466
            return;
467
        }
468
469
        if ( $errors == '' && ! $ajax ) {
470
			$errors = FrmEntryValidate::validate( $_POST );
471
        }
472
473
		/**
474
		 * Use this filter to add trigger actions and add errors after
475
		 * all other errors have been processed
476
		 * @since 2.0.6
477
		 */
478
		$errors = apply_filters( 'frm_entries_before_create', $errors, $form );
479
480
		$frm_vars['created_entries'][ $form_id ] = array( 'errors' => $errors );
481
482
        if ( empty( $errors ) ) {
483
			$_POST['frm_skip_cookie'] = 1;
484
            if ( $params['action'] == 'create' ) {
485
				if ( apply_filters( 'frm_continue_to_create', true, $form_id ) && ! isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) {
486
					$frm_vars['created_entries'][ $form_id ]['entry_id'] = FrmEntry::create( $_POST );
487
                }
488
            }
489
490
            do_action( 'frm_process_entry', $params, $errors, $form, array( 'ajax' => $ajax ) );
491
			unset( $_POST['frm_skip_cookie'] );
492
        }
493
    }
494
495
    public static function delete_entry_before_redirect( $url, $form, $atts ) {
496
        self::_delete_entry( $atts['id'], $form );
497
        return $url;
498
    }
499
500
    //Delete entry if not redirected
501
    public static function delete_entry_after_save( $atts ) {
502
        self::_delete_entry( $atts['entry_id'], $atts['form'] );
503
    }
504
505
    private static function _delete_entry( $entry_id, $form ) {
506
        if ( ! $form ) {
507
            return;
508
        }
509
510
        $form->options = maybe_unserialize( $form->options );
511
        if ( isset( $form->options['no_save'] ) && $form->options['no_save'] ) {
512
            FrmEntry::destroy( $entry_id );
513
        }
514
    }
515
516
	/**
517
	 * @param $atts
518
	 *
519
	 * @return array|string
520
	 */
521
	public static function show_entry_shortcode( $atts ) {
522
		$defaults = array(
523
			'id'             => false,
524
			'entry'          => false,
525
			'fields'         => false,
526
			'plain_text'     => false,
527
			'user_info'      => false,
528
			'include_blank'  => false,
529
			'default_email'  => false,
530
			'form_id'        => false,
531
			'format'         => 'text',
532
			'direction'      => 'ltr',
533
			'font_size'      => '',
534
			'text_color'     => '',
535
			'border_width'   => '',
536
			'border_color'   => '',
537
			'bg_color'       => '',
538
			'alt_bg_color'   => '',
539
			'clickable'      => false,
540
			'exclude_fields' => '',
541
			'include_fields' => '',
542
			'include_extras' => '',
543
			'inline_style'   => 1,
544
		);
545
546
		$atts = shortcode_atts( $defaults, $atts );
547
548
		if ( $atts['default_email'] ) {
549
			$shortcode_atts = array( 'format' => $atts['format'], 'plain_text' => $atts['plain_text'] );
550
			$entry_shortcode_formatter = FrmEntryFactory::entry_shortcode_formatter_instance( $atts['form_id'], $shortcode_atts );
551
			$formatted_entry = $entry_shortcode_formatter->content();
552
553
		} else {
554
555
			$entry_formatter = FrmEntryFactory::entry_formatter_instance( $atts );
556
			$formatted_entry = $entry_formatter->get_formatted_entry_values();
557
558
		}
559
560
		return $formatted_entry;
561
	}
562
563
	public static function get_params( $form = null ) {
564
		_deprecated_function( __FUNCTION__, '2.0.9', 'FrmForm::get_params' );
565
		return FrmForm::get_params( $form );
566
	}
567
568
	public static function entry_sidebar( $entry ) {
569
        $data = maybe_unserialize($entry->description);
570
        $date_format = get_option('date_format');
571
        $time_format = get_option('time_format');
572
		if ( isset( $data['browser'] ) ) {
573
			$browser = FrmEntriesHelper::get_browser( $data['browser'] );
574
		}
575
576
		include( FrmAppHelper::plugin_path() . '/classes/views/frm-entries/sidebar-shared.php' );
577
    }
578
579
	/***********************************************************************
580
	 * Deprecated Functions
581
	 ************************************************************************/
582
583
	/**
584
	 * @deprecated 2.02.14
585
	 *
586
	 * @return mixed
587
	 */
588
	public static function filter_email_value( $value ) {
589
		_deprecated_function( __FUNCTION__, '2.02.14', 'FrmProEntriesController::filter_value_in_single_entry_table' );
590
		return $value;
591
	}
592
593
	/**
594
	 * @deprecated 2.02.14
595
	 *
596
	 * @return mixed
597
	 */
598
	public static function filter_display_value( $value ) {
599
		_deprecated_function( __FUNCTION__, '2.02.14', 'FrmProEntriesController::filter_display_value' );
600
		return $value;
601
	}
602
603
	/**
604
	 * @deprecated 2.03.04
605
	 *
606
	 * @return mixed
607
	 */
608
	public static function filter_shortcode_value( $value ) {
609
		_deprecated_function( __FUNCTION__, '2.03.04', 'custom code' );
610
		return $value;
611
	}
612
}
613