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

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