PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / views / admin / export / template.php
wp-all-export / views / admin / export Last commit date
blocks 4 weeks ago options 4 weeks ago template 4 weeks ago google.php 4 weeks ago index.php 4 weeks ago options.php 4 weeks ago process.php 4 weeks ago success_page.php 4 weeks ago template.php 4 weeks ago variation_options.php 4 weeks ago variation_options_common.php 3 years ago
template.php
651 lines
1 <?php
2 if(!defined('ABSPATH')) {
3 die();
4 }
5
6 // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- variables in template files inherited from controller render() scope
7 ?>
8 <h2 class="wpallexport-wp-notices"></h2>
9 <div class="wpallexport-wrapper">
10 <div class="wpallexport-header">
11 <div class="wpallexport-logo"></div>
12 <div class="wpallexport-title">
13 <h2><?php esc_html_e('Drag & Drop', 'wp-all-export'); ?></h2>
14 </div>
15 <div class="wpallexport-links">
16 <a href="http://www.wpallimport.com/support/?utm_source=export-plugin-free&utm_medium=help&utm_campaign=premium-support"
17 target="_blank"><?php esc_html_e('Support', 'wp-all-export'); ?></a> |
18 <a
19 href="http://www.wpallimport.com/documentation/?utm_source=export-plugin-free&utm_medium=help&utm_campaign=docs"
20 target="_blank"><?php esc_html_e('Documentation', 'wp-all-export'); ?></a>
21 </div>
22 </div>
23 <div class="clear"></div>
24 </div>
25
26 <div class="clear"></div>
27
28 <div class="wpallexport-content-section wpallexport-console" style="display: block; margin-bottom: 10px;">
29 <div class="ajax-console">
30 <div class="founded_records">
31 <div class="wp_all_export_preloader"></div>
32 <h4><?php esc_html_e( "Drag & drop data to include in the export file.", 'wp-all-export' ); ?></h4>
33 </div>
34 </div>
35 </div>
36
37 <?php \Wpae\Pro\Filtering\FilteringFactory::render_filtering_block( $engine, $this->isWizard, $post, true ); ?>
38
39 <table class="wpallexport-layout wpallexport-export-template">
40 <tr>
41 <td class="left">
42
43 <?php do_action('pmxe_template_header', $this->isWizard, $post); ?>
44
45 <?php if ($this->errors->get_error_codes()): ?>
46 <?php $this->error(); ?>
47 <?php endif ?>
48
49 <form class="wpallexport-template <?php echo ! $this->isWizard ? 'edit' : '' ?> wpallexport-step-3" method="post" style="display:none;" id="templateForm">
50
51 <input type="hidden" class="hierarhy-output" name="filter_rules_hierarhy" value="<?php echo esc_attr($post['filter_rules_hierarhy']);?>"/>
52 <input type="hidden" name="taxonomy_to_export" value="<?php echo esc_attr($post['taxonomy_to_export']);?>">
53 <input type="hidden" name="export_only_modified_stuff" value="<?php echo esc_attr($post['export_only_modified_stuff']) ;?>" />
54 <input type="hidden" name="export_only_new_stuff" value="<?php echo esc_attr($post['export_only_new_stuff']);?>" />
55 <input type="hidden" name="sub_post_type_to_export" value="<?php echo esc_attr($post['sub_post_type_to_export']);?>">
56
57 <?php
58 $addons = new \Wpae\App\Service\Addons\AddonService();
59 $selected_post_type = '';
60 if ($addons->isUserAddonActive() && XmlExportUser::$is_active):
61 $selected_post_type = empty($post['cpt'][0]) ? 'users' : $post['cpt'][0];
62 endif;
63 if (empty($selected_post_type) and ! empty($post['cpt'][0]))
64 {
65 $selected_post_type = $post['cpt'][0];
66 }
67 ?>
68
69 <input type="hidden" name="selected_post_type" value="<?php echo esc_attr($selected_post_type); ?>"/>
70 <input type="hidden" name="export_type" value="<?php echo esc_attr($post['export_type']); ?>"/>
71 <div class="wpallexport-collapsed wpallexport-section wpallexport-simple-xml-template">
72 <div class="wpallexport-content-section" style="margin-bottom: 10px;">
73 <div class="wpallexport-collapsed-content">
74 <fieldset class="optionsset" style="padding: 10px 20px 0px;">
75 <div id="columns_to_export">
76 <div class="columns-to-export-content" style="padding-right: 8px;">
77 <ol id="columns" class="rad4" style="margin-bottom:0;">
78 <?php
79 $i = 0;
80 $new_export = false;
81 if ( ! empty($post['ids']) )
82 {
83 foreach ($post['ids'] as $ID => $value)
84 {
85 if (is_numeric($ID)){ if (empty($post['cc_name'][$ID])) continue;
86 ?>
87 <li>
88 <div class="custom_column" rel="<?php echo intval(($i + 1));?>">
89 <?php
90 $field_label = (!empty($post['cc_name'][$ID])) ? $post['cc_name'][$ID] : $post['cc_label'][$ID];
91 $field_name = (!empty($post['cc_name'][$ID])) ? $post['cc_name'][$ID] : trim(str_replace(" ", "_", $post['cc_label'][$ID]));
92 $field_type = $post['cc_type'][$ID];
93 $field_options = esc_html($post['cc_options'][$ID]);
94 ?>
95 <label class="wpallexport-xml-element"><?php echo (strtolower($field_label) == "id") ? "ID" : esc_html($field_label); ?></label>
96 <input type="hidden" name="ids[]" value="1"/>
97 <input type="hidden" name="cc_label[]" value="<?php echo (!empty($post['cc_label'][$ID])) ? esc_attr($post['cc_label'][$ID]) : ''; ?>"/>
98 <input type="hidden" name="cc_php[]" value="<?php echo (!empty($post['cc_php'][$ID])) ? esc_attr($post['cc_php'][$ID]) : 0; ?>"/>
99 <input type="hidden" name="cc_code[]" value="<?php echo (!empty($post['cc_code'][$ID])) ? esc_attr($post['cc_code'][$ID]) : ''; ?>"/>
100 <input type="hidden" name="cc_sql[]" value="<?php echo (!empty($post['cc_sql'][$ID])) ? esc_attr($post['cc_sql'][$ID]) : 0; ?>"/>
101 <input type="hidden" name="cc_type[]" value="<?php echo esc_attr($field_type); ?>"/>
102 <input type="hidden" name="cc_options[]" value="<?php echo (!empty($field_options)) ? esc_attr($field_options) : 0; ?>"/>
103 <input type="hidden" name="cc_value[]" value="<?php echo esc_attr($post['cc_value'][$ID]); ?>"/>
104 <input type="hidden" name="cc_name[]" value="<?php echo esc_attr(XmlExportEngine::sanitizeFieldName($field_name)); ?>"/>
105 <input type="hidden" name="cc_settings[]" value="<?php echo (!empty($post['cc_settings'][$ID])) ? esc_attr($post['cc_settings'][$ID]) : 0; ?>"/>
106 </div>
107 </li>
108 <?php
109 $i++;
110 }
111 }
112 }
113 elseif ($this->isWizard)
114 {
115 $new_export = true;
116 if ( empty($post['cpt']) and $addons->isWooCommerceAddonActive() and ! XmlExportWooCommerceOrder::$is_active and ($addons->isUserAddonActive() and ! XmlExportUser::$is_active) ){
117 $init_fields[] =
118 array(
119 'label' => 'post_type',
120 'name' => 'post_type',
121 'type' => 'post_type'
122 );
123 }
124 foreach ($init_fields as $k => $field) {
125 ?>
126 <li>
127 <div class="custom_column" rel="<?php echo intval(($i + 1));?>">
128 <label class="wpallexport-xml-element"><?php echo esc_html(XmlExportEngine::sanitizeFieldName($field['name'])); ?></label>
129 <input type="hidden" name="ids[]" value="1"/>
130 <input type="hidden" name="cc_label[]" value="<?php echo esc_attr($field['label']); ?>"/>
131 <input type="hidden" name="cc_php[]" value="0"/>
132 <input type="hidden" name="cc_code[]" value=""/>
133 <input type="hidden" name="cc_sql[]" value="0"/>
134 <input type="hidden" name="cc_options[]" value="<?php echo (empty($field['options'])) ? 0 : esc_attr($field['options']); ?>"/>
135 <input type="hidden" name="cc_type[]" value="<?php echo esc_attr($field['type']); ?>"/>
136 <input type="hidden" name="cc_value[]" value="<?php echo esc_attr($field['label']); ?>"/>
137 <input type="hidden" name="cc_name[]" value="<?php echo (strtoupper($field['name']) == 'ID') ? 'id' : esc_attr($field['name']);?>"/>
138 <input type="hidden" name="cc_settings[]" value="0"/>
139 </div>
140 </li>
141 <?php
142 $i++;
143 }
144 }
145 ?>
146 <li class="placeholder" <?php if ( ! empty($post['ids']) and count($post['ids']) > 1 or $new_export) echo 'style="display:none;"'; ?>><?php esc_html_e("Drag & drop data from \"Available Data\" on the right to include it in the export or click \"Add Field To Export\" below.", "wp-all-export"); ?></li>
147 <?php
148 ?>
149 </ol>
150 </div>
151 </div>
152
153 <div class="custom_column template">
154 <label class="wpallexport-xml-element"></label>
155 <input type="hidden" name="ids[]" value="1"/>
156 <input type="hidden" name="cc_label[]" value=""/>
157 <input type="hidden" name="cc_php[]" value="0"/>
158 <input type="hidden" name="cc_code[]" value=""/>
159 <input type="hidden" name="cc_sql[]" value="0"/>
160 <input type="hidden" name="cc_type[]" value=""/>
161 <input type="hidden" name="cc_options[]" value="0"/>
162 <input type="hidden" name="cc_value[]" value=""/>
163 <input type="hidden" name="cc_name[]" value=""/>
164 <input type="hidden" name="cc_settings[]" value="0"/>
165 </div>
166
167 <!-- Warning Messages -->
168 <?php if ( (($addons->isWooCommerceAddonActive() || $addons->isWooCommerceOrderAddonActive()) && ! XmlExportWooCommerceOrder::$is_active) && ! XmlExportTaxonomy::$is_active ) : ?>
169 <div class="wp-all-export-warning" <?php if ( empty($post['ids']) or count($post['ids']) > 1 ) echo 'style="display:none;"'; ?>>
170 <p></p>
171 <?php /* translators: %s: missing required field name */ ?>
172 <input type="hidden" id="warning_template" value="<?php esc_html_e("Warning: without %s you won't be able to re-import this data back to this site using WP All Import.", "wp-all-export"); ?>"/>
173 <button class="notice-dismiss" type="button"><span class="screen-reader-text">Dismiss this notice.</span></button>
174 </div>
175 <?php endif; ?>
176
177 <?php if ( ($addons->isWooCommerceAddonActive() || $addons->isWooCommerceProductAddonActive()) && in_array('product', XmlExportEngine::$post_types) ) : ?>
178 <input type="hidden" id="is_product_export" value="1"/>
179 <?php endif; ?>
180
181 <?php if ( empty($post['cpt']) and ! (($addons->isWooCommerceAddonActive() || $addons->isWooCommerceOrderAddonActive()) && XmlExportWooCommerceOrder::$is_active) and ! ($addons->isUserAddonActive() && XmlExportUser::$is_active) and ! XmlExportTaxonomy::$is_active ) : ?>
182 <input type="hidden" id="is_wp_query" value="1"/>
183 <?php endif; ?>
184
185 </fieldset>
186
187 <!-- Add New Field Button -->
188 <div class="input" style="display:inline-block; margin: 20px 0 10px 20px;">
189 <input type="button" value="<?php esc_html_e('Add Field', 'wp-all-export'); ?>"
190 class="add_column" style="float:left;">
191 <input type="button" value="<?php esc_html_e('Add All', 'wp-all-export'); ?>"
192 class="wp_all_export_auto_generate_data">
193 <input type="button" value="<?php esc_html_e('Clear All', 'wp-all-export'); ?>"
194 class="wp_all_export_clear_all_data">
195 </div>
196
197 <!-- Preview a Row Button -->
198 <div class="input" style="float:right; margin: 20px 20px 10px 0;">
199 <input type="button" value="<?php esc_html_e('Preview', 'wp-all-export'); ?>"
200 class="preview_a_row">
201 </div>
202 </div>
203
204 <?php include('variation_options_common.php');?>
205
206 <div class="wpallexport-collapsed closed wpallexport-section wpallexport-xml-advanced-options" <?php if ($post['export_to'] !== 'xml') { ?> style="display: none;" <?php }?> >
207 <div class="wpallexport-content-section rad0" style="margin:0; border-top:1px solid #ddd; border-bottom: none; border-right: none; border-left: none; background: #f1f2f2; padding-bottom: 15px; margin-top: 5px;">
208 <div class="wpallexport-collapsed-header">
209 <h3 style="color:#40acad;"><?php esc_html_e('Advanced Options','wp-all-export');?></h3>
210 <hr style="display:none; margin-right:25px;"/>
211 </div>
212 <div class="wpallexport-collapsed-content" style="padding:0 0 0 5px;">
213 <div class="wpallexport-collapsed-content-inner">
214 <div class="simple_xml_template_options" style="margin-top:20px;">
215 <div class="input" style="display: inline-block; max-width: 360px; width: 40%; margin-right: 10px;">
216 <label for="main_xml_tag" style="float: left;"><?php esc_html_e('Root XML Element','wp-all-export');?></label>
217 <div class="input">
218 <input type="text" name="main_xml_tag" style="vertical-align:middle; background:#fff !important; width: 100%; margin-left:0;" value="<?php echo esc_attr($post['main_xml_tag']) ?>" />
219 </div>
220 </div>
221 <div class="input" style="display: inline-block; max-width: 360px; width: 40%; ">
222 <?php
223 $post_type_details = ( ! empty($post['cpt'])) ? get_post_type_object( $post['cpt'][0] ) : '';
224 ?>
225 <?php /* translators: %s: post type singular name */ ?>
226 <label for="record_xml_tag" style="float: left;"><?php printf(esc_html__('Single %s XML Element','wp-all-export'), empty($post_type_details) ? 'Record' : esc_html($post_type_details->labels->singular_name)); ?></label>
227 <div class="input">
228 <input type="text" name="record_xml_tag" style="vertical-align:middle; background:#fff !important; width: 100%; margin-left:0;" value="<?php echo esc_attr($post['record_xml_tag']) ?>" />
229 </div>
230 </div>
231 </div>
232 <input type="hidden" id="custom_xml_cdata_logic" value="<?php echo esc_attr($post['custom_xml_cdata_logic']); ?>" name="custom_xml_cdata_logic" />
233 <input type="hidden" id="show_cdata_in_preview" value="<?php echo esc_attr($post['show_cdata_in_preview']); ?>" name="show_cdata_in_preview" />
234
235 <div>
236 <?php if( (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive()) && XmlExportWooCommerce::$is_active)
237 {
238 include('variation_options.php');
239 }
240 ?>
241 </div>
242 <div class="wp-all-export-product-bundle-warning warning-only-export-parent-products" style="display:none;">
243 <p><?php esc_html_e("You will not be able to reimport data to the product variations, and you will not be able to import these products to another site.", 'wp-all-export'); ?></p>
244 </div>
245 <div class="wp-all-export-product-bundle-warning warning-only-export-product-variations" style="display:none;">
246 <p><?php esc_html_e("You will not be able to reimport data to the parent products, and you will not be able to import these products to another site.", 'wp-all-export'); ?></p>
247 </div>
248 <div class="input cdata">
249 <h4 style="margin-top: 20px;">CDATA</h4>
250 <p style="font-size: 12px;margin-top: 10px;"><?php echo wp_kses_post(sprintf(__("There are certain characters that cannot be included in an XML file unless they are wrapped in CDATA tags.<br/>Read more about CDATA tags: <a target='_blank' href='%1\$s' style='font-size: 12px;'>%2\$s</a>.", 'wp-all-export'), 'https://en.wikipedia.org/wiki/CDATA', 'https://en.wikipedia.org/wiki/CDATA')); ?></p>
251 <div class="input" style="margin: 8px 0;">
252 <input type="radio" id="simple_custom_xml_cdata_logic_auto" name="simple_custom_xml_cdata_logic" value="auto" checked="checked" <?php echo ( "auto" == $post['custom_xml_cdata_logic'] ) ? 'checked="checked"': '' ?> class="switcher cdata"/>
253 <label for="simple_custom_xml_cdata_logic_auto"><?php esc_html_e('Automatically wrap data in CDATA tags when it contains illegal characters', 'wp-all-export') ?></label>
254 </div>
255 <div class="input" style="margin: 8px 0;">
256 <input type="radio" id="simple_custom_xml_cdata_logic_all" name="simple_custom_xml_cdata_logic" value="all" <?php echo ( "all" == $post['custom_xml_cdata_logic'] ) ? 'checked="checked"': '' ?> class="switcher cdata" />
257 <label for="simple_custom_xml_cdata_logic_all"><?php esc_html_e('Always wrap data in CDATA tags', 'wp-all-export') ?></label>
258 </div>
259 <div class="input" style="margin: 8px 0;">
260 <input type="radio" id="simple_custom_xml_cdata_logic_never" name="simple_custom_xml_cdata_logic" value="never" <?php echo ( "never" == $post['custom_xml_cdata_logic'] ) ? 'checked="checked"': '' ?> class="switcher cdata"/>
261 <label for="simple_custom_xml_cdata_logic_never"><?php esc_html_e('Never wrap data in CDATA tags', 'wp-all-export') ?></label>
262 <div class="switcher-target-simple_custom_xml_cdata_logic_never">
263 <p style="font-size: 12px;margin-top: 8px;"><?php esc_html_e('Warning: This may result in an invalid XML file', 'wp-all-export');?></p>
264 </div>
265 </div>
266 <div class="input" style="margin: 16px 4px;">
267 <input type="checkbox" value="1" id="simple_show_cdata_in_preview" <?php echo ( 1 == $post['show_cdata_in_preview'] ) ? 'checked="checked"': '' ?> class="show_cdata_in_preview" />
268 <label for="simple_show_cdata_in_preview">Show CDATA tags in XML preview</label>
269 </div>
270 </div>
271 </div>
272 </div>
273 </div>
274 </div>
275
276 <!-- ExportToCsvBegin -->
277 <div class="wpallexport-collapsed closed wpallexport-section wpallexport-csv-advanced-options export_to_csv" <?php if ($post['export_to'] == 'xml') : ?> style="display: none;" <?php endif; ?> >
278 <div class="wpallexport-content-section rad0" style="margin:0; border-top:1px solid #ddd; border-bottom: none; border-right: none; border-left: none; background: #f1f2f2; padding-bottom: 15px; margin-top: 5px;">
279 <div class="wpallexport-collapsed-header">
280 <h3 style="color:#40acad;"><?php esc_html_e('Advanced Options','wp-all-export');?></h3>
281 <hr style="display:none; margin-right:25px;"/>
282 </div>
283 <div class="wpallexport-collapsed-content" style="padding:0 0 0 5px;">
284 <div class="wpallexport-collapsed-content-inner" style="padding-left: 5px;">
285 <div class="simple_xml_template_options csv_delimiter" style="margin-top:20px;">
286 <div class="input" style="display: inline-block; max-width: 360px; width: 40%; margin-right: 10px;">
287 <label style="width: 80px; margin-left: 20px;"><?php esc_html_e('Separator:','wp-all-export');?></label>
288 <input type="text" name="delimiter" value="<?php echo esc_attr($post['delimiter']) ?>" style="width: 40px; height: 30px; top: 0px; text-align: center;"/>
289 </div>
290 </div>
291 <?php if (class_exists('SitePress')): ?>
292 <div class="wp-all-export-wpml-options" style="margin-left:20px;">
293 <h4><?php esc_html_e('Language', 'wp-all-export'); ?></h4>
294 <div class="input">
295 <?php foreach ($wpml_options as $key => $value):?>
296 <div class="input">
297 <input type="radio" id="<?php echo esc_attr("wpml_lang_" . $key);?>" name="wpml_lang" value="<?php echo esc_attr($key); ?>" <?php if ($post['wpml_lang'] == $key):?>checked="checked"<?php endif; ?> class="switcher"/>
298 <label for="<?php echo esc_attr("wpml_lang_" . $key);?>"><?php echo wp_kses_post($value); ?></label>
299 </div>
300 <?php endforeach; ?>
301 </div>
302 </div>
303 <?php endif; ?>
304 <div style="margin-left:20px;">
305 <?php if( (XmlExportEngine::get_addons_service()->isWooCommerceAddonActive() || XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive()) && XmlExportWooCommerce::$is_active)
306 {
307 include('variation_options.php');
308 }
309 ?>
310 </div>
311 <div class="wp-all-export-product-bundle-warning" style="display:none;">
312 <p><?php esc_html_e("You will not be able to reimport data to the product variations, and you will not be able to import these products to another site.", 'wp-all-export'); ?></p>
313 </div>
314 <!-- Display each product in its own row -->
315 <?php if ( ($addons->isWooCommerceAddonActive() && XmlExportWooCommerceOrder::$is_active) ): ?>
316 <div class="input" style="float: left; margin-top: 15px; margin-left:20px;" id="woo_commerce_order">
317 <input type="hidden" name="order_item_per_row" value="0"/>
318 <input type="checkbox" id="order_item_per_row" name="order_item_per_row" value="1" <?php if ($post['order_item_per_row']):?>checked="checked"<?php endif; ?> class="switcher"/>
319 <label for="order_item_per_row"><?php esc_html_e("Display each product in its own row", "wp-all-export"); ?></label>
320 <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php esc_html_e('If an order contains multiple products, each product will have its own row. If disabled, each product will have its own column.', 'wp-all-export'); ?>">?</a>
321 <div class="input switcher-target-order_item_per_row" style="margin-top: 10px; text-align:left;">
322 <input type="hidden" name="order_item_fill_empty_columns" value="0"/>
323 <input type="checkbox" id="order_item_fill_empty_columns" name="order_item_fill_empty_columns" value="1" <?php if ($post['order_item_fill_empty_columns']):?>checked="checked"<?php endif; ?>/>
324 <label for="order_item_fill_empty_columns"><?php esc_html_e("Fill in empty columns", "wp-all-export"); ?></label>
325 <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;"
326 title="<?php esc_html_e('If enabled, each order item will appear as its own row with all order info filled in for every column. If disabled, order info will only display on one row with only the order item info displaying in additional rows.', 'wp-all-export'); ?>">?</a>
327 </div>
328 </div>
329 <div class="clear"></div>
330 <?php endif; ?>
331 </div>
332 </div>
333 </div>
334 </div>
335 <!-- ExporToCsvEnd -->
336 </div>
337 </div>
338
339 <div class="wpallexport-collapsed wpallexport-section wpallexport-file-options closed" style="margin-top: 0px;">
340 <div class="wpallexport-content-section" style="padding-bottom: 15px; margin-bottom: 10px;">
341 <div class="wpallexport-collapsed-header" style="padding-left: 25px;">
342 <h3><?php esc_html_e('Export Type','wp-all-export');?></h3>
343 </div>
344 <div class="wpallexport-collapsed-content" style="padding: 0; overflow: hidden;">
345 <div class="wpallexport-collapsed-content-inner">
346 <div class="wpallexport-choose-data-type">
347 <h3 style="margin-top: 10px; margin-bottom: 40px;"><?php esc_html_e('Choose your export type', 'wp-all-export'); ?></h3>
348 <a href="javascript:void(0);" class="wpallexport-import-to-format rad4 wpallexport-csv-type <?php if ($post['export_to'] != XmlExportEngine::EXPORT_TYPE_XML) echo 'selected'; ?>">
349 <span class="wpallexport-import-to-title"><?php esc_html_e('Spreadsheet', 'wp-all-export'); ?></span>
350 <span class="wpallexport-import-to-arrow"></span>
351 </a>
352 <a href="javascript:void(0);" class="wpallexport-import-to-format rad4 wpallexport-xml-type <?php if ($post['export_to'] == XmlExportEngine::EXPORT_TYPE_XML) echo 'selected'; ?>" style="margin-right:0;">
353 <span class="wpallexport-import-to-title"><?php esc_html_e('Feed', 'wp-all-export'); ?></span>
354 <span class="wpallexport-import-to-arrow"></span>
355 </a>
356 </div>
357
358 <div class="wpallexport-all-options">
359 <input type="hidden" name="export_to" value="<?php echo esc_attr($post['export_to']); ?>"/>
360
361 <div class="wpallexport-file-format-options">
362
363 <div class="wpallexport-csv-options" style="<?php if ($post['export_to'] == XmlExportEngine::EXPORT_TYPE_XML || $post['export_to'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) echo 'display:none;'; ?>">
364 <!-- Export File Format -->
365 <div class="input">
366 <select name="export_to_sheet" id="export_to_sheet">
367 <option value="csv" <?php if ($post['export_to_sheet'] == 'csv') echo 'selected="selected"';?>><?php esc_html_e('CSV File', 'wp-all-export'); ?></option>
368 <option value="xls" <?php if ($post['export_to_sheet'] == 'xls') echo 'selected="selected"';?>><?php esc_html_e('Excel File (XLS)', 'wp-all-export'); ?></option>
369 <option value="xlsx" <?php if ($post['export_to_sheet'] == 'xlsx') echo 'selected="selected"';?>><?php esc_html_e('Excel File (XLSX)', 'wp-all-export'); ?></option>
370 </select>
371 </div>
372 <div class="clear"></div>
373 <div class="wpallexport-clear"></div>
374 <div class="input export_to_xls_upgrade_notice" style="vertical-align:middle; position: relative; margin-top: 48px;">
375 <span class="wpallexport-free-edition-notice">
376 <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=5839967&discount=welcome-upgrade-99&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-excel"><?php esc_html_e('Upgrade to the Pro edition of WP All Export to Export to Excel','wp-all-export');?></a>
377 <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.','wp-all-export');?></p>
378 </span>
379 </div>
380 </div>
381
382 <div class="wpallexport-xml-options" <?php if ($post['export_to'] != XmlExportEngine::EXPORT_TYPE_XML) echo 'style="display:none;"'; ?>>
383 <div class="input">
384 <select name="xml_template_type" class="xml_template_type">
385 <option value="simple" <?php if ($post['xml_template_type'] == 'simple') echo 'selected="selected"';?>><?php esc_html_e('Simple XML Feed', 'wp-all-export'); ?></option>
386 <option value="custom" <?php if ($post['xml_template_type'] == 'custom') echo 'selected="selected"';?>><?php esc_html_e('Custom XML Feed', 'wp-all-export'); ?></option>
387 <?php
388 if(in_array('product', $post['cpt'])) {
389 ?>
390 <option value="<?php echo esc_attr(XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS); ?>" <?php if ($post['xml_template_type'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) echo 'selected="selected"';?>><?php esc_html_e('Google Merchant Center Product Feed', 'wp-all-export'); ?></option>
391 <?php
392 }
393 ?>
394 </select>
395 </div>
396 </div>
397 </div>
398 </div>
399 </div>
400 </div>
401 </div>
402 </div>
403
404 <!-- Google Merchants -->
405 <?php include(__DIR__.'/google.php'); ?>
406
407 <div class="error inline" id="validationError" style="display: none;">
408 <p>
409
410 </p>
411 </div>
412
413 <div class="wpallexport-collapsed wpallexport-section wpallexport-custom-xml-template">
414 <div class="wpallexport-content-section" style="padding-bottom: 0; margin-bottom: 10px;">
415 <div class="wpallexport-collapsed-header" style="margin-bottom: 15px;">
416 <h3><?php esc_html_e('XML Editor', 'wp-all-export'); ?></h3>
417 </div>
418 <div class="wpallexport-collapsed-content" style="padding: 0;">
419 <div class="wpallexport-collapsed-content-inner" style="padding-top: 5px;">
420
421 <?php $default_template = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<data>\n\t<!-- BEGIN LOOP -->\n\t<post>\n\n\t</post>\n\t<!-- END LOOP -->\n</data>";?>
422
423 <textarea id="wp_all_export_custom_xml_template" name="custom_xml_template"><?php echo (empty($post['custom_xml_template'])) ? esc_textarea($default_template) : esc_textarea($post['custom_xml_template']);?></textarea>
424
425 <div class="input" style="overflow: hidden; margin-top: 10px; margin-bottom: -20px;">
426 <!-- Help Button -->
427 <div class="input" style="float: left;">
428 <input type="button" value="<?php esc_html_e('Help', 'wp-all-export'); ?>"
429 class="help_custom_xml">
430 </div>
431 <!-- Preview a Row Button -->
432 <div class="input" style="float: right;">
433 <input type="button" value="<?php esc_html_e('Preview', 'wp-all-export'); ?>"
434 class="preview_a_custom_xml_row wp_all_export_disabled_button" disabled>
435 </div>
436 </div>
437 </div>
438 <div class="wpallexport-collapsed closed wpallexport-section">
439 <div class="wpallexport-content-section rad0"
440 style="margin:0; border-top:1px solid #ddd; border-bottom: none; border-right: none; border-left: none; background: #f1f2f2; padding-bottom: 15px; margin-top: 5px;">
441 <div class="wpallexport-collapsed-header">
442 <h3 style="color:#40acad;"><?php esc_html_e('Advanced Options','wp-all-export');?></h3>
443 <hr style="display: none; margin-right: 25px;"/>
444 </div>
445 <div class="wpallexport-collapsed-content" style="padding: 0 0 0 5px;">
446 <div class="wpallexport-collapsed-content-inner">
447 <div class="input cdata">
448 <h4 style="margin-top: 20px;">CDATA</h4>
449 <p style="font-size: 12px;margin-top: 8px;"><?php echo wp_kses_post(sprintf(__("There are certain characters that cannot be included in an XML file unless they are wrapped in CDATA tags.<br/>Read more about CDATA tags: <a target='_blank' href='%1\$s' style='font-size: 12px;'>%2\$s</a>.", 'wp-all-export'), 'https://en.wikipedia.org/wiki/CDATA', 'https://en.wikipedia.org/wiki/CDATA')); ?></p>
450 <div class="input" style="margin: 8px 0;">
451 <input type="radio" id="custom_xml_cdata_logic_auto"
452 name="custom_custom_xml_cdata_logic"
453 value="auto" <?php echo ("auto" == $post['custom_xml_cdata_logic']) ? 'checked="checked"' : '' ?>
454 class="switcher"/>
455 <label
456 for="custom_xml_cdata_logic_auto"><?php esc_html_e('Automatically wrap data in CDATA tags when it contains illegal characters', 'wp-all-export') ?></label>
457 </div>
458 <div class="input" style="margin: 8px 0;">
459 <input type="radio" id="custom_custom_xml_cdata_logic_all"
460 name="custom_custom_xml_cdata_logic"
461 value="all" <?php echo ("all" == $post['custom_xml_cdata_logic']) ? 'checked="checked"' : '' ?>
462 class="switcher cdata"/>
463 <label
464 for="custom_custom_xml_cdata_logic_all"><?php esc_html_e('Always wrap data in CDATA tags', 'wp-all-export') ?></label>
465 </div>
466 <div class="input" style="margin: 8px 0;">
467 <input type="radio" id="custom_custom_xml_cdata_logic_never"
468 name="custom_custom_xml_cdata_logic"
469 value="never" <?php echo ("never" == $post['custom_xml_cdata_logic']) ? 'checked="checked"' : '' ?>
470 class="switcher cdata"/>
471 <label
472 for="custom_custom_xml_cdata_logic_never"><?php esc_html_e('Never wrap data in CDATA tags', 'wp-all-export') ?></label>
473 <div class="switcher-target-simple_custom_xml_cdata_logic_never">
474 <p style="font-size: 12px;margin-top: 8px;"><?php esc_html_e('Warning: This may result in an invalid XML file', 'wp-all-export');?></p>
475 </div>
476 </div>
477 <div class="input" style="margin: 16px 4px;">
478 <input type="checkbox" value="1" name="custom_show_cdata_in_preview"
479 id="custom_show_cdata_in_preview" <?php echo (1 == $post['show_cdata_in_preview']) ? 'checked="checked"' : '' ?>
480 class="show_cdata_in_preview"/>
481 <label for="custom_show_cdata_in_preview">Show CDATA tags in XML
482 preview</label>
483 </div>
484 </div>
485 </div>
486 </div>
487 </div>
488 </div>
489 </div>
490 </div>
491 </div>
492
493 <?php
494
495 $uploads = wp_upload_dir();
496 $functions = $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php';
497
498 ?>
499
500 <div class="wpallexport-collapsed closed wpallexport-section wpallexport-custom-xml-template">
501 <div class="wpallexport-content-section" style="padding-bottom: 15px; margin-bottom: 10px;">
502 <div class="wpallexport-collapsed-header">
503 <h3><?php esc_html_e('Function Editor', 'wp-all-export'); ?></h3>
504 </div>
505 <div class="wpallexport-collapsed-content" style="padding: 0;">
506 <div class="wpallexport-collapsed-content-inner">
507
508 <textarea id="wp_all_export_main_code" name="wp_all_export_main_code"><?php echo "<?php\n\n?>";?></textarea>
509 <div class="wpallexport-free-edition-notice" style="margin: 15px 0;">
510 <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=5839967&discount=welcome-upgrade-99&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=custom-php"><?php esc_html_e('Upgrade to the Pro edition of WP All Export to use Custom PHP Functions','wp-all-export');?></a>
511 <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.','wp-all-export');?></p>
512 </div>
513 <div class="input" style="margin-top: 10px;">
514
515 <div class="input" style="display:inline-block; margin-right: 20px;">
516 <input type="button" class="button-primary wp_all_export_save_functions wp_all_export_save_main_code" value="<?php esc_html_e("Save Functions", 'wp-all-export'); ?>" disabled="disabled"/>
517 <a href="#help" class="wpallexport-help" title="<?php printf(esc_html__("Add functions here for use during your export. You can access this file at %s", "wp-all-export"), esc_attr(preg_replace("%.*wp-content%", "wp-content", $functions)));?>" style="top: 0;">?</a>
518 <div class="wp_all_export_functions_preloader"></div>
519 </div>
520 <div class="input wp_all_export_saving_status"></div>
521 </div>
522 </div>
523 </div>
524 </div>
525 </div>
526
527 <hr>
528
529 <div class="input wpallexport-section load-template-container" style="padding-bottom: 8px; padding-left: 8px;">
530 <p style="margin: 11px; float: left;">
531 <input type="hidden" name="save_template_as" value="0" />
532 <input type="checkbox" id="save_template_as" name="save_template_as"
533 class="switcher-horizontal fix_checkbox"
534 value="1" <?php echo (!empty($post['save_template_as'])) ? 'checked="checked"' : '' ?> />
535 <label
536 for="save_template_as"><?php esc_html_e('Save settings as a template', 'wp-all-export'); ?></label>
537 </p>
538 <div class="switcher-target-save_template_as" style="float: left; overflow: hidden;">
539 <input type="text" name="name"
540 placeholder="<?php esc_html_e('Template name...', 'wp-all-export') ?>"
541 style="vertical-align:middle; line-height: 26px;"
542 value="<?php echo esc_attr($post['name']) ?>"/>
543 </div>
544 <?php $templates = new PMXE_Template_List(); ?>
545 <div class="load-template">
546 <select name="load_template" id="load_template">
547 <option value=""><?php esc_html_e('Load Template...', 'wp-all-export') ?></option>
548 <?php foreach ($templates->getBy()->convertRecords() as $t): ?>
549 <?php
550 // When creating a new export you should be able to select existing saved export templates that were created for the same post type.
551 if ( $t->options['cpt'] != $post['cpt'] ) continue;
552 ?>
553 <option value="<?php echo esc_attr($t->id) ?>"><?php echo esc_html(wp_all_export_clear_xss($t->name)); ?></option>
554 <?php endforeach ?>
555 </select>
556 </div>
557
558 </div>
559
560 <hr>
561
562 <div class="input custom_xml_upgrade_notice wpallexport-custom-xml-template" style="vertical-align:middle; position: relative; top: -5px;">
563 <span class="wpallexport-free-edition-notice" style="margin: 0 0 10px;">
564 <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=5839967&discount=welcome-upgrade-99&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=custom-xml"><?php esc_html_e('Upgrade to the Pro edition of WP All Export to Export Custom XML','wp-all-export');?></a>
565 <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.','wp-all-export');?></p>
566 </span>
567 </div>
568
569 <div class="input custom_xml_upgrade_notice wpallexport-google-merchants-template" style="vertical-align:middle; position: relative; top: -5px;">
570 <span class="wpallexport-free-edition-notice" style="margin: 0 0 10px;">
571 <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=5839967&discount=welcome-upgrade-99&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=google-merchant-center"><?php esc_html_e('Upgrade to the Pro edition of WP All Export to Export To Google Merchant Center','wp-all-export');?></a>
572 <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.','wp-all-export');?></p>
573 </span>
574 </div>
575
576 <div class="wpallexport-submit-buttons">
577
578 <div style="text-align:center; width:100%;">
579 <?php wp_nonce_field('template', '_wpnonce_template'); ?>
580 <input type="hidden" name="is_submitted" value="1" />
581 <input type="hidden" id="dismiss_warnings" value="<?php echo esc_attr($dismiss_warnings); ?>"/>
582 <?php if ( ! $this->isWizard ): ?>
583 <a href="<?php echo esc_url(remove_query_arg('id', remove_query_arg('action', esc_url($this->baseUrl)))); ?>"
584 class="back rad3"
585 style="float:none;"><?php esc_html_e('Back to Manage Exports', 'wp-all-export') ?></a>
586 <?php else: ?>
587 <a href="<?php echo esc_url(add_query_arg('action', 'index', esc_url($this->baseUrl))); ?>"
588 class="back rad3"><?php esc_html_e('Back', 'wp-all-export') ?></a>
589 <?php endif; ?>
590 <input type="submit" class="button wpallexport-large-button"
591 value="<?php echo esc_attr( ($this->isWizard) ? __('Continue', 'wp-all-export') : __('Update Template', 'wp-all-export') ); ?>"/>
592 </div>
593
594 </div>
595
596 <a href="http://soflyy.com/" target="_blank"
597 class="wpallexport-created-by"><?php esc_html_e('Created by', 'wp-all-export'); ?> <span></span></a>
598
599 </form>
600
601 </td>
602
603 <td class="right template-sidebar" style="position: relative; width: 18%; right: 0px; padding: 0;">
604
605 <fieldset id="available_data" class="optionsset rad4 wpae_available_data">
606
607 <div class="title"><?php esc_html_e('Available Data', 'wp-all-export'); ?></div>
608
609 <div class="wpallexport-xml resetable">
610
611 <ul>
612
613 <?php
614 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $available_data_view built from view templates with internal escaping (see views/admin/export/template/available_data*.php)
615 echo $available_data_view;
616 ?>
617
618 </ul>
619
620 </div>
621
622 </fieldset>
623 <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- plugin-owned filter output; callback in filters/wpallexport_info_panel.php returns trusted static HTML
624 echo apply_filters('wpallexport_info_panel', ''); ?>
625 </td>
626 </tr>
627
628 </table>
629
630 <fieldset class="optionsset column rad4 wp-all-export-edit-column">
631
632 <div class="title"><span
633 class="wpallexport-add-row-title" style="font-size: 14px;"><?php esc_html_e('Add Field To Export', 'wp-all-export'); ?></span><span
634 class="wpallexport-edit-row-title" style="font-size: 14px;"><?php esc_html_e('Edit Export Field', 'wp-all-export'); ?></span></div>
635
636 <?php include_once 'template/add_new_field.php'; ?>
637
638 </fieldset>
639
640 <fieldset class="optionsset column rad4 wp-all-export-custom-xml-help">
641
642 <div class="title"><span style="font-size:1.5em;"
643 class="wpallexport-add-row-title"><?php esc_html_e('Custom XML Feeds', 'wp-all-export'); ?></span><span
644 class="wpallexport-edit-row-title"><?php esc_html_e('Edit Export Field', 'wp-all-export'); ?></span></div>
645
646 <?php include_once 'template/custom_xml_help.php'; ?>
647
648 </fieldset>
649
650 <div class="wpallexport-overlay"></div>
651