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 / deprecated / FrmDeprecated.php

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

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