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

189 lines 7.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 include( 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"><?php echo esc_html( apply_filters( 'frm_upload_instructions1', __( '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' ) ) ); ?></p>
19 <br/>
20 <form enctype="multipart/form-data" method="post" class="frm-fields">
21 <input type="hidden" name="frm_action" value="import_xml" />
22 <?php wp_nonce_field( 'import-xml-nonce', 'import-xml' ); ?>
23 <p>
24 <label>
25 <?php echo esc_html( apply_filters( 'frm_upload_instructions2', __( 'Choose a Formidable XML file', 'formidable' ) ) ); ?>
26 (<?php
27 /* translators: %s: File size */
28 echo esc_html( sprintf( __( 'Maximum size: %s', 'formidable' ), ini_get( 'upload_max_filesize' ) ) );
29 ?>)
30 </label>
31 <br/>
32 <input type="file" name="frm_import_file" size="25" />
33 </p>
34
35 <?php do_action( 'frm_csv_opts', $forms ); ?>
36
37 <p class="submit">
38 <input type="submit" value="<?php esc_attr_e( 'Upload file and import', 'formidable' ); ?>" class="button-primary frm-button-primary" />
39 </p>
40 </form>
41 <?php FrmFormMigratorsHelper::maybe_show_download_link(); ?>
42 <?php FrmTipsHelper::pro_tip( 'get_import_tip' ); ?>
43
44 <?php do_action( 'frm_import_settings' ); ?>
45
46 <h2 class="frm-h2"><?php esc_html_e( 'Export', 'formidable' ); ?></h2>
47 <p class="howto">
48 <?php echo esc_html( __( 'Export your forms, entries, views, and styles so you can easily import them on another site.', 'formidable' ) ); ?>
49 </p>
50 <form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" id="frm_export_xml" class="frm-fields frm_grid_container">
51 <input type="hidden" name="action" value="frm_export_xml" />
52 <?php wp_nonce_field( 'export-xml-nonce', 'export-xml' ); ?>
53
54 <p class="frm4 frm_form_field">
55 <label for="format"><?php esc_html_e( 'Export Format', 'formidable' ); ?></label>
56 <select name="format">
57 <?php foreach ( $export_format as $t => $type ) { ?>
58 <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'] ) . '"' : ''; ?>>
59 <?php echo esc_html( isset( $type['name'] ) ? $type['name'] : $t ); ?>
60 </option>
61 <?php } ?>
62 </select>
63 </p>
64
65 <p class="frm_hidden csv_opts export-filters frm4 frm_form_field">
66 <label for="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' ); ?>">
67 <?php esc_html_e( 'CSV Encoding Format', 'formidable' ); ?>
68 </label>
69 <select name="csv_format">
70 <?php foreach ( FrmCSVExportHelper::csv_format_options() as $format ) { ?>
71 <option value="<?php echo esc_attr( $format ); ?>">
72 <?php echo esc_html( $format ); ?>
73 </option>
74 <?php } ?>
75 </select>
76 </p>
77
78 <p class="frm_hidden csv_opts export-filters frm4 frm_form_field">
79 <label for="csv_col_sep">
80 <?php esc_html_e( 'Column Separation', 'formidable' ); ?>
81 </label>
82 <input id="frm_csv_col_sep" name="csv_col_sep" value="," type="text" />
83 </p>
84
85 <p id="frm_csv_data_export" class="xml_opts">
86 <label><?php esc_html_e( 'Include the following in the export file', 'formidable' ); ?></label>
87 <?php foreach ( $export_types as $t => $type ) { ?>
88 <label class="frm_inline_label">
89 <input type="checkbox" name="type[]" value="<?php echo esc_attr( $t ); ?>"/>
90 <?php echo esc_html( $type ); ?>
91 </label> &nbsp;
92 <?php } ?>
93 </p>
94
95 <div class="frm-table-box">
96 <p class="alignleft frm-mb-sm">
97 <label class="xml_opts">
98 <?php esc_html_e( 'Select Form(s)', 'formidable' ); ?>
99 </label>
100 <label class="csv_opts frm_hidden">
101 <?php esc_html_e( 'Select a Form', 'formidable' ); ?>
102 </label>
103 </p>
104 <?php
105 FrmAppHelper::show_search_box(
106 array(
107 'input_id' => 'template',
108 'placeholder' => __( 'Search Forms', 'formidable' ),
109 'tosearch' => 'frm-row',
110 )
111 );
112 ?>
113 <div class="frm-scroll-box">
114 <table class="widefat striped frm-border frm-mt-0">
115 <thead>
116 <tr>
117 <td class="column-cb check-column">
118 <label class="screen-reader-text" for="frm-export-select-all"><?php esc_html_e( 'Select All', 'formidable' ); ?></label>
119 <input id="frm-export-select-all" type="checkbox">
120 </td>
121 <td><?php esc_html_e( 'Form Title', 'formidable' ); ?></td>
122 <td><?php esc_html_e( 'ID / Form Key', 'formidable' ); ?></td>
123 <td><?php esc_html_e( 'Type', 'formidable' ); ?></td>
124 <td class="column-entries"><?php esc_html_e( 'Entries', 'formidable' ); ?></td>
125 <td class="column-entries"><?php esc_html_e( 'Style', 'formidable' ); ?></td>
126 </tr>
127 </thead>
128 <tbody>
129 <?php foreach ( $forms as $form ) { ?>
130 <tr class="frm-row <?php echo ! empty( $form->parent_form_id ) ? esc_attr( 'frm-is-repeater' ) : ''; ?>">
131 <td>
132 <input type="checkbox" name="frm_export_forms[]" value="<?php echo esc_attr( $form->id ); ?>" id="export_form_<?php echo esc_attr( $form->id ); ?>" />
133 </td>
134 <td>
135 <label for="export_form_<?php echo esc_attr( $form->id ); ?>">
136 <?php echo esc_html( '' === $form->name ? __( '(no title)', 'formidable' ) : $form->name ); ?>
137 </label>
138 </td>
139 <td>
140 <?php echo esc_html( $form->id ); ?> / <?php echo esc_html( $form->form_key ); ?>
141 </td>
142 <td>
143 <?php
144 if ( $form->is_template ) {
145 esc_html_e( 'Template', 'formidable' );
146 } elseif ( $form->parent_form_id ) {
147 echo esc_html(
148 sprintf(
149 /* translators: %1$s: Form name */
150 __( 'Child Form (%1$s)', 'formidable' ),
151 $form->parent_form_id
152 )
153 );
154 } else {
155 esc_html_e( 'Form', 'formidable' );
156 }
157 ?>
158 </td>
159 <td class="column-entries">
160 <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-entries&form=' . absint( $form->id ) ) ); ?>" target="_blank">
161 <?php echo absint( FrmEntry::getRecordCount( $form->id ) ); ?>
162 </a>
163 </td>
164 <td class="column-entries">
165 <?php
166 $style = isset( $form->options['custom_style'] ) ? $form->options['custom_style'] : 1;
167 if ( empty( $style ) ) {
168 echo '0';
169 } else {
170 echo '1';
171 }
172 ?>
173 </td>
174 </tr>
175 <?php } ?>
176 </tbody>
177 </table>
178 </div>
179 </div>
180
181 <p class="submit">
182 <input type="submit" value="<?php esc_attr_e( 'Export Selection', 'formidable' ); ?>" class="button-primary frm-button-primary" />
183 </p>
184 </form>
185
186 <?php do_action( 'frm_page_footer', array( 'table' => 'export' ) ); ?>
187 </div>
188 </div>
189