PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V3.3.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV3.3.2
V3.3.2 3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 All 139 releases
bit-form / views / standalone-form.php

standalone-form.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder V3.3.2, at views/standalone-form.php

112 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // This file is included via Render::view() using extract(); all variables below are in the calling method's local scope, not global namespace.
4
5 use BitCode\BitForm\Core\Util\EscapingHelper;
6 use BitCode\BitForm\Core\Util\FrontendHelpers;
7
8 if (!defined('ABSPATH')) {
9 exit;
10 }
11 if (!defined('BITFORMS_ASSET_URI')) {
12 exit;
13 }
14
15 $formUpdateVersion = get_option('bitform_form_update_version');
16 $formIdSafe = sanitize_key((string) $formID);
17
18 $baseCSSPath = "/form-styles/bitform-{$formID}.css";
19 $customCSSPath = "/form-styles/bitform-custom-{$formID}.css";
20 $standaloneCSSPath = "/form-styles/bitform-standalone-{$formID}.css";
21
22 // Use the same handles as FrontendFormHandler::loadAssets() so WP dedups instead of printing the file twice.
23 wp_register_style('bitform-style-' . $formIdSafe, FrontendHelpers::styleSrc($baseCSSPath), [], $formUpdateVersion);
24 wp_enqueue_style('bitform-style-' . $formIdSafe);
25
26 if (file_exists(BITFORMS_CONTENT_DIR . $customCSSPath)) {
27 wp_register_style('bitform-style-custom-' . $formIdSafe, FrontendHelpers::styleSrc($customCSSPath), [], $formUpdateVersion);
28 wp_enqueue_style('bitform-style-custom-' . $formIdSafe);
29 }
30
31 if (file_exists(BITFORMS_CONTENT_DIR . $standaloneCSSPath)) {
32 wp_register_style('bitform-standalone-extra-' . $formIdSafe, FrontendHelpers::styleSrc($standaloneCSSPath), [], $formUpdateVersion);
33 wp_enqueue_style('bitform-standalone-extra-' . $formIdSafe);
34 }
35
36 if (isset($font) && '' !== $font) {
37 wp_register_style('bitform-standalone-font-' . $formIdSafe, $font, [], $formUpdateVersion);
38 wp_enqueue_style('bitform-standalone-font-' . $formIdSafe);
39 }
40
41 $previewJsPath = BITFORMS_UPLOAD_BASE_URL . '/form-scripts/preview-' . $formID . '.js';
42 wp_register_script('bitform-standalone-' . $formIdSafe, $previewJsPath, [], $formUpdateVersion, true);
43 wp_enqueue_script('bitform-standalone-' . $formIdSafe);
44 if (isset($bfGlobals) && '' !== $bfGlobals) {
45 wp_add_inline_script('bitform-standalone-' . $formIdSafe, (string) $bfGlobals, 'before');
46 }
47 ?>
48
49 <!DOCTYPE html>
50 <html lang="en">
51
52 <head>
53 <meta charset="UTF-8">
54 <meta http-equiv="X-UA-Compatible" content="IE=edge">
55 <meta name="viewport" content="width=device-width, initial-scale=1.0">
56 <title><?php echo isset($title) ? esc_html($title) : ''; ?></title>
57 <style>
58 * {
59 padding: 0;
60 margin: 0;
61 box-sizing: border-box;
62 }
63
64 .standalone-form-container {
65 min-height: 100vh;
66 display: flex;
67 justify-content: center;
68 align-items: center;
69 }
70
71 .standalone-form-wrapper {
72 width: 40%;
73 /* Additional styling for the container, if needed */
74 }
75
76 @media (max-width: 575.98px) {
77 .standalone-form-wrapper {
78 width: 100%;
79 }
80 }
81
82 ._frm-bg-b<?php echo esc_html($formID); ?> {
83 width: 100%;
84 }
85 </style>
86 <?php if (isset($font) && '' !== $font) : ?>
87 <link rel="preconnect" href="https://fonts.googleapis.com">
88 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
89 <?php endif; ?>
90 <?php
91 wp_enqueue_emoji_styles();
92 wp_print_styles();
93 ?>
94 </head>
95
96 <body>
97 <div class="standalone-form-container">
98 <div class="standalone-form-wrapper">
99 <?php
100 // Fallback config for when an optimizer defers or drops the inline script.
101 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- built by buildFormConfigTag(), JSON_HEX_* escaped.
102 echo isset($configTag) ? $configTag : '';
103 ?>
104 <?php echo wp_kses($formHTML, EscapingHelper::getFormAllowedHtml(isset($formContent) ? $formContent : null)); ?>
105 </div>
106 </div>
107
108 <?php wp_print_scripts(); ?>
109 </body>
110
111 </html>
112