PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 4.07.01
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v4.07.01
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 / deprecated / FrmDeprecated.php

FrmDeprecated.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 4.07.01, at deprecated/FrmDeprecated.php

901 lines 24.9 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 /**
7 * Class FrmDeprecated
8 *
9 * @since 3.04.03
10 * @codeCoverageIgnore
11 */
12 class FrmDeprecated {
13
14 /**
15 * @deprecated 2.3
16 */
17 public static function deprecated( $function, $version ) {
18 _deprecated_function( $function, $version );
19 }
20
21 /**
22 * @deprecated 4.0
23 */
24 public static function new_form( $values = array() ) {
25 _deprecated_function( __FUNCTION__, '4.0', 'FrmFormsController::edit' );
26
27 FrmAppHelper::permission_check( 'frm_edit_forms' );
28
29 $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
30 $action = empty( $values ) ? FrmAppHelper::get_param( $action, '', 'get', 'sanitize_title' ) : $values[ $action ];
31
32 if ( $action === 'create' ) {
33 FrmFormsController::update( $values );
34 return;
35 }
36
37 $values = FrmFormsHelper::setup_new_vars( $values );
38 $id = FrmForm::create( $values );
39 $values['id'] = $id;
40
41 FrmFormsController::edit( $values );
42 }
43
44 /**
45 * @deprecated 4.0
46 */
47 public static function update_order() {
48 _deprecated_function( __FUNCTION__, '4.0' );
49 FrmAppHelper::permission_check( 'frm_edit_forms' );
50 check_ajax_referer( 'frm_ajax', 'nonce' );
51
52 $fields = FrmAppHelper::get_post_param( 'frm_field_id' );
53 foreach ( (array) $fields as $position => $item ) {
54 FrmField::update( absint( $item ), array( 'field_order' => absint( $position ) ) );
55 }
56 wp_die();
57 }
58
59 /**
60 * @deprecated 4.0
61 * @param array $values - The form array
62 */
63 public static function builder_submit_button( $values ) {
64 _deprecated_function( __FUNCTION__, '4.0' );
65 $page_action = FrmAppHelper::get_param( 'frm_action' );
66 $label = ( $page_action == 'edit' || $page_action == 'update' ) ? __( 'Update', 'formidable' ) : __( 'Create', 'formidable' );
67
68 ?>
69 <div class="postbox">
70 <p class="inside">
71 <button class="frm_submit_<?php echo esc_attr( ( isset( $values['ajax_load'] ) && $values['ajax_load'] ) ? '' : 'no_' ); ?>ajax button-primary frm_button_submit" type="button">
72 <?php echo esc_html( $label ); ?>
73 </button>
74 </p>
75 </div>
76 <?php
77 }
78
79 /**
80 * @deprecated 3.04.03
81 */
82 public static function get_licenses() {
83 _deprecated_function( __FUNCTION__, '3.04.03' );
84
85 $allow_autofill = self::allow_autofill();
86 $required_role = $allow_autofill ? 'setup_network' : 'frm_change_settings';
87 FrmAppHelper::permission_check( $required_role );
88 check_ajax_referer( 'frm_ajax', 'nonce' );
89
90 if ( is_multisite() && get_site_option( 'frmpro-wpmu-sitewide' ) ) {
91 $license = get_site_option( 'frmpro-credentials' );
92 } else {
93 $license = get_option( 'frmpro-credentials' );
94 }
95
96 if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
97 $url = 'https://formidableforms.com/frm-edd-api/licenses?l=' . urlencode( base64_encode( $license['license'] ) );
98 $licenses = self::send_api_request(
99 $url,
100 array(
101 'name' => 'frm_api_licence',
102 'expires' => 60 * 60 * 5,
103 )
104 );
105 echo json_encode( $licenses );
106 }
107
108 wp_die();
109 }
110
111
112 /**
113 * Don't allow subsite addon licenses to be fetched
114 * unless the current user has super admin permissions
115 *
116 * @since 2.03.10
117 * @deprecated 3.04.03
118 */
119 private static function allow_autofill() {
120 $allow_autofill = FrmAppHelper::pro_is_installed();
121 if ( $allow_autofill && is_multisite() ) {
122 $sitewide_activated = get_site_option( 'frmpro-wpmu-sitewide' );
123 if ( $sitewide_activated ) {
124 $allow_autofill = current_user_can( 'setup_network' );
125 }
126 }
127 return $allow_autofill;
128 }
129
130 /**
131 * @deprecated 3.04.03
132 */
133 private static function send_api_request( $url, $transient = array() ) {
134 $data = get_transient( $transient['name'] );
135 if ( $data !== false ) {
136 return $data;
137 }
138
139 $arg_array = array(
140 'body' => array(
141 'url' => home_url(),
142 ),
143 'timeout' => 15,
144 'user-agent' => 'Formidable/' . FrmAppHelper::$plug_version . '; ' . home_url(),
145 );
146
147 $response = wp_remote_post( $url, $arg_array );
148 $body = wp_remote_retrieve_body( $response );
149 $data = false;
150 if ( ! is_wp_error( $response ) && ! is_wp_error( $body ) ) {
151 $data = json_decode( $body, true );
152 set_transient( $transient['name'], $data, $transient['expires'] );
153 }
154
155 return $data;
156 }
157
158 /**
159 * @since 3.04.03
160 * @deprecated 3.06
161 * @codeCoverageIgnore
162 */
163 public static function get_pro_updater() {
164 _deprecated_function( __FUNCTION__, '3.06', 'FrmFormApi::get_pro_updater' );
165 $api = new FrmFormApi();
166 return $api->get_pro_updater();
167 }
168
169 /**
170 * @since 3.04.03
171 * @deprecated 3.06
172 * @codeCoverageIgnore
173 * @return array
174 */
175 public static function error_for_license( $license ) {
176 _deprecated_function( __FUNCTION__, '3.06', 'FrmFormApi::error_for_license' );
177 $api = new FrmFormApi( $license );
178 return $api->error_for_license();
179 }
180
181 /**
182 * @since 3.04.03
183 * @deprecated 3.06
184 */
185 public static function reset_cached_addons( $license = '' ) {
186 _deprecated_function( __FUNCTION__, '3.06', 'FrmFormApi::reset_cached' );
187 $api = new FrmFormApi( $license );
188 $api->reset_cached();
189 }
190
191 /**
192 * @since 3.04.03
193 * @deprecated 3.06
194 * @return string
195 */
196 public static function get_cache_key( $license ) {
197 _deprecated_function( __FUNCTION__, '3.06', 'FrmFormApi::get_cache_key' );
198 $api = new FrmFormApi( $license );
199 return $api->get_cache_key();
200 }
201
202 /**
203 * @since 3.04.03
204 * @deprecated 3.06
205 * @codeCoverageIgnore
206 * @return array
207 */
208 public static function get_addon_info( $license = '' ) {
209 _deprecated_function( __FUNCTION__, '3.06', 'FrmFormApi::get_api_info' );
210 $api = new FrmFormApi( $license );
211 return $api->get_api_info();
212 }
213
214 /**
215 * Add a filter to shorten the EDD filename for Formidable plugin, and add-on, updates
216 *
217 * @since 2.03.08
218 * @deprecated 3.04.03
219 *
220 * @param boolean $return
221 * @param string $package
222 *
223 * @return boolean
224 */
225 public static function add_shorten_edd_filename_filter( $return, $package ) {
226 _deprecated_function( __FUNCTION__, '3.04.03' );
227
228 if ( strpos( $package, '/edd-sl/package_download/' ) !== false && strpos( $package, 'formidableforms.com' ) !== false ) {
229 add_filter( 'wp_unique_filename', 'FrmDeprecated::shorten_edd_filename', 10, 2 );
230 }
231
232 return $return;
233 }
234
235 /**
236 * Shorten the EDD filename for automatic updates
237 * Decreases size of file path so file path limit is not hit on Windows servers
238 *
239 * @since 2.03.08
240 * @deprecated 3.04.03
241 *
242 * @param string $filename
243 * @param string $ext
244 *
245 * @return string
246 */
247 public static function shorten_edd_filename( $filename, $ext ) {
248 _deprecated_function( __FUNCTION__, '3.04.03' );
249
250 $filename = substr( $filename, 0, 50 ) . $ext;
251 remove_filter( 'wp_unique_filename', 'FrmDeprecated::shorten_edd_filename', 10 );
252
253 return $filename;
254 }
255
256 /**
257 * Filter shortcodes in text widgets
258 *
259 * @deprecated 2.5.4
260 */
261 public static function widget_text_filter( $content ) {
262 _deprecated_function( __FUNCTION__, '2.5.4' );
263 $regex = '/\[\s*(formidable|display-frm-data|frm-stats|frm-graph|frm-entry-links|formresults|frm-search)\s+.*\]/';
264 return preg_replace_callback( $regex, 'FrmAppHelper::widget_text_filter_callback', $content );
265 }
266
267 /**
268 * Used to filter shortcode in text widgets
269 *
270 * @deprecated 2.5.4
271 */
272 public static function widget_text_filter_callback( $matches ) {
273 _deprecated_function( __FUNCTION__, '2.5.4' );
274 return do_shortcode( $matches[0] );
275 }
276
277 /**
278 * Deprecated in favor of wpmu_upgrade_site
279 *
280 * @deprecated 2.3
281 */
282 public static function front_head() {
283 _deprecated_function( __FUNCTION__, '2.3' );
284 if ( is_multisite() && FrmAppController::needs_update() ) {
285 FrmAppController::install();
286 }
287 }
288
289 /**
290 * @deprecated 3.0.04
291 */
292 public static function activation_install() {
293 _deprecated_function( __FUNCTION__, '3.0.04', 'FrmAppController::install' );
294 FrmDb::delete_cache_and_transient( 'frm_plugin_version' );
295 FrmFormActionsController::actions_init();
296 FrmAppController::install();
297 }
298
299 /**
300 * Routes for wordpress pages -- we're just replacing content
301 *
302 * @deprecated 3.0
303 */
304 public static function page_route( $content ) {
305 _deprecated_function( __FUNCTION__, '3.0' );
306 global $post;
307
308 if ( $post && isset( $_GET['form'] ) ) {
309 $content = FrmFormsController::page_preview();
310 }
311
312 return $content;
313 }
314
315 /**
316 * @deprecated 1.07.05
317 */
318 public static function get_form_shortcode( $atts ) {
319 _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form_shortcode()' );
320 return FrmFormsController::get_form_shortcode( $atts );
321 }
322
323 /**
324 * @deprecated 1.07.05
325 */
326 public static function show_form( $id = '', $key = '', $title = false, $description = false ) {
327 _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::show_form()' );
328 return FrmFormsController::show_form( $id, $key, $title, $description );
329 }
330
331 /**
332 * @deprecated 1.07.05
333 */
334 public static function get_form( $filename, $form, $title, $description ) {
335 _deprecated_function( __FUNCTION__, '1.07.05', 'FrmFormsController::get_form()' );
336 return FrmFormsController::get_form( $form, $title, $description );
337 }
338
339 /**
340 * @deprecated 3.0
341 */
342 public static function edit_name( $field = 'name', $id = '' ) {
343 _deprecated_function( __FUNCTION__, '3.0' );
344
345 FrmAppHelper::permission_check( 'frm_edit_forms' );
346 check_ajax_referer( 'frm_ajax', 'nonce' );
347
348 if ( empty( $field ) ) {
349 $field = 'name';
350 }
351
352 if ( empty( $id ) ) {
353 $id = FrmAppHelper::get_post_param( 'element_id', '', 'sanitize_title' );
354 $id = str_replace( 'field_label_', '', $id );
355 }
356
357 $value = FrmAppHelper::get_post_param( 'update_value', '', 'wp_kses_post' );
358 $value = trim( $value );
359 if ( trim( strip_tags( $value ) ) === '' ) {
360 // set blank value if there is no content
361 $value = '';
362 }
363
364 FrmField::update( $id, array( $field => $value ) );
365
366 do_action( 'frm_after_update_field_' . $field, compact( 'id', 'value' ) );
367
368 echo stripslashes( wp_kses_post( $value ) ); // WPCS: XSS ok.
369 wp_die();
370 }
371
372 /**
373 * Load a single field in the form builder along with all needed variables
374 *
375 * @deprecated 3.0
376 *
377 * @param int $field_id
378 * @param array $values
379 * @param int $form_id
380 *
381 * @return array
382 */
383 public static function include_single_field( $field_id, $values, $form_id = 0 ) {
384 _deprecated_function( __FUNCTION__, '3.0', 'FrmFieldsController::load_single_field' );
385
386 $field = FrmFieldsHelper::setup_edit_vars( FrmField::getOne( $field_id ) );
387 FrmFieldsController::load_single_field( $field, $values, $form_id );
388
389 return $field;
390 }
391
392 /**
393 * @deprecated 3.0
394 */
395 public static function bulk_create_template( $ids ) {
396 _deprecated_function( __FUNCTION__, '3.0', 'FrmForm::duplicate( $id, true, true )' );
397 FrmAppHelper::permission_check( 'frm_edit_forms' );
398
399 foreach ( $ids as $id ) {
400 FrmForm::duplicate( $id, true, true );
401 }
402
403 return __( 'Form template was Successfully Created', 'formidable' );
404 }
405
406 /**
407 * @deprecated 2.03
408 */
409 public static function register_pro_scripts() {
410 _deprecated_function( __FUNCTION__, '2.03', 'FrmProEntriesController::register_scripts' );
411 if ( FrmAppHelper::pro_is_installed() ) {
412 FrmProEntriesController::register_scripts();
413 }
414 }
415
416 /**
417 * @deprecated 3.0
418 */
419 public static function edit_key() {
420 _deprecated_function( __FUNCTION__, '3.0' );
421 $values = self::edit_in_place_value( 'form_key' );
422 echo wp_kses( stripslashes( FrmForm::get_key_by_id( $values['form_id'] ) ), array() );
423 wp_die();
424 }
425
426 /**
427 * @deprecated 3.0
428 */
429 public static function edit_description() {
430 _deprecated_function( __FUNCTION__, '3.0' );
431 $values = self::edit_in_place_value( 'description' );
432 echo wp_kses_post( FrmAppHelper::use_wpautop( stripslashes( $values['description'] ) ) );
433 wp_die();
434 }
435
436 /**
437 * @deprecated 3.0
438 */
439 private static function edit_in_place_value( $field ) {
440 _deprecated_function( __FUNCTION__, '3.0' );
441 check_ajax_referer( 'frm_ajax', 'nonce' );
442 FrmAppHelper::permission_check( 'frm_edit_forms', 'hide' );
443
444 $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' );
445 $value = FrmAppHelper::get_post_param( 'update_value', '', 'wp_filter_post_kses' );
446
447 $values = array( $field => trim( $value ) );
448 FrmForm::update( $form_id, $values );
449 $values['form_id'] = $form_id;
450
451 return $values;
452 }
453
454 /**
455 * @deprecated 1.07.05
456 */
457 public static function add_default_templates( $path, $default = true, $template = true ) {
458 _deprecated_function( __FUNCTION__, '1.07.05', 'FrmXMLController::add_default_templates()' );
459
460 $path = untrailingslashit( trim( $path ) );
461 $templates = glob( $path . '/*.php' );
462
463 for ( $i = count( $templates ) - 1; $i >= 0; $i-- ) {
464 $filename = str_replace( '.php', '', str_replace( $path . '/', '', $templates[ $i ] ) );
465 $template_query = array( 'form_key' => $filename );
466 if ( $template ) {
467 $template_query['is_template'] = 1;
468 }
469 if ( $default ) {
470 $template_query['default_template'] = 1;
471 }
472 $form = FrmForm::getAll( $template_query, '', 1 );
473
474 $values = FrmFormsHelper::setup_new_vars();
475 $values['form_key'] = $filename;
476 $values['is_template'] = $template;
477 $values['status'] = 'published';
478
479 include( $templates[ $i ] );
480
481 //get updated form
482 if ( isset( $form ) && ! empty( $form ) ) {
483 $old_id = $form->id;
484 $form = FrmForm::getOne( $form->id );
485 } else {
486 $old_id = false;
487 $form = FrmForm::getAll( $template_query, '', 1 );
488 }
489
490 if ( $form ) {
491 do_action( 'frm_after_duplicate_form', $form->id, (array) $form, array( 'old_id' => $old_id ) );
492 }
493 }
494 }
495
496 /**
497 * @deprecated 3.01
498 */
499 public static function sanitize_array( &$values ) {
500 _deprecated_function( __FUNCTION__, '3.01', 'FrmAppHelper::sanitize_value' );
501 FrmAppHelper::sanitize_value( 'wp_kses_post', $values );
502 }
503
504 /**
505 * Prepare and save settings in styles and actions
506 *
507 * @param array $settings
508 * @param string $group
509 *
510 * @since 2.0.6
511 * @deprecated 2.05.06
512 */
513 public static function save_settings( $settings, $group ) {
514 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
515 return FrmDb::save_settings( $settings, $group );
516 }
517
518 /**
519 * Since actions are JSON encoded, we don't want any filters messing with it.
520 * Remove the filters and then add them back in case any posts or views are
521 * also being imported.
522 *
523 * Used when saving form actions and styles
524 *
525 * @since 2.0.4
526 * @deprecated 2.05.06
527 */
528 public static function save_json_post( $settings ) {
529 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
530 return FrmDb::save_json_post( $settings );
531 }
532
533 /**
534 * Check cache before fetching values and saving to cache
535 *
536 * @since 2.0
537 * @deprecated 2.05.06
538 *
539 * @param string $cache_key The unique name for this cache
540 * @param string $group The name of the cache group
541 * @param string $query If blank, don't run a db call
542 * @param string $type The wpdb function to use with this query
543 * @return mixed $results The cache or query results
544 */
545 public static function check_cache( $cache_key, $group = '', $query = '', $type = 'get_var', $time = 300 ) {
546 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
547 return FrmDb::check_cache( $cache_key, $group, $query, $type, $time );
548 }
549
550 /**
551 * @deprecated 2.05.06
552 */
553 public static function set_cache( $cache_key, $results, $group = '', $time = 300 ) {
554 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
555 FrmDb::set_cache( $cache_key, $results, $group, $time );
556 }
557
558 /**
559 * Keep track of the keys cached in each group so they can be deleted
560 * in Redis and Memcache
561 * @deprecated 2.05.06
562 */
563 public static function add_key_to_group_cache( $key, $group ) {
564 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
565 FrmDb::add_key_to_group_cache( $key, $group );
566 }
567
568 /**
569 * @deprecated 2.05.06
570 */
571 public static function get_group_cached_keys( $group ) {
572 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
573 return FrmDb::get_group_cached_keys( $group );
574 }
575
576 /**
577 * @since 2.0
578 * @deprecated 2.05.06
579 * @param string $cache_key
580 */
581 public static function delete_cache_and_transient( $cache_key, $group = 'default' ) {
582 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
583 FrmDb::delete_cache_and_transient( $cache_key, $group );
584 }
585
586 /**
587 * @since 2.0
588 * @deprecated 2.05.06
589 *
590 * @param string $group The name of the cache group
591 */
592 public static function cache_delete_group( $group ) {
593 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
594 FrmDb::cache_delete_group( $group );
595 }
596
597 /**
598 * Added for < WP 4.0 compatability
599 *
600 * @since 1.07.10
601 * @deprecated 2.05.06
602 *
603 * @param string $term The value to escape
604 * @return string The escaped value
605 */
606 public static function esc_like( $term ) {
607 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
608 return FrmDb::esc_like( $term );
609 }
610
611 /**
612 * @param string $order_query
613 * @deprecated 2.05.06
614 */
615 public static function esc_order( $order_query ) {
616 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
617 return FrmDb::esc_order( $order_query );
618 }
619
620 /**
621 * Make sure this is ordering by either ASC or DESC
622 * @deprecated 2.05.06
623 */
624 public static function esc_order_by( &$order_by ) {
625 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
626 FrmDb::esc_order_by( $order_by );
627 }
628
629 /**
630 * @param string $limit
631 * @deprecated 2.05.06
632 */
633 public static function esc_limit( $limit ) {
634 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
635 return FrmDb::esc_limit( $limit );
636 }
637
638 /**
639 * Get an array of values ready to go through $wpdb->prepare
640 * @since 2.0
641 * @deprecated 2.05.06
642 */
643 public static function prepare_array_values( $array, $type = '%s' ) {
644 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
645 return FrmDb::prepare_array_values( $array, $type );
646 }
647
648 /**
649 * @deprecated 2.05.06
650 */
651 public static function prepend_and_or_where( $starts_with = ' WHERE ', $where = '' ) {
652 _deprecated_function( __FUNCTION__, '2.05.06', 'FrmDb::' . __FUNCTION__ );
653 return FrmDb::prepend_and_or_where( $starts_with, $where );
654 }
655
656 /**
657 * @deprecated 2.05.06
658 */
659 public static function upgrade() {
660 $db = new FrmDbDeprecated();
661 $db->upgrade();
662 }
663
664 /**
665 * @deprecated 2.05.06
666 */
667 public static function collation() {
668 $db = new FrmDbDeprecated();
669 return $db->collation();
670 }
671
672 /**
673 * @deprecated 2.05.06
674 */
675 public static function uninstall() {
676 $db = new FrmDbDeprecated();
677 $db->uninstall();
678 }
679
680 /**
681 * @deprecated 3.0
682 *
683 * @param string $html
684 * @param array $field
685 * @param array $errors
686 * @param object $form
687 * @param array $args
688 *
689 * @return string
690 */
691 public static function replace_shortcodes( $html, $field, $errors = array(), $form = false, $args = array() ) {
692 _deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::prepare_field_html' );
693 $field_obj = FrmFieldFactory::get_field_type( $field['type'], $field );
694 return $field_obj->prepare_field_html( compact( 'errors', 'form' ) );
695 }
696
697 /**
698 * @deprecated 3.0
699 */
700 public static function get_default_field_opts( $type, $field = null, $limit = false ) {
701 if ( $limit ) {
702 _deprecated_function( __FUNCTION__, '3.0', 'FrmFieldHelper::get_default_field_options' );
703 $field_options = FrmFieldsHelper::get_default_field_options( $type );
704 } else {
705 _deprecated_function( __FUNCTION__, '3.0', 'FrmFieldHelper::get_default_field' );
706 $field_options = FrmFieldsHelper::get_default_field( $type );
707 }
708
709 return $field_options;
710 }
711
712 /**
713 * @deprecated 2.02.07
714 */
715 public static function dropdown_categories( $args ) {
716 _deprecated_function( __FUNCTION__, '2.02.07', 'FrmProPost::get_category_dropdown' );
717
718 if ( FrmAppHelper::pro_is_installed() ) {
719 $args['location'] = 'front';
720 $dropdown = FrmProPost::get_category_dropdown( $args['field'], $args );
721 } else {
722 $dropdown = '';
723 }
724
725 return $dropdown;
726 }
727
728 /**
729 * @deprecated 3.0
730 */
731 public static function remove_inline_conditions( $no_vars, $code, $replace_with, &$html ) {
732 _deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::remove_inline_conditions' );
733 FrmShortcodeHelper::remove_inline_conditions( $no_vars, $code, $replace_with, $html );
734 }
735
736 /**
737 * @deprecated 3.0
738 */
739 public static function get_shortcode_tag( $shortcodes, $short_key, $args ) {
740 _deprecated_function( __FUNCTION__, '3.0', 'FrmShortcodeHelper::get_shortcode_tag' );
741 return FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key, $args );
742 }
743
744 /**
745 * @deprecated 3.01
746 */
747 public static function get_sigle_label_postitions() {
748 _deprecated_function( __FUNCTION__, '3.01', 'FrmStylesHelper::get_single_label_positions' );
749 return FrmStylesHelper::get_single_label_positions();
750 }
751
752 /**
753 * @deprecated 3.02.03
754 */
755 public static function jquery_themes() {
756 _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_themes' );
757
758 $themes = array(
759 'ui-lightness' => 'UI Lightness',
760 'ui-darkness' => 'UI Darkness',
761 'smoothness' => 'Smoothness',
762 'start' => 'Start',
763 'redmond' => 'Redmond',
764 'sunny' => 'Sunny',
765 'overcast' => 'Overcast',
766 'le-frog' => 'Le Frog',
767 'flick' => 'Flick',
768 'pepper-grinder' => 'Pepper Grinder',
769 'eggplant' => 'Eggplant',
770 'dark-hive' => 'Dark Hive',
771 'cupertino' => 'Cupertino',
772 'south-street' => 'South Street',
773 'blitzer' => 'Blitzer',
774 'humanity' => 'Humanity',
775 'hot-sneaks' => 'Hot Sneaks',
776 'excite-bike' => 'Excite Bike',
777 'vader' => 'Vader',
778 'dot-luv' => 'Dot Luv',
779 'mint-choc' => 'Mint Choc',
780 'black-tie' => 'Black Tie',
781 'trontastic' => 'Trontastic',
782 'swanky-purse' => 'Swanky Purse',
783 );
784
785 $themes = apply_filters( 'frm_jquery_themes', $themes );
786 return $themes;
787 }
788
789 /**
790 * @deprecated 3.02.03
791 */
792 public static function enqueue_jquery_css() {
793 _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::enqueue_jquery_css' );
794
795 $form = self::get_form_for_page();
796 $theme_css = FrmStylesController::get_style_val( 'theme_css', $form );
797 if ( $theme_css != -1 ) {
798 wp_enqueue_style( 'jquery-theme', self::jquery_css_url( $theme_css ), array(), FrmAppHelper::plugin_version() );
799 }
800 }
801
802 /**
803 * @deprecated 3.02.03
804 */
805 public static function jquery_css_url( $theme_css ) {
806 _deprecated_function( __FUNCTION__, '3.02.03', 'FrmProStylesController::jquery_css_url' );
807
808 if ( $theme_css == -1 ) {
809 return;
810 }
811
812 if ( ! $theme_css || $theme_css == '' || $theme_css == 'ui-lightness' ) {
813 $css_file = FrmAppHelper::plugin_url() . '/css/ui-lightness/jquery-ui.css';
814 } elseif ( preg_match( '/^http.?:\/\/.*\..*$/', $theme_css ) ) {
815 $css_file = $theme_css;
816 } else {
817 $uploads = FrmStylesHelper::get_upload_base();
818 $file_path = '/formidable/css/' . $theme_css . '/jquery-ui.css';
819 if ( file_exists( $uploads['basedir'] . $file_path ) ) {
820 $css_file = $uploads['baseurl'] . $file_path;
821 } else {
822 $css_file = FrmAppHelper::jquery_ui_base_url() . '/themes/' . $theme_css . '/jquery-ui.min.css';
823 }
824 }
825
826 return $css_file;
827 }
828
829 /**
830 * @deprecated 3.02.03
831 */
832 public static function get_form_for_page() {
833 _deprecated_function( __FUNCTION__, '3.02.03' );
834
835 global $frm_vars;
836 $form_id = 'default';
837 if ( ! empty( $frm_vars['forms_loaded'] ) ) {
838 foreach ( $frm_vars['forms_loaded'] as $form ) {
839 if ( is_object( $form ) ) {
840 $form_id = $form->id;
841 break;
842 }
843 }
844 }
845 return $form_id;
846 }
847
848 /**
849 * @deprecated 3.0
850 */
851 public static function validate_url_field( &$errors, $field, $value, $args ) {
852 _deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::validate' );
853
854 if ( $value == '' || ! in_array( $field->type, array( 'website', 'url' ) ) ) {
855 return;
856 }
857
858 FrmEntryValidate::validate_field_types( $errors, $field, $value, $args );
859 }
860
861 /**
862 * @deprecated 3.0
863 */
864 public static function validate_email_field( &$errors, $field, $value, $args ) {
865 _deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::validate' );
866
867 if ( $field->type != 'email' ) {
868 return;
869 }
870
871 FrmEntryValidate::validate_field_types( $errors, $field, $value, $args );
872 }
873
874 /**
875 * @deprecated 3.0
876 */
877 public static function validate_number_field( &$errors, $field, $value, $args ) {
878 _deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::validate' );
879
880 //validate the number format
881 if ( $field->type != 'number' ) {
882 return;
883 }
884
885 FrmEntryValidate::validate_field_types( $errors, $field, $value, $args );
886 }
887
888 /**
889 * @deprecated 3.0
890 */
891 public static function validate_recaptcha( &$errors, $field, $args ) {
892 _deprecated_function( __FUNCTION__, '3.0', 'FrmFieldType::validate' );
893
894 if ( $field->type != 'captcha' ) {
895 return;
896 }
897
898 FrmEntryValidate::validate_field_types( $errors, $field, '', $args );
899 }
900 }
901