Export WordPress data to XML/CSV - Version 1.1.2

Version Description

  • improvement: choose WPML language in export options
  • bug fix: export ACF message field
  • bug fix: export product categories with AFC repeater fields
  • bug fix: export duplicate images from gallery
  • bug fix: export search
  • bug fix: export product variation attribute names
  • bug fix: migrating hierarchical posts and pages
Download this release

Release Info

Developer soflyy
Plugin Icon 128x128 Export WordPress data to XML/CSV
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

Files changed (149) hide show
  1. actions/admin_head.php +4 -0
  2. actions/pmxe_after_export.php +6 -2
  3. actions/wp_ajax_wpae_available_rules.php +3 -3
  4. actions/wp_ajax_wpae_filtering.php +1 -1
  5. actions/wp_ajax_wpae_filtering_count.php +19 -11
  6. actions/wp_ajax_wpae_preview.php +3 -1
  7. actions/wp_ajax_wpallexport.php +4 -0
  8. classes/wpallimport.php +2 -0
  9. controllers/admin/export.php +19 -6
  10. controllers/admin/manage.php +3 -3
  11. controllers/controller/admin.php +1 -1
  12. dist/app.js +39220 -0
  13. dist/chosen-sprite.png +0 -0
  14. dist/chosen-sprite@2x.png +0 -0
  15. dist/styles.css +843 -0
  16. frontend/.sass-cache/1e8d17c61c30578de9119afabf0505c45d305ebe/availabilityPrice.scssc +0 -0
  17. frontend/.sass-cache/1e8d17c61c30578de9119afabf0505c45d305ebe/basicInformation.scssc +0 -0
  18. frontend/.sass-cache/3d0d747a53a7fe6533c7b81385e4330be65ef070/categorySelector.scssc +0 -0
  19. frontend/.sass-cache/437041dae9230ed3512a93b84abfce7cea94ee50/categorySelector.scssc +0 -0
  20. frontend/.sass-cache/437041dae9230ed3512a93b84abfce7cea94ee50/googleCategorySelector.scssc +0 -0
  21. frontend/.sass-cache/59fb0579c0803eea727968c98dc5a2535eabfa60/availabilityPrice.scssc +0 -0
  22. frontend/.sass-cache/59fb0579c0803eea727968c98dc5a2535eabfa60/uniqueIdentifiers.scssc +0 -0
  23. frontend/.sass-cache/7a42ac8998aa7c8ba9ac04eeb0ae839b5c898de3/basicInformation.scssc +0 -0
  24. frontend/.sass-cache/7a42ac8998aa7c8ba9ac04eeb0ae839b5c898de3/productCategories.scssc +0 -0
  25. frontend/.sass-cache/83142009718bd5978df62c210f1221d16d96a9dd/advancedAttributes.scssc +0 -0
  26. frontend/.sass-cache/83142009718bd5978df62c210f1221d16d96a9dd/shipping.scssc +0 -0
  27. frontend/.sass-cache/8691e535e69e189796af67f73114fb9c83d3e1e3/advancedAttributes.scssc +0 -0
  28. frontend/.sass-cache/8691e535e69e189796af67f73114fb9c83d3e1e3/detailedInformation.scssc +0 -0
  29. frontend/.sass-cache/98eff1feffa48ac878eefb0682a97fef76be0920/common.scssc +0 -0
  30. frontend/.sass-cache/98eff1feffa48ac878eefb0682a97fef76be0920/styles.scssc +0 -0
  31. frontend/.sass-cache/a5847f4bee0f85a5055f3ae124f32b0d1d6c1685/categoryMapper.scssc +0 -0
  32. frontend/.sass-cache/be652ce12cf55d407d37b54be031acf64008ba1b/basicInformation.scssc +0 -0
  33. frontend/.sass-cache/c0fa2026c2e5c0de4b27eb6d0e10642433a23d40/basicInformation.scssc +0 -0
  34. frontend/.sass-cache/c0fa2026c2e5c0de4b27eb6d0e10642433a23d40/detailedInformation.scssc +0 -0
  35. frontend/.sass-cache/eff9f42b8d50360960249617449f0a81611d4f48/categoryMapper.scssc +0 -0
  36. frontend/.sass-cache/f5538c7683a05e133bbb60616c8fd20f4f6c3b9a/categorySelector.scssc +0 -0
  37. frontend/.sass-cache/fa29827343a974f0ae49e77fc20d63f4e80aaca2/detailedInformation.scssc +0 -0
  38. frontend/.sass-cache/fa29827343a974f0ae49e77fc20d63f4e80aaca2/mapping.scssc +0 -0
  39. frontend/Gruntfile.js +145 -0
  40. frontend/package.json +36 -0
  41. frontend/src/advancedAttributes/advancedAttributes.controller.js +9 -0
  42. frontend/src/advancedAttributes/advancedAttributes.directive.js +10 -0
  43. frontend/src/advancedAttributes/advancedAttributes.scss +9 -0
  44. frontend/src/advancedAttributes/advancedAttributes.tpl.html +156 -0
  45. frontend/src/app.js +7 -0
  46. frontend/src/availabilityPrice/availabilityPrice.controller.js +5 -0
  47. frontend/src/availabilityPrice/availabilityPrice.directive.js +10 -0
  48. frontend/src/availabilityPrice/availabilityPrice.scss +27 -0
  49. frontend/src/availabilityPrice/availabilityPrice.tpl.html +137 -0
  50. frontend/src/basicInformation/basicInformation.controller.js +3 -0
  51. frontend/src/basicInformation/basicInformation.directive.js +10 -0
  52. frontend/src/basicInformation/basicInformation.scss +13 -0
  53. frontend/src/basicInformation/basicInformation.tpl.html +123 -0
  54. frontend/src/common.scss +25 -0
  55. frontend/src/common/angular-chosen.directive.js +110 -0
  56. frontend/src/common/attributes.service.js +17 -0
  57. frontend/src/common/autodetect.directive.js +21 -0
  58. frontend/src/common/cascade.directive.js +35 -0
  59. frontend/src/common/contenteditable.directive.js +31 -0
  60. frontend/src/common/currency.service.js +18 -0
  61. frontend/src/common/droppable.directive.js +85 -0
  62. frontend/src/common/export.service.js +41 -0
  63. frontend/src/common/focusMeWhenEnabled.directive.js +16 -0
  64. frontend/src/common/googleCategoriesService.js +20 -0
  65. frontend/src/common/main.controller.js +219 -0
  66. frontend/src/common/mapping/mapping.controller.js +34 -0
  67. frontend/src/common/mapping/mapping.directive.js +12 -0
  68. frontend/src/common/mapping/mapping.scss +40 -0
  69. frontend/src/common/mapping/mapping.tpl.html +67 -0
  70. frontend/src/common/styledInput.directive.js +35 -0
  71. frontend/src/common/template.service.js +19 -0
  72. frontend/src/common/tipsy.directive.js +26 -0
  73. frontend/src/common/wpHttp.service.js +31 -0
  74. frontend/src/detailedInformation/detailedInformation.controller.js +8 -0
  75. frontend/src/detailedInformation/detailedInformation.directive.js +10 -0
  76. frontend/src/detailedInformation/detailedInformation.scss +5 -0
  77. frontend/src/detailedInformation/detailedInformation.tpl.html +210 -0
  78. frontend/src/productCategories/categoryMapper/categoryMapper.controller.js +32 -0
  79. frontend/src/productCategories/categoryMapper/categoryMapper.directive.js +13 -0
  80. frontend/src/productCategories/categoryMapper/categoryMapper.scss +201 -0
  81. frontend/src/productCategories/categoryMapper/categoryMapper.tpl.html +80 -0
  82. frontend/src/productCategories/categoryMapper/noCategoriesNotice.tpl.html +11 -0
  83. frontend/src/productCategories/googleCategorySelector/googleCategorySelector.controller.js +127 -0
  84. frontend/src/productCategories/googleCategorySelector/googleCategorySelector.directive.js +9 -0
  85. frontend/src/productCategories/googleCategorySelector/googleCategorySelector.scss +105 -0
  86. frontend/src/productCategories/googleCategorySelector/googleCategorySelector.tpl.html +22 -0
  87. frontend/src/productCategories/googleCategorySelector/googleCategorySelectorAdder.directive.js +22 -0
  88. frontend/src/productCategories/googleCategorySelector/googleCategorySelectorAdder.tpl.html +10 -0
  89. frontend/src/productCategories/productCategories.controller.js +3 -0
  90. frontend/src/productCategories/productCategories.directive.js +10 -0
  91. frontend/src/productCategories/productCategories.scss +0 -0
  92. frontend/src/productCategories/productCategories.tpl.html +61 -0
  93. frontend/src/shipping/shipping.controller.js +5 -0
  94. frontend/src/shipping/shipping.directive.js +10 -0
  95. frontend/src/shipping/shipping.scss +0 -0
  96. frontend/src/shipping/shipping.tpl.html +60 -0
  97. frontend/src/styles.scss +278 -0
  98. frontend/src/styles/bootstrap-chosen-variables.scss +18 -0
  99. frontend/src/styles/bootstrap-chosen.scss +459 -0
  100. frontend/src/styles/bootstrap-variables.scss +921 -0
  101. frontend/src/styles/chosen-sprite.png +0 -0
  102. frontend/src/styles/chosen-sprite@2x.png +0 -0
  103. frontend/src/uniqueIdentifiers/uniqueIdentifiers.controller.js +3 -0
  104. frontend/src/uniqueIdentifiers/uniqueIdentifiers.directive.js +10 -0
  105. frontend/src/uniqueIdentifiers/uniqueIdentifiers.scss +18 -0
  106. frontend/src/uniqueIdentifiers/uniqueIdentifiers.tpl.html +45 -0
  107. frontend/taxonomies/googleTaxonomies.json +1 -0
  108. frontend/taxonomies/taxonomies_multilevel.json +1 -0
  109. helpers/pmxe_functions.php +1 -1
  110. libraries/WpaeXmlProcessor.php +56 -19
  111. libraries/XmlCsvExport.php +8 -2
  112. libraries/XmlExportACF.php +146 -75
  113. libraries/XmlExportCpt.php +29 -5
  114. libraries/XmlExportEngine.php +11 -0
  115. libraries/XmlExportFiltering.php +20 -7
  116. libraries/XmlExportMediaGallery.php +1 -1
  117. libraries/XmlExportWooCommerce.php +99 -85
  118. models/export/record.php +5 -0
  119. readme.txt +11 -2
  120. schema.php +5388 -1
  121. src/App/Categories/CategoriesCollection.php +36 -0
  122. src/App/Categories/CategoriesCollectionTest.php +19 -0
  123. src/App/Controller/CategoriesController.php +46 -0
  124. src/App/Controller/ExportController.php +49 -0
  125. src/App/Controller/GoogleCategoriesController.php +127 -0
  126. src/App/Service/Pro/VariationOptions/VariationOptions.php +69 -0
  127. src/{VariationOptions → App/Service/VariationOptions}/VariationOptions.php +1 -1
  128. src/{VariationOptions → App/Service/VariationOptions}/VariationOptionsFactory.php +4 -6
  129. src/{VariationOptions → App/Service/VariationOptions}/VariationOptionsInterface.php +1 -1
  130. src/App/phpunit.xml +18 -0
  131. src/Controller/BaseController.php +32 -0
  132. src/Di/WpaeDi.php +61 -0
  133. src/Http/JsonResponse.php +14 -0
  134. src/Http/Request.php +42 -0
  135. src/Http/Response.php +37 -0
  136. src/Security/AccessControl.php +14 -0
  137. src/WordPress/Filters.php +25 -0
  138. src/phpunit.xml +0 -0
  139. static/css/admin.css +23 -5
  140. static/js/admin.js +193 -16
  141. static/js/jquery/moment.js +4301 -6
  142. views/admin/export/google.php +31 -0
  143. views/admin/export/process.php +1 -1
  144. views/admin/export/template.php +51 -23
  145. views/admin/export/variation_options.php +5 -9
  146. views/admin/google/index.php +19 -0
  147. views/admin/google/indexbck.php +1591 -0
  148. wp-all-export.php +18 -3
  149. wpae_api.php +33 -0
