| @@ -135,12 +135,17 @@ | ||
| 135 | 135 | 'formidable-welcome', |
| 136 | 136 | 'formidable-applications', |
| 137 | 137 | ); |
| 138 | 138 | |
| 139 | - if ( ! class_exists( 'FrmTransHooksController', false ) ) { | |
| 139 | + if ( ! class_exists( 'FrmTransHooksController', false ) && ! FrmTransLiteAppHelper::should_fallback_to_paypal() ) { | |
| 140 | 140 | // Only consider the payments page as a "white page" when the Payments submodule is off. |
| 141 | 141 | // Otherwise this causes a lot of styling issues when the Stripe add-on (or Authorize.Net) is active. |
| 142 | - $white_pages[] = 'formidable-payments'; | |
| 142 | + | |
| 143 | + // Add an extra check to avoid white page styling on the PayPal "edit" action. | |
| 144 | + // We fallback to the PayPal add on for the "edit" action since Stripe Lite does not have an edit view. | |
| 145 | + if ( ! in_array( FrmAppHelper::simple_get( 'action' ), array( 'edit', 'new' ), true ) || ! is_callable( 'FrmPaymentsController::route' ) ) { | |
| 146 | + $white_pages[] = 'formidable-payments'; | |
| 147 | + } | |
| 143 | 148 | } |
| 144 | 149 | |
| 145 | 150 | $get_page = FrmAppHelper::simple_get( 'page', 'sanitize_title' ); |
| 146 | 151 | $is_white_page = in_array( $get_page, $white_pages, true ); |
| @@ -292,9 +297,10 @@ | ||
| 292 | 297 | public static function settings_link( $links ) { |
| 293 | 298 | $settings = array(); |
| 294 | 299 | |
| 295 | 300 | if ( ! FrmAppHelper::pro_is_installed() ) { |
| 296 | - $settings[] = '<a href="' . esc_url( FrmAppHelper::admin_upgrade_link( 'plugin-row' ) ) . '" target="_blank" rel="noopener"><b style="color:#1da867;font-weight:700;">' . esc_html__( 'Upgrade to Pro', 'formidable' ) . '</b></a>'; | |
| 301 | + $label = FrmAddonsController::is_license_expired() ? __( 'Renew', 'formidable' ) : __( 'Upgrade to Pro', 'formidable' ); | |
| 302 | + $settings[] = '<a href="' . esc_url( FrmAppHelper::admin_upgrade_link( 'plugin-row' ) ) . '" target="_blank" rel="noopener"><b style="color:#1da867;font-weight:700;">' . esc_html( $label ) . '</b></a>'; | |
| 297 | 303 | } |
| 298 | 304 | |
| 299 | 305 | $settings[] = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable' ) ) . '">' . __( 'Build a Form', 'formidable' ) . '</a>'; |
| 300 | 306 | |
| @@ -432,10 +438,25 @@ | ||
| 432 | 438 | include $path . 'new-form-overlay.php'; |
| 433 | 439 | } |
| 434 | 440 | |
| 435 | 441 | /** |
| 442 | + * Create a basic form with an email field. | |
| 443 | + * | |
| 444 | + * @param string $form_key | |
| 445 | + * @param string $title | |
| 446 | + * @param string $description | |
| 436 | 447 | * @return void |
| 437 | 448 | */ |
| 449 | + public static function api_email_form( $form_key, $title, $description ) { | |
| 450 | + $url = 'https://sandbox.formidableforms.com/api/wp-json/frm/v2/forms/' . $form_key . '?return=html&exclude_script=jquery&exclude_style=formidable-css'; | |
| 451 | + $view_path = FrmAppHelper::plugin_path() . '/classes/views/frm-forms/new-form-overlay/'; | |
| 452 | + $user = wp_get_current_user(); | |
| 453 | + require $view_path . 'leave-email.php'; | |
| 454 | + } | |
| 455 | + | |
| 456 | + /** | |
| 457 | + * @return void | |
| 458 | + */ | |
| 438 | 459 | public static function include_info_overlay() { |
| 439 | 460 | self::enqueue_dialog_assets(); |
| 440 | 461 | add_action( 'admin_footer', 'FrmAppController::info_overlay_html' ); |
| 441 | 462 | } |
| @@ -629,8 +650,14 @@ | ||
| 629 | 650 | $version = FrmAppHelper::plugin_version(); |
| 630 | 651 | |
| 631 | 652 | FrmAppHelper::load_admin_wide_js(); |
| 632 | 653 | |
| 654 | + if ( class_exists( 'FrmOverlayController' ) ) { | |
| 655 | + // This should always exist. | |
| 656 | + // But it may not have loaded properly when updating the plugin. | |
| 657 | + FrmOverlayController::register_assets(); | |
| 658 | + } | |
| 659 | + | |
| 633 | 660 | wp_register_style( 'formidable_admin_global', $plugin_url . '/css/admin/frm_admin_global.css', array(), $version ); |
| 634 | 661 | wp_enqueue_style( 'formidable_admin_global' ); |
| 635 | 662 | |
| 636 | 663 | wp_register_style( 'formidable-admin', $plugin_url . '/css/frm_admin.css', array(), $version ); |
| @@ -687,8 +714,19 @@ | ||
| 687 | 714 | } |
| 688 | 715 | |
| 689 | 716 | wp_register_script( 'bootstrap-multiselect', $plugin_url . '/js/bootstrap-multiselect.js', array( 'jquery', 'bootstrap_tooltip', 'popper' ), '1.1.1', true ); |
| 690 | 717 | |
| 718 | + if ( ! class_exists( 'FrmTransHooksController', false ) ) { | |
| 719 | + /** | |
| 720 | + * Gateway fields are included for add-on compatibility but we do not want it to be visible. | |
| 721 | + * They do however need to be visible when the payments submodule is active. | |
| 722 | + */ | |
| 723 | + wp_add_inline_style( | |
| 724 | + 'formidable-admin', | |
| 725 | + '#frm_builder_page li[data-ftype="gateway"] { display: none; }' | |
| 726 | + ); | |
| 727 | + } | |
| 728 | + | |
| 691 | 729 | $post_type = FrmAppHelper::simple_get( 'post_type', 'sanitize_title' ); |
| 692 | 730 | |
| 693 | 731 | global $pagenow; |
| 694 | 732 | if ( strpos( $page, 'formidable' ) === 0 || ( $pagenow === 'edit.php' && $post_type === 'frm_display' ) ) { |
| @@ -1154,9 +1192,13 @@ | ||
| 1154 | 1192 | wp_enqueue_script( 's11-floating-links', $plugin_url . '/js/packages/floating-links/s11-floating-links.js', array(), $version, true ); |
| 1155 | 1193 | |
| 1156 | 1194 | // Enqueue the config script. |
| 1157 | 1195 | wp_enqueue_script( 's11-floating-links-config', $plugin_url . '/js/packages/floating-links/config.js', array( 'wp-i18n' ), $version, true ); |
| 1158 | - wp_set_script_translations( 's11-floating-links-config', 's11-' ); | |
| 1196 | + | |
| 1197 | + if ( function_exists( 'wp_set_script_translations' ) ) { | |
| 1198 | + wp_set_script_translations( 's11-floating-links-config', 's11-' ); | |
| 1199 | + } | |
| 1200 | + | |
| 1159 | 1201 | $floating_links_data = array( |
| 1160 | 1202 | 'proIsInstalled' => FrmAppHelper::pro_is_installed(), |
| 1161 | 1203 | ); |
| 1162 | 1204 | wp_localize_script( 's11-floating-links-config', 's11FloatingLinksData', $floating_links_data ); |