| @@ -9,9 +9,8 @@ | ||
| 9 | 9 | $this->init_actions(); |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | public function init_actions() { |
| 13 | - add_action( 'in_admin_header', [ $this, 'remove_admin_notices' ] ); | |
| 14 | 13 | add_action( 'admin_enqueue_scripts', [ $this, 'builder_enqueue_scripts' ], 2000 ); |
| 15 | 14 | add_action( 'admin_print_scripts', [ $this, 'builder_mixins_script' ] ); |
| 16 | 15 | add_action( 'admin_footer', [ $this, 'admin_footer_js_templates' ] ); |
| 17 | 16 | |
| @@ -25,25 +24,8 @@ | ||
| 25 | 24 | |
| 26 | 25 | do_action( 'weforms_form_builder_init' ); |
| 27 | 26 | } |
| 28 | 27 | |
| 29 | - /** | |
| 30 | - * Remove all kinds of admin notices | |
| 31 | - * | |
| 32 | - * Since we don't have much space left on top of the page, | |
| 33 | - * we have to remove all kinds of admin notices | |
| 34 | - * | |
| 35 | - * @since 1.2.6 | |
| 36 | - * | |
| 37 | - * @return void | |
| 38 | - */ | |
| 39 | - public function remove_admin_notices() { | |
| 40 | - remove_all_actions( 'network_admin_notices' ); | |
| 41 | - remove_all_actions( 'user_admin_notices' ); | |
| 42 | - remove_all_actions( 'admin_notices' ); | |
| 43 | - remove_all_actions( 'all_admin_notices' ); | |
| 44 | - } | |
| 45 | - | |
| 46 | 28 | public function builder_enqueue_scripts() { |
| 47 | 29 | $prefix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
| 48 | 30 | |
| 49 | 31 | weforms()->scripts->enqueue_backend(); |
| @@ -48,8 +30,9 @@ | ||
| 48 | 30 | |
| 49 | 31 | weforms()->scripts->enqueue_backend(); |
| 50 | 32 | |
| 51 | 33 | $recaptcha = weforms_get_settings( 'recaptcha' ); |
| 34 | + $humanpresence = get_option( 'wp-human-presence', array() ); | |
| 52 | 35 | |
| 53 | 36 | $wpuf_form_builder = apply_filters( 'wpuf-form-builder-localize-script', [ |
| 54 | 37 | 'i18n' => $this->i18n(), |
| 55 | 38 | 'panel_sections' => weforms()->fields->get_field_groups(), |
| @@ -81,11 +64,16 @@ | ||
| 81 | 64 | ], |
| 82 | 65 | ], |
| 83 | 66 | ], |
| 84 | 67 | ], |
| 85 | - 'integrations' => weforms()->integrations->get_integration_js_settings(), | |
| 86 | - 'recaptcha_site' => isset( $recaptcha->key ) ? $recaptcha->key : '', | |
| 87 | - 'recaptcha_secret' => isset( $recaptcha->secret ) ? $recaptcha->secret : '', | |
| 68 | + 'integrations' => weforms()->integrations->get_integration_js_settings(), | |
| 69 | + 'recaptcha_site' => isset( $recaptcha->key ) ? $recaptcha->key : '', | |
| 70 | + 'recaptcha_secret' => isset( $recaptcha->secret ) ? $recaptcha->secret : '', | |
| 71 | + 'humanpresence_installed' => ( | |
| 72 | + class_exists( 'HumanPresenceWEFormsIntegration' ) && | |
| 73 | + isset( $humanpresence['wp_hp_premium_license'] ) && | |
| 74 | + $humanpresence['wp_hp_premium_license'] ) | |
| 75 | + ? true : false, | |
| 88 | 76 | ] ); |
| 89 | 77 | |
| 90 | 78 | // mixins |
| 91 | 79 | $wpuf_mixins = [ |
| @@ -106,9 +94,9 @@ | ||
| 106 | 94 | 'mixins' => [ 'default' => null ], |
| 107 | 95 | 'assetsURL' => WEFORMS_ASSET_URI, |
| 108 | 96 | 'shortcodes' => $this->shortcodes(), |
| 109 | 97 | 'settings' => [ |
| 110 | - 'recaptcha' => weforms_get_settings( 'recaptcha' ), | |
| 98 | + 'recaptcha' => weforms_get_settings( 'recaptcha' ), | |
| 111 | 99 | ], |
| 112 | 100 | ] ); |
| 113 | 101 | |
| 114 | 102 | wp_localize_script( 'weforms-form-builder-mixins', 'wpuf_form_builder', $wpuf_form_builder ); |
| @@ -356,8 +344,9 @@ | ||
| 356 | 344 | |
| 357 | 345 | <a href="#" :class="['nav-tab', isActiveSettingsTab( 'form' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'form' )" class="nav-tab"><?php esc_html_e( 'Form Settings', 'weforms' ); ?></a> |
| 358 | 346 | <a href="#" :class="['nav-tab', isActiveSettingsTab( 'restriction' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'restriction' )" class="nav-tab"><?php esc_html_e( 'Submission Restriction', 'weforms' ); ?></a> |
| 359 | 347 | <a href="#" :class="['nav-tab', isActiveSettingsTab( 'display' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'display' )" class="nav-tab"><?php esc_html_e( 'Display Settings', 'weforms' ); ?></a> |
| 348 | + <a href="#" :class="['nav-tab', isActiveSettingsTab( 'humanpresence' ) ? 'nav-tab-active' : '']" v-on:click.prevent="makeActiveSettingsTab( 'humanpresence' )" class="nav-tab"><i aria-hidden="true" class="fa fa-humanpresence"></i> <?php esc_html_e( 'HP Anti-Spam', 'weforms' ); ?></a> | |
| 360 | 349 | |
| 361 | 350 | <?php do_action( 'wpuf_contact_form_settings_tab' ); ?> |
| 362 | 351 | |
| 363 | 352 | <?php |
| @@ -379,8 +368,12 @@ | ||
| 379 | 368 | </div> |
| 380 | 369 | |
| 381 | 370 | <div id="wpuf-metabox-settings-display" class="tab-content" v-show="isActiveSettingsTab('display')"> |
| 382 | 371 | <?php include_once __DIR__ . '/views/display-settings.php'; ?> |
| 372 | + </div> | |
| 373 | + | |
| 374 | + <div id="wpuf-metabox-settings-humanpresence" class="tab-content" v-show="isActiveSettingsTab('humanpresence')"> | |
| 375 | + <?php include_once __DIR__ . '/views/humanpresence-settings.php'; ?> | |
| 383 | 376 | </div> |
| 384 | 377 | |
| 385 | 378 | <?php do_action( 'wpuf_contact_form_settings_tab_content' ); ?> |
| 386 | 379 | |