actions/admin_head.php CHANGED
@@ -15,6 +15,10 @@ function pmxe_admin_head(){
15
16
?>
17
<script type="text/javascript">
18
var export_action = '<?php echo $export_action; ?>';
19
var wp_all_export_security = '<?php echo $wp_all_export_ajax_nonce; ?>';
20
</script>
15
16
?>
17
<script type="text/javascript">
18
+ if(typeof GoogleMerchants != 'undefined') {
19
+ GoogleMerchants.constant('NONCE', '<?php echo $wp_all_export_ajax_nonce; ?>');
20
+ }
21
+
22
var export_action = '<?php echo $export_action; ?>';
23
var wp_all_export_security = '<?php echo $wp_all_export_ajax_nonce; ?>';
24
</script>
actions/pmxe_after_export.php CHANGED
@@ -34,15 +34,19 @@ function pmxe_pmxe_after_export($export_id, $export)
34
35
$is_export_csv_headers = apply_filters('wp_all_export_is_csv_headers_enabled', true, $export->id);
36
37
// Remove headers row from CSV file
38
- if ( ! $is_export_csv_headers && @file_exists($filepath) && $export->options['export_to'] == 'csv' ){
39
40
$tmp_file = str_replace(basename($filepath), 'iteration_' . basename($filepath), $filepath);
41
copy($filepath, $tmp_file);
42
$in = fopen($tmp_file, 'r');
43
$out = fopen($filepath, 'w');
44
45
- $headers = fgetcsv($in);
46
47
if (is_resource($in)) {
48
$lineNumber = 0;
34
35
$is_export_csv_headers = apply_filters('wp_all_export_is_csv_headers_enabled', true, $export->id);
36
37
+ if ( isset($export->options['include_header_row'])) {
38
+ $is_export_csv_headers = $export->options['include_header_row'];
39
+ }
40
+
41
// Remove headers row from CSV file
42
+ if ( empty($is_export_csv_headers) && @file_exists($filepath) && $export->options['export_to'] == 'csv' && $export->options['export_to_sheet'] == 'csv' ){
43
44
$tmp_file = str_replace(basename($filepath), 'iteration_' . basename($filepath), $filepath);
45
copy($filepath, $tmp_file);
46
$in = fopen($tmp_file, 'r');
47
$out = fopen($filepath, 'w');
48
49
+ $headers = fgetcsv($in, 0, XmlExportEngine::$exportOptions['delimiter']);
50
51
if (is_resource($in)) {
52
$lineNumber = 0;
actions/wp_ajax_wpae_available_rules.php CHANGED
@@ -20,12 +20,12 @@ function pmxe_wp_ajax_wpae_available_rules(){
20
<select id="wp_all_export_rule">
21
<option value=""><?php _e('Select Rule', 'wp_all_export_plugin'); ?></option>
22
<?php
23
- if (strpos($post['selected'], 'tx_') === 0){
24
?>
25
26
<!-- Taxonomies -->
27
- <option value="in"><?php echo __('In', 'wp_all_export_plugin') . ' ' . ucwords(str_replace(array("tx_", "_"), array("", " "), $post['selected'])); ?></option>
28
- <option value="not_in"><?php echo __('Not In', 'wp_all_export_plugin') . ' ' . ucwords(str_replace(array("tx_", "_"), array("", " "), $post['selected'])); ?></option>
29
30
<!-- Custom Fields -->
31
<!--option value="between">BETWEEN</option-->
20
<select id="wp_all_export_rule">
21
<option value=""><?php _e('Select Rule', 'wp_all_export_plugin'); ?></option>
22
<?php
23
+ if (strpos($post['selected'], 'tx_') === 0 || strpos($post['selected'], 'product_tx') === 0){
24
?>
25
26
<!-- Taxonomies -->
27
+ <option value="in"><?php echo __('In', 'wp_all_export_plugin') . ' ' . ucwords(str_replace(array("product_tx", "tx_", "_"), array("", "", " "), $post['selected'])); ?></option>
28
+ <option value="not_in"><?php echo __('Not In', 'wp_all_export_plugin') . ' ' . ucwords(str_replace(array("product_tx", "tx_", "_"), array("", "", " "), $post['selected'])); ?></option>
29
30
<!-- Custom Fields -->
31
<!--option value="between">BETWEEN</option-->
actions/wp_ajax_wpae_filtering.php CHANGED
@@ -56,7 +56,7 @@ function pmxe_wp_ajax_wpae_filtering(){
56
if ( XmlExportEngine::$is_auto_generate_enabled ):
57
?>
58
<span class="wp_all_export_btn_with_note">
59
- <a href="javascript:void(0);" class="back rad3 auto-generate-template" style="float:none; background: #425f9a; padding: 0 50px; margin-right: 10px; color: #fff; font-weight: normal;"><?php printf(__('Migrate %s', 'wp_all_export_plugin'), wp_all_export_get_cpt_name(array($post['cpt']), 2)); ?></a>
60
<span class="auto-generate-template">&nbsp;</span>
61
</span>
62
<span class="wp_all_export_btn_with_note">
56
if ( XmlExportEngine::$is_auto_generate_enabled ):
57
?>
58
<span class="wp_all_export_btn_with_note">
59
+ <a href="javascript:void(0);" class="back rad3 auto-generate-template" style="float:none; background: #425f9a; padding: 0 50px; margin-right: 10px; color: #fff; font-weight: normal;"><?php printf(__('Migrate %s', 'wp_all_export_plugin'), wp_all_export_get_cpt_name(array($post['cpt']), 2, $post)); ?></a>
60
<span class="auto-generate-template">&nbsp;</span>
61
</span>
62
<span class="wp_all_export_btn_with_note">
actions/wp_ajax_wpae_filtering_count.php CHANGED
@@ -37,6 +37,14 @@ function pmxe_wp_ajax_wpae_filtering_count(){
37
{
38
XmlExportEngine::$exportOptions = $export->options + PMXE_Plugin::get_default_import_options();
39
XmlExportEngine::$exportOptions['export_only_new_stuff'] = $post['export_only_new_stuff'];
40
}
41
42
XmlExportEngine::$is_user_export = ( 'users' == $post['cpt'] or 'shop_customer' == $post['cpt'] ) ? true : false;
@@ -149,17 +157,17 @@ function pmxe_wp_ajax_wpae_filtering_count(){
149
}
150
}
151
else
152
- {
153
remove_all_actions('parse_query');
154
- remove_all_actions('pre_get_posts');
155
- remove_all_filters('posts_clauses');
156
157
$cpt = ($is_products_export) ? array('product', 'product_variation') : array($post['cpt']);
158
159
// get total custom post type records
160
$totalQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
161
if ( ! empty($totalQuery->found_posts)){
162
- $total_records = $totalQuery->found_posts;
163
}
164
165
wp_reset_postdata();
@@ -167,12 +175,12 @@ function pmxe_wp_ajax_wpae_filtering_count(){
167
ob_start();
168
// get custom post type records depends on filters
169
add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
170
- add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
171
-
172
$exportQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
173
- if ( ! empty($exportQuery->found_posts))
174
{
175
- $found_records = $exportQuery->found_posts;
176
}
177
178
if($is_products_export) {
@@ -183,9 +191,9 @@ function pmxe_wp_ajax_wpae_filtering_count(){
183
}
184
}
185
186
- remove_filter('posts_join', 'wp_all_export_posts_join');
187
- remove_filter('posts_where', 'wp_all_export_posts_where');
188
- ob_end_clean();
189
}
190
}
191
37
{
38
XmlExportEngine::$exportOptions = $export->options + PMXE_Plugin::get_default_import_options();
39
XmlExportEngine::$exportOptions['export_only_new_stuff'] = $post['export_only_new_stuff'];
40
+ if (!empty($post['wpml_lang'])) XmlExportEngine::$exportOptions['wpml_lang'] = $post['wpml_lang'];
41
+ }
42
+ else{
43
+ XmlExportEngine::$exportOptions['wpml_lang'] = empty($post['wpml_lang']) ? 'all' : $post['wpml_lang'];
44
+ }
45
+
46
+ if (class_exists('SitePress') && !empty(XmlExportEngine::$exportOptions['wpml_lang'])){
47
+ do_action( 'wpml_switch_language', XmlExportEngine::$exportOptions['wpml_lang'] );
48
}
49
50
XmlExportEngine::$is_user_export = ( 'users' == $post['cpt'] or 'shop_customer' == $post['cpt'] ) ? true : false;
157
}
158
}
159
else
160
+ {
161
remove_all_actions('parse_query');
162
+ remove_all_actions('pre_get_posts');
163
+ remove_all_filters('posts_clauses');
164
165
$cpt = ($is_products_export) ? array('product', 'product_variation') : array($post['cpt']);
166
167
// get total custom post type records
168
$totalQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
169
if ( ! empty($totalQuery->found_posts)){
170
+ $total_records = $totalQuery->found_posts;
171
}
172
173
wp_reset_postdata();
175
ob_start();
176
// get custom post type records depends on filters
177
add_filter('posts_where', 'wp_all_export_posts_where', 10, 1);
178
+ add_filter('posts_join', 'wp_all_export_posts_join', 10, 1);
179
+
180
$exportQuery = new WP_Query( array( 'post_type' => $cpt, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
181
+ if ( ! empty($exportQuery->found_posts))
182
{
183
+ $found_records = $exportQuery->found_posts;
184
}
185
186
if($is_products_export) {
191
}
192
}
193
194
+ remove_filter('posts_join', 'wp_all_export_posts_join');
195
+ remove_filter('posts_where', 'wp_all_export_posts_where');
196
+ ob_end_clean();
197
}
198
}
199
actions/wp_ajax_wpae_preview.php CHANGED
@@ -44,7 +44,9 @@ function pmxe_wp_ajax_wpae_preview(){
44
XmlExportEngine::$is_taxonomy_export = $exportOptions['is_taxonomy_export'];
45
XmlExportEngine::$exportID = $export_id;
46
47
-
48
49
if ( in_array(XmlExportEngine::$exportOptions['xml_template_type'], array('custom', 'XmlGoogleMerchants')) ){
50
44
XmlExportEngine::$is_taxonomy_export = $exportOptions['is_taxonomy_export'];
45
XmlExportEngine::$exportID = $export_id;
46
47
+ if ( class_exists('SitePress') && ! empty(XmlExportEngine::$exportOptions['wpml_lang'])){
48
+ do_action( 'wpml_switch_language', XmlExportEngine::$exportOptions['wpml_lang'] );
49
+ }
50
51
if ( in_array(XmlExportEngine::$exportOptions['xml_template_type'], array('custom', 'XmlGoogleMerchants')) ){
52
actions/wp_ajax_wpallexport.php CHANGED
@@ -39,6 +39,10 @@ function pmxe_wp_ajax_wpallexport(){
39
XmlExportEngine::$exportID = $export_id;
40
XmlExportEngine::$exportRecord = $export;
41
42
$errors = new WP_Error();
43
$engine = new XmlExportEngine($exportOptions, $errors);
44
39
XmlExportEngine::$exportID = $export_id;
40
XmlExportEngine::$exportRecord = $export;
41
42
+ if ( class_exists('SitePress') && ! empty(XmlExportEngine::$exportOptions['wpml_lang'])){
43
+ do_action( 'wpml_switch_language', XmlExportEngine::$exportOptions['wpml_lang'] );
44
+ }
45
+
46
$errors = new WP_Error();
47
$engine = new XmlExportEngine($exportOptions, $errors);
48
classes/wpallimport.php CHANGED
@@ -297,6 +297,8 @@ final class PMXE_Wpallimport
297
self::$templateOptions['matching_parent'] = 'first_is_parent_id';
298
//self::$templateOptions['single_product_id_first_is_parent_id'] = '{parent_id[1]}';
299
}
300
}
301
}
302
297
self::$templateOptions['matching_parent'] = 'first_is_parent_id';
298
//self::$templateOptions['single_product_id_first_is_parent_id'] = '{parent_id[1]}';
299
}
300
+ self::$templateOptions['create_new_records'] = 0;
301
+ self::$templateOptions['is_update_product_type'] = 0;
302
}
303
}
304
controllers/admin/export.php CHANGED
@@ -7,7 +7,7 @@
7
8
class PMXE_Admin_Export extends PMXE_Controller_Admin {
9
10
- protected $isWizard = true; // indicates whether controller is in wizard mode (otherwize it called to be deligated an edit action)
11
12
protected function init() {
13
@@ -43,6 +43,7 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
43
/**
44
* Checks whether corresponding step of wizard is complete
45
* @param string $action
46
*/
47
protected function _step_ready($action) {
48
@@ -184,11 +185,14 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
184
185
$this->data['dismiss_warnings'] = 0;
186
if ($this->isWizard) {
187
$DefaultOptions = (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + $default;
188
$post = $this->input->post($DefaultOptions);
189
}
190
else{
191
$DefaultOptions = $this->data['export']->options + $default;
192
if (empty($this->data['export']->options['export_variations'])){
193
$DefaultOptions['export_variations'] = XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT_AND_VARIATION;
194
}
@@ -233,11 +237,9 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
233
unset($template_options['wp_query_selector']);
234
$this->data['post'] = array_merge($post, $template_options);
235
PMXE_Plugin::$session->set('is_loaded_template', $load_template);
236
- //PMXE_Plugin::$session->set('options', $template_options);
237
}
238
239
} elseif ($this->input->post('is_submitted')) {
240
-
241
check_admin_referer('template', '_wpnonce_template');
242
243
if ( empty($post['cc_type'][0]) && ! in_array($post['xml_template_type'], array('custom', 'XmlGoogleMerchants')) ){
@@ -289,9 +291,7 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
289
}
290
wp_redirect(add_query_arg(array('page' => 'pmxe-admin-manage', 'pmxe_nt' => urlencode(__('Options updated', 'pmxi_plugin'))) + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)), admin_url('admin.php'))); die();
291
}
292
-
293
}
294
-
295
}
296
297
if ( empty($this->data['engine']) ){
@@ -307,6 +307,20 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
307
308
$this->data['available_fields_view'] = $this->data['engine']->render_new_field();
309
310
$this->render();
311
}
312
@@ -315,7 +329,6 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
315
*/
316
public function options()
317
{
318
-
319
$default = PMXE_Plugin::get_default_import_options();
320
321
if ($this->isWizard) {
7
8
class PMXE_Admin_Export extends PMXE_Controller_Admin {
9
10
+ protected $isWizard = true; // indicates whether controller is in wizard mode (otherwise it called to be delegated an edit action)
11
12
protected function init() {
13
43
/**
44
* Checks whether corresponding step of wizard is complete
45
* @param string $action
46
+ * @return bool
47
*/
48
protected function _step_ready($action) {
49
185
186
$this->data['dismiss_warnings'] = 0;
187
if ($this->isWizard) {
188
+ // New export
189
$DefaultOptions = (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + $default;
190
$post = $this->input->post($DefaultOptions);
191
}
192
else{
193
+ // Edit export
194
$DefaultOptions = $this->data['export']->options + $default;
195
+
196
if (empty($this->data['export']->options['export_variations'])){
197
$DefaultOptions['export_variations'] = XmlExportEngine::VARIABLE_PRODUCTS_EXPORT_PARENT_AND_VARIATION;
198
}
237
unset($template_options['wp_query_selector']);
238
$this->data['post'] = array_merge($post, $template_options);
239
PMXE_Plugin::$session->set('is_loaded_template', $load_template);
240
}
241
242
} elseif ($this->input->post('is_submitted')) {
243
check_admin_referer('template', '_wpnonce_template');
244
245
if ( empty($post['cc_type'][0]) && ! in_array($post['xml_template_type'], array('custom', 'XmlGoogleMerchants')) ){
291
}
292
wp_redirect(add_query_arg(array('page' => 'pmxe-admin-manage', 'pmxe_nt' => urlencode(__('Options updated', 'pmxi_plugin'))) + array_intersect_key($_GET, array_flip($this->baseUrlParamNames)), admin_url('admin.php'))); die();
293
}
294
}
295
}
296
297
if ( empty($this->data['engine']) ){
307
308
$this->data['available_fields_view'] = $this->data['engine']->render_new_field();
309
310
+ if (class_exists('SitePress')){
311
+ global $sitepress;
312
+ $langs = $sitepress->get_active_languages();
313
+ if ( ! empty($langs) ){
314
+ // prepare active languages list
315
+ $language_list = array('all' => 'All');
316
+ foreach ($langs as $code => $langInfo){
317
+ $language_list[$code] = "<img width='18' height='12' src='" . $sitepress->get_flag_url($code) . "' style='position:relative; top: 2px;'/> " . $langInfo['display_name'];
318
+ if ($code == $this->default_language) $language_list[$code] .= ' ( <strong>default</strong> )';
319
+ }
320
+ }
321
+ $this->data['wpml_options'] = $language_list;
322
+ }
323
+
324
$this->render();
325
}
326
329
*/
330
public function options()
331
{
332
$default = PMXE_Plugin::get_default_import_options();
333
334
if ($this->isWizard) {
controllers/admin/manage.php CHANGED
@@ -30,7 +30,7 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
30
extract($get);
31
$this->data += $get;
32
33
- if ( ! in_array($order_by, array('registered_on', 'id', 'name'))){
34
$order_by = 'registered_on';
35
}
36
@@ -42,7 +42,7 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
42
$by = array('parent_id' => 0);
43
if ('' != $s) {
44
$like = '%' . preg_replace('%\s+%', '%', preg_replace('/[%?]/', '\\\\$0', $s)) . '%';
45
- $by[] = array(array('name LIKE' => $like, 'type LIKE' => $like, 'path LIKE' => $like), 'OR');
46
}
47
48
$this->data['list'] = $list->setColumns(
@@ -105,7 +105,7 @@ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
105
106
if ( ! empty($item['options']['bundlepath']) )
107
{
108
- $this->data['bundle_url'] = site_url() . '/wp-cron.php?export_hash=' . substr(md5($this->data['cron_job_key'] . $item['id']), 0, 16) . '&export_id=' . $item['id'] . '&action=get_bundle';
109
}
110
111
$this->render();
30
extract($get);
31
$this->data += $get;
32
33
+ if ( ! in_array($order_by, array('registered_on', 'id', 'friendly_name'))){
34
$order_by = 'registered_on';
35
}
36
42
$by = array('parent_id' => 0);
43
if ('' != $s) {
44
$like = '%' . preg_replace('%\s+%', '%', preg_replace('/[%?]/', '\\\\$0', $s)) . '%';
45
+ $by[] = array(array('friendly_name LIKE' => $like, 'registered_on LIKE' => $like), 'OR');
46
}
47
48
$this->data['list'] = $list->setColumns(
105
106
if ( ! empty($item['options']['bundlepath']) )
107
{
108
+ $this->data['bundle_url'] = site_url() . '/wp-cron.php?export_hash=' . substr(md5($this->data['cron_job_key'] . $item['id']), 0, 16) . '&export_id=' . $item['id'] . '&action=get_bundle&t=zip';
109
}
110
111
$this->render();
controllers/controller/admin.php CHANGED
@@ -68,7 +68,7 @@ abstract class PMXE_Controller_Admin extends PMXE_Controller {
68
//wp_enqueue_script('jquery-ui-autocomplete', PMXE_ROOT_URL . '/static/js/jquery/ui.autocomplete.js', array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'));
69
wp_enqueue_script('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/jquery.tipsy.js', 'jquery');
70
wp_enqueue_script('jquery-pmxe-nestable', PMXE_ROOT_URL . '/static/js/jquery/jquery.mjs.pmxe_nestedSortable.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-tabs', 'jquery-ui-progressbar'));
71
- wp_enqueue_script('jquery-moment', PMXE_ROOT_URL . '/static/js/jquery/moment.js', 'jquery');
72
wp_enqueue_script('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/select2.min.js', 'jquery');
73
wp_enqueue_script('jquery-ddslick', PMXE_ROOT_URL . '/static/js/jquery/jquery.ddslick.min.js', 'jquery');
74
wp_enqueue_script('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/chosen.jquery.min.js', 'jquery');
68
//wp_enqueue_script('jquery-ui-autocomplete', PMXE_ROOT_URL . '/static/js/jquery/ui.autocomplete.js', array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position'));
69
wp_enqueue_script('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/jquery.tipsy.js', 'jquery');
70
wp_enqueue_script('jquery-pmxe-nestable', PMXE_ROOT_URL . '/static/js/jquery/jquery.mjs.pmxe_nestedSortable.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-tabs', 'jquery-ui-progressbar'));
71
+ wp_enqueue_script('jquery-moment', PMXE_ROOT_URL . '/static/js/jquery/moment.js', 'jquery', PMXE_VERSION);
72
wp_enqueue_script('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/select2.min.js', 'jquery');
73
wp_enqueue_script('jquery-ddslick', PMXE_ROOT_URL . '/static/js/jquery/jquery.ddslick.min.js', 'jquery');
74
wp_enqueue_script('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/chosen.jquery.min.js', 'jquery');
dist/app.js ADDED
<
@@ -0,0 +1,39220 @@