PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.12
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.12
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 / classes / views / xml / import_form.php

import_form.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.12, at classes/views/xml/import_form.php

215 lines 8.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5 ?>
6 <div class="frm_wrap">
7 <?php
8 FrmAppHelper::get_admin_header(
9 array(
10 'label' => __( 'Import/Export', 'formidable' ),
11 )
12 );
13 ?>
14 <div class="wrap">
15 <?php require FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php'; ?>
16
17 <h2 class="frm-h2"><?php esc_html_e( 'Import', 'formidable' ); ?></h2>
18 <p class="howto">
19 <?php
20 if ( FrmAppHelper::is_formidable_branding() ) {
21 $page_description = esc_html__( 'Upload your Formidable XML file to import forms into this site. If your imported form key and creation date match a form on your site, that form will be updated.', 'formidable' );
22 } else {
23 $page_description = sprintf(
24 // Translators: 1: Menu name
25 esc_html__( 'Upload your %1$s XML file to import forms into this site. If your imported form key and creation date match a form on your site, that form will be updated.', 'formidable' ),
26 FrmAppHelper::get_menu_name()
27 );
28 }
29 echo esc_html( apply_filters( 'frm_upload_instructions1', $page_description ) );
30 ?>
31 </p>
32 <br/>
33 <form enctype="multipart/form-data" method="post" class="frm-fields">
34 <input type="hidden" name="frm_action" value="import_xml" />
35 <?php wp_nonce_field( 'import-xml-nonce', 'import-xml' ); ?>
36 <p>
37 <label for="frm_import_file">
38 <?php
39 if ( FrmAppHelper::is_formidable_branding() ) {
40 $file_section_title = esc_html__( 'Choose a Formidable XML file', 'formidable' );
41 } else {
42 $file_section_title = sprintf(
43 // Translators: 1: Menu name
44 esc_html__( 'Choose a %1$s XML file', 'formidable' ),
45 FrmAppHelper::get_menu_name()
46 );
47 }
48 echo esc_html( apply_filters( 'frm_upload_instructions2', $file_section_title ) );
49 ?>
50 (<?php
51 /* translators: %s: File size */
52 echo esc_html( sprintf( __( 'Maximum size: %s', 'formidable' ), ini_get( 'upload_max_filesize' ) ) );
53 ?>)
54 </label>
55 <br/>
56 <input id="frm_import_file" type="file" name="frm_import_file" size="25" accept="<?php echo esc_attr( implode( ', ', FrmXMLHelper::get_supported_upload_file_types() ) ); ?>" />
57 </p>
58
59 <?php do_action( 'frm_csv_opts', $forms ); ?>
60
61 <p class="submit">
62 <input type="submit" value="<?php esc_attr_e( 'Upload file and import', 'formidable' ); ?>" class="button-primary frm-button-primary" />
63 </p>
64 </form>
65 <?php FrmFormMigratorsHelper::maybe_show_download_link(); ?>
66 <?php FrmTipsHelper::pro_tip( 'get_import_tip' ); ?>
67
68 <?php do_action( 'frm_import_settings' ); ?>
69
70 <h2 class="frm-h2"><?php esc_html_e( 'Export', 'formidable' ); ?></h2>
71 <p class="howto">
72 <?php echo esc_html( __( 'Export your forms, entries, views, and styles so you can easily import them on another site.', 'formidable' ) ); ?>
73 </p>
74 <form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" id="frm_export_xml" class="frm-fields frm_grid_container">
75 <input type="hidden" name="action" value="frm_export_xml" />
76 <?php wp_nonce_field( 'export-xml-nonce', 'export-xml' ); ?>
77
78 <p class="frm4 frm_form_field">
79 <label for="format"><?php esc_html_e( 'Export Format', 'formidable' ); ?></label>
80 <select id="format" name="format">
81 <?php foreach ( $export_format as $t => $type ) { ?>
82 <option value="<?php echo esc_attr( $t ); ?>" data-support="<?php echo esc_attr( $type['support'] ); ?>" <?php echo isset( $type['count'] ) ? 'data-count="' . esc_attr( $type['count'] ) . '"' : ''; ?>>
83 <?php echo esc_html( isset( $type['name'] ) ? $type['name'] : $t ); ?>
84 </option>
85 <?php } ?>
86 </select>
87 </p>
88
89 <p class="frm_hidden csv_opts export-filters frm4 frm_form_field">
90 <label for="frm_csv_format" class="frm_help" title="<?php esc_attr_e( 'If your CSV special characters are not working correctly, try a different formatting option.', 'formidable' ); ?>">
91 <?php esc_html_e( 'CSV Encoding Format', 'formidable' ); ?>
92 </label>
93 <select id="frm_csv_format" name="csv_format">
94 <?php foreach ( FrmCSVExportHelper::csv_format_options() as $format ) { ?>
95 <option value="<?php echo esc_attr( $format ); ?>">
96 <?php echo esc_html( $format ); ?>
97 </option>
98 <?php } ?>
99 </select>
100 </p>
101
102 <p class="frm_hidden csv_opts export-filters frm4 frm_form_field">
103 <label for="frm_csv_col_sep">
104 <?php esc_html_e( 'Column Separation', 'formidable' ); ?>
105 </label>
106 <input id="frm_csv_col_sep" name="csv_col_sep" value="," type="text" />
107 </p>
108
109 <p id="frm_csv_data_export" class="xml_opts">
110 <label><?php esc_html_e( 'Include the following in the export file', 'formidable' ); ?></label>
111 <?php foreach ( $export_types as $t => $type ) { ?>
112 <label class="frm_inline_label frm-export-xml-<?php echo esc_attr( $t ); ?>">
113 <input type="checkbox" name="type[]" value="<?php echo esc_attr( $t ); ?>"/>
114 <?php echo esc_html( $type ); ?>
115 </label> &nbsp;
116 <?php } ?>
117 </p>
118
119 <div class="frm-table-box">
120 <p class="alignleft frm-mb-sm">
121 <label class="xml_opts">
122 <?php esc_html_e( 'Select Form(s)', 'formidable' ); ?>
123 </label>
124 <label class="csv_opts frm_hidden">
125 <?php esc_html_e( 'Select a Form', 'formidable' ); ?>
126 </label>
127 </p>
128 <?php
129 FrmAppHelper::show_search_box(
130 array(
131 'input_id' => 'template',
132 'placeholder' => __( 'Search Forms', 'formidable' ),
133 'tosearch' => 'frm-row',
134 )
135 );
136 ?>
137 <div class="frm-scroll-box">
138 <table class="widefat striped frm-border frm-mt-0">
139 <thead>
140 <tr>
141 <td class="column-cb check-column">
142 <label class="screen-reader-text" for="frm-export-select-all"><?php esc_html_e( 'Select All', 'formidable' ); ?></label>
143 <input id="frm-export-select-all" type="checkbox">
144 </td>
145 <td><?php esc_html_e( 'Form Title', 'formidable' ); ?></td>
146 <td><?php esc_html_e( 'ID / Form Key', 'formidable' ); ?></td>
147 <td><?php esc_html_e( 'Type', 'formidable' ); ?></td>
148 <td class="column-entries"><?php esc_html_e( 'Entries', 'formidable' ); ?></td>
149 <td class="column-entries"><?php esc_html_e( 'Style', 'formidable' ); ?></td>
150 </tr>
151 </thead>
152 <tbody>
153 <?php foreach ( $forms as $form ) { ?>
154 <tr class="frm-row <?php echo ! empty( $form->parent_form_id ) ? esc_attr( 'frm-is-repeater' ) : ''; ?>">
155 <td>
156 <input type="checkbox" name="frm_export_forms[]" value="<?php echo esc_attr( $form->id ); ?>" id="export_form_<?php echo esc_attr( $form->id ); ?>" />
157 </td>
158 <td>
159 <label for="export_form_<?php echo esc_attr( $form->id ); ?>">
160 <?php echo esc_html( '' === $form->name ? __( '(no title)', 'formidable' ) : $form->name ); ?>
161 </label>
162 </td>
163 <td>
164 <?php echo esc_html( $form->id ); ?> / <?php echo esc_html( $form->form_key ); ?>
165 </td>
166 <td>
167 <?php
168 if ( $form->is_template ) {
169 esc_html_e( 'Template', 'formidable' );
170 } elseif ( $form->parent_form_id ) {
171 echo esc_html(
172 sprintf(
173 /* translators: %1$s: Form name */
174 __( 'Child Form (%1$s)', 'formidable' ),
175 $form->parent_form_id
176 )
177 );
178 } else {
179 esc_html_e( 'Form', 'formidable' );
180 }
181 ?>
182 </td>
183 <td class="column-entries">
184 <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-entries&form=' . absint( $form->id ) ) ); ?>" target="_blank">
185 <?php echo absint( FrmEntry::getRecordCount( $form->id ) ); ?>
186 </a>
187 </td>
188 <td class="column-entries">
189 <?php
190 $style = isset( $form->options['custom_style'] ) ? $form->options['custom_style'] : 1;
191 if ( empty( $style ) ) {
192 echo '0';
193 } else {
194 echo '1';
195 }
196 ?>
197 </td>
198 </tr>
199 <?php
200 }//end foreach
201 ?>
202 </tbody>
203 </table>
204 </div>
205 </div>
206
207 <p class="submit">
208 <input type="submit" value="<?php esc_attr_e( 'Export Selection', 'formidable' ); ?>" class="button-primary frm-button-primary" />
209 </p>
210 </form>
211
212 <?php do_action( 'frm_page_footer', array( 'table' => 'export' ) ); ?>
213 </div>
214 </div>
215