| @@ -81,12 +81,11 @@ | ||
| 81 | 81 | $classes .= ' frm-grey-body '; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | if ( FrmAppHelper::is_full_screen() ) { |
| 85 | - $full_screen_on = self::get_full_screen_setting(); | |
| 86 | - $add_class = ''; | |
| 85 | + $add_class = ''; | |
| 87 | 86 | |
| 88 | - if ( $full_screen_on ) { | |
| 87 | + if ( self::get_full_screen_setting() ) { | |
| 89 | 88 | $add_class = ' frm-full-screen is-fullscreen-mode'; |
| 90 | 89 | |
| 91 | 90 | // Load the CSS for .is-fullscreen-mode. |
| 92 | 91 | wp_enqueue_style( 'wp-edit-post' ); |
| @@ -374,9 +373,11 @@ | ||
| 374 | 373 | public static function settings_link( $links ) { |
| 375 | 374 | $settings = array(); |
| 376 | 375 | |
| 377 | 376 | if ( ! FrmAppHelper::pro_is_installed() ) { |
| 378 | - if ( FrmAddonsController::is_license_expired() ) { | |
| 377 | + $is_expired = FrmAddonsController::is_license_expired(); | |
| 378 | + | |
| 379 | + if ( $is_expired ) { | |
| 379 | 380 | $label = __( 'Renew', 'formidable' ); |
| 380 | 381 | } else { |
| 381 | 382 | $label = FrmSalesApi::get_best_sale_value( 'plugin_page_cta_text' ); |
| 382 | 383 | |
| @@ -384,14 +385,20 @@ | ||
| 384 | 385 | $label = __( 'Upgrade to Pro', 'formidable' ); |
| 385 | 386 | } |
| 386 | 387 | } |
| 387 | 388 | |
| 388 | - $upgrade_link = FrmSalesApi::get_best_sale_value( 'plugin_page_cta_link' ); | |
| 389 | + $upgrade_content = $is_expired ? 'renew' : 'upgrade'; | |
| 390 | + $upgrade_link = FrmSalesApi::get_best_sale_value( 'plugin_page_cta_link' ); | |
| 389 | 391 | |
| 392 | + $utm = array( | |
| 393 | + 'campaign' => 'plugin-row', | |
| 394 | + 'content' => $upgrade_content, | |
| 395 | + ); | |
| 396 | + | |
| 390 | 397 | if ( $upgrade_link ) { |
| 391 | - $upgrade_link = FrmAppHelper::maybe_add_missing_utm( $upgrade_link, array( 'medium' => 'plugin-row' ) ); | |
| 398 | + $upgrade_link = FrmAppHelper::maybe_add_missing_utm( $upgrade_link, $utm ); | |
| 392 | 399 | } else { |
| 393 | - $upgrade_link = FrmAppHelper::admin_upgrade_link( 'plugin-row' ); | |
| 400 | + $upgrade_link = FrmAppHelper::admin_upgrade_link( $utm ); | |
| 394 | 401 | } |
| 395 | 402 | |
| 396 | 403 | $settings[] = '<a href="' . esc_url( $upgrade_link ) . '" target="_blank" rel="noopener"><b style="color:#1da867;font-weight:700;">' . esc_html( $label ) . '</b></a>'; |
| 397 | 404 | }//end if |
| @@ -729,24 +736,28 @@ | ||
| 729 | 736 | } |
| 730 | 737 | |
| 731 | 738 | wp_register_script( 'formidable_admin', $plugin_url . '/js/formidable_admin.js', self::get_admin_js_dependencies(), $version, true ); |
| 732 | 739 | |
| 740 | + wp_register_script( | |
| 741 | + 'formidable_forms_list', | |
| 742 | + $plugin_url . '/js/admin/forms-list.js', | |
| 743 | + array( | |
| 744 | + 'formidable_dom', | |
| 745 | + ), | |
| 746 | + $version, | |
| 747 | + true | |
| 748 | + ); | |
| 749 | + | |
| 733 | 750 | if ( FrmAppHelper::on_form_listing_page() ) { |
| 734 | 751 | // For the existing page dropdown in the Form embed modal. |
| 735 | 752 | wp_enqueue_script( 'jquery-ui-autocomplete' ); |
| 753 | + wp_enqueue_script( 'formidable_forms_list' ); | |
| 736 | 754 | } |
| 737 | 755 | |
| 738 | 756 | wp_register_script( 'bootstrap-multiselect', $plugin_url . '/js/bootstrap-multiselect.js', array( 'jquery', 'bootstrap_tooltip', 'popper' ), '2.0', true ); |
| 739 | 757 | |
| 740 | 758 | if ( ! class_exists( 'FrmTransHooksController', false ) ) { |
| 741 | - /** | |
| 742 | - * Gateway fields are included for add-on compatibility but we do not want it to be visible. | |
| 743 | - * They do however need to be visible when the payments submodule is active. | |
| 744 | - */ | |
| 745 | - wp_add_inline_style( | |
| 746 | - 'formidable-admin', | |
| 747 | - '#frm_builder_page li[data-ftype="gateway"] { display: none; }' | |
| 748 | - ); | |
| 759 | + FrmTransLiteAppController::hide_gateway_fields_in_builder(); | |
| 749 | 760 | } |
| 750 | 761 | |
| 751 | 762 | $page = FrmAppHelper::simple_get( 'page', 'sanitize_title' ); |
| 752 | 763 | $post_type = FrmAppHelper::simple_get( 'post_type', 'sanitize_title' ); |
| @@ -784,8 +795,9 @@ | ||
| 784 | 795 | wp_enqueue_script( 'formidable_entries' ); |
| 785 | 796 | } |
| 786 | 797 | |
| 787 | 798 | do_action( 'frm_enqueue_builder_scripts' ); |
| 799 | + self::maybe_enqueue_legacy_paypal_assets(); | |
| 788 | 800 | self::include_upgrade_overlay(); |
| 789 | 801 | self::include_info_overlay(); |
| 790 | 802 | } elseif ( FrmAppHelper::is_view_builder_page() ) { |
| 791 | 803 | if ( isset( $_REQUEST['post_type'] ) ) { |
| @@ -944,8 +956,29 @@ | ||
| 944 | 956 | FrmUsageController::load_scripts(); |
| 945 | 957 | } |
| 946 | 958 | |
| 947 | 959 | /** |
| 960 | + * Enqueue legacy PayPal action settings styles when the PayPal add-on is active. | |
| 961 | + * | |
| 962 | + * @since 6.31 | |
| 963 | + * | |
| 964 | + * @return void | |
| 965 | + */ | |
| 966 | + private static function maybe_enqueue_legacy_paypal_assets() { | |
| 967 | + if ( ! FrmAppHelper::is_form_builder_page() || ! class_exists( 'FrmPaymentsController' ) ) { | |
| 968 | + return; | |
| 969 | + } | |
| 970 | + | |
| 971 | + wp_register_style( | |
| 972 | + 'formidable-legacy-paypal', | |
| 973 | + FrmAppHelper::plugin_url() . '/css/admin/frm-legacy-paypal.css', | |
| 974 | + array( 'formidable-admin' ), | |
| 975 | + FrmAppHelper::plugin_version() | |
| 976 | + ); | |
| 977 | + wp_enqueue_style( 'formidable-legacy-paypal' ); | |
| 978 | + } | |
| 979 | + | |
| 980 | + /** | |
| 948 | 981 | * Enqueue required assets for the Legacy Views editor (Views v4.x). |
| 949 | 982 | * |
| 950 | 983 | * @since 6.1.2 |
| 951 | 984 | * |
| @@ -1296,9 +1329,9 @@ | ||
| 1296 | 1329 | } |
| 1297 | 1330 | |
| 1298 | 1331 | /** |
| 1299 | 1332 | * The payment cron is unscheduled when Formidable is deactivated. |
| 1300 | - * We need to add it back again on activation if Stripe is configured. | |
| 1333 | + * We need to add it back again on activation if any payment gateway is configured. | |
| 1301 | 1334 | * |
| 1302 | 1335 | * @since 6.5 |
| 1303 | 1336 | * |
| 1304 | 1337 | * @return void |
| @@ -1303,9 +1336,13 @@ | ||
| 1303 | 1336 | * |
| 1304 | 1337 | * @return void |
| 1305 | 1338 | */ |
| 1306 | 1339 | private static function maybe_activate_payment_cron() { |
| 1307 | - if ( ! FrmStrpLiteConnectHelper::stripe_connect_is_setup() ) { | |
| 1340 | + $stripe_connected = FrmStrpLiteConnectHelper::at_least_one_mode_is_setup(); | |
| 1341 | + $square_connected = FrmSquareLiteConnectHelper::at_least_one_mode_is_setup(); | |
| 1342 | + $paypal_connected = FrmPayPalLiteConnectHelper::at_least_one_mode_is_setup(); | |
| 1343 | + | |
| 1344 | + if ( ! $stripe_connected && ! $square_connected && ! $paypal_connected ) { | |
| 1308 | 1345 | return; |
| 1309 | 1346 | } |
| 1310 | 1347 | |
| 1311 | 1348 | FrmTransLiteAppController::maybe_schedule_cron(); |
| @@ -1381,8 +1418,9 @@ | ||
| 1381 | 1418 | 'cancel_url' => '', |
| 1382 | 1419 | 'cancel_classes' => '', |
| 1383 | 1420 | 'continue_url' => '', |
| 1384 | 1421 | 'continue_classes' => '', |
| 1422 | + 'continue_target' => '', | |
| 1385 | 1423 | 'icon' => 'frm_lock_simple', |
| 1386 | 1424 | ); |
| 1387 | 1425 | |
| 1388 | 1426 | $error_args = wp_parse_args( $error_args, $defaults ); |
| @@ -1589,10 +1627,9 @@ | ||
| 1589 | 1627 | if ( false === $meta_key ) { |
| 1590 | 1628 | return; |
| 1591 | 1629 | } |
| 1592 | 1630 | |
| 1593 | - $user_id = get_current_user_id(); | |
| 1594 | - $preferred_list_sort = get_user_meta( $user_id, $meta_key, true ); | |
| 1631 | + $preferred_list_sort = get_user_meta( get_current_user_id(), $meta_key, true ); | |
| 1595 | 1632 | $form_id = FrmAppHelper::simple_get( 'form', 'absint' ); |
| 1596 | 1633 | |
| 1597 | 1634 | if ( is_array( $preferred_list_sort ) && $form_id && is_int( $form_id ) && isset( $preferred_list_sort[ $form_id ] ) ) { |
| 1598 | 1635 | $preferred_list_sort = $preferred_list_sort[ $form_id ]; |