Export WordPress data to XML/CSV - Version 1.0.0

Version Description

  • WP All Export exits beta
Download this release

Release Info

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

Code changes from version 0.9.1 to 1.0.0

Files changed (177) hide show
  1. actions/admin_head.php +22 -0
  2. actions/admin_init.php +0 -0
  3. actions/admin_menu.php +6 -4
  4. actions/admin_notices.php +1 -12
  5. actions/plugins_loaded.php +0 -9
  6. actions/wp.php +0 -7
  7. actions/wp_ajax_export.php +0 -403
  8. actions/wp_ajax_export_available_rules.php +57 -0
  9. actions/wp_ajax_export_filtering.php +143 -0
  10. actions/wp_ajax_export_filtering_count.php +59 -0
  11. actions/wp_ajax_export_preview.php +137 -0
  12. actions/wp_ajax_wpallexport.php +390 -0
  13. actions/wp_loaded.php +2 -0
  14. actions/wp_session_garbage_collection.php +0 -65
  15. classes/arrayaccess.php +0 -141
  16. classes/config.php +0 -0
  17. classes/download.php +0 -0
  18. classes/handler.php +132 -0
  19. classes/helper.php +0 -0
  20. classes/input.php +8 -1
  21. classes/session.php +91 -366
  22. config/options.php +6 -2
  23. controllers/admin/export.php +294 -63
  24. controllers/admin/feedback.php +12 -0
  25. controllers/admin/help.php +0 -0
  26. controllers/admin/manage.php +328 -0
  27. controllers/admin/settings.php +13 -7
  28. controllers/controller.php +51 -14
  29. controllers/controller/admin.php +4 -1
  30. filters/.gitkeep +0 -0
  31. filters/wp_all_import_is_exported_file_valid.php +65 -0
  32. filters/wpallexport_custom_types.php +7 -0
  33. helpers/backward.php +0 -0
  34. helpers/get_taxonomies_by_object_type.php +25 -0
  35. helpers/pmxe_export_acf_field_csv.php +369 -0
  36. helpers/pmxe_export_acf_field_xml.php +345 -0
  37. helpers/pmxe_export_csv.php +589 -0
  38. helpers/pmxe_export_xml.php +432 -0
  39. helpers/pmxe_filter.php +4 -0
  40. helpers/pmxe_functions.php +14 -69
  41. helpers/pmxe_render_xml_attributes.php +7 -0
  42. helpers/pmxe_render_xml_element.php +55 -0
  43. helpers/pmxe_render_xml_text.php +21 -0
  44. helpers/str_getcsv.php +0 -0
  45. helpers/wp_all_export_check_children_assign.php +15 -0
  46. helpers/wp_all_export_get_cpt_name.php +27 -0
  47. helpers/wp_all_export_is_compatible.php +4 -0
  48. helpers/wp_all_export_prepare_template_csv.php +510 -0
  49. helpers/wp_all_export_prepare_template_xml.php +470 -0
  50. helpers/wp_all_export_rand_char.php +11 -0
  51. helpers/wp_all_export_remove_colons.php +27 -0
  52. helpers/wp_all_export_remove_source.php +22 -0
  53. helpers/wp_all_export_reverse_rules_html.php +40 -0
  54. helpers/wp_all_export_rmdir.php +13 -0
  55. helpers/wp_all_export_secure_file.php +23 -0
  56. helpers/wp_all_export_url_title.php +42 -0
  57. helpers/wp_redirect_or_javascript.php +0 -0
  58. libraries/.gitkeep +0 -0
  59. libraries/XmlExportACF.php +246 -0
  60. libraries/XmlExportEngine.php +515 -0
  61. libraries/XmlExportUser.php +354 -0
  62. libraries/XmlExportWooCommerce.php +551 -0
  63. libraries/XmlExportWooCommerceOrder.php +550 -0
  64. models/export/list.php +2 -2
  65. models/export/record.php +30 -20
  66. models/model.php +0 -0
  67. models/model/list.php +0 -0
  68. models/model/record.php +0 -0
  69. plugin.php +0 -520
  70. readme.txt +45 -19
  71. schema.php +19 -1
  72. screenshot-1.png +0 -0
  73. screenshot-2.png +0 -0
  74. sessions/.gitkeep +0 -0
  75. shortcodes/.gitkeep +0 -0
  76. static/css/admin-ie.css +0 -0
  77. static/css/admin-wp-3.8.css +0 -0
  78. static/css/admin.css +3166 -1039
  79. static/img/add-ons/acf-thumb.jpg +0 -0
  80. static/img/add-ons/woo-commerce-thumb.jpg +0 -0
  81. static/img/back.png +0 -0
  82. static/img/collapser.png +0 -0
  83. static/img/continue.png +0 -0
  84. static/img/date-picker.gif +0 -0
  85. static/img/down.gif +0 -0
  86. static/img/drag.png +0 -0
  87. static/img/elements.png +0 -0
  88. static/img/help.png +0 -0
  89. static/img/ico-add-new.png +0 -0
  90. static/img/ico-remove.png +0 -0
  91. static/img/import-templates.png +0 -0
  92. static/img/left_btn.png +0 -0
  93. static/img/list.png +0 -0
  94. static/img/loading.png +0 -0
  95. static/img/logo.png +0 -0
  96. static/img/preloader.png +0 -0
  97. static/img/progress_animated.gif +0 -0
  98. static/img/remove.png +0 -0
  99. static/img/right_btn.png +0 -0
  100. static/img/rule.png +0 -0
  101. static/img/screen-options-right-up.gif +0 -0
  102. static/img/screen-options-right.gif +0 -0
  103. static/img/soflyy-logo.png +0 -0
  104. static/img/stars.png +0 -0
  105. static/img/trash.png +0 -0
  106. static/img/xmlicon.png +0 -0
  107. static/js/admin.js +1076 -76
  108. static/js/jquery/chosen.jquery.js +1263 -0
  109. static/js/jquery/chosen.jquery.min.js +2 -0
  110. static/js/jquery/css/chosen/chosen-sprite.png +0 -0
  111. static/js/jquery/css/chosen/chosen-sprite@2x.png +0 -0
  112. static/js/jquery/css/chosen/chosen.css +450 -0
  113. static/js/jquery/css/redmond/images/animated-overlay.gif +0 -0
  114. static/js/jquery/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  115. static/js/jquery/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100_1.png +0 -0
  116. static/js/jquery/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  117. static/js/jquery/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  118. static/js/jquery/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  119. static/js/jquery/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  120. static/js/jquery/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  121. static/js/jquery/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  122. static/js/jquery/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  123. static/js/jquery/css/redmond/images/ui-icons_217bc0_256x240.png +0 -0
  124. static/js/jquery/css/redmond/images/ui-icons_2e83ff_256x240.png +0 -0
  125. static/js/jquery/css/redmond/images/ui-icons_469bdd_256x240.png +0 -0
  126. static/js/jquery/css/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
  127. static/js/jquery/css/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
  128. static/js/jquery/css/redmond/images/ui-icons_d8e7f3_256x240.png +0 -0
  129. static/js/jquery/css/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
  130. static/js/jquery/css/redmond/jquery-ui.css +0 -0
  131. static/js/jquery/css/select2/select2-bootstrap.css +0 -0
  132. static/js/jquery/css/select2/select2-spinner.gif +0 -0
  133. static/js/jquery/css/select2/select2.css +0 -0
  134. static/js/jquery/css/select2/select2.png +0 -0
  135. static/js/jquery/css/smoothness/images/tipsy.gif +0 -0
  136. static/js/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  137. static/js/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  138. static/js/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  139. static/js/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  140. static/js/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  141. static/js/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  142. static/js/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  143. static/js/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  144. static/js/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  145. static/js/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  146. static/js/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  147. static/js/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  148. static/js/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  149. static/js/jquery/css/smoothness/jquery-ui.css +0 -0
  150. static/js/jquery/css/smoothness/jquery.tipsy.css +1 -1
  151. static/js/jquery/jquery.ddslick.min.js +1 -0
  152. static/js/jquery/{jquery.mjs.nestedSortable.js → jquery.mjs.pmxe_nestedSortable.js} +13 -10
  153. static/js/jquery/jquery.tipsy.js +0 -0
  154. static/js/jquery/moment.js +0 -0
  155. static/js/jquery/select2.min.js +0 -0
  156. static/js/jquery/ui.autocomplete.js +0 -0
  157. static/js/jquery/ui.datepicker.js +0 -0
  158. static/js/pmxe.js +0 -0
  159. views/admin/export/element.php +0 -183
  160. views/admin/export/index.php +119 -56
  161. views/admin/export/options.php +245 -0
  162. views/admin/export/process.php +115 -27
  163. views/admin/export/template.php +273 -0
  164. views/admin/export/template/new_field_cpt.php +126 -0
  165. views/admin/export/template/new_field_shop_order.php +73 -0
  166. views/admin/export/template/new_field_user.php +97 -0
  167. views/admin/feedback/index.php +29 -0
  168. views/admin/help/index.php +24 -12
  169. views/admin/manage/bulk.php +17 -0
  170. views/admin/manage/delete.php +11 -0
  171. views/admin/manage/index.php +355 -0
  172. views/admin/manage/scheduling.php +57 -0
  173. views/admin/manage/templates.php +19 -0
  174. views/admin/manage/update.php +16 -0
  175. views/admin/settings/index.php +51 -13
  176. views/controller/error.php +0 -0
  177. wp-all-export.php +606 -0
actions/admin_head.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function pmxe_admin_head(){
3
+ $input = new PMXE_Input();
4
+ $export_id = $input->get('id', false);
5
+ $export_action = $input->get('action', false);
6
+ if ($export_id){
7
+ ?>
8
+ <script type="text/javascript">
9
+ var export_id = '<?php echo $export_id; ?>';
10
+ </script>
11
+ <?php
12
+ }
13
+
14
+ $wp_all_export_ajax_nonce = wp_create_nonce( "wp_all_export_secure" );
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>
21
+ <?php
22
+ }
actions/admin_init.php CHANGED
File without changes
actions/admin_menu.php CHANGED
@@ -8,12 +8,14 @@ function pmxe_admin_menu() {
8
 
9
  if (current_user_can('manage_options')) { // admin management options
10
 
11
- add_menu_page(__('WP All Export', 'pmxe_plugin'), __('All Export', 'pmxe_plugin'), 'manage_options', 'pmxe-admin-home', array(PMXE_Plugin::getInstance(), 'adminDispatcher'), PMXE_Plugin::ROOT_URL . '/static/img/xmlicon.png');
12
  // workaround to rename 1st option to `Home`
13
  $submenu['pmxe-admin-home'] = array();
14
- add_submenu_page('pmxe-admin-home', __('Export to XML', 'pmxe_plugin') . ' &lsaquo; ' . __('WP All Export', 'pmxe_plugin'), __('New Export', 'pmxe_plugin'), 'manage_options', 'pmxe-admin-export', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
15
- add_submenu_page('pmxe-admin-home', __('Settings', 'pmxe_plugin') . ' &lsaquo; ' . __('WP All Export', 'pmxe_plugin'), __('Settings', 'pmxe_plugin'), 'manage_options', 'pmxe-admin-settings', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
16
- add_submenu_page('pmxe-admin-home', __('Support', 'pmxe_plugin') . ' &lsaquo; ' . __('WP All Export', 'pmxe_plugin'), __('Support', 'pmxe_plugin'), 'manage_options', 'pmxe-admin-help', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
 
 
17
 
18
  }
19
  }
8
 
9
  if (current_user_can('manage_options')) { // admin management options
10
 
11
+ add_menu_page(__('WP All Export', 'wp_all_export_plugin'), __('All Export', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-home', array(PMXE_Plugin::getInstance(), 'adminDispatcher'), PMXE_Plugin::ROOT_URL . '/static/img/xmlicon.png');
12
  // workaround to rename 1st option to `Home`
13
  $submenu['pmxe-admin-home'] = array();
14
+ add_submenu_page('pmxe-admin-home', __('Export to XML', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('New Export', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-export', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
15
+ add_submenu_page('pmxe-admin-home', __('Manage Exports', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('Manage Exports', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-manage', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
16
+ add_submenu_page('pmxe-admin-home', __('Settings', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('Settings', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-settings', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
17
+ add_submenu_page('pmxe-admin-home', __('Feedback', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('Feedback', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-feedback', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
18
+ add_submenu_page('pmxe-admin-home', __('Support', 'wp_all_export_plugin') . ' &lsaquo; ' . __('WP All Export', 'wp_all_export_plugin'), __('Support', 'wp_all_export_plugin'), 'manage_options', 'pmxe-admin-help', array(PMXE_Plugin::getInstance(), 'adminDispatcher'));
19
 
20
  }
21
  }
actions/admin_notices.php CHANGED
@@ -3,18 +3,7 @@
3
  function pmxe_admin_notices() {
4
 
5
  // notify user if history folder is not writable
6
- $uploads = wp_upload_dir();
7
-
8
- // notify user
9
- if (!PMXE_Plugin::getInstance()->getOption('dismiss') and strpos($_SERVER['REQUEST_URI'], 'pmxe-admin') !== false) {
10
- ?>
11
- <div class="updated"><p>
12
- <?php printf(
13
- __('Welcome to WP All Export. We hope you like it. Please send all support requests and feedback to <a href="mailto:support@soflyy.com">support@soflyy.com</a>.<br/><br/><a href="javascript:void(0);" id="dismiss">dismiss</a>', 'pmxe_plugin')
14
- ) ?>
15
- </p></div>
16
- <?php
17
- }
18
 
19
  $input = new PMXE_Input();
20
  $messages = $input->get('pmxe_nt', array());
3
  function pmxe_admin_notices() {
4
 
5
  // notify user if history folder is not writable
6
+ $uploads = wp_upload_dir();
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  $input = new PMXE_Input();
9
  $messages = $input->get('pmxe_nt', array());
actions/plugins_loaded.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- function pmxe_plugins_loaded() {
4
-
5
- PMXE_Plugin::$session = PMXE_Session::get_instance();
6
- do_action( 'pmxe_session_start' );
7
-
8
- return PMXE_Plugin::$session->session_started();
9
- }
 
 
 
 
 
 
 
 
 
actions/wp.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp() {
4
- if ( ! wp_next_scheduled( 'wp_session_garbage_collection' ) ) {
5
- wp_schedule_event( time(), 'twicedaily', 'wp_session_garbage_collection' );
6
- }
7
- }
 
 
 
 
 
 
 
actions/wp_ajax_export.php DELETED
@@ -1,403 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_ajax_export(){
4
-
5
- $wp_uploads = wp_upload_dir();
6
-
7
- $default = PMXE_Plugin::get_default_import_options();
8
- $exportOptions = (isset(PMXE_Plugin::$session->data['pmxe_export']) ? PMXE_Plugin::$session->data['pmxe_export'] : array()) + $default;
9
-
10
- wp_reset_postdata();
11
-
12
- $exportQuery = new WP_Query( array( 'post_type' => $exportOptions['cpt'], 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => -1 ));
13
-
14
- ob_start();
15
-
16
- switch ($exportOptions['export_to']) {
17
- case 'xml':
18
- echo '<?xml version="1.0" encoding="UTF-8"?>';
19
-
20
- ?>
21
- <data>
22
- <?php
23
- // The Loop
24
- while ( $exportQuery->have_posts() ) :
25
-
26
- $exportQuery->the_post();
27
-
28
- $record = get_post( get_the_ID() );
29
-
30
- ?>
31
- <post>
32
- <post_type><?php echo get_post_type(); ?></post_type>
33
- <?php if ($exportOptions['is_export_title']): ?><title><?php the_title(); ?></title><?php endif; ?>
34
-
35
- <?php if ($exportOptions['is_export_content']): ?>
36
- <content><?php echo '<![CDATA['; the_content(); echo ']]>'; ?></content>
37
- <?php endif; ?>
38
-
39
- <?php if ($exportOptions['is_export_custom_fields']): ?>
40
- <custom_fields>
41
- <?php foreach (get_post_custom($record->ID) as $cur_meta_key => $cur_meta_val): ?>
42
- <?php if ( $exportOptions['export_custom_fields_logic'] == 'full_export' or ($exportOptions['export_custom_fields_logic'] == 'only' and in_array($cur_meta_key, $exportOptions['custom_fields_list']))): ?>
43
- <<?php echo $cur_meta_key; ?>><?php echo '<![CDATA[' . ((!empty($cur_meta_val) and is_array($cur_meta_val) and count($cur_meta_val) == 1) ? $cur_meta_val[0] : serialize($cur_meta_val)) . ']]>'; ?></<?php echo $cur_meta_key;?>>
44
- <?php endif; ?>
45
- <?php endforeach; ?>
46
- </custom_fields>
47
- <?php endif; ?>
48
-
49
- <?php if ($exportOptions['is_export_categories']): ?>
50
- <taxonomies>
51
- <?php
52
-
53
- global $wp_taxonomies;
54
-
55
- foreach ($wp_taxonomies as $key => $obj) {
56
-
57
- if ($exportOptions['export_categories_logic'] == 'full_export' or ($exportOptions['export_categories_logic'] == 'only' and in_array($obj->name, $exportOptions['taxonomies_list'])))
58
- {
59
- $txes_list = get_the_terms($record->ID, $obj->name);
60
-
61
- if ( ! is_wp_error($txes_list)) {
62
- $txes_new = array();
63
- if (!empty($txes_list)):
64
- foreach ($txes_list as $t) {
65
- $txes_new[] = $t->slug;
66
- }
67
- ?>
68
- <<?php echo $obj->name; ?>><?php echo implode(', ', $txes_new); ?></<?php echo $obj->name; ?>>
69
- <?php
70
- endif;
71
- }
72
- }
73
- }
74
- ?>
75
- </taxonomies>
76
- <?php endif; ?>
77
-
78
- <?php if ($exportOptions['is_export_images'] and ! empty($exportOptions['export_images_logic'])): ?>
79
-
80
- <media_gallery>
81
- <?php
82
-
83
- $attachment_imgs = get_posts( array(
84
- 'post_type' => 'attachment',
85
- 'posts_per_page' => -1,
86
- 'post_parent' => $record->ID,
87
- ) );
88
-
89
- if ( ! empty($attachment_imgs)):
90
-
91
- foreach ($attachment_imgs as $attach) {
92
- if ( wp_attachment_is_image( $attach->ID ) ){
93
- ?>
94
- <image>
95
- <?php if (in_array('urls', $exportOptions['export_images_logic'])): ?><url><?php echo wp_get_attachment_url( $attach->ID ); ?></url><?php endif;?>
96
-
97
- <?php if (in_array('meta_data', $exportOptions['export_images_logic'])): ?>
98
- <title><?php echo esc_html($attach->post_title); ?></title>
99
- <caption><?php echo esc_html($attach->post_excerpt); ?></caption>
100
- <description><?php echo $attach->post_content;?></description>
101
- <alt><?php echo get_post_meta($record->ID, '_wp_attachment_image_alt'); ?></alt>
102
- <?php endif; ?>
103
- </image>
104
- <?php
105
- }
106
- }
107
-
108
- endif;
109
-
110
- ?>
111
- </media_gallery>
112
-
113
- <?php endif; ?>
114
-
115
- <?php if ($exportOptions['is_export_other']): ?>
116
-
117
- <other_stuff>
118
-
119
- <?php if ($exportOptions['is_export_dates']): ?><date><?php echo get_post_time('U', true); ?></date><?php endif; ?>
120
- <?php if ($exportOptions['is_export_parent']): ?><parent><?php echo $record->post_parent; ?></parent><?php endif; ?>
121
- <?php if ($exportOptions['is_export_template']): ?><template><?php echo get_post_meta($record->ID, '_wp_page_template', true); ?></template><?php endif; ?>
122
- <?php if ($exportOptions['is_export_menu_order']): ?><menu_order><?php echo $record->menu_order; ?></menu_order><?php endif; ?>
123
- <?php if ($exportOptions['is_export_status']): ?><status><?php echo $record->post_status; ?></status><?php endif; ?>
124
- <?php if ($exportOptions['is_export_format']): ?><format><?php echo get_post_format($record->ID); ?></format><?php endif; ?>
125
- <?php if ($exportOptions['is_export_author']): ?><author><?php echo $record->post_author; ?></author><?php endif; ?>
126
- <?php if ($exportOptions['is_export_slug']): ?><slug><?php echo $record->guid; ?></slug><?php endif; ?>
127
- <?php if ($exportOptions['is_export_excerpt']): ?><excerpt><?php echo $record->post_excerpt; ?></excerpt><?php endif; ?>
128
- <?php if ($exportOptions['is_export_attachments']): ?>
129
- <attachments>
130
- <?php
131
-
132
- $attachment_imgs = get_posts( array(
133
- 'post_type' => 'attachment',
134
- 'posts_per_page' => -1,
135
- 'post_parent' => $record->ID,
136
- ) );
137
-
138
- if ( ! empty($attachment_imgs)):
139
-
140
- foreach ($attachment_imgs as $attach) {
141
- if ( ! wp_attachment_is_image( $attach->ID ) ){
142
- ?>
143
- <attach>
144
- <url><?php echo wp_get_attachment_url( $attach->ID ); ?></url>
145
- </attach>
146
- <?php
147
- }
148
- }
149
-
150
- endif;
151
-
152
- ?>
153
- </attachments>
154
- <?php endif; ?>
155
-
156
- </other_stuff>
157
-
158
- <?php endif; ?>
159
-
160
- </post>
161
-
162
- <?php
163
- endwhile;
164
- ?>
165
-
166
- </data>
167
- <?php
168
-
169
- break;
170
- case 'csv':
171
-
172
- // Prepare headers
173
-
174
- $headers = array();
175
-
176
- $stream = fopen("php://output", 'w');
177
-
178
- $max_attach_count = 0;
179
- $max_images_count = 0;
180
-
181
- $cf = array();
182
- $taxes = array();
183
-
184
- $articles = array();
185
-
186
- while ( $exportQuery->have_posts() ) :
187
-
188
- $attach_count = 0;
189
- $images_count = 0;
190
-
191
- $exportQuery->the_post();
192
-
193
- $record = get_post( get_the_ID() );
194
-
195
- $article = array();
196
-
197
- $article['post_type'] = $record->post_type;
198
-
199
- if ($exportOptions['is_export_title']) $article['title'] = get_the_title();
200
- if ($exportOptions['is_export_content']) $article['content'] = get_the_content();
201
-
202
- if ($exportOptions['is_export_other']):
203
- if ($exportOptions['is_export_dates']) $article['date'] = get_post_time('U', true);
204
- if ($exportOptions['is_export_parent']) $article['parent'] = $record->post_parent;
205
- if ($exportOptions['is_export_template']) $article['template'] = get_post_meta($record->ID, '_wp_page_template', true);
206
- if ($exportOptions['is_export_menu_order']) $article['menu_order'] = $record->menu_order;
207
- if ($exportOptions['is_export_status']) $article['status'] = $record->post_status;
208
- if ($exportOptions['is_export_format']) $article['format'] = get_post_format($record->ID);
209
- if ($exportOptions['is_export_author']) $article['author'] = $record->post_author;
210
- if ($exportOptions['is_export_slug']) $article['slug'] = $record->guid;
211
- if ($exportOptions['is_export_excerpt']) $article['excerpt'] = $record->post_excerpt;
212
- if ($exportOptions['is_export_attachments']):
213
- $attachment_imgs = get_posts( array(
214
- 'post_type' => 'attachment',
215
- 'posts_per_page' => -1,
216
- 'post_parent' => $record->ID,
217
- ) );
218
-
219
- if ( ! empty($attachment_imgs)):
220
-
221
- foreach ($attachment_imgs as $key => $attach) {
222
- if ( ! wp_attachment_is_image( $attach->ID ) ){
223
- $article['attach_' . ($key + 1)] = wp_get_attachment_url( $attach->ID );
224
- $attach_count++;
225
- }
226
- }
227
-
228
- if ($attach_count > $max_attach_count) $max_attach_count = $attach_count;
229
-
230
- endif;
231
- endif;
232
- endif;
233
-
234
- if ($exportOptions['is_export_custom_fields']):
235
-
236
- foreach (get_post_custom($record->ID) as $cur_meta_key => $cur_meta_val):
237
- if ( $exportOptions['export_custom_fields_logic'] == 'full_export' or ($exportOptions['export_custom_fields_logic'] == 'only' and in_array($cur_meta_key, $exportOptions['custom_fields_list']))):
238
- $article['CF_' . $cur_meta_key] = ((!empty($cur_meta_val) and is_array($cur_meta_val) and count($cur_meta_val) == 1) ? $cur_meta_val[0] : serialize($cur_meta_val));
239
-
240
- if (!in_array('CF_' . $cur_meta_key, $cf)) $cf[] = 'CF_' . $cur_meta_key;
241
-
242
- endif;
243
- endforeach;
244
-
245
- endif;
246
-
247
- if ($exportOptions['is_export_categories']):
248
-
249
- global $wp_taxonomies;
250
-
251
- foreach ($wp_taxonomies as $key => $obj) {
252
-
253
- if ($exportOptions['export_categories_logic'] == 'full_export' or ($exportOptions['export_categories_logic'] == 'only' and in_array($obj->name, $exportOptions['taxonomies_list'])))
254
- {
255
- $txes_list = get_the_terms($record->ID, $obj->name);
256
-
257
- if ( ! is_wp_error($txes_list)) {
258
- $txes_new = array();
259
- if (!empty($txes_list)):
260
- foreach ($txes_list as $t) {
261
- $txes_new[] = $t->slug;
262
- }
263
- $article['TX_' . $obj->name] = implode('|', $txes_new);
264
-
265
- if (!in_array('TX_' . $obj->name, $taxes)) $taxes[] = 'TX_' . $obj->name;
266
-
267
- endif;
268
- }
269
- }
270
- }
271
-
272
- endif;
273
-
274
- if ($exportOptions['is_export_images'] and ! empty($exportOptions['export_images_logic'])):
275
-
276
- $attachment_imgs = get_posts( array(
277
- 'post_type' => 'attachment',
278
- 'posts_per_page' => -1,
279
- 'post_parent' => $record->ID,
280
- ) );
281
-
282
- if ( ! empty($attachment_imgs)):
283
-
284
- foreach ($attachment_imgs as $key => $attach) {
285
- if ( wp_attachment_is_image( $attach->ID ) ){
286
- if (in_array('urls', $exportOptions['export_images_logic'])) $article['image_url_' . ($key + 1)] = wp_get_attachment_url( $attach->ID );
287
-
288
- if (in_array('meta_data', $exportOptions['export_images_logic'])):
289
- $article['image_title_' . ($key + 1)] = $attach->post_title;
290
- $article['image_caption_' . ($key + 1)] = $attach->post_excerpt;
291
- $article['image_description_' . ($key + 1)] = $attach->post_content;
292
- $article['image_alt_' . ($key + 1)] = get_post_meta($record->ID, '_wp_attachment_image_alt');
293
- endif;
294
-
295
- $images_count++;
296
- }
297
- }
298
-
299
- if ($max_images_count > $images_count) $max_images_count = $images_count;
300
-
301
- endif;
302
-
303
- endif;
304
-
305
- $articles[] = $article;
306
-
307
- //fputcsv($stream, $article);
308
-
309
- endwhile;
310
-
311
- $headers[] = 'post_type';
312
-
313
- if ($exportOptions['is_export_title']) $headers[] = 'title';
314
- if ($exportOptions['is_export_content']) $headers[] = 'content';
315
-
316
- if ($exportOptions['is_export_other']):
317
- if ($exportOptions['is_export_dates']) $headers[] = 'date';
318
- if ($exportOptions['is_export_parent']) $headers[] = 'parent';
319
- if ($exportOptions['is_export_template']) $headers[] = 'template';
320
- if ($exportOptions['is_export_menu_order']) $headers[] = 'menu_order';
321
- if ($exportOptions['is_export_status']) $headers[] = 'status';
322
- if ($exportOptions['is_export_format']) $headers[] = 'format';
323
- if ($exportOptions['is_export_author']) $headers[] = 'author';
324
- if ($exportOptions['is_export_slug']) $headers[] = 'slug';
325
- if ($exportOptions['is_export_excerpt']) $headers[] = 'excerpt';
326
-
327
- for ($i = 0; $i < $max_attach_count; $i++){
328
- $headers[] = 'attach_' . ($i + 1);
329
- }
330
-
331
- endif;
332
-
333
- if (!empty($cf)){
334
- foreach ($cf as $cf_key) {
335
- $headers[] = $cf_key;
336
- }
337
- }
338
-
339
- if (!empty($taxes)){
340
- foreach ($taxes as $tx) {
341
- $headers[] = $tx;
342
- }
343
- }
344
-
345
- for ($i = 0; $i < $max_images_count; $i++){
346
-
347
- if (in_array('urls', $exportOptions['export_images_logic'])) $headers[] = 'image_url_' . ($i + 1);
348
-
349
- if (in_array('meta_data', $exportOptions['export_images_logic'])):
350
- $headers[] = 'image_title_' . ($i + 1);
351
- $headers[] = 'image_caption_' . ($i + 1);
352
- $headers[] = 'image_description_' . ($i + 1);
353
- $headers[] = 'image_alt_' . ($i + 1);
354
- endif;
355
-
356
- }
357
-
358
- fputcsv($stream, $headers);
359
-
360
- foreach ($articles as $article) {
361
- $line = array();
362
- foreach ($headers as $header) {
363
- $line[$header] = (!empty($article[$header])) ? $article[$header] : '';
364
- }
365
- fputcsv($stream, $line);
366
- }
367
-
368
- break;
369
-
370
- default:
371
- # code...
372
- break;
373
- }
374
-
375
- wp_reset_postdata();
376
-
377
- $export_file = $wp_uploads['path'] . '/' . time() . '.' . $exportOptions['export_to'];
378
-
379
- if (@file_exists($export_file)) @unlink($export_file);
380
-
381
- file_put_contents($export_file, ob_get_clean());
382
-
383
- if ( file_exists($export_file)){
384
- $wp_filetype = wp_check_filetype(basename($export_file), null );
385
- $attachment_data = array(
386
- 'guid' => $wp_uploads['baseurl'] . '/' . _wp_relative_upload_path( $export_file ),
387
- 'post_mime_type' => $wp_filetype['type'],
388
- 'post_title' => preg_replace('/\.[^.]+$/', '', basename($export_file)),
389
- 'post_content' => '',
390
- 'post_status' => 'inherit'
391
- );
392
- $attach_id = wp_insert_attachment( $attachment_data, $export_file );
393
- }
394
-
395
- PMXE_Plugin::$session['pmxe_export']['export_file'] = $export_file;
396
-
397
- pmxe_session_commit();
398
-
399
- exit(json_encode(array('file' => $export_file))); die;
400
-
401
- }
402
-
403
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
actions/wp_ajax_export_available_rules.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function pmxe_wp_ajax_export_available_rules(){
4
+
5
+ if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
6
+ exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
+ }
8
+
9
+ if ( ! current_user_can('manage_options') ){
10
+ exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
+ }
12
+
13
+ ob_start();
14
+
15
+ $input = new PMXE_Input();
16
+
17
+ $post = $input->post('data', array());
18
+
19
+ ?>
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">IN</option>
28
+ <option value="not_in">NOT IN</option>
29
+
30
+ <!-- Custom Fields -->
31
+ <!--option value="between">BETWEEN</option-->
32
+
33
+ <?php
34
+ }
35
+ else
36
+ {
37
+ ?>
38
+ <option value="equals"><?php _e('equals', 'wp_all_export_plugin'); ?></option>
39
+ <option value="not_equals"><?php _e('not equals', 'wp_all_export_plugin'); ?></option>
40
+ <option value="greater"><?php _e('greater than', 'wp_all_export_plugin');?></option>
41
+ <option value="equals_or_greater"><?php _e('equals or greater than', 'wp_all_export_plugin'); ?></option>
42
+ <option value="less"><?php _e('less than', 'wp_all_export_plugin'); ?></option>
43
+ <option value="equals_or_less"><?php _e('equals or less than', 'wp_all_export_plugin'); ?></option>
44
+
45
+ <option value="contains"><?php _e('contains', 'wp_all_export_plugin'); ?></option>
46
+ <option value="not_contains"><?php _e('not contains', 'wp_all_export_plugin'); ?></option>
47
+ <option value="is_empty"><?php _e('is empty', 'wp_all_export_plugin'); ?></option>
48
+ <option value="is_not_empty"><?php _e('is not empty', 'wp_all_export_plugin'); ?></option>
49
+ <?php
50
+ }
51
+ ?>
52
+ </select>
53
+ <?php
54
+
55
+ exit(json_encode(array('html' => ob_get_clean()))); die;
56
+
57
+ }
actions/wp_ajax_export_filtering.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function pmxe_wp_ajax_export_filtering(){
4
+
5
+ if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
6
+ exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
+ }
8
+
9
+ if ( ! current_user_can('manage_options') ){
10
+ exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
+ }
12
+
13
+ ob_start();
14
+
15
+ $errors = new WP_Error();
16
+
17
+ $input = new PMXE_Input();
18
+
19
+ $post = $input->post('data', array());
20
+
21
+ if ( ! empty($post['cpt'])):
22
+
23
+ $engine = new XmlExportEngine($post, $errors);
24
+
25
+ $engine->init_available_data();
26
+
27
+ ?>
28
+ <div class="wpallexport-content-section">
29
+ <div class="wpallexport-collapsed-header">
30
+ <h3><?php _e('Add Filtering Options', 'wp_all_export_plugin'); ?></h3>
31
+ </div>
32
+ <div class="wpallexport-collapsed-content">
33
+ <div class="wpallexport-free-edition-notice" style="padding: 20px; margin-bottom: 10px;">
34
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=filter-rules&amp;utm_campaign=free+wp+all+export+plugin"><?php _e(' Filtering Options Upgrade to the professional edition of WP All Export to add filtering rules.','wp_all_export_plugin');?></a>
35
+ </div>
36
+ <div class="wp_all_export_rule_inputs">
37
+ <table>
38
+ <tr>
39
+ <th><?php _e('Element', 'wp_all_export_plugin'); ?></th>
40
+ <th><?php _e('Rule', 'wp_all_export_plugin'); ?></th>
41
+ <th><?php _e('Value', 'wp_all_export_plugin'); ?></th>
42
+ <th>&nbsp;</th>
43
+ </tr>
44
+ <tr>
45
+ <td style="width: 25%;">
46
+ <select id="wp_all_export_xml_element">
47
+ <option value=""><?php _e('Select Element', 'wp_all_export_plugin'); ?></option>
48
+ <?php echo $engine->render_filters(); ?>
49
+ </select>
50
+ </td>
51
+ <td style="width: 25%;" id="wp_all_export_available_rules">
52
+ <select id="wp_all_export_rule">
53
+ <option value=""><?php _e('Select Rule', 'wp_all_export_plugin'); ?></option>
54
+ </select>
55
+ </td>
56
+ <td style="width: 25%;">
57
+ <input id="wp_all_export_value" type="text" placeholder="value" value="" disabled="disabled"/>
58
+ </td>
59
+ <td style="width: 15%;">
60
+ <a id="wp_all_export_add_rule" href="javascript:void(0);"><?php _e('Add Rule', 'wp_all_export_plugin');?></a>
61
+ </td>
62
+ </tr>
63
+ </table>
64
+ </div>
65
+ <div id="wpallexport-filters" style="padding:0;">
66
+ <div class="wpallexport-content-section" style="padding:0; border: none;">
67
+ <fieldset id="wp_all_export_filtering_rules">
68
+ <?php
69
+ $filter_rules = PMXE_Plugin::$session->get('filter_rules_hierarhy');
70
+ $filter_rules_hierarhy = json_decode($filter_rules);
71
+ ?>
72
+ <p style="margin:20px 0 5px; text-align:center; <?php if (!empty($filter_rules_hierarhy)):?> display:none;<?php endif; ?>"><?php _e('No filtering options. Add filtering options to only export records matching some specified criteria.', 'wp_all_export_plugin');?></p>
73
+ <ol class="wp_all_export_filtering_rules">
74
+ <?php
75
+ if ( ! empty($filter_rules_hierarhy) and is_array($filter_rules_hierarhy) ):
76
+ $rulenumber = 0;
77
+ foreach ($filter_rules_hierarhy as $rule) {
78
+
79
+ if ( is_null($rule->parent_id) )
80
+ {
81
+ $rulenumber++;
82
+ ?>
83
+ <li id="item_<?php echo $rulenumber;?>" class="dragging">
84
+ <div class="drag-element">
85
+ <input type="hidden" value="<?php echo $rule->element; ?>" class="wp_all_export_xml_element" name="wp_all_export_xml_element[<?php echo $rulenumber; ?>]"/>
86
+ <input type="hidden" value="<?php echo $rule->title; ?>" class="wp_all_export_xml_element_title" name="wp_all_export_xml_element_title[<?php echo $rulenumber; ?>]"/>
87
+ <input type="hidden" value="<?php echo $rule->condition; ?>" class="wp_all_export_rule" name="wp_all_export_rule[<?php echo $rulenumber; ?>]"/>
88
+ <input type="hidden" value="<?php echo $rule->value; ?>" class="wp_all_export_value" name="wp_all_export_value[<?php echo $rulenumber; ?>]"/>
89
+ <span class="rule_element"><?php echo $rule->title; ?></span>
90
+ <span class="rule_as_is"><?php echo $rule->condition; ?></span>
91
+ <span class="rule_condition_value"><?php echo $rule->value; ?></span>
92
+ <span class="condition" <?php if ($rulenumber == count($filter_rules_hierarhy)):?>style="display:none;"<?php endif; ?>>
93
+ <label for="rule_and_<?php echo $rulenumber; ?>">AND</label>
94
+ <input id="rule_and_<?php echo $rulenumber; ?>" type="radio" value="and" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'AND'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
95
+ <label for="rule_or_<?php echo $rulenumber; ?>">OR</label>
96
+ <input id="rule_or_<?php echo $rulenumber; ?>" type="radio" value="or" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'OR'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
97
+ </span>
98
+ </div>
99
+ <a href="javascript:void(0);" class="icon-item remove-ico"></a>
100
+ <?php echo wp_all_export_reverse_rules_html($filter_rules_hierarhy, $rule, $rulenumber); ?>
101
+ </li>
102
+ <?php
103
+ }
104
+ }
105
+ endif;
106
+ ?>
107
+ </ol>
108
+ <div class="clear"></div>
109
+ <div class="ajax-console" id="filtering_result">
110
+
111
+ </div>
112
+ <!--a href="javascript:void(0);" id="wp_all_export_apply_filters" <?php if (empty($filter_rules_hierarhy)):?>style="display:none;"<?php endif; ?>><?php _e('Apply Filters To Export Data', 'wp_all_export_plugin');?></a-->
113
+ <div class="wp_all_export_filter_preloader"></div>
114
+ </fieldset>
115
+
116
+ <?php if ( "product" == $post["cpt"] and class_exists('WooCommerce')) : ?>
117
+
118
+ <div class="input wp_all_export_product_matching_mode" <?php if (empty($filter_rules_hierarhy)): ?>style="display:none;"<?php endif; ?>>
119
+ <?php $product_matching_mode = PMXE_Plugin::$session->get('product_matching_mode'); ?>
120
+ <label><?php _e("Variable product matching rules: ", "wp_all_export_plugin"); ?></label>
121
+ <select name="product_matching_mode">
122
+ <option value="strict" <?php echo ( $product_matching_mode == 'strict' ) ? 'selected="selected"' : ''; ?>><?php _e("Strict", "wp_all_export_plugin"); ?></option>
123
+ <option value="permissive" <?php echo ( $product_matching_mode == 'permissive' ) ? 'selected="selected"' : ''; ?>><?php _e("Permissive", "wp_all_export_plugin"); ?></option>
124
+ </select>
125
+ <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('Strict matching requires all variations to pass in order for the product to be exported. Permissive matching allows the product to be exported if any of the variations pass.', 'wp_all_export_plugin'); ?>">?</a>
126
+ </div>
127
+
128
+ <?php endif; ?>
129
+
130
+
131
+
132
+ </div>
133
+ </div>
134
+ </div>
135
+ </div>
136
+
137
+ <?php
138
+
139
+ endif;
140
+
141
+ exit(json_encode(array('html' => ob_get_clean()))); die;
142
+
143
+ }
actions/wp_ajax_export_filtering_count.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function pmxe_wp_ajax_export_filtering_count(){
4
+
5
+ if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
6
+ exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
7
+ }
8
+
9
+ if ( ! current_user_can('manage_options') ){
10
+ exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
11
+ }
12
+
13
+ ob_start();
14
+
15
+ $input = new PMXE_Input();
16
+
17
+ $post = $input->post('data', array());
18
+
19
+ $filter_args = array(
20
+ 'filter_rules_hierarhy' => $post['filter_rules_hierarhy'],
21
+ 'product_matching_mode' => $post['product_matching_mode']
22
+ );
23
+
24
+ XmlExportEngine::$is_user_export = ( 'users' == $post['cpt'] ) ? true : false;
25
+ XmlExportEngine::$post_types = array($post['cpt']);
26
+
27
+ $found_records = 0;
28
+
29
+ if ( 'users' == $post['cpt'] )
30
+ {
31
+ $exportQuery = new WP_User_Query( array( 'orderby' => 'ID', 'order' => 'ASC', 'number' => 10 ));
32
+
33
+ if ( ! empty($exportQuery->results)){
34
+ $found_records = $exportQuery->get_total();
35
+ }
36
+ }
37
+ else
38
+ {
39
+ $exportQuery = new WP_Query( array( 'post_type' => $post['cpt'], 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
40
+
41
+ if ( ! empty($exportQuery->found_posts)){
42
+ $found_records = $exportQuery->found_posts;
43
+ }
44
+ }
45
+
46
+ ?>
47
+ <div class="founded_records">
48
+ <?php if ($found_records > 0) :?>
49
+ <h3><span class="matches_count"><?php echo $found_records; ?></span> <strong><?php echo wp_all_export_get_cpt_name(array($post['cpt']), $found_records); ?></strong> will be exported</h3>
50
+ <h4><?php _e("Continue to Step 2 to choose data to include in the export file."); ?></h4>
51
+ <?php else: ?>
52
+ <h4 style="line-height:60px;"><?php printf(__("No matching %s found for selected filter rules"), wp_all_export_get_cpt_name(array($post['cpt']))); ?></h4>
53
+ <?php endif; ?>
54
+ </div>
55
+ <?php
56
+
57
+ exit(json_encode(array('html' => ob_get_clean()))); die;
58
+
59
+ }
actions/wp_ajax_export_preview.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AJAX action for preview export row
4
+ */
5
+ function pmxe_wp_ajax_export_preview(){
6
+
7
+ if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
8
+ exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
9
+ }
10
+
11
+ if ( ! current_user_can('manage_options') ){
12
+ exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
13
+ }
14
+
15
+ ob_start();
16
+
17
+ $values = array();
18
+
19
+ parse_str($_POST['data'], $values);
20
+
21
+ $exportOptions = $values + (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + PMXE_Plugin::get_default_import_options();
22
+
23
+ XmlExportEngine::$exportOptions = $exportOptions;
24
+ XmlExportEngine::$is_user_export = $exportOptions['is_user_export'];
25
+
26
+ if ( 'advanced' == $exportOptions['export_type'] )
27
+ {
28
+ if ( XmlExportEngine::$is_user_export )
29
+ {
30
+ exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
31
+ }
32
+ else
33
+ {
34
+ $exportQuery = eval('return new WP_Query(array(' . $exportOptions['wp_query'] . ', \'offset\' => 0, \'posts_per_page\' => 10));');
35
+ }
36
+ }
37
+ else
38
+ {
39
+ XmlExportEngine::$post_types = $exportOptions['cpt'];
40
+
41
+ if ( ! in_array('users', $exportOptions['cpt']))
42
+ {
43
+ $exportQuery = new WP_Query( array( 'post_type' => $exportOptions['cpt'], 'post_status' => 'any', 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => 10 ));
44
+ }
45
+ else
46
+ {
47
+ exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
48
+ }
49
+ }
50
+
51
+ XmlExportEngine::$exportQuery = $exportQuery;
52
+
53
+ ?>
54
+
55
+ <div id="post-preview" class="wpallexport-preview">
56
+
57
+ <div class="wpallexport-preview-content">
58
+
59
+ <?php
60
+
61
+ switch ($exportOptions['export_to']) {
62
+
63
+ case 'xml':
64
+
65
+ $dom = new DOMDocument('1.0', $exportOptions['encoding']);
66
+ $old = libxml_use_internal_errors(true);
67
+ $xml = pmxe_export_xml($exportQuery, $exportOptions, true);
68
+ $dom->loadXML($xml);
69
+ libxml_use_internal_errors($old);
70
+ $xpath = new DOMXPath($dom);
71
+ if (($elements = @$xpath->query('/data')) and $elements->length){
72
+ pmxe_render_xml_element($elements->item( 0 ), true);
73
+ }
74
+
75
+ break;
76
+
77
+ case 'csv':
78
+ ?>
79
+ <small>
80
+ <?php
81
+ $csv = pmxe_export_csv($exportQuery, $exportOptions, true);
82
+ if (!empty($csv)){
83
+ $csv_rows = array_filter(explode("\n", $csv));
84
+ if ($csv_rows){
85
+ ?>
86
+ <table class="pmxe_preview" cellpadding="0" cellspacing="0">
87
+ <?php
88
+ foreach ($csv_rows as $rkey => $row) {
89
+ $cells = str_getcsv($row, $exportOptions['delimiter']);
90
+ if ($cells){
91
+ ?>
92
+ <tr>
93
+ <?php
94
+ foreach ($cells as $key => $value) {
95
+ ?>
96
+ <td>
97
+ <?php if (!$rkey):?><strong><?php endif;?>
98
+ <?php echo $value; ?>
99
+ <?php if (!$rkey):?></strong><?php endif;?>
100
+ </td>
101
+ <?php
102
+ }
103
+ ?>
104
+ </tr>
105
+ <?php
106
+ }
107
+ }
108
+ ?>
109
+ </table>
110
+ <?php
111
+ }
112
+ }
113
+ else{
114
+ _e('Data not found.', 'pmxe_plugin');
115
+ }
116
+ ?>
117
+ </small>
118
+ <?php
119
+ break;
120
+
121
+ default:
122
+
123
+ _e('This format is not supported.', 'pmxe_plugin');
124
+
125
+ break;
126
+ }
127
+ wp_reset_postdata();
128
+ ?>
129
+
130
+ </div>
131
+
132
+ </div>
133
+
134
+ <?php
135
+
136
+ exit(json_encode(array('html' => ob_get_clean()))); die;
137
+ }
actions/wp_ajax_wpallexport.php ADDED
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AJAX action export processing
4
+ */
5
+ function pmxe_wp_ajax_wpallexport(){
6
+
7
+ if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
8
+ exit( __('Security check', 'wp_all_export_plugin') );
9
+ }
10
+
11
+ if ( ! current_user_can('manage_options') ){
12
+ exit( __('Security check', 'wp_all_export_plugin') );
13
+ }
14
+
15
+ $wp_uploads = wp_upload_dir();
16
+
17
+ $export = new PMXE_Export_Record();
18
+
19
+ $export->getById(PMXE_Plugin::$session->update_previous);
20
+
21
+ $exportOptions = (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + PMXE_Plugin::get_default_import_options();
22
+
23
+ wp_reset_postdata();
24
+
25
+ XmlExportEngine::$exportOptions = $exportOptions;
26
+ XmlExportEngine::$is_user_export = $exportOptions['is_user_export'];
27
+
28
+ $posts_per_page = $exportOptions['records_per_iteration'];
29
+
30
+ if ('advanced' == $exportOptions['export_type'])
31
+ {
32
+ if (XmlExportEngine::$is_user_export)
33
+ {
34
+ exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
35
+ }
36
+ else
37
+ {
38
+ $exportQuery = eval('return new WP_Query(array(' . $exportOptions['wp_query'] . ', \'orderby\' => \'ID\', \'order\' => \'ASC\', \'offset\' => ' . $export->exported . ', \'posts_per_page\' => ' . $posts_per_page . ' ));');
39
+ }
40
+ }
41
+ else
42
+ {
43
+ XmlExportEngine::$post_types = $exportOptions['cpt'];
44
+
45
+ if ( ! in_array('users', $exportOptions['cpt']))
46
+ {
47
+ $exportQuery = new WP_Query( array( 'post_type' => $exportOptions['cpt'], 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'offset' => $export->exported, 'posts_per_page' => $posts_per_page ));
48
+ }
49
+ else
50
+ {
51
+ exit( json_encode(array('html' => __('Upgrade to the professional edition of WP All Export to export users.', 'wp_all_export_plugin'))) );
52
+ }
53
+ }
54
+
55
+ XmlExportEngine::$exportQuery = $exportQuery;
56
+
57
+ $foundPosts = ( ! XmlExportEngine::$is_user_export ) ? $exportQuery->found_posts : $exportQuery->get_total();
58
+
59
+ $postCount = ( ! XmlExportEngine::$is_user_export ) ? $exportQuery->post_count : count($exportQuery->get_results());
60
+
61
+ if ( ! $export->exported )
62
+ {
63
+ if ( ! empty($export->attch_id)){
64
+ wp_delete_attachment($export->attch_id, true);
65
+ }
66
+
67
+ $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
68
+
69
+ if ( $is_secure_import and ! empty($exportOptions['filepath'])){
70
+
71
+ wp_all_export_remove_source(wp_all_export_get_absolute_path($exportOptions['filepath']));
72
+
73
+ $exportOptions['filepath'] = '';
74
+
75
+ }
76
+
77
+ PMXE_Plugin::$session->set('count', $foundPosts);
78
+ PMXE_Plugin::$session->save_data();
79
+ }
80
+
81
+ // if posts still exists then export them
82
+ if ( $postCount )
83
+ {
84
+ switch ( $exportOptions['export_to'] ) {
85
+
86
+ case 'xml':
87
+
88
+ pmxe_export_xml($exportQuery, $exportOptions);
89
+
90
+ break;
91
+
92
+ case 'csv':
93
+
94
+ pmxe_export_csv($exportQuery, $exportOptions);
95
+
96
+ break;
97
+
98
+ default:
99
+ # code...
100
+ break;
101
+ }
102
+
103
+ wp_reset_postdata();
104
+
105
+ }
106
+
107
+ if ($postCount){
108
+
109
+ $export->set(array(
110
+ 'exported' => $export->exported + $postCount
111
+ ))->save();
112
+
113
+ }
114
+
115
+ if ($posts_per_page != -1 and $postCount){
116
+
117
+ wp_send_json(array(
118
+ 'exported' => $export->exported,
119
+ 'percentage' => ceil(($export->exported/$foundPosts) * 100),
120
+ 'done' => false,
121
+ 'records_per_request' => $exportOptions['records_per_iteration']
122
+ ));
123
+
124
+ }
125
+ else
126
+ {
127
+
128
+ wp_reset_postdata();
129
+
130
+ if ( file_exists(PMXE_Plugin::$session->file)){
131
+
132
+ if ($exportOptions['export_to'] == 'xml') file_put_contents(PMXE_Plugin::$session->file, '</data>', FILE_APPEND);
133
+
134
+ $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
135
+
136
+ if ( ! $is_secure_import ){
137
+
138
+ $wp_filetype = wp_check_filetype(basename(PMXE_Plugin::$session->file), null );
139
+ $attachment_data = array(
140
+ 'guid' => $wp_uploads['baseurl'] . '/' . _wp_relative_upload_path( PMXE_Plugin::$session->file ),
141
+ 'post_mime_type' => $wp_filetype['type'],
142
+ 'post_title' => preg_replace('/\.[^.]+$/', '', basename(PMXE_Plugin::$session->file)),
143
+ 'post_content' => '',
144
+ 'post_status' => 'inherit'
145
+ );
146
+
147
+ $attach_id = wp_insert_attachment( $attachment_data, PMXE_Plugin::$session->file );
148
+ if ( ! $export->isEmpty() ){
149
+ $export->set(array(
150
+ 'attch_id' => $attach_id
151
+ ))->save();
152
+ }
153
+
154
+ }
155
+ else{
156
+
157
+ $exportOptions['filepath'] = wp_all_export_get_relative_path(PMXE_Plugin::$session->file);
158
+
159
+ if ( ! $export->isEmpty() ){
160
+ $export->set(array(
161
+ 'options' => $exportOptions
162
+ ))->save();
163
+ }
164
+
165
+ }
166
+
167
+ if ( wp_all_export_is_compatible() and ($exportOptions['is_generate_templates'] or $exportOptions['is_generate_import'])){
168
+
169
+ $custom_type = (empty($exportOptions['cpt'])) ? 'post' : $exportOptions['cpt'][0];
170
+
171
+ $templateOptions = array(
172
+ 'type' => ( ! empty($exportOptions['cpt']) and $exportOptions['cpt'][0] == 'page') ? 'page' : 'post',
173
+ 'wizard_type' => 'new',
174
+ 'deligate' => 'wpallexport',
175
+ 'custom_type' => (XmlExportEngine::$is_user_export) ? 'import_users' : $custom_type,
176
+ 'status' => 'xpath',
177
+ 'is_multiple_page_parent' => 'no',
178
+ 'unique_key' => '',
179
+ 'acf' => array(),
180
+ 'fields' => array(),
181
+ 'is_multiple_field_value' => array(),
182
+ 'multiple_value' => array(),
183
+ 'fields_delimiter' => array(),
184
+
185
+ 'update_all_data' => 'no',
186
+ 'is_update_status' => 0,
187
+ 'is_update_title' => 0,
188
+ 'is_update_author' => 0,
189
+ 'is_update_slug' => 0,
190
+ 'is_update_content' => 0,
191
+ 'is_update_excerpt' => 0,
192
+ 'is_update_dates' => 0,
193
+ 'is_update_menu_order' => 0,
194
+ 'is_update_parent' => 0,
195
+ 'is_update_attachments' => 0,
196
+ 'is_update_acf' => 0,
197
+ 'update_acf_logic' => 'only',
198
+ 'acf_list' => '',
199
+ 'is_update_product_type' => 0,
200
+ 'is_update_attributes' => 0,
201
+ 'update_attributes_logic' => 'only',
202
+ 'attributes_list' => '',
203
+ 'is_update_images' => 0,
204
+ 'is_update_custom_fields' => 0,
205
+ 'update_custom_fields_logic' => 'only',
206
+ 'custom_fields_list' => '',
207
+ 'is_update_categories' => 0,
208
+ 'update_categories_logic' => 'only',
209
+ 'taxonomies_list' => '',
210
+ 'export_id' => $export->id
211
+ );
212
+
213
+ if ( in_array('product', $exportOptions['cpt']) )
214
+ {
215
+ $templateOptions['_virtual'] = 1;
216
+ $templateOptions['_downloadable'] = 1;
217
+ }
218
+
219
+ if ( XmlExportEngine::$is_user_export )
220
+ {
221
+ $templateOptions['is_update_first_name'] = 0;
222
+ $templateOptions['is_update_last_name'] = 0;
223
+ $templateOptions['is_update_role'] = 0;
224
+ $templateOptions['is_update_nickname'] = 0;
225
+ $templateOptions['is_update_description'] = 0;
226
+ $templateOptions['is_update_login'] = 0;
227
+ $templateOptions['is_update_password'] = 0;
228
+ $templateOptions['is_update_nicename'] = 0;
229
+ $templateOptions['is_update_email'] = 0;
230
+ $templateOptions['is_update_registered'] = 0;
231
+ $templateOptions['is_update_display_name'] = 0;
232
+ $templateOptions['is_update_url'] = 0;
233
+ }
234
+
235
+ if ( 'xml' == $exportOptions['export_to'] )
236
+ {
237
+ wp_all_export_prepare_template_xml($exportOptions, $templateOptions);
238
+ }
239
+ else
240
+ {
241
+ wp_all_export_prepare_template_csv($exportOptions, $templateOptions);
242
+ }
243
+
244
+ $options = $templateOptions + PMXI_Plugin::get_default_import_options();
245
+
246
+ if ($exportOptions['is_generate_templates']){
247
+
248
+ $template = new PMXI_Template_Record();
249
+
250
+ $tpl_options = $options;
251
+
252
+ if ( 'csv' == $exportOptions['export_to'] )
253
+ {
254
+ $tpl_options['delimiter'] = $exportOptions['delimiter'];
255
+ }
256
+
257
+ $tpl_options['update_all_data'] = 'yes';
258
+ $tpl_options['is_update_status'] = 1;
259
+ $tpl_options['is_update_title'] = 1;
260
+ $tpl_options['is_update_author'] = 1;
261
+ $tpl_options['is_update_slug'] = 1;
262
+ $tpl_options['is_update_content'] = 1;
263
+ $tpl_options['is_update_excerpt'] = 1;
264
+ $tpl_options['is_update_dates'] = 1;
265
+ $tpl_options['is_update_menu_order'] = 1;
266
+ $tpl_options['is_update_parent'] = 1;
267
+ $tpl_options['is_update_attachments'] = 1;
268
+ $tpl_options['is_update_acf'] = 1;
269
+ $tpl_options['update_acf_logic'] = 'full_update';
270
+ $tpl_options['acf_list'] = '';
271
+ $tpl_options['is_update_product_type'] = 1;
272
+ $tpl_options['is_update_attributes'] = 1;
273
+ $tpl_options['update_attributes_logic'] = 'full_update';
274
+ $tpl_options['attributes_list'] = '';
275
+ $tpl_options['is_update_images'] = 1;
276
+ $tpl_options['is_update_custom_fields'] = 1;
277
+ $tpl_options['update_custom_fields_logic'] = 'full_update';
278
+ $tpl_options['custom_fields_list'] = '';
279
+ $tpl_options['is_update_categories'] = 1;
280
+ $tpl_options['update_categories_logic'] = 'full_update';
281
+ $tpl_options['taxonomies_list'] = '';
282
+
283
+ $tpl_data = array(
284
+ 'name' => $exportOptions['template_name'],
285
+ 'is_keep_linebreaks' => 0,
286
+ 'is_leave_html' => 0,
287
+ 'fix_characters' => 0,
288
+ 'options' => $tpl_options,
289
+ );
290
+
291
+ if ( ! empty($exportOptions['template_name'])) { // save template in database
292
+ $template->getByName($exportOptions['template_name'])->set($tpl_data)->save();
293
+ }
294
+
295
+ }
296
+
297
+ // associate exported posts with new import
298
+ if ($exportOptions['is_generate_import']){
299
+
300
+ $import = new PMXI_Import_Record();
301
+
302
+ $import->getById($exportOptions['import_id']);
303
+
304
+ if ( ! $import->isEmpty() and $import->parent_import_id == 99999 ){
305
+
306
+ $xmlPath = PMXE_Plugin::$session->file;
307
+
308
+ $root_element = '';
309
+
310
+ $historyPath = PMXE_Plugin::$session->file;
311
+
312
+ if ( 'csv' == $exportOptions['export_to'] )
313
+ {
314
+ $options['delimiter'] = $exportOptions['delimiter'];
315
+
316
+ include_once( PMXI_Plugin::ROOT_DIR . '/libraries/XmlImportCsvParse.php' );
317
+
318
+ $path_info = pathinfo($xmlPath);
319
+
320
+ $path_parts = explode(DIRECTORY_SEPARATOR, $path_info['dirname']);
321
+
322
+ $security_folder = array_pop($path_parts);
323
+
324
+ $target = $is_secure_import ? $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY . DIRECTORY_SEPARATOR . $security_folder : $wp_uploads['path'];
325
+
326
+ $csv = new PMXI_CsvParser( array( 'filename' => $xmlPath, 'targetDir' => $target ) );
327
+
328
+ $historyPath = $csv->xml_path;
329
+
330
+ $root_element = 'node';
331
+
332
+ }
333
+ else
334
+ {
335
+ $root_element = 'post';
336
+ }
337
+
338
+ $import->set(array(
339
+ //'parent_import_id' => 99999,
340
+ 'xpath' => '/' . $root_element,
341
+ 'type' => 'upload',
342
+ 'options' => $options,
343
+ 'root_element' => $root_element,
344
+ 'path' => $xmlPath,
345
+ 'name' => basename($xmlPath),
346
+ 'imported' => 0,
347
+ 'created' => 0,
348
+ 'updated' => 0,
349
+ 'skipped' => 0,
350
+ 'deleted' => 0,
351
+ 'iteration' => 1,
352
+ 'count' => PMXE_Plugin::$session->count
353
+ ))->save();
354
+
355
+ $history_file = new PMXI_File_Record();
356
+ $history_file->set(array(
357
+ 'name' => $import->name,
358
+ 'import_id' => $import->id,
359
+ 'path' => $historyPath,
360
+ 'registered_on' => date('Y-m-d H:i:s')
361
+ ))->save();
362
+
363
+ $exportOptions['import_id'] = $import->id;
364
+
365
+ $export->set(array(
366
+ 'options' => $exportOptions
367
+ ))->save();
368
+ }
369
+ }
370
+ }
371
+ }
372
+
373
+ $export->set(array(
374
+ 'executing' => 0,
375
+ 'canceled' => 0
376
+ ))->save();
377
+
378
+ do_action('pmxe_after_export', $export->id);
379
+
380
+ wp_send_json(array(
381
+ 'exported' => $export->exported,
382
+ 'percentage' => 100,
383
+ 'done' => true,
384
+ 'records_per_request' => $exportOptions['records_per_iteration'],
385
+ 'file' => PMXE_Plugin::$session->file
386
+ ));
387
+
388
+ }
389
+
390
+ }
actions/wp_loaded.php CHANGED
@@ -2,5 +2,7 @@
2
 
3
  function pmxe_wp_loaded() {
4
 
 
 
5
 
6
  }
2
 
3
  function pmxe_wp_loaded() {
4
 
5
+ @ini_set("max_input_time", PMXE_Plugin::getInstance()->getOption('max_input_time'));
6
+ @ini_set("max_execution_time", PMXE_Plugin::getInstance()->getOption('max_execution_time'));
7
 
8
  }
actions/wp_session_garbage_collection.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
-
3
- function pmxe_wp_session_garbage_collection() {
4
- global $wpdb;
5
-
6
- if ( defined( 'WP_SETUP_CONFIG' ) ) {
7
- return;
8
- }
9
-
10
- $session_mode = PMXE_Plugin::getInstance()->getOption('session_mode');
11
-
12
- if ( ! defined( 'WP_INSTALLING' ) ) {
13
- if ($session_mode == 'database'){
14
- $expiration_keys = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE option_name LIKE '_pmxe_session_expires_%'" );
15
-
16
- $now = time();
17
- $expired_sessions = array();
18
-
19
- foreach( $expiration_keys as $expiration ) {
20
- // If the session has expired
21
- if ( $now > intval( $expiration->option_value ) ) {
22
- // Get the session ID by parsing the option_name
23
- $session_id = str_replace("_PMXE_session_expires_", "", $expiration->option_name);
24
-
25
- $expired_sessions[] = $expiration->option_name;
26
- $expired_sessions[] = "_PMXE_session_$session_id";
27
- }
28
- }
29
-
30
- // Delete all expired sessions in a single query
31
- if ( ! empty( $expired_sessions ) ) {
32
- $option_names = implode( "','", $expired_sessions );
33
- $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name IN ('$option_names')" );
34
- }
35
- }
36
- elseif ($session_mode == 'files'){
37
- $session_files = scandir( PMXE_ROOT_DIR . '/sessions');
38
-
39
- if (!empty($session_files)){
40
- $now = time();
41
- $expired_sessions = array();
42
- foreach ($session_files as $key => $file) {
43
- if ( strpos($file, "_pmxe_session_expires_") !== false){
44
- $expiration_value = @file_get_contents( PMXE_ROOT_DIR . "/sessions/" . $file );
45
-
46
- if ($now > intval($expiration_value)){
47
- $session_id = str_replace("_pmxe_session_expires_", "", $file);
48
- $expired_sessions[] = $file;
49
- $expired_sessions[] = "_pmxe_session_$session_id";
50
- }
51
- }
52
- }
53
- // Delete all expired sessions in a single query
54
- if ( ! empty( $expired_sessions ) ) {
55
- foreach ($expired_sessions as $key => $file) {
56
- @unlink( PMXE_ROOT_DIR . "/sessions/" . $file );
57
- }
58
- }
59
- }
60
- }
61
- }
62
-
63
- // Allow other plugins to hook in to the garbage collection process.
64
- do_action( 'PMXE_session_cleanup' );
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/arrayaccess.php DELETED
@@ -1,141 +0,0 @@
1
- <?php
2
- /**
3
- * Multidimensional ArrayAccess
4
- *
5
- * Allows ArrayAccess-like functionality with multidimensional arrays. Fully supports
6
- * both sets and unsets.
7
- *
8
- * @package WordPress
9
- * @subpackage Session
10
- * @since 3.7.0
11
- */
12
-
13
- /**
14
- * Recursive array class to allow multidimensional array access.
15
- *
16
- * @package WordPress
17
- * @since 3.7.0
18
- */
19
- class PMXE_ArrayAccess implements ArrayAccess {
20
- /**
21
- * Internal data collection.
22
- *
23
- * @var array
24
- */
25
- public $container = array();
26
-
27
- /**
28
- * Flag whether or not the internal collection has been changed.
29
- *
30
- * @var bool
31
- */
32
- protected $dirty = false;
33
-
34
- /**
35
- * Default object constructor.
36
- *
37
- * @param array $data
38
- */
39
- protected function __construct( $data = array() ) {
40
- foreach ( $data as $key => $value ) {
41
- $this[ $key ] = $value;
42
- }
43
- }
44
-
45
- /**
46
- * Allow deep copies of objects
47
- */
48
- public function __clone() {
49
- foreach ( $this->container as $key => $value ) {
50
- if ( $value instanceof self ) {
51
- $this[ $key ] = clone $value;
52
- }
53
- }
54
- }
55
-
56
- /**
57
- * Output the data container as a multidimensional array.
58
- *
59
- * @return array
60
- */
61
- public function toArray() {
62
- $data = $this->container;
63
- if (!empty($data)){
64
- foreach ( $data as $key => $value ) {
65
- if ( $value instanceof self ) {
66
- $data[ $key ] = $value->toArray();
67
- }
68
- }
69
- }
70
- return $data;
71
- }
72
-
73
- /*****************************************************************/
74
- /* ArrayAccess Implementation */
75
- /*****************************************************************/
76
-
77
- /**
78
- * Whether a offset exists
79
- *
80
- * @link http://php.net/manual/en/arrayaccess.offsetexists.php
81
- *
82
- * @param mixed $offset An offset to check for.
83
- *
84
- * @return boolean true on success or false on failure.
85
- */
86
- public function offsetExists( $offset ) {
87
- return isset( $this->container[ $offset ]) ;
88
- }
89
-
90
- /**
91
- * Offset to retrieve
92
- *
93
- * @link http://php.net/manual/en/arrayaccess.offsetget.php
94
- *
95
- * @param mixed $offset The offset to retrieve.
96
- *
97
- * @return mixed Can return all value types.
98
- */
99
- public function offsetGet( $offset ) {
100
- return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null;
101
- }
102
-
103
- /**
104
- * Offset to set
105
- *
106
- * @link http://php.net/manual/en/arrayaccess.offsetset.php
107
- *
108
- * @param mixed $offset The offset to assign the value to.
109
- * @param mixed $value The value to set.
110
- *
111
- * @return void
112
- */
113
- public function offsetSet( $offset, $data ) {
114
- if ( is_array( $data ) ) {
115
- $data = new self( $data );
116
- }
117
- if ( $offset === null ) { // don't forget this!
118
- $this->container[] = $data;
119
- } else {
120
- $this->container[ $offset ] = $data;
121
- }
122
-
123
- $this->dirty = true;
124
- }
125
-
126
- /**
127
- * Offset to unset
128
- *
129
- * @link http://php.net/manual/en/arrayaccess.offsetunset.php
130
- *
131
- * @param mixed $offset The offset to unset.
132
- *
133
- * @return void
134
- */
135
- public function offsetUnset( $offset ) {
136
- unset( $this->container[ $offset ] );
137
-
138
- $this->dirty = true;
139
- }
140
- }
141
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/config.php CHANGED
File without changes
classes/download.php CHANGED
File without changes
classes/handler.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class PMXE_Handler extends PMXE_Session {
4
+
5
+ /** cookie name */
6
+ private $_cookie;
7
+
8
+ /** session due to expire timestamp */
9
+ private $_session_expiring;
10
+
11
+ /** session expiration timestamp */
12
+ private $_session_expiration;
13
+
14
+ /** Bool based on whether a cookie exists **/
15
+ private $_has_cookie = false;
16
+
17
+ /**
18
+ * Constructor for the session class.
19
+ *
20
+ * @access public
21
+ * @return void
22
+ */
23
+ public function __construct() {
24
+
25
+ $this->set_session_expiration();
26
+
27
+ $this->_import_id = $this->generate_import_id();
28
+
29
+ $this->_data = $this->get_session_data();
30
+
31
+ }
32
+
33
+ /**
34
+ * Return true if the current user has an active session, i.e. a cookie to retrieve values
35
+ * @return boolean
36
+ */
37
+ public function has_session() {
38
+ return isset( $_COOKIE[ $this->_cookie ] ) || $this->_has_cookie || is_user_logged_in();
39
+ }
40
+
41
+ /**
42
+ * set_session_expiration function.
43
+ *
44
+ * @access public
45
+ * @return void
46
+ */
47
+ public function set_session_expiration() {
48
+ $this->_session_expiring = time() + intval( apply_filters( 'wpallexport_session_expiring', 60 * 60 * 47 ) ); // 47 Hours
49
+ $this->_session_expiration = time() + intval( apply_filters( 'wpallexport_session_expiration', 60 * 60 * 48 ) ); // 48 Hours
50
+ }
51
+
52
+ public function generate_import_id() {
53
+
54
+ $input = new PMXE_Input();
55
+ $import_id = $input->get('id', 'new');
56
+
57
+ return $import_id;
58
+
59
+ }
60
+
61
+ /**
62
+ * get_session_data function.
63
+ *
64
+ * @access public
65
+ * @return array
66
+ */
67
+ public function get_session_data() {
68
+ return (array) get_option( '_wpallexport_session_' . $this->_import_id . '_', array() );
69
+ }
70
+
71
+ /**
72
+ * get_session_data function.
73
+ *
74
+ * @access public
75
+ * @return array
76
+ */
77
+ public function get_clear_session_data() {
78
+ $this->_data = $this->get_session_data();
79
+ $clear_data = array();
80
+ foreach ($this->_data as $key => $value) {
81
+ $ckey = sanitize_key( $key );
82
+ $clear_data[ $ckey ] = maybe_unserialize( $value );
83
+ }
84
+
85
+ return $clear_data;
86
+ }
87
+
88
+ /**
89
+ * save_data function.
90
+ *
91
+ * @access public
92
+ * @return void
93
+ */
94
+ public function save_data() {
95
+ // Dirty if something changed - prevents saving nothing new
96
+
97
+ if ( $this->_dirty and $this->has_session() ) {
98
+
99
+ $session_option = '_wpallexport_session_' . $this->_import_id . '_';
100
+ $session_expiry_option = '_wpallexport_session_expires_' . $this->_import_id . '_';
101
+
102
+ update_option( $session_option, $this->_data );
103
+
104
+ if ( false === get_option( $session_option ) ) {
105
+ add_option( $session_expiry_option, $this->_session_expiration, '', 'no' );
106
+ }
107
+ }
108
+ }
109
+
110
+ public function convertData( $import_id ){
111
+
112
+ $this->_import_id = 'new';
113
+
114
+ $this->_data = $this->get_session_data();
115
+
116
+ $this->set_session_expiration();
117
+
118
+ $this->_import_id = $import_id;
119
+
120
+ $this->clean_session();
121
+
122
+ $this->_dirty = true;
123
+
124
+ $this->save_data();
125
+ }
126
+
127
+ public function clean_session( $import_id = 'new' ){
128
+
129
+ delete_option('_wpallexport_session_' . $import_id . '_');
130
+
131
+ }
132
+ }
classes/helper.php CHANGED
File without changes
classes/input.php CHANGED
@@ -19,7 +19,14 @@ class PMXE_Input {
19
  }
20
 
21
  public function get($paramName, $default = NULL) {
22
- return $this->read($_GET, $paramName, $default);
 
 
 
 
 
 
 
23
  }
24
 
25
  public function post($paramName, $default = NULL) {
19
  }
20
 
21
  public function get($paramName, $default = NULL) {
22
+ $this->addFilter('htmlspecialchars');
23
+ $this->addFilter('strip_tags');
24
+ $this->addFilter('esc_sql');
25
+ $result = $this->read($_GET, $paramName, $default);
26
+ $this->removeFilter('htmlspecialchars');
27
+ $this->removeFilter('strip_tags');
28
+ $this->removeFilter('esc_sql');
29
+ return $result;
30
  }
31
 
32
  public function post($paramName, $default = NULL) {
classes/session.php CHANGED
@@ -1,371 +1,96 @@
1
  <?php
2
- /**
3
- * WordPress session managment.
4
- *
5
- * Standardizes WordPress session data using database-backed options for storage.
6
- * for storing user session information.
7
- *
8
- * @package WordPress
9
- * @subpackage Session
10
- * @since 3.7.0
11
- */
12
 
13
- /**
14
- * WordPress Session class for managing user session data.
15
- *
16
- * @package WordPress
17
- * @since 3.7.0
18
- */
19
- final class PMXE_Session extends PMXE_ArrayAccess implements Iterator, Countable {
20
- /**
21
- * ID of the current session.
22
- *
23
- * @var string
24
- */
25
- protected $session_id;
26
-
27
- /**
28
- * Unix timestamp when session expires.
29
- *
30
- * @var int
31
- */
32
- protected $expires;
33
-
34
- /**
35
- * Unix timestamp indicating when the expiration time needs to be reset.
36
- *
37
- * @var int
38
- */
39
- protected $exp_variant;
40
-
41
- /**
42
- * Singleton instance.
43
- *
44
- * @var bool|WP_Session
45
- */
46
- private static $instance = false;
47
-
48
- public $data = array();
49
-
50
- public $session_mode = '';
51
- /**
52
- * Retrieve the current session instance.
53
- *
54
- * @param bool $session_id Session ID from which to populate data.
55
- *
56
- * @return bool|WP_Session
57
- */
58
- public static function get_instance() {
59
- if ( ! self::$instance ) {
60
- self::$instance = new self();
61
- }
62
-
63
- return self::$instance;
64
- }
65
-
66
- /**
67
- * Default constructor.
68
- * Will rebuild the session collection from the given session ID if it exists. Otherwise, will
69
- * create a new session with that ID.
70
- *
71
- * @param $session_id
72
- * @uses apply_filters Calls `wp_session_expiration` to determine how long until sessions expire.
73
- */
74
- protected function __construct() {
75
-
76
- $this->session_mode = PMXE_Plugin::getInstance()->getOption('session_mode');
77
-
78
- if ($this->session_mode != 'default'){
79
-
80
- if ( isset( $_COOKIE[PMXE_SESSION_COOKIE] ) ) {
81
-
82
- $cookie = stripslashes( $_COOKIE[PMXE_SESSION_COOKIE] );
83
- $cookie_crumbs = explode( '||', $cookie );
84
-
85
- $this->session_id = (!empty($cookie_crumbs[0])) ? $cookie_crumbs[0] : $this->generate_id();
86
- $this->expires = $cookie_crumbs[1];
87
- $this->exp_variant = $cookie_crumbs[2];
88
-
89
- // Update the session expiration if we're past the variant time
90
- if ( time() > $this->exp_variant ) {
91
- $this->set_expiration();
92
- if ($this->session_mode == 'database'){
93
- update_option( "_pmxi_session_expires_{$this->session_id}", $this->expires );
94
- }
95
- elseif ($this->session_mode == 'files'){
96
- @file_put_contents(PMXE_ROOT_DIR . "/sessions/_pmxe_session_expires_{$this->session_id}.txt", $this->expires);
97
- }
98
- }
99
-
100
- } else {
101
- $this->session_id = $this->generate_id();
102
- $this->set_expiration();
103
- }
104
- }
105
- else{
106
- try{
107
- $path = @session_save_path();
108
- if ( ! @is_dir($path) or ! @is_writable($path)){
109
- @ini_set("session.save_handler", "files");
110
- @session_save_path(sys_get_temp_dir());
111
- }
112
- } catch (XmlImportException $e) {
113
-
114
- }
115
-
116
- // enable sessions
117
- if ( ! session_id()) @session_start();
118
- }
119
-
120
- $this->read_data();
121
-
122
- $this->set_cookie();
123
- }
124
-
125
- /**
126
- * Set both the expiration time and the expiration variant.
127
- *
128
- * If the current time is below the variant, we don't update the session's expiration time. If it's
129
- * greater than the variant, then we update the expiration time in the database. This prevents
130
- * writing to the database on every page load for active sessions and only updates the expiration
131
- * time if we're nearing when the session actually expires.
132
- *
133
- * By default, the expiration time is set to 30 minutes.
134
- * By default, the expiration variant is set to 24 minutes.
135
- *
136
- * As a result, the session expiration time - at a maximum - will only be written to the database once
137
- * every 24 minutes. After 30 minutes, the session will have been expired. No cookie will be sent by
138
- * the browser, and the old session will be queued for deletion by the garbage collector.
139
- *
140
- * @uses apply_filters Calls `wp_session_expiration_variant` to get the max update window for session data.
141
- * @uses apply_filters Calls `wp_session_expiration` to get the standard expiration time for sessions.
142
- */
143
- protected function set_expiration() {
144
- $this->exp_variant = time() + (int) apply_filters( 'wp_session_expiration_variant', 24 * 60 );
145
- $this->expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 );
146
- }
147
-
148
- /**
149
- * Set the session cookie
150
- */
151
- protected function set_cookie() {
152
- @setcookie( PMXE_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN );
153
- }
154
-
155
- /**
156
- * Generate a cryptographically strong unique ID for the session token.
157
- *
158
- * @return string
159
- */
160
- protected function generate_id() {
161
- require_once( ABSPATH . 'wp-includes/class-phpass.php');
162
- $hasher = new PasswordHash( 8, false );
163
-
164
- return md5( $hasher->get_random_bytes( 32 ) );
165
- }
166
-
167
- /**
168
- * Read data from a transient for the current session.
169
- *
170
- * Automatically resets the expiration time for the session transient to some time in the future.
171
- *
172
- * @return array
173
- */
174
- protected function read_data() {
175
- if ($this->session_mode == 'database'){
176
- $this->container = get_option( "_pmxe_session_{$this->session_id}", array() );
177
- }
178
- elseif ($this->session_mode == 'files'){
179
- $container = @file_get_contents(PMXE_ROOT_DIR . "/sessions/_pmxe_session_{$this->session_id}.txt");
180
- $this->container = unserialize( (!empty($container)) ? $container : '' );
181
- }
182
- else{
183
- $this['pmxe_export'] = ( ! empty($_SESSION['pmxe_export']) ) ? $_SESSION['pmxe_export'] : array();
184
- }
185
-
186
- $this->data = $this->toArray();
187
-
188
- return $this->container;
189
- }
190
-
191
- /**
192
- * Write the data from the current session to the data storage system.
193
- */
194
- public function write_data() {
195
-
196
- $option_key = "_pmxe_session_{$this->session_id}";
197
-
198
- $this->data = $this->toArray();
199
-
200
- // Only write the collection to the DB if it's changed.
201
- if ($this->session_mode == "database"){
202
- if ( false === get_option( $option_key ) ) {
203
- add_option( "_pmxe_session_{$this->session_id}", $this->container, '', 'no' );
204
- add_option( "_pmxe_session_expires_{$this->session_id}", $this->expires, '', 'no' );
205
- } else {
206
- delete_option("_pmxe_session_{$this->session_id}");
207
- add_option( "_pmxe_session_{$this->session_id}", $this->container, '', 'no' );
208
- }
209
- }
210
- elseif ($this->session_mode == 'files'){
211
- if ( @file_exists( PMXE_ROOT_DIR . "/sessions/" . $option_key . ".txt") ){
212
- @file_put_contents( PMXE_ROOT_DIR . "/sessions/" . $option_key . ".txt", (string) serialize($this->container) );
213
- }
214
- else{
215
- @file_put_contents( PMXE_ROOT_DIR . "/sessions/" . $option_key . ".txt", (string) serialize($this->container) );
216
- @file_put_contents( PMXE_ROOT_DIR . "/sessions/_pmxe_session_expires_{$this->session_id}.txt", $this->expires );
217
- }
218
- }
219
- else{
220
- $session = $this->toArray(); $_SESSION['pmxe_export'] = (!empty($session['pmxe_export'])) ? $session['pmxe_export'] : array();
221
- }
222
-
223
- }
224
-
225
- /**
226
- * Output the current container contents as a JSON-encoded string.
227
- *
228
- * @return string
229
- */
230
- public function json_out() {
231
- return json_encode( $this->container );
232
- }
233
-
234
- /**
235
- * Decodes a JSON string and, if the object is an array, overwrites the session container with its contents.
236
- *
237
- * @param string $data
238
- *
239
- * @return bool
240
- */
241
- public function json_in( $data ) {
242
- $array = json_decode( $data );
243
-
244
- if ( is_array( $array ) ) {
245
- $this->container = $array;
246
- return true;
247
- }
248
-
249
- return false;
250
- }
251
-
252
- /**
253
- * Regenerate the current session's ID.
254
- *
255
- * @param bool $delete_old Flag whether or not to delete the old session data from the server.
256
- */
257
- public function regenerate_id( $delete_old = false ) {
258
- if ( $delete_old ) {
259
- if ($this->session_mode == "database"){
260
- delete_option( "_pmxe_session_{$this->session_id}" );
261
- }
262
- elseif ($this->session_mode == 'files'){
263
- @unlink( PMXE_ROOT_DIR . "/sessions/_pmxe_session_{$this->session_id}.txt");
264
- }
265
- }
266
-
267
- $this->session_id = $this->generate_id();
268
-
269
- $this->set_cookie();
270
- }
271
-
272
- /**
273
- * Check if a session has been initialized.
274
- *
275
- * @return bool
276
- */
277
- public function session_started() {
278
- return !!self::$instance;
279
- }
280
-
281
- /**
282
- * Return the read-only cache expiration value.
283
- *
284
- * @return int
285
- */
286
- public function cache_expiration() {
287
- return $this->expires;
288
- }
289
-
290
- /**
291
- * Flushes all session variables.
292
- */
293
- public function reset() {
294
- $this->container = array();
295
- if ($this->session_mode == "default") unset($_SESSION['pmxe_export']);
296
- }
297
-
298
- /*****************************************************************/
299
- /* Iterator Implementation */
300
- /*****************************************************************/
301
-
302
- /**
303
- * Current position of the array.
304
- *
305
- * @link http://php.net/manual/en/iterator.current.php
306
- *
307
- * @return mixed
308
- */
309
- public function current() {
310
- return current( $this->container );
311
- }
312
-
313
- /**
314
- * Key of the current element.
315
- *
316
- * @link http://php.net/manual/en/iterator.key.php
317
- *
318
- * @return mixed
319
- */
320
- public function key() {
321
- return key( $this->container );
322
- }
323
-
324
- /**
325
- * Move the internal point of the container array to the next item
326
- *
327
- * @link http://php.net/manual/en/iterator.next.php
328
- *
329
- * @return void
330
- */
331
- public function next() {
332
- next( $this->container );
333
- }
334
-
335
- /**
336
- * Rewind the internal point of the container array.
337
- *
338
- * @link http://php.net/manual/en/iterator.rewind.php
339
- *
340
- * @return void
341
- */
342
- public function rewind() {
343
- reset( $this->container );
344
- }
345
-
346
- /**
347
- * Is the current key valid?
348
- *
349
- * @link http://php.net/manual/en/iterator.rewind.php
350
- *
351
- * @return bool
352
- */
353
- public function valid() {
354
- return $this->offsetExists( $this->key() );
355
- }
356
-
357
- /*****************************************************************/
358
- /* Countable Implementation */
359
- /*****************************************************************/
360
-
361
- /**
362
- * Get the count of elements in the container array.
363
- *
364
- * @link http://php.net/manual/en/countable.count.php
365
- *
366
  * @return int
367
  */
368
- public function count() {
369
- return count( $this->container );
370
  }
371
- }
1
  <?php
 
 
 
 
 
 
 
 
 
 
2
 
3
+ abstract class PMXE_Session {
4
+
5
+ /** @var int $_customer_id */
6
+ protected $_import_id;
7
+
8
+ /** @var array $_data */
9
+ protected $_data = array();
10
+
11
+ /** @var bool $_dirty When something changes */
12
+ protected $_dirty = false;
13
+
14
+ /**
15
+ * __get function.
16
+ *
17
+ * @access public
18
+ * @param mixed $key
19
+ * @return mixed
20
+ */
21
+ public function __get( $key ) {
22
+ return $this->get( $key );
23
+ }
24
+
25
+ /**
26
+ * __set function.
27
+ *
28
+ * @access public
29
+ * @param mixed $key
30
+ * @param mixed $value
31
+ * @return void
32
+ */
33
+ public function __set( $key, $value ) {
34
+ $this->set( $key, $value );
35
+ }
36
+
37
+ /**
38
+ * __isset function.
39
+ *
40
+ * @access public
41
+ * @param mixed $key
42
+ * @return bool
43
+ */
44
+ public function __isset( $key ) {
45
+ return isset( $this->_data[ sanitize_title( $key ) ] );
46
+ }
47
+
48
+ /**
49
+ * __unset function.
50
+ *
51
+ * @access public
52
+ * @param mixed $key
53
+ * @return void
54
+ */
55
+ public function __unset( $key ) {
56
+
57
+ if ( isset( $this->_data[ $key ] ) ) {
58
+ unset( $this->_data[ $key ] );
59
+ $this->_dirty = true;
60
+ }
61
+
62
+ }
63
+
64
+ /**
65
+ * Get a session variable
66
+ *
67
+ * @param string $key
68
+ * @param mixed $default used if the session variable isn't set
69
+ * @return mixed value of session variable
70
+ */
71
+ public function get( $key, $default = null ) {
72
+ $key = sanitize_key( $key );
73
+ return isset( $this->_data[ $key ] ) ? maybe_unserialize( $this->_data[ $key ] ) : $default;
74
+ }
75
+
76
+ /**
77
+ * Set a session variable
78
+ *
79
+ * @param string $key
80
+ * @param mixed $value
81
+ */
82
+ public function set( $key, $value ) {
83
+ $this->_data[ sanitize_key( $key ) ] = maybe_serialize( $value );
84
+ $this->_dirty = true;
85
+ }
86
+
87
+ /**
88
+ * get_import_id function.
89
+ *
90
+ * @access public
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  * @return int
92
  */
93
+ public function get_import_id() {
94
+ return $this->_import_id;
95
  }
96
+ }
config/options.php CHANGED
@@ -4,8 +4,12 @@
4
  * and can be changed by corresponding wordpress function calls
5
  */
6
  $config = array(
 
7
  "dismiss" => 0,
8
  "dismiss_manage_top" => 0,
9
- "dismiss_manage_bottom" => 0,
10
- "session_mode" => 'default',
 
 
 
11
  );
4
  * and can be changed by corresponding wordpress function calls
5
  */
6
  $config = array(
7
+ "info_api_url" => "http://www.wpallimport.com",
8
  "dismiss" => 0,
9
  "dismiss_manage_top" => 0,
10
+ "dismiss_manage_bottom" => 0,
11
+ "cron_job_key" => wp_all_export_url_title(wp_all_export_rand_char(12)),
12
+ "max_input_time" => -1,
13
+ "max_execution_time" => -1,
14
+ "secure" => 1
15
  );
controllers/admin/export.php CHANGED
@@ -6,14 +6,28 @@
6
  */
7
 
8
  class PMXE_Admin_Export extends PMXE_Controller_Admin {
 
9
  protected $isWizard = true; // indicates whether controller is in wizard mode (otherwize it called to be deligated an edit action)
10
 
11
  protected function init() {
12
 
13
  parent::init();
14
-
15
- $action = PMXE_Plugin::getInstance()->getAdminCurrentScreen()->action;
16
- $this->_step_ready($action);
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  }
19
 
@@ -34,10 +48,16 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
34
 
35
  // step #1: xml selction - has no prerequisites
36
  if ('index' == $action) return true;
37
-
38
  if ('element' == $action) return true;
39
 
40
- if (empty(PMXE_Plugin::$session->data['pmxe_export'])){
 
 
 
 
 
 
41
  wp_redirect_or_javascript($this->baseUrl); die();
42
  }
43
 
@@ -50,25 +70,37 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
50
  */
51
  public function index() {
52
 
 
 
53
  $wp_uploads = wp_upload_dir();
54
 
55
  $this->data['post'] = $post = $this->input->post(array(
56
- 'cpt' => array(),
57
- 'export_to' => 'xml'
58
- ));
 
 
 
 
 
59
 
60
  // Delete history
61
- foreach (PMXE_Helper::safe_glob(PMXE_ROOT_DIR . '/history/*', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH) as $filePath) {
62
- @file_exists($filePath) and @unlink($filePath);
63
- }
 
 
 
64
 
65
- if ($this->input->post('is_submitted')){
66
 
67
- pmxe_session_unset();
 
 
 
68
 
69
- PMXE_Plugin::$session['pmxe_export'] = array(
70
- 'cpt' => ( ! is_array($post['cpt']) ) ? array($post['cpt']) : $post['cpt']
71
- );
72
 
73
  }
74
 
@@ -76,48 +108,151 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
76
 
77
  check_admin_referer('choose-cpt', '_wpnonce_choose-cpt');
78
 
79
- pmxe_session_commit();
80
-
81
- wp_redirect(add_query_arg('action', 'element', $this->baseUrl)); die();
 
82
  }
83
 
84
  $this->render();
85
- }
86
-
87
  /**
88
- * Step #2: Choose data to export
89
- */
90
- public function element()
91
- {
92
 
93
  $default = PMXE_Plugin::get_default_import_options();
94
- $DefaultOptions = (isset(PMXE_Plugin::$session->data['pmxe_export']) ? PMXE_Plugin::$session->data['pmxe_export'] : array()) + $default;
95
- $post = $this->input->post($DefaultOptions);
96
 
97
- $this->data['post'] =& $post;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
 
99
- $this->data['meta_keys'] = $keys = new PMXE_Model_List();
100
- $keys->setTable(PMXE_Plugin::getInstance()->getWPPrefix() . 'postmeta');
101
- $keys->setColumns('meta_id', 'meta_key')->getBy(NULL, "meta_id", NULL, NULL, "meta_key");
102
 
103
  if ($this->input->post('is_submitted')) {
104
 
105
- check_admin_referer('element', '_wpnonce_element');
106
 
107
- if ( ! $this->errors->get_error_codes()) {
 
 
108
 
109
- PMXE_Plugin::$session['pmxe_export']['export_to'] = preg_match('%\W(xml)$%i', trim($post['export_to'])) ? 'xml' : 'csv';
 
 
110
 
111
- pmxe_session_commit();
112
-
113
- wp_redirect(add_query_arg('action', 'process', $this->baseUrl)); die();
114
-
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
116
 
117
- }
 
 
 
 
 
 
 
 
118
 
119
  $this->render();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
 
 
121
  }
122
 
123
  /**
@@ -126,36 +261,132 @@ class PMXE_Admin_Export extends PMXE_Controller_Admin {
126
  public function process()
127
  {
128
 
129
- @set_time_limit(0);
130
- $this->render();
131
-
132
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
134
- /**
135
- * Step #4: Download
136
- */
137
- public function download(){
138
 
139
- $attch_url = PMXE_Plugin::$session->data['pmxe_export']['export_file'];
140
 
141
- $export_type = PMXE_Plugin::$session->data['pmxe_export']['export_to'];
142
 
143
- // clear import session
144
- pmxe_session_unset(); // clear session data (prevent from reimporting the same data on page refresh)
145
 
146
- switch ($export_type) {
147
- case 'xml':
148
- PMXE_download::xml($attch_url);
149
- break;
150
- case 'csv':
151
- PMXE_download::csv($attch_url);
152
- break;
153
-
154
- default:
155
- # code...
156
- break;
157
  }
158
 
159
- }
 
 
160
 
161
  }
6
  */
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
 
14
  parent::init();
15
+
16
+ if ('PMXE_Admin_Manage' == PMXE_Plugin::getInstance()->getAdminCurrentScreen()->base) { // prereqisites are not checked when flow control is deligated
17
+ $id = $this->input->get('id');
18
+ $this->data['export'] = $export = new PMXE_Export_Record();
19
+ if ( ! $id or $export->getById($id)->isEmpty()) { // specified import is not found
20
+ wp_redirect(add_query_arg('page', 'pmxe-admin-manage', admin_url('admin.php'))); die();
21
+ }
22
+ $this->isWizard = false;
23
+
24
+ } else {
25
+ $action = PMXE_Plugin::getInstance()->getAdminCurrentScreen()->action;
26
+ $this->_step_ready($action);
27
+ }
28
+
29
+ // preserve id parameter as part of baseUrl
30
+ $id = $this->input->get('id') and $this->baseUrl = add_query_arg('id', $id, $this->baseUrl);
31
 
32
  }
33
 
48
 
49
  // step #1: xml selction - has no prerequisites
50
  if ('index' == $action) return true;
51
+
52
  if ('element' == $action) return true;
53
 
54
+ $this->data['update_previous'] = $update_previous = new PMXE_Export_Record();
55
+
56
+ $update_previous->getById(PMXE_Plugin::$session->update_previous);
57
+
58
+ if ('options' == $action) return true;
59
+
60
+ if ( ! PMXE_Plugin::$session->has_session()){
61
  wp_redirect_or_javascript($this->baseUrl); die();
62
  }
63
 
70
  */
71
  public function index() {
72
 
73
+ PMXE_Plugin::$session->clean_session();
74
+
75
  $wp_uploads = wp_upload_dir();
76
 
77
  $this->data['post'] = $post = $this->input->post(array(
78
+ 'cpt' => '',
79
+ 'export_to' => 'xml',
80
+ 'export_type' => 'specific',
81
+ 'wp_query' => '',
82
+ 'filter_rules_hierarhy' => '',
83
+ 'product_matching_mode' => 'strict',
84
+ 'wp_query_selector' => 'wp_query'
85
+ ));
86
 
87
  // Delete history
88
+ $history_files = PMXE_Helper::safe_glob(PMXE_ROOT_DIR . '/history/*', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH);
89
+ if ( ! empty($history_files) ){
90
+ foreach ($history_files as $filePath) {
91
+ @file_exists($filePath) and @unlink($filePath);
92
+ }
93
+ }
94
 
95
+ if ($this->input->post('is_submitted')){
96
 
97
+ PMXE_Plugin::$session->set('export_type', $post['export_type']);
98
+ PMXE_Plugin::$session->set('filter_rules_hierarhy', $post['filter_rules_hierarhy']);
99
+ PMXE_Plugin::$session->set('product_matching_mode', $post['product_matching_mode']);
100
+ PMXE_Plugin::$session->set('wp_query_selector', $post['wp_query_selector']);
101
 
102
+ $engine = new XmlExportEngine($post, $this->errors);
103
+ $engine->init_additional_data();
 
104
 
105
  }
106
 
108
 
109
  check_admin_referer('choose-cpt', '_wpnonce_choose-cpt');
110
 
111
+ PMXE_Plugin::$session->save_data();
112
+
113
+ wp_redirect(add_query_arg('action', 'template', $this->baseUrl)); die();
114
+
115
  }
116
 
117
  $this->render();
118
+ }
119
+
120
  /**
121
+ * Step #2: Template
122
+ */
123
+ public function template(){
 
124
 
125
  $default = PMXE_Plugin::get_default_import_options();
 
 
126
 
127
+ if ($this->isWizard) {
128
+ $DefaultOptions = (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + $default;
129
+ $post = $this->input->post($DefaultOptions);
130
+ }
131
+ else{
132
+ $DefaultOptions = $this->data['export']->options + $default;
133
+ $post = $this->input->post($DefaultOptions);
134
+ $post['scheduled'] = $this->data['export']->scheduled;
135
+
136
+ foreach ($post as $key => $value) {
137
+ PMXE_Plugin::$session->set($key, $value);
138
+ }
139
+
140
+ }
141
+
142
+ PMXE_Plugin::$session->save_data();
143
 
144
+ $this->data['post'] =& $post;
 
 
145
 
146
  if ($this->input->post('is_submitted')) {
147
 
148
+ check_admin_referer('template', '_wpnonce_template');
149
 
150
+ if ( empty($post['cc_type'][0]) ){
151
+ $this->errors->add('form-validation', __('You haven\'t selected any columns for export.', 'pmxe_plugin'));
152
+ }
153
 
154
+ if ( 'csv' == $post['export_to'] and '' == $post['delimiter'] ){
155
+ $this->errors->add('form-validation', __('CSV delimiter must be specified', 'pmxe_plugin'));
156
+ }
157
 
158
+ if ( ! $this->errors->get_error_codes()) {
159
+
160
+ if ($this->isWizard) {
161
+ foreach ($this->data['post'] as $key => $value) {
162
+ PMXE_Plugin::$session->set($key, $value);
163
+ }
164
+ PMXE_Plugin::$session->save_data();
165
+ wp_redirect(add_query_arg('action', 'options', $this->baseUrl)); die();
166
+ }
167
+ else {
168
+ $this->data['export']->set(array( 'options' => $post, 'settings_update_on' => date('Y-m-d H:i:s')))->save();
169
+ if ( ! empty($post['friendly_name']) ) {
170
+ $this->data['export']->set( array( 'friendly_name' => $post['friendly_name'], 'scheduled' => (($post['is_scheduled']) ? $post['scheduled_period'] : '') ) )->save();
171
+ }
172
+ 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();
173
+ }
174
+
175
  }
176
 
177
+ }
178
+
179
+ $engine = new XmlExportEngine($post, $this->errors);
180
+
181
+ $engine->init_additional_data();
182
+
183
+ $this->data = array_merge($this->data, $engine->init_available_data());
184
+
185
+ $this->data['available_data_view'] = $engine->render();
186
 
187
  $this->render();
188
+ }
189
+
190
+ public function options()
191
+ {
192
+
193
+ $default = PMXE_Plugin::get_default_import_options();
194
+
195
+ if ($this->isWizard) {
196
+ $DefaultOptions = (PMXE_Plugin::$session->has_session() ? PMXE_Plugin::$session->get_clear_session_data() : array()) + $default;
197
+ $post = $this->input->post($DefaultOptions);
198
+ }
199
+ else{
200
+ $DefaultOptions = $this->data['export']->options + $default;
201
+ $post = $this->input->post($DefaultOptions);
202
+ $post['scheduled'] = $this->data['export']->scheduled;
203
+ foreach ($post as $key => $value) {
204
+ PMXE_Plugin::$session->set($key, $value);
205
+ }
206
+ PMXE_Plugin::$session->save_data();
207
+
208
+ $this->data['engine'] = new XmlExportEngine($post, $this->errors);
209
+
210
+ $this->data['engine']->init_available_data();
211
+
212
+ }
213
+
214
+ $this->data['post'] =& $post;
215
+
216
+ if ($this->input->post('is_submitted')) {
217
+
218
+ check_admin_referer('options', '_wpnonce_options');
219
+
220
+ if ($post['is_generate_templates'] and '' == $post['template_name']){
221
+ $friendly_name = '';
222
+ $post_types = PMXE_Plugin::$session->get('cpt');
223
+ if ( ! empty($post_types) )
224
+ {
225
+ $post_type_details = get_post_type_object( array_shift($post_types) );
226
+ $friendly_name = $post_type_details->labels->name . ' Export - ' . date("Y F d H:i");
227
+ }
228
+ else
229
+ {
230
+ $friendly_name = 'WP_Query Export - ' . date("Y F d H:i");
231
+ }
232
+ $post['template_name'] = $friendly_name;
233
+ }
234
+
235
+ if ( ! $this->errors->get_error_codes()) {
236
+ if ($this->isWizard) {
237
+ foreach ($this->data['post'] as $key => $value) {
238
+ PMXE_Plugin::$session->set($key, $value);
239
+ }
240
+ PMXE_Plugin::$session->save_data();
241
+ wp_redirect(add_query_arg('action', 'process', $this->baseUrl)); die();
242
+ }
243
+ else {
244
+ $this->data['export']->set(array( 'options' => $post, 'settings_update_on' => date('Y-m-d H:i:s')))->save();
245
+ if ( ! empty($post['friendly_name']) ) {
246
+ $this->data['export']->set( array( 'friendly_name' => $post['friendly_name'], 'scheduled' => (($post['is_scheduled']) ? $post['scheduled_period'] : '') ) )->save();
247
+ }
248
+ 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();
249
+ }
250
+
251
+ }
252
+
253
+ }
254
 
255
+ $this->render();
256
  }
257
 
258
  /**
261
  public function process()
262
  {
263
 
264
+ @set_time_limit(0);
265
+
266
+ $export = $this->data['update_previous'];
267
+
268
+ if ( ! PMXE_Plugin::is_ajax() ) {
269
+
270
+ if ("" == PMXE_Plugin::$session->friendly_name){
271
+ $friendly_name = '';
272
+ $post_types = PMXE_Plugin::$session->get('cpt');
273
+ if ( ! empty($post_types) )
274
+ {
275
+ if ( ! in_array('users', $post_types)){
276
+ $post_type_details = get_post_type_object( array_shift($post_types) );
277
+ $friendly_name = $post_type_details->labels->name . ' Export - ' . date("Y F d H:i");
278
+ }
279
+ else
280
+ {
281
+ $friendly_name = 'Users Export - ' . date("Y F d H:i");
282
+ }
283
+ }
284
+ else
285
+ {
286
+ $friendly_name = 'WP_Query Export - ' . date("Y F d H:i");
287
+ }
288
+
289
+ PMXE_Plugin::$session->set('friendly_name', $friendly_name);
290
+ }
291
+
292
+ PMXE_Plugin::$session->set('file', '');
293
+ PMXE_Plugin::$session->save_data();
294
+
295
+ $export->set(
296
+ array(
297
+ 'triggered' => 0,
298
+ 'processing' => 0,
299
+ 'exported' => 0,
300
+ 'executing' => 1,
301
+ 'canceled' => 0,
302
+ 'options' => PMXE_Plugin::$session->get_clear_session_data(),
303
+ 'friendly_name' => PMXE_Plugin::$session->friendly_name,
304
+ 'scheduled' => (PMXE_Plugin::$session->is_scheduled) ? PMXE_Plugin::$session->scheduled_period : '',
305
+ 'registered_on' => date('Y-m-d H:i:s'),
306
+ 'last_activity' => date('Y-m-d H:i:s')
307
+ )
308
+ )->save();
309
+
310
+ $options = $export->options;
311
+
312
+ if ( $options['is_generate_import'] and wp_all_export_is_compatible() ){
313
+
314
+ $import = new PMXI_Import_Record();
315
+
316
+ if ( ! empty($options['import_id']) ) $import->getById($options['import_id']);
317
+
318
+ if ($import->isEmpty()){
319
+
320
+ $import->set(array(
321
+ 'parent_import_id' => 99999,
322
+ 'xpath' => '/',
323
+ 'type' => 'upload',
324
+ 'options' => array('empty'),
325
+ 'root_element' => 'root',
326
+ 'path' => 'path',
327
+ //'name' => '',
328
+ 'imported' => 0,
329
+ 'created' => 0,
330
+ 'updated' => 0,
331
+ 'skipped' => 0,
332
+ 'deleted' => 0,
333
+ 'iteration' => 1
334
+ ))->save();
335
+
336
+ PMXE_Plugin::$session->set('import_id', $import->id);
337
+
338
+ $options['import_id'] = $import->id;
339
+
340
+ $export->set(array(
341
+ 'options' => $options
342
+ ))->save();
343
+ }
344
+ else{
345
+
346
+ if ( $import->parent_import_id != 99999 ){
347
+
348
+ $newImport = new PMXI_Import_Record();
349
+
350
+ $newImport->set(array(
351
+ 'parent_import_id' => 99999,
352
+ 'xpath' => '/',
353
+ 'type' => 'upload',
354
+ 'options' => array('empty'),
355
+ 'root_element' => 'root',
356
+ 'path' => 'path',
357
+ //'name' => '',
358
+ 'imported' => 0,
359
+ 'created' => 0,
360
+ 'updated' => 0,
361
+ 'skipped' => 0,
362
+ 'deleted' => 0,
363
+ 'iteration' => 1
364
+ ))->save();
365
+
366
+ PMXE_Plugin::$session->set('import_id', $newImport->id);
367
+
368
+ $options['import_id'] = $newImport->id;
369
+
370
+ $export->set(array(
371
+ 'options' => $options
372
+ ))->save();
373
+
374
+ }
375
+
376
+ }
377
 
378
+ }
 
 
 
379
 
380
+ PMXE_Plugin::$session->set('update_previous', $export->id);
381
 
382
+ PMXE_Plugin::$session->save_data();
383
 
384
+ do_action('pmxe_before_export', $export->id);
 
385
 
 
 
 
 
 
 
 
 
 
 
 
386
  }
387
 
388
+ $this->render();
389
+
390
+ }
391
 
392
  }
controllers/admin/feedback.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin Help page
4
+ *
5
+ * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
+ */
7
+ class PMXE_Admin_Feedback extends PMXE_Controller_Admin {
8
+
9
+ public function index() {
10
+ $this->render();
11
+ }
12
+ }
controllers/admin/help.php CHANGED
File without changes
controllers/admin/manage.php ADDED
@@ -0,0 +1,328 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Manage Imports
4
+ *
5
+ * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6
+ */
7
+ class PMXE_Admin_Manage extends PMXE_Controller_Admin {
8
+
9
+ public function init() {
10
+ parent::init();
11
+
12
+ if ('update' == PMXE_Plugin::getInstance()->getAdminCurrentScreen()->action) {
13
+ $this->isInline = true;
14
+ }
15
+ }
16
+
17
+ /**
18
+ * Previous Imports list
19
+ */
20
+ public function index() {
21
+
22
+ $get = $this->input->get(array(
23
+ 's' => '',
24
+ 'order_by' => 'id',
25
+ 'order' => 'DESC',
26
+ 'pagenum' => 1,
27
+ 'perPage' => 25,
28
+ ));
29
+ $get['pagenum'] = absint($get['pagenum']);
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
+
37
+ if ( ! in_array($order, array('DESC', 'ASC'))){
38
+ $order = 'DESC';
39
+ }
40
+
41
+ $list = new PMXE_Export_List();
42
+ $by = null;
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(
49
+ $list->getTable() . '.*'
50
+ )->getBy($by, "$order_by $order", $pagenum, $perPage, $list->getTable() . '.id');
51
+
52
+ $this->data['page_links'] = paginate_links(array(
53
+ 'base' => add_query_arg('pagenum', '%#%', $this->baseUrl),
54
+ 'add_args' => array('page' => 'pmxe-admin-manage'),
55
+ 'format' => '',
56
+ 'prev_text' => __('&laquo;', 'PMXE_plugin'),
57
+ 'next_text' => __('&raquo;', 'PMXE_plugin'),
58
+ 'total' => ceil($list->total() / $perPage),
59
+ 'current' => $pagenum,
60
+ ));
61
+
62
+ PMXE_Plugin::$session->clean_session();
63
+
64
+ $this->render();
65
+ }
66
+
67
+ /**
68
+ * Edit Options
69
+ */
70
+ public function options() {
71
+
72
+ // deligate operation to other controller
73
+ $controller = new PMXE_Admin_Export();
74
+ $controller->set('isTemplateEdit', true);
75
+ $controller->options();
76
+ }
77
+
78
+ /**
79
+ * Edit Template
80
+ */
81
+ public function template() {
82
+
83
+ // deligate operation to other controller
84
+ $controller = new PMXE_Admin_Export();
85
+ $controller->set('isTemplateEdit', true);
86
+ $controller->template();
87
+ }
88
+
89
+ /**
90
+ * Cron Scheduling
91
+ */
92
+ public function scheduling() {
93
+ $this->data['id'] = $id = $this->input->get('id');
94
+ $this->data['cron_job_key'] = PMXE_Plugin::getInstance()->getOption('cron_job_key');
95
+ $this->data['item'] = $item = new PMXE_Export_Record();
96
+ if ( ! $id or $item->getById($id)->isEmpty()) {
97
+ wp_redirect($this->baseUrl); die();
98
+ }
99
+
100
+ $wp_uploads = wp_upload_dir();
101
+
102
+ $to_dirname = $wp_uploads['baseurl'] . DIRECTORY_SEPARATOR . PMXE_Plugin::CRON_DIRECTORY . DIRECTORY_SEPARATOR . md5($this->data['cron_job_key'] . $item->id);
103
+
104
+ $this->data['file_path'] = $to_dirname . DIRECTORY_SEPARATOR . ( ( ! empty($item->friendly_name)) ? sanitize_file_name($item->friendly_name) : 'feed' ) . '.' . $item->options['export_to'];
105
+
106
+ $this->render();
107
+ }
108
+
109
+ /**
110
+ * Download import templates
111
+ */
112
+ public function templates() {
113
+ $this->data['id'] = $id = $this->input->get('id');
114
+ $this->data['item'] = $item = new PMXE_Export_Record();
115
+ if ( ! $id or $item->getById($id)->isEmpty()) {
116
+ wp_redirect($this->baseUrl); die();
117
+ }
118
+
119
+ $this->render();
120
+ }
121
+
122
+ /**
123
+ * Cancel import processing
124
+ */
125
+ public function cancel(){
126
+
127
+ $id = $this->input->get('id');
128
+
129
+ PMXE_Plugin::$session->clean_session( $id );
130
+
131
+ $item = new PMXE_Export_Record();
132
+ if ( ! $id or $item->getById($id)->isEmpty()) {
133
+ wp_redirect($this->baseUrl); die();
134
+ }
135
+ $item->set(array(
136
+ 'triggered' => 0,
137
+ 'processing' => 0,
138
+ 'executing' => 0,
139
+ 'canceled' => 1,
140
+ 'canceled_on' => date('Y-m-d H:i:s')
141
+ ))->update();
142
+
143
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('Export canceled', 'wp_all_import_plugin')), $this->baseUrl)); die();
144
+ }
145
+
146
+ /**
147
+ * Reexport
148
+ */
149
+ public function update() {
150
+
151
+ $id = $this->input->get('id');
152
+
153
+ PMXE_Plugin::$session->clean_session($id);
154
+
155
+ $action_type = $this->input->get('type');
156
+
157
+ $this->data['item'] = $item = new PMXE_Export_Record();
158
+ if ( ! $id or $item->getById($id)->isEmpty()) {
159
+ wp_redirect($this->baseUrl); die();
160
+ }
161
+
162
+ if ($this->input->post('is_confirmed')) {
163
+
164
+ check_admin_referer('update-export', '_wpnonce_update-export');
165
+
166
+ $default = PMXE_Plugin::get_default_import_options();
167
+
168
+ // compose data to look like result of wizard steps
169
+ $sesson_data = $item->options + array('update_previous' => $item->id ) + $default;
170
+
171
+ foreach ($sesson_data as $key => $value) {
172
+ PMXE_Plugin::$session->set($key, $value);
173
+ }
174
+
175
+ $this->data['engine'] = new XmlExportEngine($sesson_data, $this->errors);
176
+ $this->data['engine']->init_additional_data();
177
+ $this->data['engine']->init_available_data();
178
+
179
+ PMXE_Plugin::$session->save_data();
180
+
181
+ if ( ! $this->errors->get_error_codes()) {
182
+
183
+ // deligate operation to other controller
184
+ $controller = new PMXE_Admin_Export();
185
+ $controller->data['update_previous'] = $item;
186
+ $controller->process();
187
+ return;
188
+
189
+ }
190
+
191
+ }
192
+
193
+ $this->render();
194
+ }
195
+
196
+ /**
197
+ * Delete an import
198
+ */
199
+ public function delete() {
200
+ $id = $this->input->get('id');
201
+ $this->data['item'] = $item = new PMXE_Export_Record();
202
+ if ( ! $id or $item->getById($id)->isEmpty()) {
203
+ wp_redirect($this->baseUrl); die();
204
+ }
205
+
206
+ if ($this->input->post('is_confirmed')) {
207
+ check_admin_referer('delete-export', '_wpnonce_delete-export');
208
+ $item->delete();
209
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('Export deleted', 'pmxe_plugin')), $this->baseUrl)); die();
210
+ }
211
+
212
+ $this->render();
213
+ }
214
+
215
+ /**
216
+ * Bulk actions
217
+ */
218
+ public function bulk() {
219
+ check_admin_referer('bulk-exports', '_wpnonce_bulk-exports');
220
+ if ($this->input->post('doaction2')) {
221
+ $this->data['action'] = $action = $this->input->post('bulk-action2');
222
+ } else {
223
+ $this->data['action'] = $action = $this->input->post('bulk-action');
224
+ }
225
+ $this->data['ids'] = $ids = $this->input->post('items');
226
+ $this->data['items'] = $items = new PMXE_Export_List();
227
+ if (empty($action) or ! in_array($action, array('delete')) or empty($ids) or $items->getBy('id', $ids)->isEmpty()) {
228
+ wp_redirect($this->baseUrl); die();
229
+ }
230
+ if ($this->input->post('is_confirmed')) {
231
+ foreach($items->convertRecords() as $item) {
232
+
233
+ if ($item->attch_id) wp_delete_attachment($item->attch_id, true);
234
+
235
+ $item->delete();
236
+ }
237
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(sprintf(__('%d %s deleted', 'pmxe_plugin'), $items->count(), _n('export', 'exports', $items->count(), 'pmxe_plugin'))), $this->baseUrl)); die();
238
+ }
239
+ $this->render();
240
+ }
241
+
242
+ public function get_template(){
243
+ $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
244
+ if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_template' ) ) {
245
+ die( __('Security check', 'wp_all_export_plugin') );
246
+ } else {
247
+
248
+ $id = $this->input->get('id');
249
+
250
+ $export = new PMXE_Export_Record();
251
+
252
+ $filepath = '';
253
+
254
+ $export_data = array();
255
+
256
+ if ( ! $export->getById($id)->isEmpty()){
257
+ $template = new PMXI_Template_Record();
258
+ if ( ! empty($export->options['template_name'])) {
259
+ $template->getByName($export->options['template_name']);
260
+ if ( ! $template->isEmpty() ){
261
+ $export_data[] = $template->toArray(TRUE);
262
+ $uploads = wp_upload_dir();
263
+ $targetDir = $uploads['basedir'] . DIRECTORY_SEPARATOR . PMXI_Plugin::TEMP_DIRECTORY;
264
+ $export_file_name = "templates_".uniqid().".txt";
265
+ file_put_contents($targetDir . DIRECTORY_SEPARATOR . $export_file_name, json_encode($export_data));
266
+ PMXI_download::csv($targetDir . DIRECTORY_SEPARATOR . $export_file_name);
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+
273
+ /*
274
+ * Download import log file
275
+ *
276
+ */
277
+ public function get_file(){
278
+
279
+ $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
280
+ if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_feed' ) ) {
281
+ die( __('Security check', 'wp_all_export_plugin') );
282
+ } else {
283
+
284
+ $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
285
+
286
+ $id = $this->input->get('id');
287
+
288
+ $export = new PMXE_Export_Record();
289
+
290
+ $filepath = '';
291
+
292
+ if ( ! $export->getById($id)->isEmpty()){
293
+
294
+
295
+ if ( ! $is_secure_import){
296
+ $filepath = wp_get_attachment_url($export->attch_id);
297
+ }
298
+ else{
299
+ $filepath = wp_all_export_get_absolute_path($export->options['filepath']);
300
+ }
301
+
302
+ if ( @file_exists($filepath) ){
303
+
304
+ switch ($export['options']['export_to']) {
305
+ case 'xml':
306
+ PMXE_download::xml($filepath);
307
+ break;
308
+ case 'csv':
309
+ PMXE_download::csv($filepath);
310
+ break;
311
+
312
+ default:
313
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('File format not supported', 'pmxe_plugin')), $this->baseUrl)); die();
314
+ break;
315
+ }
316
+
317
+ }
318
+ else{
319
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported file is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'pmxe_plugin')), $this->baseUrl)); die();
320
+ }
321
+ }
322
+ else {
323
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('The exported file is missing and can\'t be downloaded. Please re-run your export to re-generate it.', 'pmxe_plugin')), $this->baseUrl)); die();
324
+ }
325
+ }
326
+ }
327
+
328
+ }
controllers/admin/settings.php CHANGED
@@ -8,7 +8,19 @@ class PMXE_Admin_Settings extends PMXE_Controller_Admin {
8
 
9
  public function index() {
10
 
11
- $this->data['post'] = $post = $this->input->post(PMXI_Plugin::getInstance()->getOption());
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  $this->render();
14
 
@@ -21,10 +33,4 @@ class PMXE_Admin_Settings extends PMXE_Controller_Admin {
21
  exit('OK');
22
  }
23
 
24
- public function download(){
25
-
26
- PMXE_download::csv(PMXE_Plugin::ROOT_DIR.'/logs/'.$_GET['file'].'.txt');
27
-
28
- }
29
-
30
  }
8
 
9
  public function index() {
10
 
11
+ $this->data['post'] = $post = $this->input->post(PMXE_Plugin::getInstance()->getOption());
12
+
13
+ if ($this->input->post('is_settings_submitted')) { // save settings form
14
+
15
+ check_admin_referer('edit-settings', '_wpnonce_edit-settings');
16
+
17
+ if ( ! $this->errors->get_error_codes()) { // no validation errors detected
18
+
19
+ PMXE_Plugin::getInstance()->updateOption($post);
20
+
21
+ wp_redirect(add_query_arg('pmxe_nt', urlencode(__('Settings saved', 'pmxe_plugin')), $this->baseUrl)); die();
22
+ }
23
+ }
24
 
25
  $this->render();
26
 
33
  exit('OK');
34
  }
35
 
 
 
 
 
 
 
36
  }
controllers/controller.php CHANGED
@@ -56,21 +56,29 @@ abstract class PMXE_Controller {
56
  * @param string[optional] $viewPath Template path to render
57
  */
58
  protected function render($viewPath = null) {
59
- // assume template file name depending on calling function
60
- if (is_null($viewPath)) {
61
- $trace = debug_backtrace();
62
- $viewPath = str_replace('_', '/', preg_replace('%^' . preg_quote(PMXE_Plugin::PREFIX, '%') . '%', '', strtolower($trace[1]['class']))) . '/' . $trace[1]['function'];
63
- }
64
- // append file extension if not specified
65
- if ( ! preg_match('%\.php$%', $viewPath)) {
66
- $viewPath .= '.php';
67
- }
68
- $filePath = PMXE_Plugin::ROOT_DIR . '/views/' . $viewPath;
69
- if (is_file($filePath)) {
70
- extract($this->data);
71
- include $filePath;
72
  } else {
73
- throw new Exception("Requested template file $filePath is not found.");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
  }
76
 
@@ -99,4 +107,33 @@ abstract class PMXE_Controller {
99
  }
100
  }
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  }
56
  * @param string[optional] $viewPath Template path to render
57
  */
58
  protected function render($viewPath = null) {
59
+
60
+ if ( ! get_current_user_id() or ! current_user_can('manage_options')) {
61
+ // This nonce is not valid.
62
+ die( 'Security check' );
63
+
 
 
 
 
 
 
 
 
64
  } else {
65
+
66
+ // assume template file name depending on calling function
67
+ if (is_null($viewPath)) {
68
+ $trace = debug_backtrace();
69
+ $viewPath = str_replace('_', '/', preg_replace('%^' . preg_quote(PMXE_Plugin::PREFIX, '%') . '%', '', strtolower($trace[1]['class']))) . '/' . $trace[1]['function'];
70
+ }
71
+ // append file extension if not specified
72
+ if ( ! preg_match('%\.php$%', $viewPath)) {
73
+ $viewPath .= '.php';
74
+ }
75
+ $filePath = PMXE_Plugin::ROOT_DIR . '/views/' . $viewPath;
76
+ if (is_file($filePath)) {
77
+ extract($this->data);
78
+ include $filePath;
79
+ } else {
80
+ throw new Exception("Requested template file $filePath is not found.");
81
+ }
82
  }
83
  }
84
 
107
  }
108
  }
109
 
110
+ public function download(){
111
+
112
+ $nonce = (!empty($_REQUEST['_wpnonce'])) ? $_REQUEST['_wpnonce'] : '';
113
+ if ( ! wp_verify_nonce( $nonce, '_wpnonce-download_feed' ) ) {
114
+ die( __('Security check', 'wp_all_export_plugin') );
115
+ } else {
116
+
117
+ $attch_url = PMXE_Plugin::$session->file;
118
+
119
+ $export_type = PMXE_Plugin::$session->export_to;
120
+
121
+ // clear import session
122
+ PMXE_Plugin::$session->clean_session(); // clear session data (prevent from reimporting the same data on page refresh)
123
+
124
+ switch ($export_type) {
125
+ case 'xml':
126
+ PMXE_download::xml($attch_url);
127
+ break;
128
+ case 'csv':
129
+ PMXE_download::csv($attch_url);
130
+ break;
131
+
132
+ default:
133
+ # code...
134
+ break;
135
+ }
136
+ }
137
+
138
+ }
139
  }
controllers/controller/admin.php CHANGED
@@ -47,6 +47,7 @@ abstract class PMXE_Controller_Admin extends PMXE_Controller {
47
  wp_enqueue_style('pmxe-admin-style-ie', PMXE_ROOT_URL . '/static/css/admin-ie.css');
48
  wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2.css');
49
  wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2-bootstrap.css');
 
50
  $wp_styles->add_data('pmxe-admin-style-ie', 'conditional', 'lte IE 7');
51
  wp_enqueue_style('wp-pointer');
52
 
@@ -62,9 +63,11 @@ abstract class PMXE_Controller_Admin extends PMXE_Controller {
62
  wp_enqueue_script('jquery-ui-datepicker', PMXE_ROOT_URL . '/static/js/jquery/ui.datepicker.js', 'jquery-ui-core');
63
  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'));
64
  wp_enqueue_script('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/jquery.tipsy.js', 'jquery');
65
- wp_enqueue_script('jquery-nestable', PMXE_ROOT_URL . '/static/js/jquery/jquery.mjs.nestedSortable.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-tabs', 'jquery-ui-progressbar'));
66
  wp_enqueue_script('jquery-moment', PMXE_ROOT_URL . '/static/js/jquery/moment.js', 'jquery');
67
  wp_enqueue_script('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/select2.min.js', 'jquery');
 
 
68
  wp_enqueue_script('wp-pointer');
69
 
70
  /* load plupload scripts */
47
  wp_enqueue_style('pmxe-admin-style-ie', PMXE_ROOT_URL . '/static/css/admin-ie.css');
48
  wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2.css');
49
  wp_enqueue_style('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/css/select2/select2-bootstrap.css');
50
+ wp_enqueue_style('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/css/chosen/chosen.css');
51
  $wp_styles->add_data('pmxe-admin-style-ie', 'conditional', 'lte IE 7');
52
  wp_enqueue_style('wp-pointer');
53
 
63
  wp_enqueue_script('jquery-ui-datepicker', PMXE_ROOT_URL . '/static/js/jquery/ui.datepicker.js', 'jquery-ui-core');
64
  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'));
65
  wp_enqueue_script('jquery-tipsy', PMXE_ROOT_URL . '/static/js/jquery/jquery.tipsy.js', 'jquery');
66
+ 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'));
67
  wp_enqueue_script('jquery-moment', PMXE_ROOT_URL . '/static/js/jquery/moment.js', 'jquery');
68
  wp_enqueue_script('jquery-select2', PMXE_ROOT_URL . '/static/js/jquery/select2.min.js', 'jquery');
69
+ wp_enqueue_script('jquery-ddslick', PMXE_ROOT_URL . '/static/js/jquery/jquery.ddslick.min.js', 'jquery');
70
+ wp_enqueue_script('jquery-chosen', PMXE_ROOT_URL . '/static/js/jquery/chosen.jquery.min.js', 'jquery');
71
  wp_enqueue_script('wp-pointer');
72
 
73
  /* load plupload scripts */
filters/.gitkeep ADDED
File without changes
filters/wp_all_import_is_exported_file_valid.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function pmxe_wp_all_import_is_exported_file_valid($is_valid, $export_id, $elements_cloud){
4
+
5
+ $exportRecord = new PMXE_Export_Record();
6
+ $exportRecord->getById($export_id);
7
+ if ( ! $exportRecord->isEmpty()){
8
+ $exportOptions = $exportRecord->options;
9
+ $required_fields = array();
10
+ foreach ($exportOptions['ids'] as $ID => $value) {
11
+ if (is_numeric($ID)){
12
+
13
+ if ($exportOptions['export_to'] == 'csv')
14
+ {
15
+ $element_name = ( ! empty($exportOptions['cc_name'][$ID]) ) ? preg_replace('/[^a-z0-9_]/i', '', $exportOptions['cc_name'][$ID]) : 'untitled_' . $ID;
16
+ }
17
+ else
18
+ {
19
+ $element_name = ( ! empty($exportOptions['cc_name'][$ID]) ) ? str_replace(" ", "_", $exportOptions['cc_name'][$ID]) : 'untitled_' . $ID;
20
+ }
21
+
22
+ switch ($exportOptions['cc_type'][$ID]) {
23
+ case 'id':
24
+ $required_fields[] = $element_name;
25
+ break;
26
+ case 'post_type':
27
+ if ($exportOptions['export_type'] == 'advanced')
28
+ $required_fields[] = $element_name;
29
+ break;
30
+ case 'woo':
31
+ if ( ! empty($exportOptions['cpt']) and in_array('product', $exportOptions['cpt']))
32
+ {
33
+ switch ($exportOptions['cc_label'][$ID]) {
34
+ case '_sku':
35
+ $required_fields[] = $element_name;
36
+ break;
37
+ }
38
+ }
39
+ break;
40
+ case 'cats':
41
+ if ( ! empty($exportOptions['cpt']) and in_array('product', $exportOptions['cpt']))
42
+ {
43
+ switch ($exportOptions['cc_label'][$ID]) {
44
+ case 'product_type':
45
+ $required_fields[] = $element_name;
46
+ break;
47
+ }
48
+ }
49
+ break;
50
+ }
51
+ }
52
+ }
53
+ if ( ! empty($required_fields) ){
54
+ foreach ($required_fields as $field) {
55
+ if (empty($elements_cloud[$field]) and empty($elements_cloud[strtolower($field)])) {
56
+ $is_valid = false;
57
+ break;
58
+ }
59
+ }
60
+ }
61
+ }
62
+
63
+ return $is_valid;
64
+
65
+ }
filters/wpallexport_custom_types.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function pmxe_wpallexport_custom_types($custom_types){
4
+ if ( ! empty($custom_types['product']) and class_exists('WooCommerce')) $custom_types['product']->labels->name = __('WooCommerce Products','wp_all_export_plugin');
5
+ if ( ! empty($custom_types['product_variation'])) unset($custom_types['product_variation']);
6
+ return $custom_types;
7
+ }
helpers/backward.php CHANGED
File without changes
helpers/get_taxonomies_by_object_type.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! function_exists('get_taxonomies_by_object_type')):
3
+ /**
4
+ * get_taxnomies doesn't filter propery by object_type, so these function can be used when filtering by object type requied
5
+ * @param string|array $object_type
6
+ * @param string[optional] $output
7
+ */
8
+ function get_taxonomies_by_object_type($object_type, $output = 'names') {
9
+ global $wp_taxonomies;
10
+
11
+ is_array($object_type) or $object_type = array($object_type);
12
+ $field = ('names' == $output) ? 'name' : false;
13
+ $filtered = array();
14
+ foreach ($wp_taxonomies as $key => $obj) {
15
+ if (array_intersect($object_type, $obj->object_type)) {
16
+ $filtered[$key] = $obj;
17
+ }
18
+ }
19
+ if ($field) {
20
+ $filtered = wp_list_pluck($filtered, $field);
21
+ }
22
+ return $filtered;
23
+ }
24
+
25
+ endif;
helpers/pmxe_export_acf_field_csv.php ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function pmxe_export_acf_field_csv($field_value, $exportOptions, $ID, $recordID, &$article, &$acfs, $element_name = '', $fieldSnipped = '', $group_id = '', $preview = false){
4
+
5
+ $put_to_csv = true;
6
+
7
+ $field_name = ($ID) ? $exportOptions['cc_label'][$ID] : $exportOptions['name'];
8
+
9
+ $field_options = ($ID) ? unserialize($exportOptions['cc_options'][$ID]) : $exportOptions;
10
+
11
+ if ( ! empty($field_value) ) {
12
+
13
+ $field_value = maybe_unserialize($field_value);
14
+
15
+ $implode_delimiter = ($exportOptions['delimiter'] == ',') ? '|' : ',';
16
+
17
+ // switch ACF field type
18
+ switch ($field_options['type']) {
19
+
20
+ case 'date_time_picker':
21
+ case 'date_picker':
22
+
23
+ $field_value = date('Ymd', strtotime($field_value));
24
+
25
+ break;
26
+
27
+ case 'file':
28
+ case 'image':
29
+
30
+ if (is_numeric($field_value)){
31
+ $field_value = wp_get_attachment_url($field_value);
32
+ }
33
+ elseif(is_array($field_value)){
34
+ $field_value = $field_value['url'];
35
+ }
36
+
37
+ break;
38
+
39
+ case 'gallery':
40
+
41
+ $v = array();
42
+ foreach ($field_value as $key => $item) {
43
+ $v[] = $item['url'];
44
+ }
45
+ $field_value = implode($implode_delimiter, $v);
46
+
47
+ break;
48
+ case 'location-field':
49
+
50
+ $localion_parts = explode("|", $field_value);
51
+
52
+ $acfs[] = $element_name . '_address';
53
+ $acfs[] = $element_name . '_lat';
54
+ $acfs[] = $element_name . '_lng';
55
+
56
+ if (!empty($localion_parts)){
57
+
58
+ $article[$element_name . '_address'] = $localion_parts[0];
59
+
60
+ if (!empty($localion_parts[1])){
61
+ $coordinates = explode(",", $localion_parts[1]);
62
+ if (!empty($coordinates)){
63
+ $article[$element_name . '_lat'] = $coordinates[0];
64
+ $article[$element_name . '_lng'] = $coordinates[1];
65
+ }
66
+ }
67
+ }
68
+
69
+ $put_to_csv = false;
70
+
71
+ break;
72
+ case 'paypal_item':
73
+
74
+ $acfs[] = $element_name . '_item_name';
75
+ $acfs[] = $element_name . '_item_description';
76
+ $acfs[] = $element_name . '_price';
77
+
78
+ if ( is_array($field_value) ){
79
+ foreach ($field_value as $key => $value) {
80
+ $article[$element_name . '_' . $key] = $value;
81
+ }
82
+ }
83
+
84
+ $put_to_csv = false;
85
+
86
+ break;
87
+ case 'google_map':
88
+
89
+ $article[$element_name . '_address'] = $field_value['address'];
90
+ $acfs[] = $element_name . '_address';
91
+
92
+ $article[$element_name . '_lat'] = $field_value['lat'];
93
+ $acfs[] = $element_name . '_lat';
94
+
95
+ $article[$element_name . '_lng'] = $field_value['lng'];
96
+ $acfs[] = $element_name . '_lng';
97
+
98
+ $put_to_csv = false;
99
+
100
+ break;
101
+
102
+ case 'acf_cf7':
103
+ case 'gravity_forms_field':
104
+
105
+ if ( ! empty($field_options['multiple']) )
106
+ $field_value = implode($implode_delimiter, $field_value);
107
+
108
+ break;
109
+
110
+ case 'page_link':
111
+
112
+ if (is_array($field_value))
113
+ $field_value = implode($implode_delimiter, $field_value);
114
+
115
+ break;
116
+ case 'post_object':
117
+
118
+ if ( ! empty($field_options['multiple'])){
119
+ $v = array();
120
+ foreach ($field_value as $key => $pid) {
121
+
122
+ if (is_numeric($pid)){
123
+ $entry = get_post($pid);
124
+ if ($entry)
125
+ {
126
+ $v[] = $entry->post_name;
127
+ }
128
+ }
129
+ else{
130
+ $v[] = $pid->post_name;
131
+ }
132
+ }
133
+ $field_value = implode($implode_delimiter, $v);
134
+ }
135
+ else{
136
+ if (is_numeric($field_value)){
137
+ $entry = get_post($field_value);
138
+ if ($entry)
139
+ {
140
+ $field_value = $entry->post_name;
141
+ }
142
+ }
143
+ else{
144
+ $field_value = $field_value->post_name;
145
+ }
146
+ }
147
+
148
+ break;
149
+ case 'relationship':
150
+
151
+ $v = array();
152
+ foreach ($field_value as $key => $pid) {
153
+ $entry = get_post($pid);
154
+ if ($entry)
155
+ {
156
+ $v[] = $entry->post_title;
157
+ }
158
+ }
159
+ $field_value = implode($implode_delimiter, $v);
160
+
161
+ break;
162
+ case 'user':
163
+
164
+ if ( ! empty($field_options['multiple'])){
165
+ $v = array();
166
+ foreach ($field_value as $key => $user) {
167
+ if (is_numeric($user)){
168
+ $entry = get_user_by('ID', $user);
169
+ if ($entry)
170
+ {
171
+ $v[] = $entry->user_email;
172
+ }
173
+ }
174
+ else{
175
+ $v[] = $user['user_email'];
176
+ }
177
+ }
178
+ $field_value = implode($implode_delimiter, $v);
179
+ }
180
+ else{
181
+ if (is_numeric($field_value)){
182
+ $entry = get_user_by('ID', $field_value);
183
+ if ($entry)
184
+ {
185
+ $field_value = $entry->user_email;
186
+ }
187
+ }
188
+ else{
189
+ $field_value = $field_value['user_email'];
190
+ }
191
+ }
192
+
193
+ break;
194
+ case 'taxonomy':
195
+
196
+ if ( ! in_array($field_options['field_type'], array('radio', 'select'))){
197
+ $v = array();
198
+ foreach ($field_value as $key => $tid) {
199
+ $entry = get_term($tid , $field_options['taxonomy']);
200
+ if ($entry and !is_wp_error($entry))
201
+ {
202
+ $v[] = $entry->name;
203
+ }
204
+ }
205
+ $field_value = implode($implode_delimiter, $v);
206
+ }
207
+ else{
208
+ $entry = get_term($field_value, $field_options['taxonomy']);
209
+ if ($entry)
210
+ {
211
+ $field_value = $entry->name;
212
+ }
213
+ }
214
+
215
+ break;
216
+ case 'select':
217
+
218
+ if ( ! empty($field_options['multiple'])){
219
+ $field_value = implode($implode_delimiter, $field_value);
220
+ }
221
+
222
+ break;
223
+ case 'checkbox':
224
+
225
+ $field_value = implode($implode_delimiter, $field_value);
226
+
227
+ break;
228
+
229
+ case 'repeater':
230
+
231
+ if( have_rows($field_name, $recordID) ){
232
+
233
+ $rowValues = array();
234
+
235
+ while( have_rows($field_name, $recordID) ): the_row();
236
+
237
+ $row = acf_get_row();
238
+
239
+ foreach ($row['field']['sub_fields'] as $sub_field) {
240
+
241
+ // get
242
+ $v = $row['value'][ $row['i'] ][ $sub_field['key'] ];//acf_format_value($row['value'][ $row['i'] ][ $sub_field['key'] ], $row['post_id'], $sub_field);
243
+
244
+ $rowValues[$sub_field['name']][] = $v;
245
+
246
+ //pmxe_export_acf_field_csv($v, $sub_field, false, $recordID, $article, $acfs, str_replace('acf' . $group_id, '', $element_name) . '_' . $sub_field['name'], '');
247
+
248
+ }
249
+
250
+ endwhile;
251
+
252
+ foreach ($rowValues as $key => $values) {
253
+ $article[$element_name . '_' . $key] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars(implode($implode_delimiter, $values)))) : implode($implode_delimiter, $values);
254
+ if ( ! in_array($element_name . '_' . $key, $acfs)) $acfs[] = $element_name . '_' . $key;
255
+ }
256
+
257
+ }
258
+
259
+ $put_to_csv = false;
260
+
261
+ break;
262
+
263
+ case 'flexible_content':
264
+
265
+ // check if the flexible content field has rows of data
266
+ if( have_rows($field_name) ):
267
+
268
+ // loop through the rows of data
269
+ while ( have_rows($field_name) ) : the_row();
270
+
271
+ $row = acf_get_row();
272
+
273
+ foreach ($row['field']['layouts'] as $layout) {
274
+
275
+ if ($layout['name'] == $row['value'][ $row['i'] ]['acf_fc_layout']){
276
+
277
+ foreach ($layout['sub_fields'] as $sub_field) {
278
+
279
+ if (isset($row['value'][ $row['i'] ][ $sub_field['key'] ])){
280
+ // get
281
+ $v = $row['value'][ $row['i'] ][ $sub_field['key'] ]; //acf_format_value($row['value'][ $row['i'] ][ $sub_field['key'] ], $row['post_id'], $sub_field);
282
+
283
+ $article[$element_name . '_' . $layout['name'] . '_' . $row['i'] . '_' . $sub_field['name']] = $v;
284
+ $acfs[] = $element_name . '_' . $layout['name'] . '_' . $row['i'] . '_' . $sub_field['name'];
285
+
286
+ //pmxe_export_acf_field_csv($v, $sub_field, false, $recordID, $article, $acfs, str_replace('acf' . $group_id, '', $element_name) . '_' . $row['value'][ $row['i'] ]['acf_fc_layout'] . '_' . $row['i'] . '_' . $sub_field['name'], '', '', true);
287
+ }
288
+
289
+ }
290
+ }
291
+ }
292
+
293
+ endwhile;
294
+
295
+ else :
296
+
297
+ // no layouts found
298
+
299
+ endif;
300
+
301
+ $put_to_csv = false;
302
+
303
+ break;
304
+
305
+ default:
306
+
307
+ break;
308
+ }
309
+
310
+ }
311
+
312
+ if ($put_to_csv){
313
+
314
+
315
+ switch ($field_options['type']) {
316
+
317
+ case 'repeater':
318
+
319
+ global $acf;
320
+
321
+ if ($acf->settings['version'] and version_compare($acf->settings['version'], '5.0.0') >= 0){
322
+
323
+ $acf_fields = get_posts(array('posts_per_page' => -1, 'post_type' => 'acf-field', 'post_parent' => $field_options['ID'], 'post_status' => 'publish', 'orderby' => 'menu_order', 'order' => 'ASC'));
324
+
325
+ if ( ! empty($acf_fields) ){
326
+
327
+ foreach ($acf_fields as $field) {
328
+
329
+ $sub_name = $element_name . '_' . $field->post_excerpt;
330
+
331
+ if ( ! in_array($sub_name, $acfs)) $acfs[] = $sub_name;
332
+
333
+ }
334
+
335
+ }
336
+
337
+ }
338
+
339
+ break;
340
+
341
+ case 'google_map':
342
+ case 'location-field':
343
+
344
+ $acfs[] = $element_name . '_address';
345
+ $acfs[] = $element_name . '_lat';
346
+ $acfs[] = $element_name . '_lng';
347
+
348
+ break;
349
+ case 'paypal_item':
350
+
351
+ $acfs[] = $element_name . '_item_name';
352
+ $acfs[] = $element_name . '_item_description';
353
+ $acfs[] = $element_name . '_price';
354
+
355
+ break;
356
+
357
+ default:
358
+
359
+ $val = apply_filters('pmxe_acf_field', pmxe_filter( ( ! empty($field_value) ) ? maybe_serialize($field_value) : '', $fieldSnipped), $field_name, $recordID);
360
+ $article[$element_name] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val;
361
+ $acfs[] = $element_name;
362
+
363
+ break;
364
+
365
+ }
366
+
367
+ }
368
+ }
369
+
helpers/pmxe_export_acf_field_xml.php ADDED
@@ -0,0 +1,345 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function pmxe_export_acf_field_xml($field_value, $exportOptions, $ID, $recordID, &$xmlWriter, $element_name = '', $fieldSnipped = '', $group_id = ''){
4
+
5
+ if ( ! empty($field_value) ) {
6
+
7
+ $field_value = maybe_unserialize($field_value);
8
+
9
+ $field_name = ($ID) ? $exportOptions['cc_label'][$ID] : $exportOptions['name'];
10
+
11
+ $field_options = ($ID) ? unserialize($exportOptions['cc_options'][$ID]) : $exportOptions;
12
+
13
+ //$element_name = 'acf_' . $element_name;
14
+
15
+ $put_to_xml = true;
16
+
17
+ // switch ACF field type
18
+ switch ($field_options['type']) {
19
+
20
+ case 'date_time_picker':
21
+ case 'date_picker':
22
+
23
+ $field_value = date('Ymd', strtotime($field_value));
24
+
25
+ break;
26
+
27
+ case 'file':
28
+ case 'image':
29
+
30
+ if (is_numeric($field_value)){
31
+ $field_value = wp_get_attachment_url($field_value);
32
+ }
33
+ elseif(is_array($field_value)){
34
+ $field_value = $field_value['url'];
35
+ }
36
+
37
+ break;
38
+
39
+ case 'gallery':
40
+
41
+ $v = array();
42
+ foreach ($field_value as $key => $item) {
43
+ $v[] = $item['url'];
44
+ }
45
+ $field_value = implode(",", $v);
46
+
47
+ break;
48
+ case 'location-field':
49
+
50
+ $localion_parts = explode("|", $field_value);
51
+
52
+ if (!empty($localion_parts)){
53
+
54
+ $xmlWriter->startElement($element_name);
55
+ $xmlWriter->startElement('address');
56
+ $xmlWriter->writeCData($localion_parts[0]);
57
+ $xmlWriter->endElement();
58
+
59
+ if (!empty($localion_parts[1])){
60
+ $coordinates = explode(",", $localion_parts[1]);
61
+ if (!empty($coordinates)){
62
+ $xmlWriter->startElement('lat');
63
+ $xmlWriter->writeCData($coordinates[0]);
64
+ $xmlWriter->endElement();
65
+ $xmlWriter->startElement('lng');
66
+ $xmlWriter->writeCData($coordinates[1]);
67
+ $xmlWriter->endElement();
68
+ }
69
+ }
70
+ $xmlWriter->endElement();
71
+
72
+ }
73
+
74
+ $put_to_xml = false;
75
+
76
+ break;
77
+ case 'paypal_item':
78
+
79
+ $xmlWriter->startElement($element_name);
80
+ if ( is_array($field_value) ){
81
+ foreach ($field_value as $key => $value) {
82
+ $xmlWriter->startElement($key);
83
+ $xmlWriter->writeCData($value);
84
+ $xmlWriter->endElement();
85
+ }
86
+ }
87
+ $xmlWriter->endElement();
88
+
89
+ $put_to_xml = false;
90
+
91
+ break;
92
+ case 'google_map':
93
+
94
+ $xmlWriter->startElement($element_name);
95
+ $xmlWriter->startElement('address');
96
+ $xmlWriter->writeCData($field_value['address']);
97
+ $xmlWriter->endElement();
98
+ $xmlWriter->startElement('lat');
99
+ $xmlWriter->writeCData($field_value['lat']);
100
+ $xmlWriter->endElement();
101
+ $xmlWriter->startElement('lng');
102
+ $xmlWriter->writeCData($field_value['lng']);
103
+ $xmlWriter->endElement();
104
+ $xmlWriter->endElement();
105
+
106
+ $put_to_xml = false;
107
+
108
+ break;
109
+
110
+ case 'acf_cf7':
111
+ case 'gravity_forms_field':
112
+
113
+ if ( ! empty($field_options['multiple']) )
114
+ $field_value = implode(",", $field_value);
115
+
116
+ break;
117
+
118
+ case 'page_link':
119
+
120
+ if (is_array($field_value))
121
+ $field_value = implode(",", $field_value);
122
+
123
+ break;
124
+ case 'post_object':
125
+
126
+ if ( ! empty($field_options['multiple'])){
127
+ $v = array();
128
+ foreach ($field_value as $key => $pid) {
129
+
130
+ if (is_numeric($pid)){
131
+ $entry = get_post($pid);
132
+ if ($entry)
133
+ {
134
+ $v[] = $entry->post_name;
135
+ }
136
+ }
137
+ else{
138
+ $v[] = $pid->post_name;
139
+ }
140
+ }
141
+ $field_value = implode(",", $v);
142
+ }
143
+ else{
144
+ if (is_numeric($field_value)){
145
+ $entry = get_post($field_value);
146
+ if ($entry)
147
+ {
148
+ $field_value = $entry->post_name;
149
+ }
150
+ }
151
+ else{
152
+ $field_value = $field_value->post_name;
153
+ }
154
+ }
155
+
156
+ break;
157
+ case 'relationship':
158
+
159
+ $v = array();
160
+ foreach ($field_value as $key => $pid) {
161
+ $entry = get_post($pid);
162
+ if ($entry)
163
+ {
164
+ $v[] = $entry->post_title;
165
+ }
166
+ }
167
+ $field_value = implode(",", $v);
168
+
169
+ break;
170
+ case 'user':
171
+
172
+ if ( ! empty($field_options['multiple'])){
173
+ $v = array();
174
+ foreach ($field_value as $key => $user) {
175
+ if (is_numeric($user)){
176
+ $entry = get_user_by('ID', $user);
177
+ if ($entry)
178
+ {
179
+ $v[] = $entry->user_email;
180
+ }
181
+ }
182
+ else{
183
+ $v[] = $user['user_email'];
184
+ }
185
+ }
186
+ $field_value = implode(",", $v);
187
+ }
188
+ else{
189
+ if (is_numeric($field_value)){
190
+ $entry = get_user_by('ID', $field_value);
191
+ if ($entry)
192
+ {
193
+ $field_value = $entry->user_email;
194
+ }
195
+ }
196
+ else{
197
+ $field_value = $field_value['user_email'];
198
+ }
199
+ }
200
+
201
+ break;
202
+ case 'taxonomy':
203
+
204
+ $xmlWriter->startElement($element_name);
205
+
206
+ if ( ! in_array($field_options['field_type'], array('radio', 'select'))){
207
+ foreach ($field_value as $key => $tid) {
208
+ $entry = get_term($tid , $field_options['taxonomy']);
209
+ if ($entry and !is_wp_error($entry))
210
+ {
211
+ $xmlWriter->startElement('term');
212
+ $xmlWriter->writeCData($entry->name);
213
+ $xmlWriter->endElement();
214
+ }
215
+ }
216
+ }
217
+ else{
218
+ $entry = get_term($field_value, $field_options['taxonomy']);
219
+ if ($entry)
220
+ {
221
+ $xmlWriter->startElement('term');
222
+ $xmlWriter->writeCData($entry->name);
223
+ $xmlWriter->endElement();
224
+ }
225
+ }
226
+
227
+ $xmlWriter->endElement();
228
+
229
+ $put_to_xml = false;
230
+
231
+ break;
232
+ case 'select':
233
+
234
+ if ( ! empty($field_options['multiple'])){
235
+ $field_value = implode(",", $field_value);
236
+ }
237
+
238
+ break;
239
+ case 'checkbox':
240
+
241
+ $field_value = implode(",", $field_value);
242
+
243
+ break;
244
+
245
+ case 'repeater':
246
+
247
+ $xmlWriter->startElement($element_name);
248
+
249
+ if( have_rows($field_name, $recordID) ):
250
+
251
+ while( have_rows($field_name, $recordID) ):
252
+
253
+ the_row();
254
+
255
+ $row = acf_get_row();
256
+
257
+ //$xmlWriter->startElementNs('key_' . $row['i'], 'row', null);
258
+
259
+ $xmlWriter->startElement('row');
260
+
261
+ foreach ($row['field']['sub_fields'] as $sub_field) {
262
+
263
+ // get
264
+ $v = acf_format_value($row['value'][ $row['i'] ][ $sub_field['key'] ], $row['post_id'], $sub_field);
265
+
266
+ pmxe_export_acf_field_xml($v, $sub_field, false, $recordID, $xmlWriter, $sub_field['name'], '', '');
267
+
268
+ }
269
+
270
+ $xmlWriter->endElement();
271
+
272
+ endwhile;
273
+
274
+ endif;
275
+
276
+ $xmlWriter->endElement();
277
+
278
+ $put_to_xml = false;
279
+
280
+ break;
281
+
282
+ case 'flexible_content':
283
+
284
+ $xmlWriter->startElement($element_name);
285
+
286
+ // check if the flexible content field has rows of data
287
+ if( have_rows($field_name) ):
288
+
289
+ // loop through the rows of data
290
+ while ( have_rows($field_name) ) : the_row();
291
+
292
+ $row = acf_get_row();
293
+
294
+ foreach ($row['field']['layouts'] as $layout) {
295
+
296
+ if ($layout['name'] == $row['value'][ $row['i'] ]['acf_fc_layout']){
297
+
298
+ $xmlWriter->startElement($row['value'][ $row['i'] ]['acf_fc_layout'] . '_' . $row['i']);
299
+
300
+ foreach ($layout['sub_fields'] as $sub_field) {
301
+
302
+ if (isset($row['value'][ $row['i'] ][ $sub_field['key'] ])){
303
+ // get
304
+ $v = acf_format_value($row['value'][ $row['i'] ][ $sub_field['key'] ], $row['post_id'], $sub_field);
305
+
306
+ pmxe_export_acf_field_xml($v, $sub_field, false, $recordID, $xmlWriter, $sub_field['name'], '', '');
307
+ }
308
+
309
+ }
310
+
311
+ $xmlWriter->endElement();
312
+ }
313
+
314
+ }
315
+
316
+ endwhile;
317
+
318
+ else :
319
+
320
+ // no layouts found
321
+
322
+ endif;
323
+
324
+ $xmlWriter->endElement();
325
+
326
+ $put_to_xml = false;
327
+
328
+ break;
329
+
330
+ default:
331
+
332
+ break;
333
+ }
334
+
335
+ if ($put_to_xml){
336
+
337
+ $xmlWriter->startElement($element_name);
338
+ $xmlWriter->writeCData(apply_filters('pmxe_acf_field', pmxe_filter( maybe_serialize($field_value), $fieldSnipped), $field_name, $recordID));
339
+ $xmlWriter->endElement();
340
+
341
+ }
342
+
343
+ }
344
+
345
+ }
helpers/pmxe_export_csv.php ADDED
@@ -0,0 +1,589 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Export CSV helper
4
+ */
5
+ function pmxe_export_csv($exportQuery, $exportOptions, $preview = false, $is_cron = false, $file_path = false, $exported_by_cron = 0){
6
+
7
+ ob_start();
8
+
9
+ // Prepare headers
10
+
11
+ $headers = array();
12
+
13
+ $stream = fopen("php://output", 'w');
14
+
15
+ $max_attach_count = 0;
16
+ $max_images_count = 0;
17
+
18
+ $cf = array();
19
+ $woo = array();
20
+ $woo_order = array();
21
+ $acfs = array();
22
+ $taxes = array();
23
+ $attributes = array();
24
+ $articles = array();
25
+
26
+ $implode_delimiter = ($exportOptions['delimiter'] == ',') ? '|' : ',';
27
+
28
+ while ( $exportQuery->have_posts() ) :
29
+
30
+ $attach_count = 0;
31
+ $images_count = 0;
32
+
33
+ $exportQuery->the_post();
34
+
35
+ $record = get_post( get_the_ID() );
36
+
37
+ $article = array();
38
+
39
+ $article['post_type'] = $record->post_type;
40
+ $article['ID'] = apply_filters('pmxe_post_id', get_the_ID());
41
+ $article['permalink'] = get_permalink();
42
+
43
+ global $wpdb;
44
+ $table_prefix = $wpdb->prefix;
45
+
46
+ if ($exportOptions['ids']):
47
+
48
+ if ( wp_all_export_is_compatible() and $exportOptions['is_generate_import'] and $exportOptions['import_id']){
49
+ $postRecord = new PMXI_Post_Record();
50
+ $postRecord->clear();
51
+ $postRecord->getBy(array(
52
+ 'post_id' => $record->ID,
53
+ 'import_id' => $exportOptions['import_id'],
54
+ ));
55
+
56
+ if ($postRecord->isEmpty()){
57
+ $postRecord->set(array(
58
+ 'post_id' => $record->ID,
59
+ 'import_id' => $exportOptions['import_id'],
60
+ 'unique_key' => $record->ID,
61
+ 'product_key' => get_post_meta($record->ID, '_sku', true)
62
+ ))->save();
63
+ }
64
+ unset($postRecord);
65
+ }
66
+
67
+ foreach ($exportOptions['ids'] as $ID => $value) {
68
+
69
+ if (is_numeric($ID)){
70
+
71
+ if ( empty($exportOptions['cc_name'][$ID]) or empty($exportOptions['cc_type'][$ID]) ) continue;
72
+
73
+ $element_name = ( ! empty($exportOptions['cc_name'][$ID]) ) ? $exportOptions['cc_name'][$ID] : 'untitled_' . $ID;
74
+ $fieldSnipped = ( ! empty($exportOptions['cc_php'][$ID] ) and ! empty($exportOptions['cc_code'][$ID])) ? $exportOptions['cc_code'][$ID] : false;
75
+
76
+ switch ($exportOptions['cc_type'][$ID]){
77
+ case 'id':
78
+ $article[$element_name] = apply_filters('pmxe_post_id', pmxe_filter(get_the_ID(), $fieldSnipped), get_the_ID());
79
+ break;
80
+ case 'permalink':
81
+ $article[$element_name] = apply_filters('pmxe_post_guid', pmxe_filter(get_permalink(), $fieldSnipped), get_the_ID());
82
+ break;
83
+ case 'post_type':
84
+ $pType = get_post_type();
85
+ if ($pType == 'product_variation') $pType = 'product';
86
+ $article[$element_name] = apply_filters('pmxe_post_type', pmxe_filter($pType, $fieldSnipped), get_the_ID());
87
+ break;
88
+ case 'title':
89
+ $article[$element_name] = apply_filters('pmxe_post_title', pmxe_filter($record->post_title, $fieldSnipped), get_the_ID());
90
+ break;
91
+ case 'content':
92
+ $val = apply_filters('pmxe_post_content', pmxe_filter($record->post_content, $fieldSnipped), get_the_ID());
93
+ $article[$element_name] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val;
94
+ break;
95
+ case 'media':
96
+
97
+ $attachment_ids = array();
98
+
99
+ $_featured_image = get_post_meta(get_the_ID(), '_thumbnail_id', true);
100
+
101
+ if ( ! empty($_featured_image)) $attachment_ids[] = $_featured_image;
102
+
103
+ $_gallery = get_post_meta(get_the_ID(), '_product_image_gallery', true);
104
+
105
+ if (!empty($_gallery)){
106
+ $gallery = explode(',', $_gallery);
107
+ if (!empty($gallery) and is_array($gallery)){
108
+ foreach ($gallery as $aid) {
109
+ if (!in_array($aid, $attachment_ids)) $attachment_ids[] = $aid;
110
+ }
111
+ }
112
+ }
113
+
114
+ if ( ! empty($attachment_ids)):
115
+ $img_urls = array();
116
+ $img_titles = array();
117
+ $img_captions = array();
118
+ $img_alts = array();
119
+ $img_descriptions = array();
120
+ foreach ($attachment_ids as $key => $attach_id) {
121
+
122
+ $attach = get_post($attach_id);
123
+
124
+ if ( $attach and ! is_wp_error($attach) and wp_attachment_is_image( $attach->ID ) ){
125
+
126
+ $val = wp_get_attachment_url( $attach->ID );
127
+
128
+ if (!empty($exportOptions['cc_options'][$ID])){
129
+ switch ($exportOptions['cc_options'][$ID]) {
130
+ case 'filenames':
131
+ $val = basename(wp_get_attachment_url( $attach->ID ));
132
+ break;
133
+ case 'filepaths':
134
+ $val = get_attached_file( $attach->ID );
135
+ break;
136
+
137
+ default:
138
+ # code...
139
+ break;
140
+ }
141
+ }
142
+
143
+ $img_urls[] = apply_filters('pmxe_attachment_url', $val, get_the_ID(), $attach->ID);
144
+ $img_titles[] = apply_filters('pmxe_attachment_title', $attach->post_title, get_the_ID(), $attach->ID);
145
+ $img_captions[] = apply_filters('pmxe_attachment_caption', $attach->post_excerpt, get_the_ID(), $attach->ID);
146
+ $img_descriptions[] = apply_filters('pmxe_attachment_content', $attach->post_content, get_the_ID(), $attach->ID);
147
+ $img_alts[] = apply_filters('pmxe_attachment_alt', get_post_meta($record->ID, '_wp_attachment_image_alt', true), get_the_ID(), $attach->ID);
148
+
149
+ $images_count++;
150
+ }
151
+ }
152
+ if (! empty($img_urls))
153
+ $article[$element_name . '_images'] = implode($implode_delimiter, $img_urls);
154
+
155
+ if (!empty($img_titles)) $article[$element_name. '_titles'] = implode($implode_delimiter, $img_titles);
156
+ if (!empty($img_captions)) $article[$element_name . '_captions'] = implode($implode_delimiter, $img_captions);
157
+ if (!empty($img_alts)) $article[$element_name . '_alts'] = implode($implode_delimiter, $img_alts);
158
+ if (!empty($img_descriptions)) $article[$element_name . '_descriptions'] = implode($implode_delimiter, $img_descriptions);
159
+
160
+ if ($max_images_count > $images_count) $max_images_count = $images_count;
161
+
162
+ endif;
163
+
164
+ break;
165
+
166
+ case 'date':
167
+
168
+ if (!empty($exportOptions['cc_options'][$ID])){
169
+ switch ($exportOptions['cc_options'][$ID]) {
170
+ case 'unix':
171
+ $post_date = get_post_time('U', true);
172
+ break;
173
+ default:
174
+ $post_date = date($exportOptions['cc_options'][$ID], get_post_time('U', true));
175
+ break;
176
+ }
177
+ }
178
+ else{
179
+ $post_date = date("Ymd", get_post_time('U', true));
180
+ }
181
+
182
+ $article[$element_name] = apply_filters('pmxe_post_date', pmxe_filter($post_date, $fieldSnipped), get_the_ID());
183
+
184
+ break;
185
+
186
+ case 'attachments':
187
+
188
+ $attachment_imgs = get_posts( array(
189
+ 'post_type' => 'attachment',
190
+ 'posts_per_page' => -1,
191
+ 'post_parent' => $record->ID,
192
+ ) );
193
+
194
+ if ( ! empty($attachment_imgs)):
195
+ $attachment_urls = array();
196
+ foreach ($attachment_imgs as $key => $attach) {
197
+ if ( ! wp_attachment_is_image( $attach->ID ) ){
198
+ $attachment_urls[] = apply_filters('pmxe_attachment_url', pmxe_filter(wp_get_attachment_url( $attach->ID ), $fieldSnipped), get_the_ID(), $attach->ID);
199
+ $attach_count++;
200
+ }
201
+ }
202
+ if (!empty($attachment_urls)) $article[$element_name . '_attachments'] = implode($implode_delimiter, $attachment_urls);
203
+
204
+ if ($attach_count > $max_attach_count) $max_attach_count = $attach_count;
205
+
206
+ endif;
207
+
208
+ break;
209
+
210
+ case 'parent':
211
+
212
+ $article[$element_name] = apply_filters('pmxe_post_parent', pmxe_filter($record->post_parent, $fieldSnipped), get_the_ID());
213
+
214
+ break;
215
+
216
+ case 'comment_status':
217
+
218
+ $article[$element_name] = apply_filters('pmxe_comment_status', pmxe_filter($record->comment_status, $fieldSnipped), get_the_ID());
219
+
220
+ break;
221
+
222
+ case 'ping_status':
223
+
224
+ $article[$element_name] = apply_filters('pmxe_ping_status', pmxe_filter($record->ping_status, $fieldSnipped), get_the_ID());
225
+
226
+ break;
227
+
228
+ case 'template':
229
+
230
+ $article[$element_name] = apply_filters('pmxe_post_template', pmxe_filter(get_post_meta($record->ID, '_wp_page_template', true), $fieldSnipped), get_the_ID());
231
+
232
+ break;
233
+
234
+ case 'order':
235
+
236
+ $article[$element_name] = apply_filters('pmxe_menu_order', pmxe_filter($record->menu_order, $fieldSnipped), get_the_ID());
237
+
238
+ break;
239
+
240
+ case 'status':
241
+
242
+ $article[$element_name] = apply_filters('pmxe_post_status', pmxe_filter($record->post_status, $fieldSnipped), get_the_ID());
243
+
244
+ break;
245
+
246
+ case 'format':
247
+
248
+ $article[$element_name] = apply_filters('pmxe_post_format', pmxe_filter(get_post_format($record->ID), $fieldSnipped), get_the_ID());
249
+
250
+ break;
251
+
252
+ case 'author':
253
+
254
+ $article[$element_name] = apply_filters('pmxe_post_author', pmxe_filter($record->post_author, $fieldSnipped), get_the_ID());
255
+
256
+ break;
257
+
258
+ case 'slug':
259
+
260
+ $article[$element_name] = apply_filters('pmxe_post_slug', pmxe_filter($record->post_name, $fieldSnipped), get_the_ID());
261
+
262
+ break;
263
+
264
+ case 'excerpt':
265
+
266
+ $val = apply_filters('pmxe_post_excerpt', pmxe_filter($record->post_excerpt, $fieldSnipped), get_the_ID());
267
+ $article[$element_name] = ($preview) ? trim(preg_replace('~[\r\n]+~', ' ', htmlspecialchars($val))) : $val;
268
+
269
+ break;
270
+
271
+ case 'cf':
272
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
273
+ $cur_meta_values = get_post_meta($record->ID, $exportOptions['cc_value'][$ID]);
274
+ if (!empty($cur_meta_values) and is_array($cur_meta_values)){
275
+ foreach ($cur_meta_values as $key => $cur_meta_value) {
276
+ if (empty($article[$element_name])){
277
+ $article[$element_name] = apply_filters('pmxe_custom_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID());
278
+ if (!in_array($element_name, $cf)) $cf[] = $element_name;
279
+ }
280
+ else{
281
+ $article[$element_name] = apply_filters('pmxe_custom_field', pmxe_filter($article[$element_name] . $implode_delimiter . maybe_serialize($cur_meta_value), $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID());
282
+ }
283
+ }
284
+ }
285
+
286
+ if (empty($cur_meta_values)){
287
+ if (empty($article[$element_name])){
288
+ $article[$element_name] = apply_filters('pmxe_custom_field', pmxe_filter('', $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID());
289
+ if (!in_array($element_name, $cf)) $cf[] = $element_name;
290
+ }
291
+ // else{
292
+ // $article[$element_name . '_' . $key] = apply_filters('pmxe_custom_field', pmxe_filter('', $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID());
293
+ // if (!in_array($element_name . '_' . $key, $cf)) $cf[] = $element_name . '_' . $key;
294
+ // }
295
+ }
296
+ }
297
+ break;
298
+
299
+ case 'acf':
300
+
301
+ if ( ! empty($exportOptions['cc_label'][$ID]) and class_exists( 'acf' ) ){
302
+
303
+ global $acf;
304
+
305
+ $field_options = unserialize($exportOptions['cc_options'][$ID]);
306
+
307
+ switch ($field_options['type']) {
308
+ case 'textarea':
309
+ case 'oembed':
310
+ case 'wysiwyg':
311
+ case 'wp_wysiwyg':
312
+ case 'date_time_picker':
313
+ case 'date_picker':
314
+
315
+ $field_value = get_field($exportOptions['cc_label'][$ID], $record->ID, false);
316
+
317
+ break;
318
+
319
+ default:
320
+
321
+ $field_value = get_field($exportOptions['cc_label'][$ID], $record->ID);
322
+
323
+ break;
324
+ }
325
+
326
+ pmxe_export_acf_field_csv($field_value, $exportOptions, $ID, $record->ID, $article, $acfs, $element_name, $fieldSnipped, $field_options['group_id'], $preview);
327
+
328
+ }
329
+
330
+ break;
331
+
332
+ case 'woo':
333
+
334
+ XmlExportWooCommerce::getInstance()->export_csv($article, $woo, $record, $exportOptions, $ID);
335
+
336
+ break;
337
+
338
+ case 'woo_order':
339
+
340
+ XmlExportWooCommerceOrder::getInstance()->export_csv($article, $woo_order, $record, $exportOptions, $ID);
341
+
342
+ break;
343
+
344
+ case 'attr':
345
+
346
+ if ( ! empty($exportOptions['cc_value'][$ID])){
347
+ if ($record->post_parent == 0){
348
+ $txes_list = get_the_terms($record->ID, $exportOptions['cc_value'][$ID]);
349
+ if ( ! is_wp_error($txes_list) and ! empty($txes_list)) {
350
+ $attr_new = array();
351
+ foreach ($txes_list as $t) {
352
+ $attr_new[] = $t->name;
353
+ }
354
+ $article[$element_name] = apply_filters('pmxe_woo_attribute', pmxe_filter(implode($implode_delimiter, $attr_new), $fieldSnipped), get_the_ID());
355
+ }
356
+ if ( ! in_array($element_name, $attributes)) $attributes[] = $element_name;
357
+ }
358
+ else{
359
+ $attribute_pa = get_post_meta($record->ID, 'attribute_' . $exportOptions['cc_value'][$ID], true);
360
+ $article['attribute_' . $element_name] = $attribute_pa;
361
+ if ( ! in_array('attribute_' . $element_name, $attributes)) $attributes[] = 'attribute_' . $element_name;
362
+ }
363
+ }
364
+ break;
365
+
366
+ case 'cats':
367
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
368
+ $txes_list = get_the_terms($record->ID, $exportOptions['cc_value'][$ID]);
369
+ if ( ! is_wp_error($txes_list) and ! empty($txes_list) ) {
370
+
371
+ $txes_ids = array();
372
+ $hierarchy_groups = array();
373
+
374
+ foreach ($txes_list as $t) {
375
+ $txes_ids[] = $t->term_id;
376
+ }
377
+
378
+ foreach ($txes_list as $t) {
379
+ if ( wp_all_export_check_children_assign($t->term_id, $exportOptions['cc_value'][$ID], $txes_ids) ){
380
+ $ancestors = get_ancestors( $t->term_id, $exportOptions['cc_value'][$ID] );
381
+ if (count($ancestors) > 0){
382
+ $hierarchy_group = array();
383
+ for ( $i = count($ancestors) - 1; $i >= 0; $i-- ) {
384
+ $term = get_term_by('id', $ancestors[$i], $exportOptions['cc_value'][$ID]);
385
+ if ($term){
386
+ $hierarchy_group[] = $term->name;
387
+ }
388
+ }
389
+ $hierarchy_group[] = $t->name;
390
+ $hierarchy_groups[] = implode('>', $hierarchy_group);
391
+ }
392
+ else{
393
+ $hierarchy_groups[] = $t->name;
394
+ }
395
+ }
396
+ }
397
+
398
+ if ( ! empty($hierarchy_groups) ){
399
+ $article[$element_name] = apply_filters('pmxe_post_taxonomy', pmxe_filter(implode($implode_delimiter, $hierarchy_groups), $fieldSnipped), get_the_ID());
400
+ }
401
+
402
+ }
403
+
404
+ if ( ! in_array($element_name, $taxes)) $taxes[] = $element_name;
405
+
406
+ if ($exportOptions['cc_label'][$ID] == 'product_type' and get_post_type() == 'product_variation'){
407
+
408
+ $article[$element_name] = 'variable';
409
+ $article['parent_sku'] = get_post_meta($record->post_parent, '_sku', true);
410
+
411
+ }
412
+ }
413
+ break;
414
+
415
+ case 'sql':
416
+ if ( ! empty($exportOptions['cc_sql'][$ID]) ) {
417
+ $val = $wpdb->get_var( $wpdb->prepare( stripcslashes(str_replace("%%ID%%", "%d", $exportOptions['cc_sql'][$ID])), get_the_ID() ));
418
+ if ( ! empty($exportOptions['cc_php'][$ID]) and !empty($exportOptions['cc_code'][$ID]) ){
419
+ // if shortcode defined
420
+ if (strpos($exportOptions['cc_code'][$ID], '[') === 0){
421
+ $val = do_shortcode(str_replace("%%VALUE%%", $val, $exportOptions['cc_code'][$ID]));
422
+ }
423
+ else{
424
+ $val = eval('return ' . stripcslashes(str_replace("%%VALUE%%", $val, $exportOptions['cc_code'][$ID])) . ';');
425
+ }
426
+ }
427
+ $article[$element_name] = apply_filters('pmxe_sql_field', $val, $element_name, get_the_ID());
428
+ }
429
+ break;
430
+
431
+ default:
432
+ # code...
433
+ break;
434
+ }
435
+ }
436
+ }
437
+ endif;
438
+
439
+ $articles[] = $article;
440
+
441
+ $articles = apply_filters('wp_all_export_csv_rows', $articles, $exportOptions);
442
+
443
+ if ($preview) break;
444
+
445
+ endwhile;
446
+
447
+ if ($exportOptions['ids']):
448
+
449
+ foreach ($exportOptions['ids'] as $ID => $value) {
450
+
451
+ if (is_numeric($ID)){
452
+
453
+ if (empty($exportOptions['cc_name'][$ID]) or empty($exportOptions['cc_type'][$ID])) continue;
454
+
455
+ $element_name = ( ! empty($exportOptions['cc_name'][$ID]) ) ? $exportOptions['cc_name'][$ID] : 'untitled_' . $ID;
456
+
457
+ switch ($exportOptions['cc_type'][$ID]) {
458
+ case 'media':
459
+
460
+ $headers[] = $element_name . '_images';
461
+ $headers[] = $element_name . '_titles';
462
+ $headers[] = $element_name . '_captions';
463
+ $headers[] = $element_name . '_descriptions';
464
+ $headers[] = $element_name . '_alts';
465
+
466
+ break;
467
+
468
+ case 'attachments':
469
+
470
+ $headers[] = $element_name . '_attachments';
471
+
472
+ break;
473
+ case 'cats':
474
+ if ( ! empty($taxes) ){
475
+ $tx = array_shift($taxes);
476
+ $headers[] = $tx;
477
+ if ($tx == 'product_type'){
478
+ $headers[] = 'parent_sku';
479
+ }
480
+ }
481
+ break;
482
+ case 'attr':
483
+ if ( ! empty($attributes) ){
484
+ $headers[] = array_shift($attributes);
485
+ if (in_array('attribute_' . $element_name, $attributes)) {
486
+ $headers[] = 'attribute_' . $element_name;
487
+ foreach ($attributes as $akey => $avalue) {
488
+ if ($avalue == 'attribute_' . $element_name){
489
+ unset($attributes[$akey]);
490
+ break;
491
+ }
492
+ }
493
+ }
494
+ }
495
+ break;
496
+ case 'cf':
497
+
498
+ if ( ! empty($cf) ){
499
+ $headers[] = array_shift($cf);
500
+ }
501
+
502
+ break;
503
+ case 'woo':
504
+
505
+ XmlExportWooCommerce::getInstance()->get_element_header( $headers, $exportOptions, $ID );
506
+
507
+ break;
508
+
509
+ case 'woo_order':
510
+
511
+ XmlExportWooCommerceOrder::getInstance()->get_element_header( $headers, $exportOptions, $ID );
512
+
513
+ break;
514
+
515
+ case 'acf':
516
+
517
+ if ( ! empty($acfs) ){
518
+ $headers[] = array_shift($acfs);
519
+ }
520
+
521
+ break;
522
+
523
+ default:
524
+ $headers[] = $element_name;
525
+ break;
526
+ }
527
+
528
+ }
529
+ }
530
+
531
+ endif;
532
+
533
+ if ($is_cron)
534
+ {
535
+ if ( ! $exported_by_cron ) fputcsv($stream, $headers, $exportOptions['delimiter']);
536
+ }
537
+ else
538
+ {
539
+ if ($preview or empty(PMXE_Plugin::$session->file)) fputcsv($stream, $headers, $exportOptions['delimiter']);
540
+ }
541
+
542
+
543
+ foreach ($articles as $article) {
544
+ $line = array();
545
+ foreach ($headers as $header) {
546
+ $line[$header] = ( isset($article[$header]) ) ? $article[$header] : '';
547
+ }
548
+ fputcsv($stream, $line, $exportOptions['delimiter']);
549
+
550
+ }
551
+
552
+ if ($preview) return ob_get_clean();
553
+
554
+ if ($is_cron)
555
+ {
556
+
557
+ file_put_contents($file_path, ob_get_clean(), FILE_APPEND);
558
+
559
+ return $file_path;
560
+
561
+ }
562
+ else
563
+ {
564
+ if ( empty(PMXE_Plugin::$session->file) ){
565
+
566
+ $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
567
+
568
+ $wp_uploads = wp_upload_dir();
569
+
570
+ $target = $is_secure_import ? wp_all_export_secure_file($wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY) : $wp_uploads['path'];
571
+
572
+ $export_file = $target . DIRECTORY_SEPARATOR . preg_replace('%- \d{4}.*%', '', $exportOptions['friendly_name']) . '- ' . date("Y F d H_i") . '.' . $exportOptions['export_to'];
573
+
574
+ file_put_contents($export_file, ob_get_clean());
575
+
576
+ PMXE_Plugin::$session->set('file', $export_file);
577
+
578
+ PMXE_Plugin::$session->save_data();
579
+
580
+ }
581
+ else
582
+ {
583
+ file_put_contents(PMXE_Plugin::$session->file, ob_get_clean(), FILE_APPEND);
584
+ }
585
+
586
+ return true;
587
+ }
588
+
589
+ }
helpers/pmxe_export_xml.php ADDED
@@ -0,0 +1,432 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Export XML helper
4
+ */
5
+ function pmxe_export_xml($exportQuery, $exportOptions, $preview = false, $is_cron = false, $file_path = false){
6
+
7
+ $xmlWriter = new XMLWriter();
8
+ $xmlWriter->openMemory();
9
+ $xmlWriter->setIndent(true);
10
+ $xmlWriter->setIndentString("\t");
11
+ $xmlWriter->startDocument('1.0', $exportOptions['encoding']);
12
+ $xmlWriter->startElement('data');
13
+
14
+ global $wpdb;
15
+
16
+ while ( $exportQuery->have_posts() ) :
17
+
18
+ $exportQuery->the_post(); $record = get_post( get_the_ID() );
19
+
20
+ $xmlWriter->startElement('post');
21
+
22
+ if ($exportOptions['ids']):
23
+
24
+ if ( wp_all_export_is_compatible() and $exportOptions['is_generate_import'] and $exportOptions['import_id']){
25
+ $postRecord = new PMXI_Post_Record();
26
+ $postRecord->clear();
27
+ $postRecord->getBy(array(
28
+ 'post_id' => $record->ID,
29
+ 'import_id' => $exportOptions['import_id'],
30
+ ));
31
+
32
+ if ($postRecord->isEmpty()){
33
+ $postRecord->set(array(
34
+ 'post_id' => $record->ID,
35
+ 'import_id' => $exportOptions['import_id'],
36
+ 'unique_key' => $record->ID,
37
+ 'product_key' => get_post_meta($record->ID, '_sku', true)
38
+ ))->save();
39
+ }
40
+ unset($postRecord);
41
+ }
42
+
43
+ foreach ($exportOptions['ids'] as $ID => $value) {
44
+
45
+ if (is_numeric($ID)){
46
+
47
+ if (empty($exportOptions['cc_name'][$ID]) or empty($exportOptions['cc_type'][$ID])) continue;
48
+
49
+ $element_name = ( ! empty($exportOptions['cc_name'][$ID]) ) ? str_replace(" ", "_", $exportOptions['cc_name'][$ID]) : 'untitled_' . $ID;
50
+ $fieldSnipped = ( ! empty($exportOptions['cc_php'][$ID]) and ! empty($exportOptions['cc_code'][$ID]) ) ? $exportOptions['cc_code'][$ID] : false;
51
+
52
+ switch ($exportOptions['cc_type'][$ID]) {
53
+ case 'id':
54
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_id', pmxe_filter(get_the_ID(), $fieldSnipped), get_the_ID()));
55
+ break;
56
+ case 'permalink':
57
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_guid', pmxe_filter(get_permalink(), $fieldSnipped), get_the_ID()));
58
+ break;
59
+ case 'post_type':
60
+ $pType = get_post_type();
61
+ if ($pType == 'product_variation') $pType = 'product';
62
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_type', pmxe_filter($pType, $fieldSnipped), get_the_ID()));
63
+ break;
64
+ case 'title':
65
+ $xmlWriter->startElement($element_name);
66
+ $xmlWriter->writeCData(apply_filters('pmxe_post_title', pmxe_filter($record->post_title, $fieldSnipped) , get_the_ID()));
67
+ $xmlWriter->endElement();
68
+ break;
69
+ case 'content':
70
+ $xmlWriter->startElement($element_name);
71
+ $xmlWriter->writeCData(apply_filters('pmxe_post_content', pmxe_filter($record->post_content, $fieldSnipped), get_the_ID()));
72
+ $xmlWriter->endElement();
73
+ break;
74
+ case 'media':
75
+ $xmlWriter->startElement($element_name);
76
+
77
+ $attachment_ids = array();
78
+
79
+ $_featured_image = get_post_meta(get_the_ID(), '_thumbnail_id', true);
80
+
81
+ if ( ! empty($_featured_image)) $attachment_ids[] = $_featured_image;
82
+
83
+ $_gallery = get_post_meta(get_the_ID(), '_product_image_gallery', true);
84
+
85
+ if (!empty($_gallery)){
86
+ $gallery = explode(',', $_gallery);
87
+ if (!empty($gallery) and is_array($gallery)){
88
+ foreach ($gallery as $aid) {
89
+ if (!in_array($aid, $attachment_ids)) $attachment_ids[] = $aid;
90
+ }
91
+ }
92
+ }
93
+
94
+ if ( ! empty($attachment_ids)):
95
+
96
+ foreach ($attachment_ids as $attach_id) {
97
+
98
+ $attach = get_post($attach_id);
99
+
100
+ if ( $attach and ! is_wp_error($attach) and wp_attachment_is_image( $attach->ID ) ) {
101
+
102
+ $xmlWriter->startElement('image');
103
+
104
+ $val = wp_get_attachment_url( $attach->ID );
105
+
106
+ if (!empty($exportOptions['cc_options'][$ID])){
107
+ switch ($exportOptions['cc_options'][$ID]) {
108
+ case 'filenames':
109
+ $val = basename(wp_get_attachment_url( $attach->ID ));
110
+ break;
111
+ case 'filepaths':
112
+ $val = get_attached_file( $attach->ID );
113
+ break;
114
+
115
+ default:
116
+ # code...
117
+ break;
118
+ }
119
+ }
120
+
121
+ $xmlWriter->writeElement('file', apply_filters('pmxe_attachment_url', $val, get_the_ID(), $attach->ID));
122
+ $xmlWriter->writeElement('title', apply_filters('pmxe_attachment_title', $attach->post_title, get_the_ID(), $attach->ID));
123
+ $xmlWriter->writeElement('caption', apply_filters('pmxe_attachment_caption', $attach->post_excerpt, get_the_ID(), $attach->ID));
124
+ $xmlWriter->writeElement('description', apply_filters('pmxe_attachment_content', $attach->post_content, get_the_ID(), $attach->ID));
125
+ $xmlWriter->writeElement('alt', apply_filters('pmxe_attachment_alt', get_post_meta($record->ID, '_wp_attachment_image_alt', true), get_the_ID(), $attach->ID));
126
+
127
+ $xmlWriter->endElement();
128
+ }
129
+ }
130
+
131
+ endif;
132
+ $xmlWriter->endElement();
133
+ break;
134
+
135
+ case 'date':
136
+ if (!empty($exportOptions['cc_options'][$ID])){
137
+ switch ($exportOptions['cc_options'][$ID]) {
138
+ case 'unix':
139
+ $post_date = get_post_time('U', true);
140
+ break;
141
+ default:
142
+ $post_date = date($exportOptions['cc_options'][$ID], get_post_time('U', true));
143
+ break;
144
+ }
145
+ }
146
+ else{
147
+ $post_date = date("Ymd", get_post_time('U', true));
148
+ }
149
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_date', pmxe_filter($post_date, $fieldSnipped), get_the_ID()));
150
+ break;
151
+
152
+ case 'attachments':
153
+ $xmlWriter->startElement($element_name);
154
+ $attachment_imgs = get_posts( array(
155
+ 'post_type' => 'attachment',
156
+ 'posts_per_page' => -1,
157
+ 'post_parent' => $record->ID,
158
+ ) );
159
+
160
+ if ( ! empty($attachment_imgs)):
161
+
162
+ foreach ($attachment_imgs as $attach) {
163
+ if ( ! wp_attachment_is_image( $attach->ID ) ){
164
+ $xmlWriter->startElement('attach');
165
+ $xmlWriter->writeElement('url', apply_filters('pmxe_attachment_url', pmxe_filter(wp_get_attachment_url( $attach->ID ), $fieldSnipped), get_the_ID(), $attach->ID));
166
+ $xmlWriter->endElement();
167
+ }
168
+ }
169
+
170
+ endif;
171
+ $xmlWriter->endElement(); // end attachments
172
+ break;
173
+
174
+ case 'parent':
175
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_parent', pmxe_filter($record->post_parent, $fieldSnipped), get_the_ID()));
176
+ break;
177
+
178
+ case 'comment_status':
179
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_comment_status', pmxe_filter($record->comment_status, $fieldSnipped), get_the_ID()));
180
+ break;
181
+
182
+ case 'ping_status':
183
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_ping_status', pmxe_filter($record->ping_status, $fieldSnipped), get_the_ID()));
184
+ break;
185
+
186
+ case 'template':
187
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_template', pmxe_filter(get_post_meta($record->ID, '_wp_page_template', true), $fieldSnipped), get_the_ID()));
188
+ break;
189
+
190
+ case 'order':
191
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_menu_order', pmxe_filter($record->menu_order, $fieldSnipped), get_the_ID()));
192
+ break;
193
+
194
+ case 'status':
195
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_status', pmxe_filter($record->post_status, $fieldSnipped), get_the_ID()));
196
+ break;
197
+
198
+ case 'format':
199
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_format', pmxe_filter(get_post_format($record->ID), $fieldSnipped), get_the_ID()));
200
+ break;
201
+
202
+ case 'author':
203
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_author', pmxe_filter($record->post_author, $fieldSnipped), get_the_ID()));
204
+ break;
205
+
206
+ case 'slug':
207
+ $xmlWriter->writeElement($element_name, apply_filters('pmxe_post_slug', pmxe_filter($record->post_name, $fieldSnipped), get_the_ID()));
208
+ break;
209
+
210
+ case 'excerpt':
211
+ $xmlWriter->startElement($element_name);
212
+ $xmlWriter->writeCData(apply_filters('pmxe_post_excerpt', pmxe_filter($record->post_excerpt, $fieldSnipped) , get_the_ID()));
213
+ $xmlWriter->endElement();
214
+ break;
215
+
216
+ case 'cf':
217
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
218
+ $cur_meta_values = get_post_meta($record->ID, $exportOptions['cc_value'][$ID]);
219
+ if (!empty($cur_meta_values) and is_array($cur_meta_values)){
220
+ foreach ($cur_meta_values as $key => $cur_meta_value) {
221
+ $xmlWriter->startElement($element_name);
222
+ $xmlWriter->writeCData(apply_filters('pmxe_custom_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID()));
223
+ $xmlWriter->endElement();
224
+ }
225
+ }
226
+
227
+ if (empty($cur_meta_values)){
228
+ $xmlWriter->startElement($element_name);
229
+ $xmlWriter->writeCData(apply_filters('pmxe_custom_field', pmxe_filter('', $fieldSnipped), $exportOptions['cc_value'][$ID], get_the_ID()));
230
+ $xmlWriter->endElement();
231
+ }
232
+ }
233
+ break;
234
+ case 'acf':
235
+
236
+ if ( ! empty($exportOptions['cc_label'][$ID]) and class_exists( 'acf' ) ){
237
+
238
+ global $acf;
239
+
240
+ $field_value = get_field($exportOptions['cc_label'][$ID], $record->ID);
241
+
242
+ $field_options = unserialize($exportOptions['cc_options'][$ID]);
243
+
244
+ pmxe_export_acf_field_xml($field_value, $exportOptions, $ID, $record->ID, $xmlWriter, $element_name, $fieldSnipped, $field_options['group_id']);
245
+
246
+ }
247
+
248
+ break;
249
+ case 'woo':
250
+
251
+ XmlExportWooCommerce::getInstance()->export_xml($xmlWriter, $record, $exportOptions, $ID);
252
+
253
+ break;
254
+ case 'woo_order':
255
+
256
+ XmlExportWooCommerceOrder::getInstance()->export_xml($xmlWriter, $record, $exportOptions, $ID);
257
+
258
+ break;
259
+ case 'attr':
260
+ if ( ! empty($exportOptions['cc_value'][$ID])){
261
+ if ($record->post_parent == 0){
262
+ $is_variable_product = false;
263
+ $product_terms = wp_get_post_terms( $record->ID, 'product_type' );
264
+ if( ! empty($product_terms)){
265
+ if( ! is_wp_error( $product_terms )){
266
+ foreach($product_terms as $term){
267
+ if ('variable' == $term->slug){
268
+ $is_variable_product = true;
269
+ break;
270
+ }
271
+ }
272
+ }
273
+ }
274
+ $txes_list = get_the_terms($record->ID, $exportOptions['cc_value'][$ID]);
275
+ if ( ! is_wp_error($txes_list)) {
276
+ $attr_new = array();
277
+ if (!empty($txes_list)):
278
+ foreach ($txes_list as $t) {
279
+ $attr_new[] = $t->name;
280
+ }
281
+ $xmlWriter->startElement($is_variable_product ? $element_name : 'attribute_' . $element_name);
282
+ $xmlWriter->writeCData(apply_filters('pmxe_woo_attribute', pmxe_filter(implode('|', $attr_new), $fieldSnipped), get_the_ID()));
283
+ $xmlWriter->endElement();
284
+ endif;
285
+ }
286
+ }
287
+ else{
288
+ $attribute_pa = get_post_meta($record->ID, 'attribute_' . $exportOptions['cc_value'][$ID], true);
289
+ if ( ! empty($attribute_pa)){
290
+ $xmlWriter->startElement('attribute_' . $element_name);
291
+ $xmlWriter->writeCData(apply_filters('woo_field', $attribute_pa));
292
+ $xmlWriter->endElement();
293
+ }
294
+ }
295
+ }
296
+ break;
297
+ case 'cats':
298
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
299
+ $txes_list = get_the_terms($record->ID, $exportOptions['cc_value'][$ID]);
300
+ if ( ! is_wp_error($txes_list)) {
301
+
302
+ $txes_ids = array();
303
+ $hierarchy_groups = array();
304
+
305
+ if ( ! empty($txes_list) ):
306
+ foreach ($txes_list as $t) {
307
+ $txes_ids[] = $t->term_id;
308
+ }
309
+
310
+ foreach ($txes_list as $t) {
311
+ if ( wp_all_export_check_children_assign($t->term_id, $exportOptions['cc_value'][$ID], $txes_ids) ){
312
+ $ancestors = get_ancestors( $t->term_id, $exportOptions['cc_value'][$ID] );
313
+ if (count($ancestors) > 0){
314
+ $hierarchy_group = array();
315
+ for ( $i = count($ancestors) - 1; $i >= 0; $i-- ) {
316
+ $term = get_term_by('id', $ancestors[$i], $exportOptions['cc_value'][$ID]);
317
+ if ($term){
318
+ $hierarchy_group[] = $term->name;
319
+ }
320
+ }
321
+ $hierarchy_group[] = $t->name;
322
+ $hierarchy_groups[] = implode(">", $hierarchy_group);
323
+ }
324
+ else{
325
+ $hierarchy_groups[] = $t->name;
326
+ }
327
+ }
328
+ }
329
+
330
+ if ( ! empty($hierarchy_groups) ){
331
+
332
+ $xmlWriter->startElement($element_name);
333
+ $xmlWriter->writeCData(apply_filters('pmxe_post_taxonomy', pmxe_filter(implode('|', $hierarchy_groups), $fieldSnipped), get_the_ID()));
334
+ $xmlWriter->endElement();
335
+
336
+ }
337
+
338
+ endif;
339
+
340
+ }
341
+ if ($exportOptions['cc_label'][$ID] == 'product_type' and get_post_type() == 'product_variation'){
342
+
343
+ $xmlWriter->writeElement('parent_sku', get_post_meta($record->post_parent, '_sku', true));
344
+ $xmlWriter->writeElement($element_name, 'variable');
345
+
346
+ }
347
+ }
348
+ break;
349
+
350
+ case 'sql':
351
+
352
+ if ( ! empty($exportOptions['cc_sql'][$ID]) ){
353
+ $val = $wpdb->get_var( $wpdb->prepare( stripcslashes(str_replace("%%ID%%", "%d", $exportOptions['cc_sql'][$ID])), get_the_ID() ));
354
+ if ( ! empty($exportOptions['cc_php'][$ID]) and !empty($exportOptions['cc_code'][$ID])){
355
+ // if shortcode defined
356
+ if (strpos($exportOptions['cc_code'][$ID], '[') === 0){
357
+ $val = do_shortcode(str_replace("%%VALUE%%", $val, $exportOptions['cc_code'][$ID]));
358
+ }
359
+ else{
360
+ $val = eval('return ' . stripcslashes(str_replace("%%VALUE%%", $val, $exportOptions['cc_code'][$ID])) . ';');
361
+ }
362
+ }
363
+ $xmlWriter->startElement($element_name);
364
+ $xmlWriter->writeCData(apply_filters('pmxe_sql_field', $val, $element_name, get_the_ID()));
365
+ $xmlWriter->endElement();
366
+ }
367
+ break;
368
+
369
+ default:
370
+ # code...
371
+ break;
372
+ }
373
+ }
374
+ }
375
+ endif;
376
+
377
+ $xmlWriter->endElement(); // end post
378
+
379
+ if ($preview) break;
380
+
381
+ endwhile;
382
+ $xmlWriter->endElement(); // end data
383
+
384
+ if ($preview) return wp_all_export_remove_colons($xmlWriter->flush(true));
385
+
386
+ if ($is_cron)
387
+ {
388
+
389
+ $xml = $xmlWriter->flush(true);
390
+
391
+ if (file_exists($file_path))
392
+ {
393
+ file_put_contents($file_path, wp_all_export_remove_colons(substr(substr($xml, 45), 0, -8)), FILE_APPEND);
394
+ }
395
+ else
396
+ {
397
+ file_put_contents($file_path, wp_all_export_remove_colons(substr($xml, 0, -8)));
398
+ }
399
+
400
+ return $file_path;
401
+
402
+ }
403
+ else
404
+ {
405
+
406
+ if ( empty(PMXE_Plugin::$session->file) ){
407
+
408
+ $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
409
+
410
+ $wp_uploads = wp_upload_dir();
411
+
412
+ $target = $is_secure_import ? wp_all_export_secure_file($wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY) : $wp_uploads['path'];
413
+
414
+ $export_file = $target . DIRECTORY_SEPARATOR . preg_replace('%- \d{4}.*%', '', $exportOptions['friendly_name']) . '- ' . date("Y F d H_i") . '.' . $exportOptions['export_to'];
415
+
416
+ file_put_contents($export_file, wp_all_export_remove_colons(substr($xmlWriter->flush(true), 0, -8)));
417
+
418
+ PMXE_Plugin::$session->set('file', $export_file);
419
+
420
+ PMXE_Plugin::$session->save_data();
421
+
422
+ }
423
+ else
424
+ {
425
+ file_put_contents(PMXE_Plugin::$session->file, wp_all_export_remove_colons(substr(substr($xmlWriter->flush(true), 45), 0, -8)), FILE_APPEND);
426
+ }
427
+
428
+ return true;
429
+
430
+ }
431
+
432
+ }
helpers/pmxe_filter.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ function pmxe_filter($value, $custom_func){
3
+ return $value;
4
+ }
helpers/pmxe_functions.php CHANGED
@@ -1,80 +1,25 @@
1
  <?php
2
 
3
- if ( ! function_exists('url_title')){
4
-
5
- function url_title($str, $separator = 'dash', $lowercase = FALSE)
6
  {
7
- if ($separator == 'dash')
8
- {
9
- $search = '_';
10
- $replace = '-';
11
- }
12
- else
13
- {
14
- $search = '-';
15
- $replace = '_';
16
- }
17
-
18
- $trans = array(
19
- '&\#\d+?;' => '',
20
- '&\S+?;' => '',
21
- '\s+' => $replace,
22
- '[^a-z0-9\-\._]' => '',
23
- $replace.'+' => $replace,
24
- $replace.'$' => $replace,
25
- '^'.$replace => $replace,
26
- '\.+$' => ''
27
- );
28
-
29
- $str = strip_tags($str);
30
-
31
- foreach ($trans as $key => $val)
32
- {
33
- $str = preg_replace("#".$key."#i", $val, $str);
34
- }
35
-
36
- if ($lowercase === TRUE)
37
- {
38
- $str = strtolower($str);
39
- }
40
-
41
- return trim(stripslashes($str));
42
  }
43
  }
44
 
45
- /* Session */
46
-
47
- /**
48
- * Return the current session status.
49
- *
50
- * @return int
51
- */
52
- function pmxe_session_status() {
53
-
54
- PMXE_Plugin::$session = PMXE_Session::get_instance();
55
 
56
- if ( PMXE_Plugin::$session->session_started() ) {
57
- return PHP_SESSION_ACTIVE;
58
- }
59
-
60
- return PHP_SESSION_NONE;
61
- }
62
 
63
- /**
64
- * Unset all session variables.
65
- */
66
- function pmxe_session_unset() {
67
- PMXE_Plugin::$session = PMXE_Session::get_instance();
68
 
69
- PMXE_Plugin::$session->reset();
70
  }
71
 
72
- /**
73
- * Alias of wp_session_write_close()
74
- */
75
- function pmxe_session_commit() {
76
- PMXE_Plugin::$session = PMXE_Session::get_instance();
77
- PMXE_Plugin::$session->write_data();
78
- do_action( 'pmxe_session_commit' );
79
- }
80
-
1
  <?php
2
 
3
+ if ( ! function_exists('wp_all_export_isValidMd5')){
4
+ function wp_all_export_isValidMd5($md5 ='')
 
5
  {
6
+ return preg_match('/^[a-f0-9]{32}$/', $md5);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  }
8
  }
9
 
10
+ if ( ! function_exists('wp_all_export_get_relative_path') ){
11
+ function wp_all_export_get_relative_path($path){
 
 
 
 
 
 
 
 
12
 
13
+ $uploads = wp_upload_dir();
 
 
 
 
 
14
 
15
+ return str_replace($uploads['basedir'], '', $path);
 
 
 
 
16
 
17
+ }
18
  }
19
 
20
+ if ( ! function_exists('wp_all_export_get_absolute_path') ){
21
+ function wp_all_export_get_absolute_path($path){
22
+ $uploads = wp_upload_dir();
23
+ return ( strpos($path, $uploads['basedir']) === false and ! preg_match('%^https?://%i', $path)) ? $uploads['basedir'] . $path : $path;
24
+ }
25
+ }
 
 
 
helpers/pmxe_render_xml_attributes.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ function pmxe_render_xml_attributes(DOMElement $el, $path = '/')
3
+ {
4
+ foreach ($el->attributes as $attr) {
5
+ echo ' <span class="xml-attr" title="' . $path . '@' . $attr->nodeName . '"><span class="xml-attr-name">' . $attr->nodeName . '</span>=<span class="xml-attr-value">"' . esc_attr($attr->value) . '"</span></span>';
6
+ }
7
+ }
helpers/pmxe_render_xml_element.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function pmxe_render_xml_element(DOMElement $el, $shorten = false, $path = '/', $ind = 1, $lvl = 0)
3
+ {
4
+ $path .= $el->nodeName;
5
+ $alternativePath = $path;
6
+ if ( ! $el->parentNode instanceof DOMDocument and $ind > 0) {
7
+ $path .= "[$ind]";
8
+ }
9
+
10
+ echo '<div class="xml-element lvl-' . $lvl . ' lvl-mod4-' . ($lvl % 4) . '" title="' . $path . '">';
11
+ //if ($el->hasAttributes()){
12
+ //echo '<div class="xml-element-xpaths">'; self::render_element_xpaths($el, $alternativePath, $ind, $lvl); echo '</div>';
13
+ //}
14
+ if ($el->hasChildNodes()) {
15
+ $is_render_collapsed = $ind > 1;
16
+ if ($el->childNodes->length > 1 or ! $el->childNodes->item(0) instanceof DOMText or strlen(trim($el->childNodes->item(0)->wholeText)) > 40) {
17
+ echo '<div class="xml-expander">' . ($is_render_collapsed ? '+' : '-') . '</div>';
18
+ }
19
+ echo '<div class="xml-tag opening">&lt;<span class="xml-tag-name">' . $el->nodeName . '</span>'; pmxe_render_xml_attributes($el, $path . '/'); echo '&gt;</div>';
20
+ if (1 == $el->childNodes->length and $el->childNodes->item(0) instanceof DOMText) {
21
+ pmxe_render_xml_text(trim($el->childNodes->item(0)->wholeText), $shorten, $is_render_collapsed);
22
+ } else {
23
+ echo '<div class="xml-content' . ($is_render_collapsed ? ' collapsed' : '') . '">';
24
+ $indexes = array();
25
+ foreach ($el->childNodes as $eli => $child) {
26
+ if ($child instanceof DOMElement) {
27
+ empty($indexes[$child->nodeName]) and $indexes[$child->nodeName] = 0; $indexes[$child->nodeName]++;
28
+ pmxe_render_xml_element($child, $shorten, $path . '/', $indexes[$child->nodeName], $lvl + 1);
29
+ } elseif ($child instanceof DOMCdataSection) {
30
+ pmxe_render_xml_text(trim($child->wholeText), $shorten, false, true);
31
+ } elseif ($child instanceof DOMText) {
32
+ if ( $el->childNodes->item($eli - 1) and ($el->childNodes->item($eli - 1) instanceof DOMCdataSection) ){
33
+
34
+ }
35
+ elseif( $el->childNodes->item($eli + 1) and ($el->childNodes->item($eli + 1) instanceof DOMCdataSection) ){
36
+
37
+ }
38
+ else{
39
+ pmxe_render_xml_text(trim($child->wholeText), $shorten);
40
+ }
41
+ } elseif ($child instanceof DOMComment) {
42
+ if (preg_match('%\[pmxi_more:(\d+)\]%', $child->nodeValue, $mtch)) {
43
+ $no = intval($mtch[1]);
44
+ echo '<div class="xml-more">[ &dArr; ' . sprintf(__('<strong>%s</strong> %s more', 'wp_all_import_plugin'), $no, _n('element', 'elements', $no, 'wp_all_import_plugin')) . ' &dArr; ]</div>';
45
+ }
46
+ }
47
+ }
48
+ echo '</div>';
49
+ }
50
+ echo '<div class="xml-tag closing">&lt;/<span class="xml-tag-name">' . $el->nodeName . '</span>&gt;</div>';
51
+ } else {
52
+ echo '<div class="xml-tag opening empty">&lt;<span class="xml-tag-name">' . $el->nodeName . '</span>'; pmxe_render_xml_attributes($el); echo '/&gt;</div>';
53
+ }
54
+ echo '</div>';
55
+ }
helpers/pmxe_render_xml_text.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function pmxe_render_xml_text($text, $shorten = false, $is_render_collapsed = false)
3
+ {
4
+ if (empty($text)) {
5
+ return; // do not display empty text nodes
6
+ }
7
+ if (preg_match('%\[more:(\d+)\]%', $text, $mtch)) {
8
+ $no = intval($mtch[1]);
9
+ echo '<div class="xml-more">[ &dArr; ' . sprintf(__('<strong>%s</strong> %s more', 'pmxi_plugin'), $no, _n('element', 'elements', $no, 'pmxi_plugin')) . ' &dArr; ]</div>';
10
+ return;
11
+ }
12
+ $more = '';
13
+ if ($shorten and preg_match('%^(.*?\s+){20}(?=\S)%', $text, $mtch)) {
14
+ $text = $mtch[0];
15
+ $more = '<span class="xml-more">[' . __('more', 'pmxi_plugin') . ']</span>';
16
+ }
17
+ $is_short = strlen($text) <= 40;
18
+ $text = esc_html($text);
19
+ $text = preg_replace('%(?<!\s)\b(?!\s|\W[\w\s])|\w{20}%', '$0&#8203;', $text); // put explicit breaks for xml content to wrap
20
+ echo '<div class="xml-content textonly' . ($is_short ? ' short' : '') . ($is_render_collapsed ? ' collapsed' : '') . '">' . $text . $more . '</div>';
21
+ }
helpers/str_getcsv.php CHANGED
File without changes
helpers/wp_all_export_check_children_assign.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_all_export_check_children_assign( $parent, $taxonomy, $term_ids = array() )
3
+ {
4
+ $is_latest_child = true;
5
+ $children = get_term_children( $parent, $taxonomy );
6
+ if ( count($children) > 0 ){
7
+ foreach ($children as $child) {
8
+ if ( in_array($child, $term_ids) ){
9
+ $is_latest_child = false;
10
+ break;
11
+ }
12
+ }
13
+ }
14
+ return $is_latest_child;
15
+ }
helpers/wp_all_export_get_cpt_name.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wp_all_export_get_cpt_name($cpt = array(), $count = 2)
4
+ {
5
+ $cptName = '';
6
+ if ( ! empty($cpt)){
7
+ if ( ! in_array('users', $cpt)){
8
+ if (in_array('product_variation', $cpt)){
9
+ $cptName = ucfirst( ( ! empty($cpt) ) ? str_replace("product_variation", __("Product Variations"), implode(", ", $cpt)) : 'record');
10
+ }
11
+ else
12
+ {
13
+ $post_type_details = get_post_type_object( $cpt[0] );
14
+ $cptName = ($count > 1) ? $post_type_details->labels->name : $post_type_details->labels->singular_name;
15
+ }
16
+ }
17
+ else
18
+ {
19
+ $cptName = ($count > 1) ? __('Users', 'wp_all_export_plugin') : __('User', 'wp_all_export_plugin');
20
+ }
21
+ }
22
+ else{
23
+ $cptName = ($count > 1) ? __('Records', 'wp_all_export_plugin') : __('Record', 'wp_all_export_plugin');
24
+ }
25
+
26
+ return $cptName;
27
+ }
helpers/wp_all_export_is_compatible.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ function wp_all_export_is_compatible(){
3
+ return ( class_exists('PMXI_Plugin') and ( PMXI_EDITION == 'paid' and version_compare(PMXI_VERSION, '4.1.4') >= 0 or PMXI_EDITION == 'free' and version_compare(PMXI_VERSION, '3.3.0') >= 0) ) ? true : false;
4
+ }
helpers/wp_all_export_prepare_template_csv.php ADDED
@@ -0,0 +1,510 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wp_all_export_prepare_template_csv($exportOptions, &$templateOptions)
4
+ {
5
+ if ($exportOptions['ids']){
6
+ $cf_list = array();
7
+ $attr_list = array();
8
+ $taxs_list = array();
9
+ $acf_list = array();
10
+ $implode_delimiter = ($exportOptions['delimiter'] == ',') ? '|' : ',';
11
+ foreach ($exportOptions['ids'] as $ID => $value) {
12
+ if (empty($exportOptions['cc_type'][$ID])) continue;
13
+ $element_name = strtolower((!empty($exportOptions['cc_name'][$ID])) ? preg_replace('/[^a-z0-9_]/i', '', $exportOptions['cc_name'][$ID]) : 'untitled_' . $ID);
14
+ switch ($exportOptions['cc_type'][$ID]) {
15
+ case 'id':
16
+ $templateOptions['unique_key'] = '{'. $element_name .'[1]}';
17
+ $templateOptions['tmp_unique_key'] = '{'. $element_name .'[1]}';
18
+ break;
19
+ case 'title':
20
+ $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
21
+ $templateOptions['is_update_title'] = 1;
22
+ break;
23
+ case 'content':
24
+ $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
25
+ $templateOptions['is_update_content'] = 1;
26
+ break;
27
+ case 'author':
28
+ $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
29
+ $templateOptions['is_update_author'] = 1;
30
+ break;
31
+ case 'date':
32
+ $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
33
+ $templateOptions['is_update_dates'] = 1;
34
+ break;
35
+ case 'status':
36
+ $templateOptions['status_xpath'] = '{'. $element_name .'[1]}';
37
+ $templateOptions['is_update_status'] = 1;
38
+ break;
39
+ case 'parent':
40
+ $templateOptions['single_page_parent'] = '{'. $element_name .'[1]}';
41
+ $templateOptions['is_update_parent'] = 1;
42
+ break;
43
+ case 'excerpt':
44
+ $templateOptions['post_excerpt'] = '{'. $element_name .'[1]}';
45
+ $templateOptions['is_update_excerpt'] = 1;
46
+ break;
47
+ case 'slug':
48
+ $templateOptions['post_slug'] = '{'. $element_name .'[1]}';
49
+ $templateOptions['is_update_slug'] = 1;
50
+ break;
51
+ case 'post_type':
52
+ if ( empty($exportOptions['cpt']) ){
53
+ $templateOptions['is_override_post_type'] = 1;
54
+ $templateOptions['post_type_xpath'] = '{'. $element_name .'[1]}';
55
+ }
56
+ break;
57
+ case 'cf':
58
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
59
+
60
+ if ( ! in_array($exportOptions['cc_value'][$ID], $cf_list)) $cf_list[] = $exportOptions['cc_value'][$ID];
61
+ $templateOptions['custom_name'][] = $exportOptions['cc_value'][$ID];
62
+ $templateOptions['custom_value'][] = '{'. $element_name .'[1]}';
63
+ $templateOptions['custom_format'][] = 0;
64
+
65
+ }
66
+ break;
67
+ case 'woo':
68
+ //$element_name = 'woo' . $element_name;
69
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
70
+ $cf_list[] = $exportOptions['cc_label'][$ID];
71
+ switch ($exportOptions['cc_label'][$ID]) {
72
+ case '_visibility':
73
+ $templateOptions['is_product_visibility'] = 'xpath';
74
+ $templateOptions['single_product_visibility'] = '{'. $element_name .'[1]}';
75
+ break;
76
+ case '_stock_status':
77
+ $templateOptions['product_stock_status'] = 'xpath';
78
+ $templateOptions['single_product_stock_status'] = '{'. $element_name .'[1]}';
79
+ break;
80
+ case '_downloadable':
81
+ $templateOptions['is_product_downloadable'] = 'xpath';
82
+ $templateOptions['single_product_downloadable'] = '{'. $element_name .'[1]}';
83
+ break;
84
+ case '_virtual':
85
+ $templateOptions['is_product_virtual'] = 'xpath';
86
+ $templateOptions['single_product_virtual'] = '{'. $element_name .'[1]}';
87
+ break;
88
+ case '_price':
89
+ case '_regular_price':
90
+ $templateOptions['single_product_regular_price'] = '{'. $element_name .'[1]}';
91
+ break;
92
+ case '_sale_price':
93
+ $templateOptions['single_product_sale_price'] = '{'. $element_name .'[1]}';
94
+ break;
95
+ case '_purchase_note':
96
+ $templateOptions['single_product_purchase_note'] = '{'. $element_name .'[1]}';
97
+ break;
98
+ case '_featured':
99
+ $templateOptions['is_product_featured'] = 'xpath';
100
+ $templateOptions['single_product_featured'] = '{'. $element_name .'[1]}';
101
+ break;
102
+ case '_weight':
103
+ $templateOptions['single_product_weight'] = '{'. $element_name .'[1]}';
104
+ break;
105
+ case '_length':
106
+ $templateOptions['single_product_length'] = '{'. $element_name .'[1]}';
107
+ break;
108
+ case '_width':
109
+ $templateOptions['single_product_width'] = '{'. $element_name .'[1]}';
110
+ break;
111
+ case '_height':
112
+ $templateOptions['single_product_height'] = '{'. $element_name .'[1]}';
113
+ break;
114
+ case '_sku':
115
+ $templateOptions['single_product_sku'] = '{'. $element_name .'[1]}';
116
+ $templateOptions['single_product_id'] = '{'. $element_name .'[1]}';
117
+ $templateOptions['single_product_parent_id'] = '{parent_sku[1]}';
118
+ break;
119
+ case '_sale_price_dates_from':
120
+ $templateOptions['single_sale_price_dates_from'] = '{'. $element_name .'[1]}';
121
+ break;
122
+ case '_sale_price_dates_to':
123
+ $templateOptions['single_sale_price_dates_to'] = '{'. $element_name .'[1]}';
124
+ break;
125
+ case '_sold_individually':
126
+ $templateOptions['product_sold_individually'] = 'xpath';
127
+ $templateOptions['single_product_sold_individually'] = '{'. $element_name .'[1]}';
128
+ break;
129
+ case '_manage_stock':
130
+ $templateOptions['is_product_manage_stock'] = 'xpath';
131
+ $templateOptions['single_product_manage_stock'] = '{'. $element_name .'[1]}';
132
+ break;
133
+ case '_stock':
134
+ $templateOptions['single_product_stock_qty'] = '{'. $element_name .'[1]}';
135
+ break;
136
+ case '_upsell_ids':
137
+ $templateOptions['single_product_up_sells'] = '{'. $element_name .'[1]}';
138
+ break;
139
+ case '_crosssell_ids':
140
+ $templateOptions['single_product_cross_sells'] = '{'. $element_name .'[1]}';
141
+ break;
142
+ case '_downloadable_files':
143
+ $templateOptions['single_product_files'] = '{'. $element_name .'_paths[1]}';
144
+ $templateOptions['single_product_files_names'] = '{'. $element_name .'_names[1]}';
145
+ break;
146
+ case '_download_limit':
147
+ $templateOptions['single_product_download_limit'] = '{'. $element_name .'[1]}';
148
+ break;
149
+ case '_download_expiry':
150
+ $templateOptions['single_product_download_expiry'] = '{'. $element_name .'[1]}';
151
+ break;
152
+ case '_download_type':
153
+ $templateOptions['single_product_download_type'] = '{'. $element_name .'[1]}';
154
+ break;
155
+ case '_product_url':
156
+ $templateOptions['single_product_url'] = '{'. $element_name .'[1]}';
157
+ break;
158
+ case '_button_text':
159
+ $templateOptions['single_product_button_text'] = '{'. $element_name .'[1]}';
160
+ break;
161
+ case '_tax_status':
162
+ $templateOptions['is_multiple_product_tax_status'] = 'no';
163
+ $templateOptions['single_product_tax_status'] = '{'. $element_name .'[1]}';
164
+ break;
165
+ case '_tax_class':
166
+ $templateOptions['is_multiple_product_tax_class'] = 'no';
167
+ $templateOptions['single_product_tax_class'] = '{'. $element_name .'[1]}';
168
+ break;
169
+ case '_backorders':
170
+ $templateOptions['product_allow_backorders'] = 'xpath';
171
+ $templateOptions['single_product_allow_backorders'] = '{'. $element_name .'[1]}';
172
+ break;
173
+ case 'attributes':
174
+
175
+ global $wp_taxonomies;
176
+
177
+ foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
178
+
179
+ if (strpos($obj->name, "pa_") === 0 and strlen($obj->name) > 3)
180
+ {
181
+ $templateOptions['attribute_name'][] = '{attributename' . $obj->name .'[1]}';
182
+ $templateOptions['attribute_value'][] = '{attributevalue' . $obj->name .'[1]}';
183
+ $templateOptions['in_variations'][] = 1;
184
+ $templateOptions['is_visible'][] = 1;
185
+ $templateOptions['is_taxonomy'][] = 1;
186
+ $templateOptions['create_taxonomy_in_not_exists'][] = 1;
187
+ $attr_list[] = $obj->name;
188
+ }
189
+ }
190
+
191
+ break;
192
+ default:
193
+ # code...
194
+ break;
195
+ }
196
+ }
197
+ break;
198
+
199
+ case 'acf':
200
+
201
+ $field_options = unserialize($exportOptions['cc_options'][$ID]);
202
+
203
+ // add ACF group ID to the template options
204
+ if( ! in_array($field_options['group_id'], $templateOptions['acf'])){
205
+ $templateOptions['acf'][$field_options['group_id']] = 1;
206
+ }
207
+
208
+ $field_tpl_key = strtolower($element_name);
209
+
210
+ $acf_list[] = '[' . $field_options['name'] . '] ' . $field_options['label'];
211
+
212
+ switch ($field_options['type']) {
213
+ case 'textarea':
214
+ case 'wysiwyg':
215
+ case 'wp_wysiwyg':
216
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
217
+ break;
218
+ case 'text':
219
+ case 'number':
220
+ case 'email':
221
+ case 'password':
222
+ case 'url':
223
+ case 'oembed':
224
+ case 'image':
225
+ case 'file':
226
+ case 'date_picker':
227
+ case 'color_picker':
228
+ case 'acf_cf7':
229
+ case 'gravity_forms_field':
230
+ case 'limiter':
231
+ case 'date_time_picker':
232
+
233
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
234
+
235
+ break;
236
+ case 'post_object':
237
+ case 'page_link':
238
+ case 'user':
239
+
240
+ if ($field_options['multiple'])
241
+ {
242
+ if ($implode_delimiter == "|")
243
+ $templateOptions['fields'][$field_options['key']] = '[str_replace("|", ",",{' . $field_tpl_key . '[1]})]';
244
+ else
245
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
246
+ }
247
+ else
248
+ {
249
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
250
+ }
251
+
252
+ break;
253
+ case 'gallery':
254
+ case 'relationship':
255
+
256
+ if ($implode_delimiter == "|")
257
+ $templateOptions['fields'][$field_options['key']] = '[str_replace("|", ",",{' . $field_tpl_key . '[1]})]';
258
+ else
259
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
260
+
261
+ break;
262
+ case 'select':
263
+ case 'checkbox':
264
+
265
+ $templateOptions['is_multiple_field_value'][$field_options['key']] = 'no';
266
+
267
+ if ($implode_delimiter == "|")
268
+ $templateOptions['fields'][$field_options['key']] = '[str_replace("|", ",",{' . $field_tpl_key . '[1]})]';
269
+ else
270
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
271
+
272
+ break;
273
+ case 'radio':
274
+ case 'true_false':
275
+
276
+ $templateOptions['is_multiple_field_value'][$field_options['key']] = 'no';
277
+
278
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
279
+
280
+ break;
281
+ case 'location-field':
282
+ case 'google_map':
283
+
284
+ $templateOptions['fields'][$field_options['key']]['address'] = '{' . $field_tpl_key . '_address[1]}';
285
+ $templateOptions['fields'][$field_options['key']]['lat'] = '{' . $field_tpl_key . '_lat[1]}';
286
+ $templateOptions['fields'][$field_options['key']]['lng'] = '{' . $field_tpl_key . '_lng[1]}';
287
+
288
+ break;
289
+ case 'paypal_item':
290
+
291
+ $templateOptions['fields'][$field_options['key']]['item_name'] = '{' . $field_tpl_key . '_item_name[1]}';
292
+ $templateOptions['fields'][$field_options['key']]['item_description'] = '{' . $field_tpl_key . '_item_description[1]}';
293
+ $templateOptions['fields'][$field_options['key']]['price'] = '{' . $field_tpl_key . '_price[1]}';
294
+
295
+ break;
296
+ case 'taxonomy':
297
+
298
+ $taxonomy_options = array();
299
+
300
+ $single_term = new stdClass;
301
+ $single_term->item_id = 1;
302
+ $single_term->parent_id = NULL;
303
+ $single_term->xpath = '{' . $field_tpl_key . '[1]}';
304
+ $single_term->assign = false;
305
+
306
+ $taxonomy_options[] = $single_term;
307
+
308
+ $templateOptions['is_multiple_field_value'][$field_options['key']] = 'no';
309
+
310
+ $templateOptions['fields'][$field_options['key']] = json_encode($taxonomy_options);
311
+
312
+ break;
313
+ case 'repeater':
314
+
315
+ $templateOptions['fields'][$field_options['key']]['is_variable'] = 'csv';
316
+
317
+ $templateOptions['fields'][$field_options['key']]['separator'] = $implode_delimiter;
318
+
319
+ if (class_exists('acf')){
320
+
321
+ global $acf;
322
+
323
+ if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0){
324
+
325
+ $sub_fields = get_posts(array('posts_per_page' => -1, 'post_type' => 'acf-field', 'post_parent' => (( ! empty($field_options['id'])) ? $field_options['id'] : $field_options['ID']), 'post_status' => 'publish'));
326
+
327
+ if ( ! empty($sub_fields) ){
328
+
329
+ foreach ($sub_fields as $n => $sub_field){
330
+
331
+ $templateOptions['fields'][$field_options['key']]['rows']['1'][$sub_field->post_name] = '{' . $field_tpl_key . '_' . strtolower($sub_field->post_excerpt) . '[1]}';
332
+
333
+ }
334
+ }
335
+
336
+ } else{
337
+
338
+ foreach ($field['sub_fields'] as $n => $sub_field){
339
+
340
+ $templateOptions['fields'][$field_options['key']]['rows']['1'][$sub_field['key']] = '{' . $field_tpl_key . '_' . strtolower($sub_field['name']) . '[1]}';
341
+
342
+ }
343
+ }
344
+
345
+ }
346
+
347
+ break;
348
+ case 'flexible_content':
349
+
350
+ break;
351
+
352
+ default:
353
+
354
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '[1]}';
355
+
356
+ break;
357
+
358
+ }
359
+
360
+ break;
361
+
362
+ case 'attr':
363
+ //$element_name = 'woo_' . $element_name;
364
+
365
+ if ( ! empty($exportOptions['cc_value'][$ID]) and ! in_array($exportOptions['cc_value'][$ID], $attr_list) ) {
366
+
367
+ $templateOptions['attribute_name'][] = str_replace('pa_', '', $exportOptions['cc_value'][$ID]);
368
+ $templateOptions['attribute_value'][] = '{attribute_'. $element_name .'[1]}';
369
+ $templateOptions['in_variations'][] = 1;
370
+ $templateOptions['is_visible'][] = 1;
371
+ $templateOptions['is_taxonomy'][] = 1;
372
+ $templateOptions['create_taxonomy_in_not_exists'][] = 1;
373
+ $attr_list[] = $exportOptions['cc_value'][$ID];
374
+
375
+ }
376
+ break;
377
+ case 'cats':
378
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
379
+ switch ($exportOptions['cc_label'][$ID]) {
380
+ case 'product_type':
381
+ $templateOptions['is_multiple_product_type'] = 'no';
382
+ $templateOptions['single_product_type'] = '{'. $element_name .'[1]}';
383
+ break;
384
+ case 'product_shipping_class':
385
+ $templateOptions['is_multiple_product_shipping_class'] = 'no';
386
+ $templateOptions['single_product_shipping_class'] = '{'. $element_name .'[1]}';
387
+ break;
388
+ default:
389
+ $taxonomy = $exportOptions['cc_value'][$ID];
390
+ $templateOptions['tax_assing'][$taxonomy] = 1;
391
+
392
+ if (is_taxonomy_hierarchical($taxonomy)){
393
+ $templateOptions['tax_logic'][$taxonomy] = 'hierarchical';
394
+ $templateOptions['tax_hierarchical_logic_entire'][$taxonomy] = 1;
395
+ $templateOptions['multiple_term_assing'][$taxonomy] = 1;
396
+ $templateOptions['tax_hierarchical_delim'][$taxonomy] = '>';
397
+ $templateOptions['is_tax_hierarchical_group_delim'][$taxonomy] = 1;
398
+ $templateOptions['tax_hierarchical_group_delim'][$taxonomy] = $implode_delimiter;
399
+ $templateOptions['tax_hierarchical_xpath'][$taxonomy] = array('{'. $element_name .'[1]}');
400
+ }
401
+ else{
402
+ $templateOptions['tax_logic'][$taxonomy] = 'multiple';
403
+ $templateOptions['multiple_term_assing'][$taxonomy] = 1;
404
+ $templateOptions['tax_multiple_xpath'][$taxonomy] = '{'. $element_name .'[1]}';
405
+ $templateOptions['tax_multiple_delim'][$taxonomy] = $implode_delimiter;
406
+ }
407
+ $taxs_list[] = $taxonomy;
408
+ break;
409
+ }
410
+ }
411
+ break;
412
+ case 'media':
413
+ $templateOptions['download_featured_image'] = '{'. $element_name .'_images[1]}';
414
+ $templateOptions['download_featured_delim'] = $implode_delimiter;
415
+ $templateOptions['set_image_meta_title'] = 1;
416
+ $templateOptions['set_image_meta_caption'] = 1;
417
+ $templateOptions['set_image_meta_alt'] = 1;
418
+ $templateOptions['set_image_meta_description'] = 1;
419
+ $templateOptions['image_meta_title'] = '{'. $element_name .'_titles[1]}';
420
+ $templateOptions['image_meta_title_delim'] = $implode_delimiter;
421
+ $templateOptions['image_meta_caption'] = '{'. $element_name .'_captions[1]}';
422
+ $templateOptions['image_meta_caption_delim'] = $implode_delimiter;
423
+ $templateOptions['image_meta_alt'] = '{'. $element_name .'_alts[1]}';
424
+ $templateOptions['image_meta_alt_delim'] = $implode_delimiter;
425
+ $templateOptions['image_meta_description'] = '{'. $element_name .'_descriptions[1]}';
426
+ $templateOptions['image_meta_description_delim'] = $implode_delimiter;
427
+ $templateOptions['is_update_images'] = 1;
428
+ $templateOptions['update_images_logic'] = 'add_new';
429
+ break;
430
+ case 'attachments':
431
+ $templateOptions['attachments'] = '{'. $element_name .'_attachments[1]}';
432
+ $templateOptions['atch_delim'] = $implode_delimiter;
433
+ $templateOptions['is_update_attachments'] = 1;
434
+ break;
435
+
436
+ // Export Users
437
+ case 'user_login':
438
+ $templateOptions['pmui']['login'] = '{'. $element_name .'[1]}';
439
+ $templateOptions['is_update_login'] = 1;
440
+ break;
441
+ case 'user_pass':
442
+ $templateOptions['pmui']['pass'] = '{'. $element_name .'[1]}';
443
+ $templateOptions['is_update_password'] = 1;
444
+ break;
445
+ case 'user_nicename':
446
+ $templateOptions['pmui']['nicename'] = '{'. $element_name .'[1]}';
447
+ $templateOptions['is_update_nicename'] = 1;
448
+ break;
449
+ case 'user_email':
450
+ $templateOptions['pmui']['email'] = '{'. $element_name .'[1]}';
451
+ $templateOptions['is_update_email'] = 1;
452
+ break;
453
+ case 'user_registered':
454
+ $templateOptions['pmui']['registered'] = '{'. $element_name .'[1]}';
455
+ $templateOptions['is_update_registered'] = 1;
456
+ break;
457
+ case 'display_name':
458
+ $templateOptions['pmui']['display_name'] = '{'. $element_name .'[1]}';
459
+ $templateOptions['is_update_display_name'] = 1;
460
+ break;
461
+ case 'user_url':
462
+ $templateOptions['pmui']['url'] = '{'. $element_name .'[1]}';
463
+ $templateOptions['is_update_url'] = 1;
464
+ break;
465
+
466
+ case 'first_name':
467
+ $templateOptions['pmui']['first_name'] = '{'. $element_name .'[1]}';
468
+ $templateOptions['is_update_first_name'] = 1;
469
+ break;
470
+ case 'last_name':
471
+ $templateOptions['pmui']['last_name'] = '{'. $element_name .'[1]}';
472
+ $templateOptions['is_update_last_name'] = 1;
473
+ break;
474
+ case 'wp_capabilities':
475
+ $templateOptions['pmui']['role'] = '{'. $element_name .'[1]}';
476
+ $templateOptions['is_update_role'] = 1;
477
+ break;
478
+ case 'nickname':
479
+ $templateOptions['pmui']['nickname'] = '{'. $element_name .'[1]}';
480
+ $templateOptions['is_update_nickname'] = 1;
481
+ break;
482
+ case 'description':
483
+ $templateOptions['pmui']['description'] = '{'. $element_name .'[1]}';
484
+ $templateOptions['is_update_description'] = 1;
485
+ break;
486
+
487
+ default:
488
+
489
+ break;
490
+ }
491
+ }
492
+ if ( ! empty($cf_list) ){
493
+ $templateOptions['is_update_custom_fields'] = 1;
494
+ $templateOptions['custom_fields_list'] = $cf_list;
495
+ }
496
+ if ( ! empty($attr_list) ){
497
+ $templateOptions['is_update_attributes'] = 1;
498
+ $templateOptions['attributes_list'] = $attr_list;
499
+ $templateOptions['attributes_only_list'] = implode(',', $attr_list);
500
+ }
501
+ if ( ! empty($taxs_list) ){
502
+ $templateOptions['is_update_categories'] = 1;
503
+ $templateOptions['taxonomies_list'] = $taxs_list;
504
+ }
505
+ if ( ! empty($acf_list) ){
506
+ $templateOptions['is_update_acf'] = 1;
507
+ $templateOptions['acf_list'] = $acf_list;
508
+ }
509
+ }
510
+ }
helpers/wp_all_export_prepare_template_xml.php ADDED
@@ -0,0 +1,470 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wp_all_export_prepare_template_xml($exportOptions, &$templateOptions)
4
+ {
5
+ if ($exportOptions['ids']){
6
+ $cf_list = array();
7
+ $attr_list = array();
8
+ $taxs_list = array();
9
+ $acf_list = array();
10
+ foreach ($exportOptions['ids'] as $ID => $value) {
11
+ if (empty($exportOptions['cc_type'][$ID])) continue;
12
+ $element_name = (!empty($exportOptions['cc_name'][$ID])) ? str_replace(" ", "_", $exportOptions['cc_name'][$ID]) : 'untitled_' . $ID;
13
+ switch ($exportOptions['cc_type'][$ID]) {
14
+ case 'id':
15
+ $templateOptions['unique_key'] = '{'. $element_name .'[1]}';
16
+ $templateOptions['tmp_unique_key'] = '{'. $element_name .'[1]}';
17
+ break;
18
+ case 'title':
19
+ $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
20
+ $templateOptions['is_update_title'] = 1;
21
+ break;
22
+ case 'content':
23
+ $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
24
+ $templateOptions['is_update_content'] = 1;
25
+ break;
26
+ case 'author':
27
+ $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
28
+ $templateOptions['is_update_author'] = 1;
29
+ break;
30
+ case 'date':
31
+ $templateOptions[$exportOptions['cc_type'][$ID]] = '{'. $element_name .'[1]}';
32
+ $templateOptions['is_update_dates'] = 1;
33
+ break;
34
+ case 'status':
35
+ $templateOptions['status_xpath'] = '{'. $element_name .'[1]}';
36
+ $templateOptions['is_update_status'] = 1;
37
+ break;
38
+ case 'parent':
39
+ $templateOptions['single_page_parent'] = '{'. $element_name .'[1]}';
40
+ $templateOptions['is_update_parent'] = 1;
41
+ break;
42
+ case 'excerpt':
43
+ $templateOptions['post_excerpt'] = '{'. $element_name .'[1]}';
44
+ $templateOptions['is_update_excerpt'] = 1;
45
+ break;
46
+ case 'slug':
47
+ $templateOptions['post_slug'] = '{'. $element_name .'[1]}';
48
+ $templateOptions['is_update_slug'] = 1;
49
+ break;
50
+ case 'post_type':
51
+ if ( empty($exportOptions['cpt']) ){
52
+ $templateOptions['is_override_post_type'] = 1;
53
+ $templateOptions['post_type_xpath'] = '{'. $element_name .'[1]}';
54
+ }
55
+ break;
56
+ case 'cf':
57
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
58
+ if ( ! in_array($exportOptions['cc_value'][$ID], $cf_list)) $cf_list[] = $exportOptions['cc_value'][$ID];
59
+ $templateOptions['custom_name'][] = $exportOptions['cc_value'][$ID];
60
+ $templateOptions['custom_value'][] = '{'. $element_name .'[1]}';
61
+ $templateOptions['custom_format'][] = 0;
62
+ }
63
+ break;
64
+ case 'woo':
65
+ //$element_name = 'woo' . $element_name;
66
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
67
+
68
+ $cf_list[] = $exportOptions['cc_label'][$ID];
69
+ switch ($exportOptions['cc_label'][$ID]) {
70
+ case '_visibility':
71
+ $templateOptions['is_product_visibility'] = 'xpath';
72
+ $templateOptions['single_product_visibility'] = '{'. $element_name .'[1]}';
73
+ break;
74
+ case '_stock_status':
75
+ $templateOptions['product_stock_status'] = 'xpath';
76
+ $templateOptions['single_product_stock_status'] = '{'. $element_name .'[1]}';
77
+ break;
78
+ case '_downloadable':
79
+ $templateOptions['is_product_downloadable'] = 'xpath';
80
+ $templateOptions['single_product_downloadable'] = '{'. $element_name .'[1]}';
81
+ break;
82
+ case '_virtual':
83
+ $templateOptions['is_product_virtual'] = 'xpath';
84
+ $templateOptions['single_product_virtual'] = '{'. $element_name .'[1]}';
85
+ break;
86
+ case '_price':
87
+ case '_regular_price':
88
+ $templateOptions['single_product_regular_price'] = '{'. $element_name .'[1]}';
89
+ break;
90
+ case '_sale_price':
91
+ $templateOptions['single_product_sale_price'] = '{'. $element_name .'[1]}';
92
+ break;
93
+ case '_purchase_note':
94
+ $templateOptions['single_product_purchase_note'] = '{'. $element_name .'[1]}';
95
+ break;
96
+ case '_featured':
97
+ $templateOptions['is_product_featured'] = 'xpath';
98
+ $templateOptions['single_product_featured'] = '{'. $element_name .'[1]}';
99
+ break;
100
+ case '_weight':
101
+ $templateOptions['single_product_weight'] = '{'. $element_name .'[1]}';
102
+ break;
103
+ case '_length':
104
+ $templateOptions['single_product_length'] = '{'. $element_name .'[1]}';
105
+ break;
106
+ case '_width':
107
+ $templateOptions['single_product_width'] = '{'. $element_name .'[1]}';
108
+ break;
109
+ case '_height':
110
+ $templateOptions['single_product_height'] = '{'. $element_name .'[1]}';
111
+ break;
112
+ case '_sku':
113
+ $templateOptions['single_product_sku'] = '{'. $element_name .'[1]}';
114
+ $templateOptions['single_product_id'] = '{'. $element_name .'[1]}';
115
+ $templateOptions['single_product_parent_id'] = '{parent_sku[1]}';
116
+ break;
117
+ case '_sale_price_dates_from':
118
+ $templateOptions['single_sale_price_dates_from'] = '{'. $element_name .'[1]}';
119
+ break;
120
+ case '_sale_price_dates_to':
121
+ $templateOptions['single_sale_price_dates_to'] = '{'. $element_name .'[1]}';
122
+ break;
123
+ case '_sold_individually':
124
+ $templateOptions['product_sold_individually'] = 'xpath';
125
+ $templateOptions['single_product_sold_individually'] = '{'. $element_name .'[1]}';
126
+ break;
127
+ case '_manage_stock':
128
+ $templateOptions['is_product_manage_stock'] = 'xpath';
129
+ $templateOptions['single_product_manage_stock'] = '{'. $element_name .'[1]}';
130
+ break;
131
+ case '_stock':
132
+ $templateOptions['single_product_stock_qty'] = '{'. $element_name .'[1]}';
133
+ break;
134
+ case '_upsell_ids':
135
+ $templateOptions['single_product_up_sells'] = '{'. $element_name .'[1]}';
136
+ break;
137
+ case '_crosssell_ids':
138
+ $templateOptions['single_product_cross_sells'] = '{'. $element_name .'[1]}';
139
+ break;
140
+ case '_downloadable_files':
141
+ $templateOptions['single_product_files'] = '{'. $element_name .'_paths[1]}';
142
+ $templateOptions['single_product_files_names'] = '{'. $element_name .'_names[1]}';
143
+ break;
144
+ case '_download_limit':
145
+ $templateOptions['single_product_download_limit'] = '{'. $element_name .'[1]}';
146
+ break;
147
+ case '_download_expiry':
148
+ $templateOptions['single_product_download_expiry'] = '{'. $element_name .'[1]}';
149
+ break;
150
+ case '_download_type':
151
+ $templateOptions['single_product_download_type'] = '{'. $element_name .'[1]}';
152
+ break;
153
+ case '_product_url':
154
+ $templateOptions['single_product_url'] = '{'. $element_name .'[1]}';
155
+ break;
156
+ case '_button_text':
157
+ $templateOptions['single_product_button_text'] = '{'. $element_name .'[1]}';
158
+ break;
159
+ case '_tax_status':
160
+ $templateOptions['is_multiple_product_tax_status'] = 'no';
161
+ $templateOptions['single_product_tax_status'] = '{'. $element_name .'[1]}';
162
+ break;
163
+ case '_tax_class':
164
+ $templateOptions['is_multiple_product_tax_class'] = 'no';
165
+ $templateOptions['single_product_tax_class'] = '{'. $element_name .'[1]}';
166
+ break;
167
+ case '_backorders':
168
+ $templateOptions['product_allow_backorders'] = 'xpath';
169
+ $templateOptions['single_product_allow_backorders'] = '{'. $element_name .'[1]}';
170
+ break;
171
+ case 'attributes':
172
+
173
+ global $wp_taxonomies;
174
+
175
+ foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
176
+
177
+ if (strpos($obj->name, "pa_") === 0 and strlen($obj->name) > 3)
178
+ {
179
+ $templateOptions['attribute_name'][] = '{attributename' . $obj->name .'[1]}';
180
+ $templateOptions['attribute_value'][] = '{attributevalue' . $obj->name .'[1]}';
181
+ $templateOptions['in_variations'][] = 1;
182
+ $templateOptions['is_visible'][] = 1;
183
+ $templateOptions['is_taxonomy'][] = 1;
184
+ $templateOptions['create_taxonomy_in_not_exists'][] = 1;
185
+ $attr_list[] = $obj->name;
186
+ }
187
+ }
188
+
189
+ break;
190
+ default:
191
+ # code...
192
+ break;
193
+ }
194
+ }
195
+ break;
196
+ case 'acf':
197
+
198
+ $field_options = unserialize($exportOptions['cc_options'][$ID]);
199
+
200
+ // add ACF group ID to the template options
201
+ if( ! in_array($field_options['group_id'], $templateOptions['acf'])){
202
+ $templateOptions['acf'][$field_options['group_id']] = 1;
203
+ }
204
+
205
+ $field_tpl_key = 'acf_' . $element_name . '[1]';
206
+
207
+ $acf_list[] = '[' . $field_options['name'] . '] ' . $field_options['label'];
208
+
209
+ switch ($field_options['type']) {
210
+
211
+ case 'text':
212
+ case 'textarea':
213
+ case 'number':
214
+ case 'email':
215
+ case 'password':
216
+ case 'url':
217
+ case 'oembed':
218
+ case 'wysiwyg':
219
+ case 'image':
220
+ case 'file':
221
+ case 'gallery':
222
+ case 'date_picker':
223
+ case 'color_picker':
224
+ case 'acf_cf7':
225
+ case 'gravity_forms_field':
226
+ case 'limiter':
227
+ case 'wp_wysiwyg':
228
+ case 'date_time_picker':
229
+ case 'post_object':
230
+ case 'page_link':
231
+ case 'relationship':
232
+ case 'user':
233
+
234
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '}';
235
+
236
+ break;
237
+ case 'select':
238
+ case 'checkbox':
239
+ case 'radio':
240
+ case 'true_false':
241
+
242
+ $templateOptions['is_multiple_field_value'][$field_options['key']] = 'no';
243
+
244
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '}';
245
+
246
+ break;
247
+ case 'location-field':
248
+ case 'google_map':
249
+
250
+ $templateOptions['fields'][$field_options['key']]['address'] = '{' . $field_tpl_key . '/address[1]}';
251
+ $templateOptions['fields'][$field_options['key']]['lat'] = '{' . $field_tpl_key . '/lat[1]}';
252
+ $templateOptions['fields'][$field_options['key']]['lng'] = '{' . $field_tpl_key . '/lng[1]}';
253
+
254
+ break;
255
+ case 'paypal_item':
256
+
257
+ $templateOptions['fields'][$field_options['key']]['item_name'] = '{' . $field_tpl_key . '/item_name[1]}';
258
+ $templateOptions['fields'][$field_options['key']]['item_description'] = '{' . $field_tpl_key . '/item_description[1]}';
259
+ $templateOptions['fields'][$field_options['key']]['price'] = '{' . $field_tpl_key . '/price[1]}';
260
+
261
+ break;
262
+ case 'taxonomy':
263
+
264
+ $taxonomy_options = array();
265
+
266
+ $single_term = new stdClass;
267
+ $single_term->item_id = 1;
268
+ $single_term->parent_id = NULL;
269
+ $single_term->xpath = '{' . $field_tpl_key . '/term[1]}';
270
+ $single_term->assign = false;
271
+
272
+ $taxonomy_options[] = $single_term;
273
+
274
+ $templateOptions['is_multiple_field_value'][$field_options['key']] = 'no';
275
+
276
+ $templateOptions['fields'][$field_options['key']] = json_encode($taxonomy_options);
277
+
278
+ break;
279
+
280
+ case 'repeater':
281
+
282
+ $templateOptions['fields'][$field_options['key']]['is_variable'] = 'yes';
283
+
284
+ $templateOptions['fields'][$field_options['key']]['foreach'] = '{' . $field_tpl_key . '/row}';
285
+
286
+ if (class_exists('acf')){
287
+
288
+ global $acf;
289
+
290
+ if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0){
291
+
292
+ $sub_fields = get_posts(array('posts_per_page' => -1, 'post_type' => 'acf-field', 'post_parent' => (( ! empty($field_options['id'])) ? $field_options['id'] : $field_options['ID']), 'post_status' => 'publish'));
293
+
294
+ if ( ! empty($sub_fields) ){
295
+
296
+ foreach ($sub_fields as $n => $sub_field){
297
+
298
+ $templateOptions['fields'][$field_options['key']]['rows']['1'][$sub_field->post_name] = '{acf_' . $sub_field->post_excerpt . '[1]}';
299
+
300
+ }
301
+ }
302
+
303
+ } else{
304
+
305
+ foreach ($field['sub_fields'] as $n => $sub_field){
306
+
307
+ $templateOptions['fields'][$field_options['key']]['rows']['1'][$sub_field['key']] = '{acf_' . $sub_field['name'] . '[1]}';
308
+
309
+ }
310
+ }
311
+
312
+ }
313
+
314
+ break;
315
+
316
+ case 'flexible_content':
317
+
318
+ break;
319
+
320
+ default:
321
+
322
+ $templateOptions['fields'][$field_options['key']] = '{' . $field_tpl_key . '}';
323
+
324
+ break;
325
+
326
+ }
327
+
328
+ break;
329
+ case 'attr':
330
+ //$element_name = 'woo_' . $element_name;
331
+
332
+ if ( ! empty($exportOptions['cc_value'][$ID]) and ! in_array($exportOptions['cc_value'][$ID], $attr_list) ) {
333
+ $templateOptions['attribute_name'][] = str_replace('pa_', '', $exportOptions['cc_value'][$ID]);
334
+ $templateOptions['attribute_value'][] = '{attribute_'. $element_name .'[1]}';
335
+ $templateOptions['in_variations'][] = 1;
336
+ $templateOptions['is_visible'][] = 1;
337
+ $templateOptions['is_taxonomy'][] = 1;
338
+ $templateOptions['create_taxonomy_in_not_exists'][] = 1;
339
+ $attr_list[] = $exportOptions['cc_value'][$ID];
340
+ }
341
+
342
+ break;
343
+ case 'cats':
344
+ if ( ! empty($exportOptions['cc_value'][$ID]) ){
345
+ switch ($exportOptions['cc_label'][$ID]) {
346
+ case 'product_type':
347
+ $templateOptions['is_multiple_product_type'] = 'no';
348
+ $templateOptions['single_product_type'] = '{'. $element_name .'[1]}';
349
+ break;
350
+ case 'product_shipping_class':
351
+ $templateOptions['is_multiple_product_shipping_class'] = 'no';
352
+ $templateOptions['single_product_shipping_class'] = '{'. $element_name .'[1]}';
353
+ break;
354
+ default:
355
+ $taxonomy = $exportOptions['cc_value'][$ID];
356
+ $templateOptions['tax_assing'][$taxonomy] = 1;
357
+
358
+ if (is_taxonomy_hierarchical($taxonomy)){
359
+ $templateOptions['tax_logic'][$taxonomy] = 'hierarchical';
360
+ $templateOptions['tax_hierarchical_logic_entire'][$taxonomy] = 1;
361
+ $templateOptions['multiple_term_assing'][$taxonomy] = 1;
362
+ $templateOptions['tax_hierarchical_delim'][$taxonomy] = '&gt;';
363
+ $templateOptions['is_tax_hierarchical_group_delim'][$taxonomy] = 1;
364
+ $templateOptions['tax_hierarchical_group_delim'][$taxonomy] = '|';
365
+ $templateOptions['tax_hierarchical_xpath'][$taxonomy] = array('{'. $element_name .'[1]}');
366
+ }
367
+ else{
368
+ $templateOptions['tax_logic'][$taxonomy] = 'multiple';
369
+ $templateOptions['multiple_term_assing'][$taxonomy] = 1;
370
+ $templateOptions['tax_multiple_xpath'][$taxonomy] = '{'. $element_name .'[1]}';
371
+ $templateOptions['tax_multiple_delim'][$taxonomy] = '|';
372
+ }
373
+ $taxs_list[] = $taxonomy;
374
+ break;
375
+ }
376
+ }
377
+ break;
378
+ case 'media':
379
+ $templateOptions['download_featured_image'] = '{' . $element_name . '[1]/image/file[1]}';
380
+ $templateOptions['set_image_meta_title'] = 1;
381
+ $templateOptions['set_image_meta_caption'] = 1;
382
+ $templateOptions['set_image_meta_alt'] = 1;
383
+ $templateOptions['set_image_meta_description'] = 1;
384
+ $templateOptions['image_meta_title'] = '{' . $element_name . '[1]/image/title[1]}';
385
+ $templateOptions['image_meta_caption'] = '{' . $element_name . '[1]/image/caption[1]}';
386
+ $templateOptions['image_meta_alt'] = '{' . $element_name . '[1]/image/alt[1]}';
387
+ $templateOptions['image_meta_description'] = '{' . $element_name . '[1]/image/description[1]}';
388
+ $templateOptions['is_update_images'] = 1;
389
+ $templateOptions['update_images_logic'] = 'add_new';
390
+ break;
391
+ case 'attachments':
392
+ $templateOptions['attachments'] = '{' . $element_name . '[1]/attach/url[1]}';
393
+ $templateOptions['is_update_attachments'] = 1;
394
+ break;
395
+
396
+ // Export Users
397
+ case 'user_login':
398
+ $templateOptions['pmui']['login'] = '{'. $element_name .'[1]}';
399
+ $templateOptions['is_update_login'] = 1;
400
+ break;
401
+ case 'user_pass':
402
+ $templateOptions['pmui']['pass'] = '{'. $element_name .'[1]}';
403
+ $templateOptions['is_update_password'] = 1;
404
+ break;
405
+ case 'user_nicename':
406
+ $templateOptions['pmui']['nicename'] = '{'. $element_name .'[1]}';
407
+ $templateOptions['is_update_nicename'] = 1;
408
+ break;
409
+ case 'user_email':
410
+ $templateOptions['pmui']['email'] = '{'. $element_name .'[1]}';
411
+ $templateOptions['is_update_email'] = 1;
412
+ break;
413
+ case 'user_registered':
414
+ $templateOptions['pmui']['registered'] = '{'. $element_name .'[1]}';
415
+ $templateOptions['is_update_registered'] = 1;
416
+ break;
417
+ case 'display_name':
418
+ $templateOptions['pmui']['display_name'] = '{'. $element_name .'[1]}';
419
+ $templateOptions['is_update_display_name'] = 1;
420
+ break;
421
+ case 'user_url':
422
+ $templateOptions['pmui']['url'] = '{'. $element_name .'[1]}';
423
+ $templateOptions['is_update_url'] = 1;
424
+ break;
425
+
426
+ case 'first_name':
427
+ $templateOptions['pmui']['first_name'] = '{'. $element_name .'[1]}';
428
+ $templateOptions['is_update_first_name'] = 1;
429
+ break;
430
+ case 'last_name':
431
+ $templateOptions['pmui']['last_name'] = '{'. $element_name .'[1]}';
432
+ $templateOptions['is_update_last_name'] = 1;
433
+ break;
434
+ case 'wp_capabilities':
435
+ $templateOptions['pmui']['role'] = '{'. $element_name .'[1]}';
436
+ $templateOptions['is_update_role'] = 1;
437
+ break;
438
+ case 'nickname':
439
+ $templateOptions['pmui']['nickname'] = '{'. $element_name .'[1]}';
440
+ $templateOptions['is_update_nickname'] = 1;
441
+ break;
442
+ case 'description':
443
+ $templateOptions['pmui']['description'] = '{'. $element_name .'[1]}';
444
+ $templateOptions['is_update_description'] = 1;
445
+ break;
446
+
447
+ default:
448
+
449
+ break;
450
+ }
451
+ }
452
+ if ( ! empty($cf_list) ){
453
+ $templateOptions['is_update_custom_fields'] = 1;
454
+ $templateOptions['custom_fields_list'] = $cf_list;
455
+ }
456
+ if ( ! empty($attr_list) ){
457
+ $templateOptions['is_update_attributes'] = 1;
458
+ $templateOptions['attributes_list'] = $attr_list;
459
+ $templateOptions['attributes_only_list'] = implode(',', $attr_list);
460
+ }
461
+ if ( ! empty($taxs_list) ){
462
+ $templateOptions['is_update_categories'] = 1;
463
+ $templateOptions['taxonomies_list'] = $taxs_list;
464
+ }
465
+ if ( ! empty($acf_list) ){
466
+ $templateOptions['is_update_acf'] = 1;
467
+ $templateOptions['acf_list'] = $acf_list;
468
+ }
469
+ }
470
+ }
helpers/wp_all_export_rand_char.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! function_exists('wp_all_export_rand_char')){
3
+
4
+ function wp_all_export_rand_char($length) {
5
+ $random = '';
6
+ for ($i = 0; $i < $length; $i++) {
7
+ $random .= chr(mt_rand(33, 126));
8
+ }
9
+ return $random;
10
+ }
11
+ }
helpers/wp_all_export_remove_colons.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wp_all_export_remove_colons($feed) {
4
+
5
+ // pull out colons from start tags
6
+ // (<\w+):(\w+>)
7
+ $pattern = '/(<\w+):(\w+[ |>]{1})/i';
8
+ $replacement = '<$2';
9
+ $feed = preg_replace($pattern, $replacement, $feed);
10
+ // pull out colons from end tags
11
+ // (<\/\w+):(\w+>)
12
+ $pattern = '/(<\/\w+):(\w+>)/i';
13
+ $replacement = '</$2';
14
+ $feed = preg_replace($pattern, $replacement, $feed);
15
+ // pull out colons from attributes
16
+ $pattern = '/(\s+\w+):(\w+[=]{1})/i';
17
+ $replacement = '$1_$2';
18
+ $feed = preg_replace($pattern, $replacement, $feed);
19
+ // pull colons from single element
20
+ // (<\w+):(\w+\/>)
21
+ $pattern = '/(<\w+):(\w+\/>)/i';
22
+ $replacement = '<$2';
23
+ $feed = preg_replace($pattern, $replacement, $feed);
24
+
25
+ return $feed;
26
+
27
+ }
helpers/wp_all_export_remove_source.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! function_exists('wp_all_export_remove_source')){
3
+ function wp_all_export_remove_source($file, $remove_dir = true){
4
+
5
+ @unlink($file);
6
+
7
+ $path_parts = pathinfo($file);
8
+ if ( ! empty($path_parts['dirname'])){
9
+ $path_all_parts = explode('/', $path_parts['dirname']);
10
+ $dirname = array_pop($path_all_parts);
11
+
12
+ if ( wp_all_export_isValidMd5($dirname)){
13
+ if ($remove_dir){
14
+ @unlink($path_parts['dirname'] . DIRECTORY_SEPARATOR . 'index.php' );
15
+ }
16
+ if ($remove_dir or count(@scandir($path_parts['dirname'])) == 2)
17
+ wp_all_export_rmdir($path_parts['dirname']);
18
+ }
19
+ }
20
+
21
+ }
22
+ }
helpers/wp_all_export_reverse_rules_html.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! function_exists('wp_all_export_reverse_rules_html') ) {
4
+ function wp_all_export_reverse_rules_html($filter_rules_hierarhy, $parent_rule, &$rulenumber){
5
+ $child_rules = array();
6
+ foreach ($filter_rules_hierarhy as $j => $rule) if ($rule->parent_id == $parent_rule->item_id and $rule->item_id != $parent_rule->item_id) { $child_rules[] = $rule; }
7
+
8
+ if (!empty($child_rules)){
9
+ ?>
10
+ <ol>
11
+ <?php
12
+ foreach ($child_rules as $rule){
13
+ $rulenumber++;
14
+ ?>
15
+ <li id="item_<?php echo $rulenumber;?>" class="dragging">
16
+ <div class="drag-element">
17
+ <input type="hidden" value="<?php echo $rule->element; ?>" class="wp_all_export_xml_element" name="wp_all_export_xml_element[<?php echo $rulenumber; ?>]"/>
18
+ <input type="hidden" value="<?php echo $rule->condition; ?>" class="wp_all_export_rule" name="wp_all_export_rule[<?php echo $rulenumber; ?>]"/>
19
+ <input type="hidden" value="<?php echo $rule->value; ?>" class="wp_all_export_value" name="wp_all_export_value[<?php echo $rulenumber; ?>]"/>
20
+ <span class="rule_element"><?php echo $rule->element; ?></span>
21
+ <span class="rule_as_is"><?php echo $rule->condition; ?></span>
22
+ <span class="rule_condition_value"><?php echo $rule->value; ?></span>
23
+ <span class="condition" <?php if ($rulenumber == count($filter_rules_hierarhy)):?>style="display:none;"<?php endif; ?>>
24
+ <label for="rule_and_<?php echo $rulenumber; ?>">AND</label>
25
+ <input id="rule_and_<?php echo $rulenumber; ?>" type="radio" value="and" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'AND'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
26
+ <label for="rule_or_<?php echo $rulenumber; ?>">OR</label>
27
+ <input id="rule_or_<?php echo $rulenumber; ?>" type="radio" value="or" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'OR'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
28
+ </span>
29
+ </div>
30
+ <a href="javascript:void(0);" class="icon-item remove-ico"></a>
31
+ <?php echo wp_all_export_reverse_rules_html($filter_rules_hierarhy, $rule, $rulenumber); ?>
32
+ </li>
33
+ <?php
34
+ }
35
+ ?>
36
+ </ol>
37
+ <?php
38
+ }
39
+ }
40
+ }
helpers/wp_all_export_rmdir.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function wp_all_export_rmdir($dir) {
3
+ $scanned_files = @scandir($dir);
4
+ if (!empty($scanned_files) and is_array($scanned_files)){
5
+ $files = array_diff($scanned_files, array('.','..'));
6
+ if (!empty($files)){
7
+ foreach ($files as $file) {
8
+ (is_dir("$dir/$file")) ? wp_all_export_rmdir("$dir/$file") : @unlink("$dir/$file");
9
+ }
10
+ }
11
+ return @rmdir($dir);
12
+ }
13
+ }
helpers/wp_all_export_secure_file.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! function_exists('wp_all_export_secure_file') ){
3
+
4
+ function wp_all_export_secure_file( $targetDir, $ID = false){
5
+
6
+ $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
7
+
8
+ if ( $is_secure_import ){
9
+
10
+ $dir = $targetDir . DIRECTORY_SEPARATOR . ( ( $ID ) ? md5( $ID . NONCE_SALT ) : md5( time() . NONCE_SALT ) );
11
+
12
+ @mkdir($dir, 0755);
13
+
14
+ if (@is_writable($dir) and @is_dir($dir)){
15
+ $targetDir = $dir;
16
+ @touch( $dir . DIRECTORY_SEPARATOR . 'index.php' );
17
+ }
18
+
19
+ }
20
+
21
+ return $targetDir;
22
+ }
23
+ }
helpers/wp_all_export_url_title.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! function_exists('wp_all_export_url_title')){
3
+
4
+ function wp_all_export_url_title($str, $separator = 'dash', $lowercase = FALSE)
5
+ {
6
+ if ($separator == 'dash')
7
+ {
8
+ $search = '_';
9
+ $replace = '-';
10
+ }
11
+ else
12
+ {
13
+ $search = '-';
14
+ $replace = '_';
15
+ }
16
+
17
+ $trans = array(
18
+ '&\#\d+?;' => '',
19
+ '&\S+?;' => '',
20
+ '\s+' => $replace,
21
+ '[^a-z0-9\-\._]' => '',
22
+ $replace.'+' => $replace,
23
+ $replace.'$' => $replace,
24
+ '^'.$replace => $replace,
25
+ '\.+$' => ''
26
+ );
27
+
28
+ $str = strip_tags($str);
29
+
30
+ foreach ($trans as $key => $val)
31
+ {
32
+ $str = preg_replace("#".$key."#i", $val, $str);
33
+ }
34
+
35
+ if ($lowercase === TRUE)
36
+ {
37
+ $str = strtolower($str);
38
+ }
39
+
40
+ return trim(stripslashes($str));
41
+ }
42
+ }
helpers/wp_redirect_or_javascript.php CHANGED
File without changes
libraries/.gitkeep ADDED
File without changes
libraries/XmlExportACF.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists('XmlExportACF') ){
4
+
5
+ final class XmlExportACF
6
+ {
7
+
8
+ /**
9
+ * Singletone instance
10
+ * @var XmlExportACF
11
+ */
12
+ protected static $instance;
13
+
14
+ /**
15
+ * Return singletone instance
16
+ * @return XmlExportACF
17
+ */
18
+ static public function getInstance() {
19
+ if (self::$instance == NULL) {
20
+ self::$instance = new self();
21
+ }
22
+ return self::$instance;
23
+ }
24
+
25
+ private $_existing_acf_meta_keys = array();
26
+
27
+ private $_acf_groups = array();
28
+
29
+ public function __construct() {
30
+
31
+ }
32
+
33
+ public function init( & $existing_meta_keys = array() ){
34
+
35
+ if ( ! class_exists( 'acf' ) ) return;
36
+
37
+ global $acf;
38
+
39
+ if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0){
40
+
41
+ $saved_acfs = get_posts(array('posts_per_page' => -1, 'post_type' => 'acf-field-group'));
42
+
43
+ }
44
+ else{
45
+
46
+ $this->_acf_groups = apply_filters('acf/get_field_groups', array());
47
+
48
+ }
49
+
50
+ if ( ! empty($saved_acfs) ){
51
+ foreach ($saved_acfs as $key => $obj) {
52
+ $this->_acf_groups[] = array(
53
+ 'ID' => $obj->ID,
54
+ 'title' => $obj->post_title
55
+ );
56
+ }
57
+ }
58
+
59
+ if ( ! empty($this->_acf_groups) ){
60
+
61
+ // get all ACF fields
62
+ if ($acf->settings['version'] and version_compare($acf->settings['version'], '5.0.0') >= 0)
63
+ {
64
+
65
+ foreach ($this->_acf_groups as $key => $acf_obj) {
66
+
67
+ if ( is_numeric($acf_obj['ID'])){
68
+
69
+ $acf_fields = get_posts(array('posts_per_page' => -1, 'post_type' => 'acf-field', 'post_parent' => $acf_obj['ID'], 'post_status' => 'publish', 'orderby' => 'menu_order', 'order' => 'ASC'));
70
+
71
+ if ( ! empty($acf_fields) ){
72
+
73
+ foreach ($acf_fields as $field) {
74
+
75
+ $fieldData = (!empty($field->post_content)) ? unserialize($field->post_content) : array();
76
+
77
+ $fieldData['ID'] = $field->ID;
78
+ $fieldData['id'] = $field->ID;
79
+ $fieldData['label'] = $field->post_title;
80
+ $fieldData['key'] = $field->post_name;
81
+
82
+ if (empty($fieldData['name'])) $fieldData['name'] = $field->post_excerpt;
83
+
84
+ if ( ! empty($fieldData['name'])){
85
+ $this->_existing_acf_meta_keys[] = $fieldData['name'];
86
+ }
87
+
88
+ $this->_acf_groups[$key]['fields'][] = $fieldData;
89
+
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ else
96
+ {
97
+
98
+ foreach ($this->_acf_groups as $key => $acf_obj) {
99
+
100
+ if (is_numeric($acf_obj['id'])){
101
+
102
+ $fields = array();
103
+
104
+ foreach (get_post_meta($acf_obj['id'], '') as $cur_meta_key => $cur_meta_val)
105
+ {
106
+ if (strpos($cur_meta_key, 'field_') !== 0) continue;
107
+
108
+ $fields[] = (!empty($cur_meta_val[0])) ? unserialize($cur_meta_val[0]) : array();
109
+
110
+ }
111
+
112
+ if (count($fields)){
113
+
114
+ $sortArray = array();
115
+
116
+ foreach($fields as $field){
117
+ foreach($field as $key2=>$value){
118
+ if(!isset($sortArray[$key2])){
119
+ $sortArray[$key2] = array();
120
+ }
121
+ $sortArray[$key2][] = $value;
122
+ }
123
+ }
124
+
125
+ $orderby = "order_no";
126
+
127
+ array_multisort($sortArray[$orderby],SORT_ASC, $fields);
128
+
129
+ foreach ($fields as $field){
130
+ $this->_acf_groups[$key]['fields'][] = $field;
131
+ if ( ! empty($field['name'])) $this->_existing_acf_meta_keys[] = $field['name'];
132
+ }
133
+ }
134
+ }
135
+ }
136
+ }
137
+
138
+ if ( ! empty($existing_meta_keys)){
139
+ foreach ($existing_meta_keys as $key => $meta_key) {
140
+ foreach ($this->_existing_acf_meta_keys as $acf_key => $acf_value) {
141
+ if (in_array($meta_key, array($acf_value, "_" . $acf_value)) or strpos($meta_key, $acf_value) === 0 or strpos($meta_key, "_" . $acf_value) === 0){
142
+ unset($existing_meta_keys[$key]);
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
+ }
149
+
150
+ }
151
+
152
+ public function render( & $i ){
153
+
154
+ if ( ! empty($this->_acf_groups) ){
155
+ ?>
156
+ <p class="wpae-available-fields-group"><?php _e("ACF", "wp_all_export_plugin"); ?><span class="wpae-expander">+</span></p>
157
+ <div class="wp-all-export-acf-wrapper wpae-custom-field">
158
+ <?php
159
+ foreach ($this->_acf_groups as $key => $group) {
160
+ ?>
161
+ <div class="wpae-acf-field">
162
+ <ul>
163
+ <li>
164
+ <div class="default_column" rel="">
165
+ <label class="wpallexport-element-label"><?php echo $group['title']; ?></label>
166
+ <input type="hidden" name="rules[]" value="pmxe_acf_<?php echo (!empty($group['ID'])) ? $group['ID'] : $group['id'];?>"/>
167
+ </div>
168
+ </li>
169
+ <?php
170
+ if ( ! empty($group['fields'])){
171
+ foreach ($group['fields'] as $field) {
172
+ ?>
173
+ <li class="pmxe_acf_<?php echo (!empty($group['ID'])) ? $group['ID'] : $group['id'];?>">
174
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
175
+ <label class="wpallexport-xml-element">&lt;<?php echo $field['label']; ?>&gt;</label>
176
+ <input type="hidden" name="ids[]" value="1"/>
177
+ <input type="hidden" name="cc_label[]" value="<?php echo $field['name']; ?>"/>
178
+ <input type="hidden" name="cc_php[]" value=""/>
179
+ <input type="hidden" name="cc_code[]" value=""/>
180
+ <input type="hidden" name="cc_sql[]" value=""/>
181
+ <input type="hidden" name="cc_options[]" value="<?php echo esc_html(serialize(array_merge($field, array('group_id' => ((!empty($group['ID'])) ? $group['ID'] : $group['id']) ))));?>"/>
182
+ <input type="hidden" name="cc_type[]" value="acf"/>
183
+ <input type="hidden" name="cc_value[]" value="<?php echo $field['name']; ?>"/>
184
+ <input type="hidden" name="cc_name[]" value="<?php echo str_replace(" ", "_", $field['label']);?>"/>
185
+ </div>
186
+ </li>
187
+ <?php
188
+ $i++;
189
+ }
190
+ }
191
+ ?>
192
+ </ul>
193
+ </div>
194
+ <?php
195
+ }
196
+ ?>
197
+ </div>
198
+ <?php
199
+ }
200
+ }
201
+
202
+ public function render_filters(){
203
+
204
+ if ( ! empty($this->_acf_groups) ){
205
+ ?>
206
+ <optgroup label="<?php _e("ACF", "wp_all_export_plugin"); ?>">
207
+ <?php
208
+ foreach ($this->_acf_groups as $key => $group) {
209
+ if ( ! empty($group['fields'])){
210
+ foreach ($group['fields'] as $field) {
211
+ ?>
212
+ <option value="<?php echo 'cf_' . $field['name']; ?>"><?php echo $field['label']; ?></option>
213
+ <?php
214
+ }
215
+ }
216
+ }
217
+ ?>
218
+ </optgroup>
219
+ <?php
220
+ }
221
+
222
+ }
223
+
224
+ /**
225
+ * __get function.
226
+ *
227
+ * @access public
228
+ * @param mixed $key
229
+ * @return mixed
230
+ */
231
+ public function __get( $key ) {
232
+ return $this->get( $key );
233
+ }
234
+
235
+ /**
236
+ * Get a session variable
237
+ *
238
+ * @param string $key
239
+ * @param mixed $default used if the session variable isn't set
240
+ * @return mixed value of session variable
241
+ */
242
+ public function get( $key, $default = null ) {
243
+ return isset( $this->{$key} ) ? $this->{$key} : $default;
244
+ }
245
+ }
246
+ }
libraries/XmlExportEngine.php ADDED
@@ -0,0 +1,515 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists('XmlExportEngine') ){
4
+
5
+ require_once dirname(__FILE__) . '/XmlExportACF.php';
6
+ require_once dirname(__FILE__) . '/XmlExportWooCommerce.php';
7
+ require_once dirname(__FILE__) . '/XmlExportWooCommerceOrder.php';
8
+ require_once dirname(__FILE__) . '/XmlExportUser.php';
9
+
10
+ final class XmlExportEngine
11
+ {
12
+
13
+ private $acf_export;
14
+ private $woo_export;
15
+ private $woo_order_export;
16
+ private $user_export;
17
+
18
+ private $post;
19
+ private $_existing_meta_keys = array();
20
+ private $_existing_taxonomies = array();
21
+
22
+ private $init_fields = array(
23
+ array(
24
+ 'label' => 'id',
25
+ 'name' => 'ID',
26
+ 'type' => 'id'
27
+ ),
28
+ array(
29
+ 'label' => 'title',
30
+ 'name' => 'title',
31
+ 'type' => 'title'
32
+ ),
33
+ array(
34
+ 'label' => 'content',
35
+ 'name' => 'content',
36
+ 'type' => 'content'
37
+ )
38
+ );
39
+
40
+ private $default_fields = array(
41
+ array(
42
+ 'label' => 'id',
43
+ 'name' => 'ID',
44
+ 'type' => 'id'
45
+ ),
46
+ array(
47
+ 'label' => 'title',
48
+ 'name' => 'title',
49
+ 'type' => 'title'
50
+ ),
51
+ array(
52
+ 'label' => 'content',
53
+ 'name' => 'content',
54
+ 'type' => 'content'
55
+ ),
56
+ array(
57
+ 'label' => 'excerpt',
58
+ 'name' => 'excerpt',
59
+ 'type' => 'excerpt'
60
+ ),
61
+ array(
62
+ 'label' => 'date',
63
+ 'name' => 'date',
64
+ 'type' => 'date'
65
+ ),
66
+ array(
67
+ 'label' => 'post_type',
68
+ 'name' => 'post_type',
69
+ 'type' => 'post_type'
70
+ ),
71
+ array(
72
+ 'label' => 'media',
73
+ 'name' => 'media',
74
+ 'type' => 'media'
75
+ ),
76
+ array(
77
+ 'label' => 'attachments',
78
+ 'name' => 'attachments',
79
+ 'type' => 'attachments'
80
+ )
81
+ );
82
+
83
+ private $other_fields = array(
84
+ array(
85
+ 'label' => 'status',
86
+ 'name' => 'status',
87
+ 'type' => 'status'
88
+ ),
89
+ array(
90
+ 'label' => 'author',
91
+ 'name' => 'author',
92
+ 'type' => 'author'
93
+ ),
94
+ array(
95
+ 'label' => 'slug',
96
+ 'name' => 'slug',
97
+ 'type' => 'slug'
98
+ ),
99
+ array(
100
+ 'label' => 'format',
101
+ 'name' => 'format',
102
+ 'type' => 'format'
103
+ ),
104
+ array(
105
+ 'label' => 'template',
106
+ 'name' => 'template',
107
+ 'type' => 'template'
108
+ ),
109
+ array(
110
+ 'label' => 'parent',
111
+ 'name' => 'parent',
112
+ 'type' => 'parent'
113
+ ),
114
+ array(
115
+ 'label' => 'order',
116
+ 'name' => 'order',
117
+ 'type' => 'order'
118
+ ),
119
+ array(
120
+ 'label' => 'permalink',
121
+ 'name' => 'permalink',
122
+ 'type' => 'permalink'
123
+ ),
124
+ array(
125
+ 'label' => 'comment_status',
126
+ 'name' => 'comment_status',
127
+ 'type' => 'comment_status'
128
+ ),
129
+ array(
130
+ 'label' => 'ping_status',
131
+ 'name' => 'ping_status',
132
+ 'type' => 'ping_status'
133
+ )
134
+ );
135
+
136
+ private $available_sections = array();
137
+ private $filter_sections = array();
138
+
139
+ private $errors;
140
+
141
+ private $available_data = array(
142
+ 'acf_groups' => array(),
143
+ 'existing_acf_meta_keys' => array(),
144
+ 'existing_meta_keys' => array(),
145
+ 'init_fields' => array(),
146
+ 'default_fields' => array(),
147
+ 'other_fields' => array(),
148
+ 'woo_data' => array(),
149
+ 'existing_attributes' => array(),
150
+ 'existing_taxonomies' => array()
151
+ );
152
+
153
+ private $filters;
154
+
155
+ public static $is_user_export = false;
156
+ public static $post_types = array();
157
+ public static $exportOptions = array();
158
+ public static $exportQuery;
159
+
160
+ public function __construct( $post, & $errors ){
161
+
162
+ $this->post = $post;
163
+ $this->errors = $errors;
164
+
165
+ $this->available_sections = array(
166
+ 'default' => array(
167
+ 'title' => __("Standard", "wp_all_export_plugin"),
168
+ 'content' => 'default_fields'
169
+ ),
170
+ 'cats' => array(
171
+ 'title' => __("Taxonomies", "wp_all_export_plugin"),
172
+ 'content' => 'existing_taxonomies'
173
+ ),
174
+ 'cf' => array(
175
+ 'title' => __("Custom Fields", "wp_all_export_plugin"),
176
+ 'content' => 'existing_meta_keys'
177
+ ),
178
+ 'other' => array(
179
+ 'title' => __("Other", "wp_all_export_plugin"),
180
+ 'content' => 'other_fields'
181
+ )
182
+ );
183
+
184
+ $this->filter_sections = array(
185
+ 'general' => array(
186
+ 'title' => __("General", "wp_all_export_plugin"),
187
+ 'fields' => array(
188
+ 'ID' => 'ID',
189
+ 'post_title' => 'Title',
190
+ 'post_content' => 'Content',
191
+ 'post_parent' => 'Parent ID',
192
+ 'post_date' => 'Date (Y-m-d H:i:s)',
193
+ 'post_status' => 'Status',
194
+ 'post_author' => 'Author ID'
195
+ )
196
+ )
197
+ );
198
+
199
+ if ( 'specific' == $this->post['export_type']) {
200
+
201
+ self::$post_types = ( ! is_array($this->post['cpt']) ) ? array($this->post['cpt']) : $this->post['cpt'];
202
+
203
+ if ( in_array('product', self::$post_types) and ! in_array('product_variation', self::$post_types)) self::$post_types[] = 'product_variation';
204
+
205
+ if ( in_array('users', self::$post_types) ) self::$is_user_export = true;
206
+
207
+ }
208
+ else
209
+ {
210
+ if ( 'wp_user_query' == $this->post['wp_query_selector'] ){
211
+ self::$is_user_export = true;
212
+ }
213
+ }
214
+
215
+ self::$exportOptions = $post;
216
+
217
+ $this->init();
218
+
219
+ $this->acf_export = XmlExportACF::getInstance();
220
+ $this->woo_export = XmlExportWooCommerce::getInstance();
221
+ $this->user_export = XmlExportUser::getInstance();
222
+ $this->woo_order_export = XmlExportWooCommerceOrder::getInstance();
223
+
224
+ }
225
+
226
+ protected function init(){
227
+
228
+ PMXE_Plugin::$session->set('is_user_export', self::$is_user_export);
229
+
230
+ if ('advanced' == $this->post['export_type']) {
231
+
232
+ if( "" == $this->post['wp_query'] ){
233
+ $this->errors->add('form-validation', __('WP Query field is required', 'pmxe_plugin'));
234
+ }
235
+ else {
236
+
237
+ if ( self::$is_user_export )
238
+ {
239
+ $this->errors->add('form-validation', __('Upgrade to the professional edition of WP All Export to export users.', 'pmxe_plugin'));
240
+ }
241
+ else
242
+ {
243
+ self::$exportQuery = eval('return new WP_Query(array(' . $this->post['wp_query'] . ', \'orderby\' => \'ID\', \'order\' => \'ASC\', \'offset\' => 0, \'posts_per_page\' => 10));');
244
+
245
+ if ( empty(self::$exportQuery) ) {
246
+ $this->errors->add('form-validation', __('Invalid query', 'pmxe_plugin'));
247
+ }
248
+ elseif ( empty(self::$exportQuery->found_posts) ) {
249
+ $this->errors->add('form-validation', __('No matching posts found for WP_Query expression specified', 'pmxe_plugin'));
250
+ }
251
+ else {
252
+ PMXE_Plugin::$session->set('wp_query', $this->post['wp_query']);
253
+ PMXE_Plugin::$session->set('found_posts', self::$exportQuery->found_posts);
254
+ }
255
+ }
256
+
257
+ }
258
+ }
259
+ else {
260
+
261
+ if ( self::$is_user_export )
262
+ {
263
+ $this->errors->add('form-validation', __('Upgrade to the professional edition of WP All Export to export users.', 'pmxe_plugin'));
264
+ }
265
+ else
266
+ {
267
+ self::$exportQuery = new WP_Query( array( 'post_type' => self::$post_types, 'post_status' => 'any', 'orderby' => 'ID', 'order' => 'ASC', 'posts_per_page' => 10 ));
268
+
269
+ if (empty(self::$exportQuery->found_posts)){
270
+ $this->errors->add('form-validation', __('No matching posts found for selected post types', 'pmxe_plugin'));
271
+ }
272
+ else{
273
+ PMXE_Plugin::$session->set('cpt', self::$post_types);
274
+ PMXE_Plugin::$session->set('found_posts', self::$exportQuery->found_posts);
275
+ }
276
+ }
277
+ }
278
+
279
+ PMXE_Plugin::$session->save_data();
280
+
281
+ }
282
+
283
+ public function init_additional_data(){
284
+
285
+ $this->woo_order_export->init_additional_data();
286
+
287
+ }
288
+
289
+ public function init_available_data( ){
290
+
291
+ global $wpdb;
292
+ $table_prefix = $wpdb->prefix;
293
+
294
+ // Prepare existing taxonomies
295
+ if ( 'specific' == $this->post['export_type'] and ! self::$is_user_export )
296
+ {
297
+ $post_taxonomies = array_diff_key(get_taxonomies_by_object_type(array(self::$post_types[0]), 'object'), array_flip(array('post_format')));
298
+
299
+ if ( ! empty($post_taxonomies)){
300
+ foreach ($post_taxonomies as $tx) {
301
+ if (strpos($tx->name, "pa_") !== 0)
302
+ $this->_existing_taxonomies[] = $tx->name;
303
+ }
304
+ }
305
+ $post_type = self::$post_types[0];
306
+ $meta_keys = $wpdb->get_results("SELECT DISTINCT {$table_prefix}postmeta.meta_key FROM {$table_prefix}postmeta, {$table_prefix}posts WHERE {$table_prefix}postmeta.post_id = {$table_prefix}posts.ID AND {$table_prefix}posts.post_type = '{$post_type}' AND {$table_prefix}postmeta.meta_key NOT LIKE '_edit%' LIMIT 500");
307
+ if ( ! empty($meta_keys)){
308
+ foreach ($meta_keys as $meta_key) {
309
+ $this->_existing_meta_keys[] = $meta_key->meta_key;
310
+ }
311
+ }
312
+ }
313
+ if ( 'advanced' == $this->post['export_type'] and ! self::$is_user_export)
314
+ {
315
+ $meta_keys = $wpdb->get_results("SELECT DISTINCT meta_key FROM {$table_prefix}postmeta WHERE {$table_prefix}postmeta.meta_key NOT LIKE '_edit%' LIMIT 500");
316
+ if ( ! empty($meta_keys)){
317
+ foreach ($meta_keys as $meta_key) {
318
+ $this->_existing_meta_keys[] = $meta_key->meta_key;
319
+ }
320
+ }
321
+
322
+ global $wp_taxonomies;
323
+
324
+ foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
325
+
326
+ if (strpos($obj->name, "pa_") !== 0 and strlen($obj->name) > 3)
327
+ $this->_existing_taxonomies[] = $obj->name;
328
+ }
329
+ }
330
+
331
+ // Prepare existing ACF groups & fields
332
+ $this->acf_export->init($this->_existing_meta_keys);
333
+
334
+ // Prepare existing WooCommerce data
335
+ $this->woo_export->init($this->_existing_meta_keys);
336
+
337
+ // Prepare existing WooCommerce Order data
338
+ $this->woo_order_export->init($this->_existing_meta_keys);
339
+
340
+ // Prepare existing Users data
341
+ $this->user_export->init($this->_existing_meta_keys);
342
+
343
+ return $this->get_available_data();
344
+ }
345
+
346
+ public function get_available_data(){
347
+
348
+ $this->available_data['acf_groups'] = $this->acf_export->get('_acf_groups');
349
+ $this->available_data['existing_acf_meta_keys'] = $this->acf_export->get('_existing_acf_meta_keys');
350
+ $this->available_data['existing_meta_keys'] = $this->_existing_meta_keys;
351
+ $this->available_data['existing_taxonomies'] = $this->_existing_taxonomies;
352
+
353
+ $this->available_data['init_fields'] = apply_filters('wp_all_export_init_fields', $this->init_fields);
354
+ $this->available_data['default_fields'] = apply_filters('wp_all_export_default_fields', $this->default_fields);
355
+ $this->available_data['other_fields'] = apply_filters('wp_all_export_other_fields', $this->other_fields);
356
+
357
+ $this->available_data = apply_filters("wp_all_export_available_data", $this->available_data);;
358
+
359
+ return $this->available_data;
360
+
361
+ }
362
+
363
+ public function render(){
364
+
365
+ $i = 0;
366
+
367
+ ob_start();
368
+
369
+ $available_sections = apply_filters("wp_all_export_available_sections", $this->available_sections);
370
+
371
+ // Render Available WooCommerce Orders Data
372
+ $this->woo_order_export->render($i);
373
+
374
+ foreach ($available_sections as $slug => $section) {
375
+
376
+ if ( ! empty($this->available_data[$section['content']]) ){
377
+ ?>
378
+ <p class="wpae-available-fields-group"><?php echo $section['title']; ?><span class="wpae-expander">+</span></p>
379
+ <div class="wpae-custom-field">
380
+ <ul>
381
+ <li>
382
+ <div class="default_column" rel="">
383
+ <a href="javascript:void(0);" class="pmxe_remove_column">X</a>
384
+ <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $section['title']; ?></label>
385
+ <input type="hidden" name="rules[]" value="pmxe_<?php echo $slug; ?>"/>
386
+ </div>
387
+ </li>
388
+ <?php
389
+ foreach ($this->available_data[$section['content']] as $field) {
390
+ ?>
391
+ <li class="pmxe_<?php echo $slug; ?> <?php if ( ! empty($field['auto'])) echo 'wp_all_export_auto_generate';?>">
392
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
393
+ <label class="wpallexport-xml-element">&lt;<?php echo (is_array($field)) ? $field['name'] : $field; ?>&gt;</label>
394
+ <input type="hidden" name="ids[]" value="1"/>
395
+ <input type="hidden" name="cc_label[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
396
+ <input type="hidden" name="cc_php[]" value=""/>
397
+ <input type="hidden" name="cc_code[]" value=""/>
398
+ <input type="hidden" name="cc_sql[]" value=""/>
399
+ <input type="hidden" name="cc_options[]" value=""/>
400
+ <input type="hidden" name="cc_type[]" value="<?php echo (is_array($field)) ? $field['type'] : $slug; ?>"/>
401
+ <input type="hidden" name="cc_value[]" value="<?php echo (is_array($field)) ? $field['label'] : $field; ?>"/>
402
+ <input type="hidden" name="cc_name[]" value="<?php echo (is_array($field)) ? $field['name'] : $field;?>"/>
403
+ <!--a href="javascript:void(0);" title="<?php _e('Delete field', 'wp_all_export_plugin'); ?>" class="icon-item remove-field"></a-->
404
+ </div>
405
+ </li>
406
+ <?php
407
+ $i++;
408
+ }
409
+ ?>
410
+ </ul>
411
+ </div>
412
+ <?php
413
+ }
414
+
415
+ }
416
+
417
+ if ( ! XmlExportWooCommerceOrder::$is_active )
418
+ {
419
+ // Render Available ACF
420
+ $this->acf_export->render($i);
421
+
422
+ }
423
+
424
+ return ob_get_clean();
425
+
426
+ }
427
+
428
+ public function render_filters(){
429
+
430
+ $filter_sections = apply_filters('wp_all_export_filters', $this->filter_sections);
431
+
432
+ foreach ($filter_sections as $slug => $section) {
433
+
434
+ ?>
435
+
436
+ <optgroup label="<?php echo $section['title']; ?>">
437
+
438
+ <?php foreach ($section['fields'] as $key => $title) : ?>
439
+
440
+ <option value="<?php echo $key; ?>"><?php echo $title; ?></option>
441
+
442
+ <?php endforeach; ?>
443
+
444
+ </optgroup>
445
+
446
+ <?php
447
+
448
+ }
449
+
450
+ $available_sections = apply_filters("wp_all_export_available_filter_sections", $this->available_sections);
451
+
452
+ foreach ($available_sections as $slug => $section) {
453
+
454
+ if ( ! empty($this->available_data[$section['content']]) ){
455
+ ?>
456
+ <optgroup label="<?php echo $section['title']; ?>">
457
+ <?php
458
+
459
+ foreach ($this->available_data[$section['content']] as $field) {
460
+ switch ($section['content']) {
461
+ case 'existing_meta_keys':
462
+ ?>
463
+ <option value="<?php echo 'cf_' . $field; ?>"><?php echo $field; ?></option>
464
+ <?php
465
+ break;
466
+ case 'existing_taxonomies':
467
+ ?>
468
+ <option value="<?php echo 'tx_' . $field; ?>"><?php echo $field; ?></option>
469
+ <?php
470
+ break;
471
+
472
+ default:
473
+ # code...
474
+ break;
475
+ }
476
+ }
477
+ ?>
478
+ </optgroup>
479
+ <?php
480
+ }
481
+
482
+ }
483
+
484
+ if ( ! XmlExportWooCommerceOrder::$is_active )
485
+ {
486
+ // Render Available ACF
487
+ $this->acf_export->render_filters();
488
+
489
+ }
490
+
491
+ }
492
+
493
+ /**
494
+ * __get function.
495
+ *
496
+ * @access public
497
+ * @param mixed $key
498
+ * @return mixed
499
+ */
500
+ public function __get( $key ) {
501
+ return $this->get( $key );
502
+ }
503
+
504
+ /**
505
+ * Get a session variable
506
+ *
507
+ * @param string $key
508
+ * @param mixed $default used if the session variable isn't set
509
+ * @return mixed value of session variable
510
+ */
511
+ public function get( $key, $default = null ) {
512
+ return isset( $this->{$key} ) ? $this->{$key} : $default;
513
+ }
514
+ }
515
+ }
libraries/XmlExportUser.php ADDED
@@ -0,0 +1,354 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists('XmlExportUser') ){
4
+
5
+ final class XmlExportUser
6
+ {
7
+
8
+ /**
9
+ * Singletone instance
10
+ * @var XmlExportUser
11
+ */
12
+ protected static $instance;
13
+
14
+ /**
15
+ * Return singletone instance
16
+ * @return XmlExportUser
17
+ */
18
+ static public function getInstance() {
19
+ if (self::$instance == NULL) {
20
+ self::$instance = new self();
21
+ }
22
+ return self::$instance;
23
+ }
24
+
25
+ private $init_fields = array(
26
+ array(
27
+ 'label' => 'id',
28
+ 'name' => 'ID',
29
+ 'type' => 'id'
30
+ ),
31
+ array(
32
+ 'label' => 'user_email',
33
+ 'name' => 'User Email',
34
+ 'type' => 'user_email'
35
+ ),
36
+ array(
37
+ 'label' => 'user_login',
38
+ 'name' => 'User Login',
39
+ 'type' => 'user_login'
40
+ )
41
+ );
42
+
43
+ private $default_fields = array(
44
+ array(
45
+ 'label' => 'id',
46
+ 'name' => 'ID',
47
+ 'type' => 'id'
48
+ ),
49
+ array(
50
+ 'label' => 'user_login',
51
+ 'name' => 'User Login',
52
+ 'type' => 'user_login'
53
+ ),
54
+ array(
55
+ 'label' => 'user_email',
56
+ 'name' => 'User Email',
57
+ 'type' => 'user_email'
58
+ ),
59
+ array(
60
+ 'label' => 'first_name',
61
+ 'name' => 'First Name',
62
+ 'type' => 'first_name'
63
+ ),
64
+ array(
65
+ 'label' => 'last_name',
66
+ 'name' => 'Last Name',
67
+ 'type' => 'last_name'
68
+ ),
69
+ array(
70
+ 'label' => 'user_registered',
71
+ 'name' => 'User Registered',
72
+ 'type' => 'user_registered'
73
+ ),
74
+ array(
75
+ 'label' => 'user_nicename',
76
+ 'name' => 'User Nicename',
77
+ 'type' => 'user_nicename'
78
+ ),
79
+ array(
80
+ 'label' => 'user_url',
81
+ 'name' => 'User URL',
82
+ 'type' => 'user_url'
83
+ ),
84
+ array(
85
+ 'label' => 'display_name',
86
+ 'name' => 'Display Name',
87
+ 'type' => 'display_name'
88
+ ),
89
+ array(
90
+ 'label' => 'nickname',
91
+ 'name' => 'Nickname',
92
+ 'type' => 'nickname'
93
+ ),
94
+ array(
95
+ 'label' => 'description',
96
+ 'name' => 'Description',
97
+ 'type' => 'description'
98
+ )
99
+ );
100
+
101
+ private $advanced_fields = array(
102
+ array(
103
+ 'label' => 'rich_editing',
104
+ 'name' => 'rich_editing',
105
+ 'type' => 'cf'
106
+ ),
107
+ array(
108
+ 'label' => 'comment_shortcuts',
109
+ 'name' => 'comment_shortcuts',
110
+ 'type' => 'cf'
111
+ ),
112
+ array(
113
+ 'label' => 'admin_color',
114
+ 'name' => 'admin_color',
115
+ 'type' => 'cf'
116
+ ),
117
+ array(
118
+ 'label' => 'use_ssl',
119
+ 'name' => 'use_ssl',
120
+ 'type' => 'cf'
121
+ ),
122
+ array(
123
+ 'label' => 'show_admin_bar_front',
124
+ 'name' => 'show_admin_bar_front',
125
+ 'type' => 'cf'
126
+ ),
127
+ array(
128
+ 'label' => 'wp_capabilities',
129
+ 'name' => 'wp_capabilities',
130
+ 'type' => 'wp_capabilities'
131
+ ),
132
+ array(
133
+ 'label' => 'wp_user_level',
134
+ 'name' => 'wp_user_level',
135
+ 'type' => 'cf'
136
+ ),
137
+ array(
138
+ 'label' => 'show_welcome_panel',
139
+ 'name' => 'show_welcome_panel',
140
+ 'type' => 'cf'
141
+ ),
142
+ array(
143
+ 'label' => 'user_pass',
144
+ 'name' => 'user_pass',
145
+ 'type' => 'user_pass'
146
+ ),
147
+ array(
148
+ 'label' => 'dismissed_wp_pointers',
149
+ 'name' => 'dismissed_wp_pointers',
150
+ 'type' => 'cf'
151
+ ),
152
+ array(
153
+ 'label' => 'session_tokens',
154
+ 'name' => 'session_tokens',
155
+ 'type' => 'cf'
156
+ ),
157
+ array(
158
+ 'label' => 'wp_user-settings',
159
+ 'name' => 'wp_user-settings',
160
+ 'type' => 'cf'
161
+ ),
162
+ array(
163
+ 'label' => 'wp_user-settings-time',
164
+ 'name' => 'wp_user-settings-time',
165
+ 'type' => 'cf'
166
+ ),
167
+ array(
168
+ 'label' => 'wp_dashboard_quick_press_last_post_id',
169
+ 'name' => 'wp_dashboard_quick_press_last_post_id',
170
+ 'type' => 'cf'
171
+ ),
172
+ array(
173
+ 'label' => 'user_activation_key',
174
+ 'name' => 'user_activation_key',
175
+ 'type' => 'user_activation_key'
176
+ ),
177
+ array(
178
+ 'label' => 'user_status',
179
+ 'name' => 'user_status',
180
+ 'type' => 'user_status'
181
+ )
182
+ );
183
+
184
+ private $filter_sections = array();
185
+
186
+ public static $is_active = true;
187
+
188
+ public function __construct()
189
+ {
190
+
191
+ if ( ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('users', XmlExportEngine::$post_types) )
192
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and XmlExportEngine::$exportOptions['wp_query_selector'] != 'wp_user_query' ) ){
193
+ self::$is_active = false;
194
+ return;
195
+ }
196
+
197
+ $this->filter_sections = array(
198
+ 'general' => array(
199
+ 'title' => __("General", "wp_all_export_plugin"),
200
+ 'fields' => array(
201
+ 'ID' => 'ID',
202
+ 'user_login' => 'User Login',
203
+ 'user_email' => 'User Email',
204
+ 'cf_first_name' => 'First Name',
205
+ 'cf_last_name' => 'Last Name',
206
+ 'user_role' => 'User Role',
207
+ 'user_nicename' => 'User Nicename',
208
+ 'user_url' => 'User URL',
209
+ 'user_registered' => 'Registered Date (Y-m-d H:i:s)',
210
+ 'user_status' => 'User Status',
211
+ 'display_name' => 'Display Name',
212
+ 'cf_nickname' => 'Nickname',
213
+ 'cf_description' => 'Description',
214
+ 'user_status' => 'User Status'
215
+ )
216
+ ),
217
+ 'advanced' => array(
218
+ 'title' => __("Advanced", "wp_all_export_plugin"),
219
+ 'fields' => array()
220
+ )
221
+ );
222
+
223
+ foreach ($this->advanced_fields as $key => $field) {
224
+ if ($field['type'] == 'cf'){
225
+ $this->filter_sections['advanced']['fields']['cf_' . $field['name']] = $field['name'];
226
+ }
227
+ }
228
+
229
+ if (is_multisite()){
230
+ $this->filter_sections['network'] = array(
231
+ 'title' => __("Network", "wp_all_export_plugin"),
232
+ 'fields' => array(
233
+ 'blog_id' => 'Blog ID'
234
+ )
235
+ );
236
+ }
237
+
238
+ add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections" ), 10, 1);
239
+ add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
240
+ add_filter("wp_all_export_default_fields", array( &$this, "filter_default_fields"), 10, 1);
241
+ add_filter("wp_all_export_other_fields", array( &$this, "filter_other_fields"), 10, 1);
242
+ add_filter("wp_all_export_filters", array( &$this, "filter_export_filters"), 10, 1);
243
+ }
244
+
245
+ // [FILTERS]
246
+
247
+ /**
248
+ *
249
+ * Filter data for advanced filtering
250
+ *
251
+ */
252
+ public function filter_export_filters($filters){
253
+ return $this->filter_sections;
254
+ }
255
+
256
+ /**
257
+ *
258
+ * Filter Init Fields
259
+ *
260
+ */
261
+ public function filter_init_fields($init_fields){
262
+ return $this->init_fields;
263
+ }
264
+
265
+ /**
266
+ *
267
+ * Filter Default Fields
268
+ *
269
+ */
270
+ public function filter_default_fields($default_fields){
271
+ return $this->default_fields;
272
+ }
273
+
274
+ /**
275
+ *
276
+ * Filter Other Fields
277
+ *
278
+ */
279
+ public function filter_other_fields($other_fields){
280
+ return $this->advanced_fields;
281
+ }
282
+
283
+ /**
284
+ *
285
+ * Filter Sections in Available Data
286
+ *
287
+ */
288
+ public function filter_available_sections($sections){
289
+
290
+ unset($sections['cats']);
291
+
292
+ $sections['other']['title'] = __("Advanced", "wp_all_export_plugin");
293
+
294
+ return $sections;
295
+ }
296
+
297
+ // [\FILTERS]
298
+
299
+ public function init( & $existing_meta_keys = array() )
300
+ {
301
+ if ( ! self::$is_active ) return;
302
+
303
+ if ( ! empty( XmlExportEngine::$exportQuery->results ) ) {
304
+ foreach ( XmlExportEngine::$exportQuery->results as $user ) {
305
+ $record_meta = get_user_meta($user->ID, '');
306
+ if ( ! empty($record_meta)){
307
+ foreach ($record_meta as $record_meta_key => $record_meta_value) {
308
+ if ( ! in_array($record_meta_key, $existing_meta_keys) ){
309
+ $to_add = true;
310
+ foreach ($this->default_fields as $default_value) {
311
+ if ( $record_meta_key == $default_value['name'] || $record_meta_key == $default_value['type'] ){
312
+ $to_add = false;
313
+ break;
314
+ }
315
+ }
316
+ if ( $to_add ){
317
+ foreach ($this->advanced_fields as $advanced_value) {
318
+ if ( $record_meta_key == $advanced_value['name'] || $record_meta_key == $advanced_value['type']){
319
+ $to_add = false;
320
+ break;
321
+ }
322
+ }
323
+ }
324
+ if ( $to_add ) $existing_meta_keys[] = $record_meta_key;
325
+ }
326
+ }
327
+ }
328
+ }
329
+ }
330
+ }
331
+
332
+ /**
333
+ * __get function.
334
+ *
335
+ * @access public
336
+ * @param mixed $key
337
+ * @return mixed
338
+ */
339
+ public function __get( $key ) {
340
+ return $this->get( $key );
341
+ }
342
+
343
+ /**
344
+ * Get a session variable
345
+ *
346
+ * @param string $key
347
+ * @param mixed $default used if the session variable isn't set
348
+ * @return mixed value of session variable
349
+ */
350
+ public function get( $key, $default = null ) {
351
+ return isset( $this->{$key} ) ? $this->{$key} : $default;
352
+ }
353
+ }
354
+ }
libraries/XmlExportWooCommerce.php ADDED
@@ -0,0 +1,551 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists('XmlExportWooCommerce') ){
4
+
5
+ final class XmlExportWooCommerce
6
+ {
7
+
8
+ /**
9
+ * Singletone instance
10
+ * @var XmlExportWooCommerce
11
+ */
12
+ protected static $instance;
13
+
14
+ /**
15
+ * Return singletone instance
16
+ * @return XmlExportWooCommerce
17
+ */
18
+ static public function getInstance() {
19
+ if (self::$instance == NULL) {
20
+ self::$instance = new self();
21
+ }
22
+ return self::$instance;
23
+ }
24
+
25
+ private $init_fields = array(
26
+ array(
27
+ 'name' => 'SKU',
28
+ 'type' => 'woo',
29
+ 'label' => '_sku'
30
+ ),
31
+ array(
32
+ 'name' => 'product_type',
33
+ 'type' => 'cats',
34
+ 'label' => 'product_type'
35
+ )
36
+ );
37
+
38
+ private $_woo_data = array();
39
+ private $_product_data = array();
40
+
41
+ private static $_existing_attributes = array();
42
+
43
+ public static $is_active = true;
44
+
45
+ public function __construct(){
46
+
47
+ if ( ! class_exists('WooCommerce')
48
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('product', XmlExportEngine::$post_types) )
49
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and strpos(XmlExportEngine::$exportOptions['wp_query'], 'product') === false ) ) {
50
+ self::$is_active = false;
51
+ return;
52
+ }
53
+
54
+ $this->_woo_data = array(
55
+ '_visibility', '_stock_status', '_downloadable', '_virtual', '_regular_price', '_sale_price', '_purchase_note', '_featured', '_weight', '_length',
56
+ '_width', '_height', '_sku', '_sale_price_dates_from', '_sale_price_dates_to', '_price', '_sold_individually', '_manage_stock', '_stock', '_upsell_ids', '_crosssell_ids',
57
+ '_downloadable_files', '_download_limit', '_download_expiry', '_download_type', '_product_url', '_button_text', '_backorders', '_tax_status', '_tax_class', '_product_image_gallery', '_default_attributes',
58
+ 'total_sales', '_product_attributes'
59
+ );
60
+
61
+ $this->_product_data = array('_sku', '_price', '_regular_price','_sale_price', '_stock_status', '_stock', '_visibility', '_product_url', 'total_sales', 'attributes');
62
+
63
+ add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
64
+ add_filter("wp_all_export_default_fields", array( &$this, "filter_default_fields"), 10, 1);
65
+ add_filter("wp_all_export_other_fields", array( &$this, "filter_other_fields"), 10, 1);
66
+ add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections"), 10, 1);
67
+ add_filter("wp_all_export_available_data", array( &$this, "filter_available_data"), 10, 1);
68
+ add_filter("wp_all_export_filters", array( &$this, "filter_export_filters"), 10, 1);
69
+
70
+ }
71
+
72
+ // [FILTERS]
73
+
74
+ /**
75
+ *
76
+ * Filter data for advanced filtering
77
+ *
78
+ */
79
+ public function filter_export_filters($filters){
80
+
81
+ $filters['product_data'] = array(
82
+ 'title' => __('Product Data', 'wp_all_export_plugin'),
83
+ 'fields' => array()
84
+ );
85
+
86
+ foreach ($this->_product_data as $woo_key) {
87
+
88
+ $filters['product_data']['fields']['cf_' . $woo_key] = ucwords(str_replace("_", " ", trim($woo_key, "_")));
89
+
90
+ }
91
+
92
+ $filters['other'] = array(
93
+ 'title' => __('Advanced', 'wp_all_export_plugin'),
94
+ 'fields' => array()
95
+ );
96
+
97
+ if ( ! empty($this->_woo_data))
98
+ {
99
+ foreach ($this->_woo_data as $woo_key) {
100
+ if ( ! in_array($woo_key, $this->_product_data))
101
+ {
102
+ $filters['other']['fields']['cf_' . $woo_key] = $woo_key;
103
+ }
104
+ }
105
+
106
+ if ( ! empty(self::$_existing_attributes) )
107
+ {
108
+ foreach (self::$_existing_attributes as $key => $tx_name) {
109
+ $filters['other']['fields']['tx_' . $tx_name] = $tx_name;
110
+ }
111
+ }
112
+ }
113
+
114
+ return $filters;
115
+ }
116
+
117
+ /**
118
+ *
119
+ * Filter Init Fields
120
+ *
121
+ */
122
+ public function filter_init_fields($init_fields){
123
+ foreach ($this->init_fields as $field) {
124
+ $init_fields[] = $field;
125
+ }
126
+ return array_map(array( &$this, 'fix_titles'), $init_fields);
127
+ }
128
+
129
+ /**
130
+ *
131
+ * Filter Default Fields
132
+ *
133
+ */
134
+ public function filter_default_fields($default_fields){
135
+ foreach ($default_fields as $key => $field) {
136
+ $default_fields[$key]['auto'] = true;
137
+ }
138
+ return array_map(array( &$this, 'fix_titles'), $default_fields);
139
+ }
140
+
141
+ /**
142
+ *
143
+ * Filter Other Fields
144
+ *
145
+ */
146
+ public function filter_other_fields($other_fields){
147
+
148
+ if ( ! empty($this->_woo_data))
149
+ {
150
+ foreach ($this->_woo_data as $woo_key) {
151
+
152
+ if ( strpos($woo_key, 'attribute_pa_') === 0 ) continue;
153
+
154
+ if ( ! in_array($woo_key, $this->_product_data) )
155
+ {
156
+ $other_fields[] = array(
157
+ 'name' => $woo_key,
158
+ 'label' => $woo_key,
159
+ 'type' => 'woo'
160
+ );
161
+ }
162
+ }
163
+
164
+ // add needed fields to auto generate list
165
+ foreach ($other_fields as $key => $field)
166
+ {
167
+ if ( strpos($field['label'], '_min_') === 0 || strpos($field['label'], '_max_') === 0 )
168
+ continue;
169
+
170
+ $other_fields[$key]['auto'] = true;
171
+ }
172
+
173
+ if ( ! empty(self::$_existing_attributes) )
174
+ {
175
+ foreach (self::$_existing_attributes as $key => $tx_name) {
176
+ $other_fields[] = array(
177
+ 'name' => $tx_name,
178
+ 'label' => $tx_name,
179
+ 'type' => 'attr'
180
+ );
181
+ }
182
+ }
183
+ }
184
+
185
+ return $other_fields;
186
+ }
187
+ /**
188
+ *
189
+ * Helper method to fix fields title
190
+ *
191
+ */
192
+ protected function fix_titles($field){
193
+ $field['name'] = ucwords(str_replace("_", " ", $field['name']));
194
+ return $field;
195
+ }
196
+
197
+ /**
198
+ *
199
+ * Filter Available Data
200
+ *
201
+ */
202
+ public function filter_available_data($available_data){
203
+ $available_data['woo_data'] = $this->_woo_data;
204
+ $available_data['existing_attributes'] = self::$_existing_attributes;
205
+ $available_data['product_fields'] = array();
206
+
207
+ if ( ! empty($this->_product_data) )
208
+ {
209
+
210
+ foreach ($this->_product_data as $woo_key) {
211
+
212
+ $available_data['product_fields'][] = array(
213
+ 'name' => ucwords(str_replace("_", " ", trim($woo_key, "_"))),
214
+ 'label' => $woo_key,
215
+ 'type' => 'woo',
216
+ 'auto' => true
217
+ );
218
+
219
+ }
220
+ }
221
+
222
+ return $available_data;
223
+ }
224
+
225
+ /**
226
+ *
227
+ * Filter Sections in Available Data
228
+ *
229
+ */
230
+ public function filter_available_sections($available_sections){
231
+
232
+ $available_sections['other']['title'] = __("Advanced", "wp_all_export_plugin");
233
+
234
+ $product_data = array(
235
+ 'product_data' => array(
236
+ 'title' => __("Product Data", "wp_all_export_plugin"),
237
+ 'content' => 'product_fields'
238
+ )
239
+ );
240
+ return array_merge(array_slice($available_sections, 0, 1), $product_data, array_slice($available_sections, 1));
241
+ }
242
+
243
+ // [\FILTERS]
244
+
245
+ public function init( & $existing_meta_keys = array() ){
246
+
247
+ if ( ! self::$is_active ) return;
248
+
249
+ $hide_fields = array('_edit_lock', '_edit_last');
250
+
251
+ if ( ! empty($existing_meta_keys) )
252
+ {
253
+ foreach ($existing_meta_keys as $key => $record_meta_key) {
254
+
255
+ if ( in_array($record_meta_key, $this->_woo_data) ) unset($existing_meta_keys[$key]);
256
+
257
+ if ( strpos($record_meta_key, 'attribute_pa_') === 0 || strpos($record_meta_key, '_min_') === 0 || strpos($record_meta_key, '_max_') === 0){
258
+ if ( ! in_array($record_meta_key, $this->_woo_data)){
259
+ $this->_woo_data[] = $record_meta_key;
260
+ unset($existing_meta_keys[$key]);
261
+ }
262
+
263
+ }
264
+ }
265
+ }
266
+
267
+ global $wp_taxonomies;
268
+
269
+ foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
270
+
271
+ if (strpos($obj->name, "pa_") === 0 and strlen($obj->name) > 3)
272
+ self::$_existing_attributes[] = $obj->name;
273
+ }
274
+
275
+ }
276
+
277
+ protected function prepare_export_data( $record, $options, $elId )
278
+ {
279
+ $data = array();
280
+
281
+ if ( ! empty($options['cc_value'][$elId]) )
282
+ {
283
+ $implode_delimiter = ($options['delimiter'] == ',') ? '|' : ',';
284
+
285
+ $element_name = ( ! empty($options['cc_name'][$elId]) ) ? str_replace(" ", "_", $options['cc_name'][$elId]) : 'untitled_' . $elId;
286
+ $fieldSnipped = ( ! empty($options['cc_php'][$elId]) and ! empty($options['cc_code'][$elId]) ) ? $options['cc_code'][$elId] : false;
287
+
288
+ switch ($options['cc_value'][$elId])
289
+ {
290
+ case 'attributes':
291
+
292
+ if ( empty(self::$_existing_attributes) )
293
+ {
294
+ global $wp_taxonomies;
295
+
296
+ foreach ($wp_taxonomies as $key => $obj) { if (in_array($obj->name, array('nav_menu'))) continue;
297
+
298
+ if (strpos($obj->name, "pa_") === 0 and strlen($obj->name) > 3 and ! in_array($obj->name, self::$_existing_attributes))
299
+ self::$_existing_attributes[] = $obj->name;
300
+ }
301
+ }
302
+
303
+ if ( ! empty(self::$_existing_attributes))
304
+ {
305
+ foreach (self::$_existing_attributes as $taxonomy_slug) {
306
+
307
+ $taxonomy = get_taxonomy($taxonomy_slug);
308
+
309
+ $data['Attribute Name (' . $taxonomy_slug . ')'] = $taxonomy->labels->name;
310
+
311
+ $element_name = 'Attribute Value (' . $taxonomy_slug . ')';
312
+
313
+ if ($record->post_parent == 0)
314
+ {
315
+ $txes_list = get_the_terms($record->ID, $taxonomy_slug);
316
+ if ( ! is_wp_error($txes_list) and ! empty($txes_list))
317
+ {
318
+ $attr_new = array();
319
+ foreach ($txes_list as $t) {
320
+ $attr_new[] = $t->name;
321
+ }
322
+ $data[$element_name] = apply_filters('pmxe_woo_attribute', pmxe_filter(implode($implode_delimiter, $attr_new), $fieldSnipped), $record->ID);
323
+ }
324
+ else
325
+ {
326
+ $data[$element_name] = '';
327
+ }
328
+ }
329
+ else
330
+ {
331
+ $data[$element_name] = get_post_meta($record->ID, 'attribute_' . $taxonomy_slug, true);
332
+ }
333
+
334
+ }
335
+ }
336
+ break;
337
+
338
+ default:
339
+
340
+ $cur_meta_values = get_post_meta($record->ID, $options['cc_value'][$elId]);
341
+
342
+ if ( ! empty($cur_meta_values) and is_array($cur_meta_values) )
343
+ {
344
+ foreach ($cur_meta_values as $key => $cur_meta_value)
345
+ {
346
+ switch ($options['cc_label'][$elId])
347
+ {
348
+ case 'attributes':
349
+
350
+
351
+ break;
352
+ case '_downloadable_files':
353
+
354
+ $files = maybe_unserialize($cur_meta_value);
355
+ $file_paths = array();
356
+ $file_names = array();
357
+
358
+ if ( ! empty($files) ){
359
+
360
+ foreach ($files as $key => $file) {
361
+ $file_paths[] = $file['file'];
362
+ $file_names[] = $file['name'];
363
+ }
364
+
365
+ $data[$element_name . '_paths'] = implode($implode_delimiter, $file_paths);
366
+
367
+ $data[$element_name . '_names'] = implode($implode_delimiter, $file_names);
368
+
369
+ }
370
+
371
+ break;
372
+ case '_crosssell_ids':
373
+ case '_upsell_ids':
374
+ $_upsell_ids = maybe_unserialize($cur_meta_value);
375
+ $_skus = array();
376
+ if (!empty($_upsell_ids)){
377
+ foreach ($_upsell_ids as $_upsell_id) {
378
+ $_skus[] = get_post_meta($_upsell_id, '_sku', true);
379
+ }
380
+ $data[$element_name] = implode($implode_delimiter, $_skus);
381
+ }
382
+ break;
383
+
384
+ default:
385
+ if ( empty($data[$element_name]) )
386
+ {
387
+ $data[$element_name] = apply_filters('pmxe_woo_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $options['cc_value'][$elId], $record->ID);
388
+ }
389
+ else
390
+ {
391
+ $data[$element_name . '_' . $key] = apply_filters('pmxe_woo_field', pmxe_filter(maybe_serialize($cur_meta_value), $fieldSnipped), $options['cc_value'][$elId], $record->ID);
392
+ }
393
+ break;
394
+ }
395
+ }
396
+ }
397
+
398
+ if ( empty($cur_meta_values) )
399
+ {
400
+ $data[$element_name] = apply_filters('pmxe_woo_field', pmxe_filter('', $fieldSnipped), $options['cc_value'][$elId], $record->ID);
401
+ }
402
+
403
+ break;
404
+ }
405
+
406
+ }
407
+
408
+ return $data;
409
+ }
410
+
411
+ public function export_csv( & $article, & $titles, $record, $options, $elId )
412
+ {
413
+ if ( ! self::$is_active ) return;
414
+
415
+ $data_to_export = $this->prepare_export_data( $record, $options, $elId );
416
+
417
+ foreach ($data_to_export as $key => $data)
418
+ {
419
+ $article[$key] = $data;
420
+ if ( ! in_array($key, $titles) ) $titles[] = $key;
421
+ }
422
+
423
+ }
424
+
425
+ public function get_element_header( & $headers, $options, $element_key )
426
+ {
427
+ switch ($options['cc_value'][$element_key])
428
+ {
429
+ case 'attributes':
430
+
431
+ if ( ! empty(self::$_existing_attributes))
432
+ {
433
+ foreach (self::$_existing_attributes as $taxonomy_slug) {
434
+
435
+ $taxonomy = get_taxonomy($taxonomy_slug);
436
+
437
+ $headers[] = 'Attribute Name (' . $taxonomy_slug . ')';
438
+ $headers[] = 'Attribute Value (' . $taxonomy_slug . ')';
439
+ }
440
+ }
441
+
442
+ break;
443
+
444
+ default:
445
+
446
+ if ( ! in_array($options['cc_name'][$element_key], $headers)) $headers[] = $options['cc_name'][$element_key];
447
+
448
+ break;
449
+ }
450
+ }
451
+
452
+ public function export_xml( & $xmlWriter, $record, $options, $elId ){
453
+
454
+ if ( ! self::$is_active ) return;
455
+
456
+ $data_to_export = $this->prepare_export_data( $record, $options, $elId );
457
+
458
+ foreach ($data_to_export as $key => $data)
459
+ {
460
+ $xmlWriter->startElement(str_replace("-", "_", preg_replace('/[^a-z0-9_]/i', '', sanitize_title($key))));
461
+ $xmlWriter->writeCData($data);
462
+ $xmlWriter->endElement();
463
+ }
464
+
465
+ }
466
+
467
+ public function render( & $i ){
468
+
469
+ if ( self::$is_active and ! empty($this->_woo_data) ){
470
+ ?>
471
+ <p class="wpae-available-fields-group"><?php _e("WooCommerce", "wp_all_export_plugin"); ?><span class="wpae-expander">+</span></p>
472
+ <div class="wpae-custom-field">
473
+ <ul>
474
+ <li>
475
+ <div class="default_column" rel="">
476
+ <label class="wpallexport-element-label"><?php _e("All WooCommerce Data", "wp_all_export_plugin"); ?></label>
477
+ <input type="hidden" name="rules[]" value="pmxe_woo"/>
478
+ </div>
479
+ </li>
480
+ <?php
481
+ foreach ($this->_woo_data as $cur_meta_key) {
482
+ if ( strpos($cur_meta_key, 'attribute_pa_') === 0 ) continue;
483
+ ?>
484
+ <li class="pmxe_woo">
485
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
486
+ <label class="wpallexport-xml-element">&lt;<?php echo $cur_meta_key; ?>&gt;</label>
487
+ <input type="hidden" name="ids[]" value="1"/>
488
+ <input type="hidden" name="cc_label[]" value="<?php echo $cur_meta_key; ?>"/>
489
+ <input type="hidden" name="cc_php[]" value=""/>
490
+ <input type="hidden" name="cc_code[]" value=""/>
491
+ <input type="hidden" name="cc_sql[]" value=""/>
492
+ <input type="hidden" name="cc_options[]" value=""/>
493
+ <input type="hidden" name="cc_type[]" value="woo"/>
494
+ <input type="hidden" name="cc_value[]" value="<?php echo $cur_meta_key; ?>"/>
495
+ <input type="hidden" name="cc_name[]" value="<?php echo str_replace(" ", "_", $cur_meta_key);?>"/>
496
+ </div>
497
+ </li>
498
+ <?php
499
+ $i++;
500
+ }
501
+ if ( ! empty($this->_existing_attributes) ){
502
+ foreach ($this->_existing_attributes as $key => $tx_name) {
503
+ ?>
504
+ <li class="pmxe_woo">
505
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
506
+ <label class="wpallexport-xml-element">&lt;<?php echo $tx_name; ?>&gt;</label>
507
+ <input type="hidden" name="ids[]" value="1"/>
508
+ <input type="hidden" name="cc_label[]" value="<?php echo $tx_name; ?>"/>
509
+ <input type="hidden" name="cc_php[]" value=""/>
510
+ <input type="hidden" name="cc_code[]" value=""/>
511
+ <input type="hidden" name="cc_sql[]" value=""/>
512
+ <input type="hidden" name="cc_options[]" value=""/>
513
+ <input type="hidden" name="cc_type[]" value="attr"/>
514
+ <input type="hidden" name="cc_value[]" value="<?php echo $tx_name; ?>"/>
515
+ <input type="hidden" name="cc_name[]" value="<?php echo str_replace(" ", "_", $tx_name);?>"/>
516
+ </div>
517
+ </li>
518
+ <?php
519
+ $i++;
520
+ }
521
+ }
522
+ ?>
523
+ </ul>
524
+ </div>
525
+ <?php
526
+ }
527
+ }
528
+
529
+ /**
530
+ * __get function.
531
+ *
532
+ * @access public
533
+ * @param mixed $key
534
+ * @return mixed
535
+ */
536
+ public function __get( $key ) {
537
+ return $this->get( $key );
538
+ }
539
+
540
+ /**
541
+ * Get a session variable
542
+ *
543
+ * @param string $key
544
+ * @param mixed $default used if the session variable isn't set
545
+ * @return mixed value of session variable
546
+ */
547
+ public function get( $key, $default = null ) {
548
+ return isset( $this->{$key} ) ? $this->{$key} : $default;
549
+ }
550
+ }
551
+ }
libraries/XmlExportWooCommerceOrder.php ADDED
@@ -0,0 +1,550 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists('XmlExportWooCommerceOrder') ){
4
+
5
+ final class XmlExportWooCommerceOrder
6
+ {
7
+ /**
8
+ * Singletone instance
9
+ * @var XmlExportWooCommerceOrder
10
+ */
11
+ protected static $instance;
12
+
13
+ /**
14
+ * Return singletone instance
15
+ * @return XmlExportWooCommerceOrder
16
+ */
17
+ static public function getInstance() {
18
+ if (self::$instance == NULL) {
19
+ self::$instance = new self();
20
+ }
21
+ return self::$instance;
22
+ }
23
+
24
+ public static $is_active = true;
25
+
26
+ public static $order_sections = array();
27
+ public static $order_items_per_line = false;
28
+ public static $orders_data = null;
29
+ public static $exportQuery = null;
30
+
31
+ private $init_fields = array(
32
+ array(
33
+ 'name' => 'Order ID',
34
+ 'type' => 'woo_order',
35
+ 'options' => 'order',
36
+ 'label' => 'ID'
37
+ ),
38
+ array(
39
+ 'name' => 'Order Key',
40
+ 'type' => 'woo_order',
41
+ 'options' => 'order',
42
+ 'label' => '_order_key'
43
+ ),
44
+ array(
45
+ 'name' => 'Title',
46
+ 'type' => 'woo_order',
47
+ 'options' => 'order',
48
+ 'label' => 'post_title'
49
+ )
50
+ );
51
+
52
+ private $filter_sections = array();
53
+
54
+ public function __construct()
55
+ {
56
+
57
+ if ( ! class_exists('WooCommerce')
58
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'specific' and ! in_array('shop_order', XmlExportEngine::$post_types) )
59
+ or ( XmlExportEngine::$exportOptions['export_type'] == 'advanced' and strpos(XmlExportEngine::$exportOptions['wp_query'], 'shop_order') === false ) ) {
60
+ self::$is_active = false;
61
+ return;
62
+ }
63
+ $this->filter_sections = array(
64
+ 'general' => array(
65
+ 'title' => __("Order", "wp_all_export_plugin"),
66
+ 'fields' => array(
67
+ 'ID' => __('Order ID', 'wp_all_export_plugin'),
68
+ 'cf__order_key' => __('Order Key', 'wp_all_export_plugin'),
69
+ 'post_date' => __('Order Date', 'wp_all_export_plugin'),
70
+ 'cf__completed_date' => __('Completed Date', 'wp_all_export_plugin'),
71
+ 'post_title' => __('Title', 'wp_all_export_plugin'),
72
+ 'post_status' => __('Order Status', 'wp_all_export_plugin'),
73
+ 'cf__order_currency' => __('Order Currency', 'wp_all_export_plugin'),
74
+ 'cf__payment_method_title' => __('Payment Method', 'wp_all_export_plugin'),
75
+ 'cf__order_total' => __('Order Total', 'wp_all_export_plugin')
76
+ )
77
+ ),
78
+ 'customer' => array(
79
+ 'title' => __("Customer", "wp_all_export_plugin"),
80
+ 'fields' => array()
81
+ )
82
+ );
83
+
84
+ foreach ($this->available_customer_data() as $key => $value) {
85
+ $this->filter_sections['customer']['fields'][($key == 'post_excerpt') ? $key : 'cf_' . $key] = $value;
86
+ }
87
+
88
+ if ( empty(PMXE_Plugin::$session) ) // if cron execution
89
+ {
90
+ $id = $_GET['export_id'];
91
+ $export = new PMXE_Export_Record();
92
+ $export->getById($id);
93
+ if ( ! $export->isEmpty() and $export->options['export_to'] == 'csv'){
94
+ $this->init_additional_data();
95
+ }
96
+ }
97
+ else
98
+ {
99
+ self::$orders_data = PMXE_Plugin::$session->get('orders_data');
100
+ }
101
+
102
+ add_filter("wp_all_export_available_sections", array( &$this, "filter_available_sections" ), 10, 1);
103
+ add_filter("wp_all_export_available_filter_sections", array( &$this, "filter_available_filter_sections" ), 10, 1);
104
+ add_filter("wp_all_export_init_fields", array( &$this, "filter_init_fields"), 10, 1);
105
+ add_filter("wp_all_export_filters", array( &$this, "filter_export_filters"), 10, 1);
106
+
107
+ self::$order_sections = $this->available_sections();
108
+
109
+ }
110
+
111
+ // [FILTERS]
112
+
113
+ /**
114
+ *
115
+ * Filter data for advanced filtering
116
+ *
117
+ */
118
+ public function filter_export_filters($filters){
119
+ return $this->filter_sections;
120
+ }
121
+
122
+ /**
123
+ *
124
+ * Filter sections for advanced filtering
125
+ *
126
+ */
127
+ public function filter_available_filter_sections($sections){
128
+ unset($sections['cats']);
129
+ $sections['cf']['title'] = __('Advanced', 'wp_all_export_plugin');
130
+ return $sections;
131
+ }
132
+
133
+ /**
134
+ *
135
+ * Filter Init Fields
136
+ *
137
+ */
138
+ public function filter_init_fields($init_fields){
139
+ return $this->init_fields;
140
+ }
141
+
142
+ /**
143
+ *
144
+ * Filter Sections in Available Data
145
+ *
146
+ */
147
+ public function filter_available_sections($sections){
148
+ return array();
149
+ }
150
+
151
+ // [\FILTERS]
152
+
153
+ public function init( & $existing_meta_keys = array() ){
154
+
155
+ if ( ! self::$is_active ) return;
156
+
157
+ if ( ! empty($existing_meta_keys) )
158
+ {
159
+ foreach (self::$order_sections as $slug => $section) :
160
+
161
+ foreach ($section['meta'] as $cur_meta_key => $cur_meta_label)
162
+ {
163
+ foreach ($existing_meta_keys as $key => $record_meta_key)
164
+ {
165
+ if ( $record_meta_key == $cur_meta_key )
166
+ {
167
+ unset($existing_meta_keys[$key]);
168
+ break;
169
+ }
170
+ }
171
+ }
172
+
173
+ endforeach;
174
+
175
+ foreach ($existing_meta_keys as $key => $record_meta_key)
176
+ {
177
+ self::$order_sections['cf']['meta'][$record_meta_key] = array(
178
+ 'name' => $record_meta_key,
179
+ 'label' => $record_meta_key,
180
+ 'options' => '',
181
+ 'type' => 'cf'
182
+ );
183
+ }
184
+ }
185
+
186
+ global $wpdb;
187
+ $table_prefix = $wpdb->prefix;
188
+
189
+ $product_data = $this->available_order_default_product_data();
190
+
191
+ $meta_keys = $wpdb->get_results("SELECT DISTINCT {$table_prefix}woocommerce_order_itemmeta.meta_key FROM {$table_prefix}woocommerce_order_itemmeta");
192
+ if ( ! empty($meta_keys)){
193
+ foreach ($meta_keys as $meta_key) {
194
+ if (strpos($meta_key->meta_key, "pa_") !== 0 and empty(self::$order_sections['cf']['meta'][$meta_key->meta_key]) and empty($product_data[$meta_key->meta_key]))
195
+ self::$order_sections['cf']['meta'][$meta_key->meta_key] = array(
196
+ 'name' => $meta_key->meta_key,
197
+ 'label' => $meta_key->meta_key,
198
+ 'options' => 'items',
199
+ 'type' => 'woo_order'
200
+ );
201
+ }
202
+ }
203
+
204
+ }
205
+
206
+ public function init_additional_data(){
207
+
208
+ if ( ! self::$is_active ) return;
209
+
210
+ }
211
+
212
+ private $order_items = null;
213
+ private $order_taxes = null;
214
+ private $order_shipping = null;
215
+ private $order_coupons = null;
216
+ private $order_surcharge = null;
217
+ private $__total_fee_amount = null;
218
+ private $__coupons_used = null;
219
+ private $order_id = null;
220
+
221
+ protected function prepare_export_data( $record, $options, $elId ){
222
+
223
+ // an array with data to export
224
+ $data = array();
225
+
226
+ global $wpdb;
227
+ $table_prefix = $wpdb->prefix;
228
+
229
+ if ( ! empty($options['cc_value'][$elId]) ){
230
+
231
+ $fieldSnipped = ( ! empty($options['cc_php'][$elId]) and ! empty($options['cc_code'][$elId]) ) ? $options['cc_code'][$elId] : false;
232
+
233
+ switch ($options['cc_options'][$elId]) {
234
+
235
+ case 'order':
236
+ case 'customer':
237
+
238
+ $data[$options['cc_name'][$elId]] = ( strpos($options['cc_value'][$elId], "_") === 0 ) ? get_post_meta($record->ID, $options['cc_value'][$elId], true) : $record->$options['cc_value'][$elId];
239
+
240
+ if ($options['cc_value'][$elId] == "post_title")
241
+ {
242
+ $data[$options['cc_name'][$elId]] = str_replace("&ndash;", '-', $data[$options['cc_name'][$elId]]);
243
+ }
244
+
245
+ $data[$options['cc_name'][$elId]] = pmxe_filter( $data[$options['cc_name'][$elId]], $fieldSnipped);
246
+
247
+ break;
248
+ }
249
+
250
+ }
251
+
252
+ return $data;
253
+ }
254
+
255
+ private $additional_articles = array();
256
+
257
+ public function export_csv( & $article, & $titles, $record, $options, $elId ){
258
+
259
+ if ( ! self::$is_active ) return;
260
+
261
+ $data_to_export = $this->prepare_export_data( $record, $options, $elId );
262
+
263
+ foreach ($data_to_export as $key => $data) {
264
+
265
+ if ( ! in_array($key, array('items', 'taxes', 'shipping', 'coupons', 'surcharge')) )
266
+ {
267
+ $article[$key] = $data;
268
+ if ( ! in_array($key, $titles) ) $titles[] = $key;
269
+ }
270
+ }
271
+ }
272
+
273
+ public function get_element_header( & $headers, $options, $element_key ){
274
+
275
+ if ( ! in_array($options['cc_name'][$element_key], $headers)) $headers[] = $options['cc_name'][$element_key];
276
+
277
+ }
278
+
279
+ public function get_rate_friendly_name( $order_item_id ){
280
+
281
+ global $wpdb;
282
+ $table_prefix = $wpdb->prefix;
283
+
284
+ $rate_details = null;
285
+ $meta_data = $wpdb->get_results("SELECT * FROM {$table_prefix}woocommerce_order_itemmeta WHERE order_item_id = {$order_item_id}", ARRAY_A);
286
+ foreach ($meta_data as $meta) {
287
+ if ($meta['meta_key'] == 'rate_id'){
288
+ $rate_id = $meta['meta_value'];
289
+ $rate_details = $wpdb->get_row("SELECT * FROM {$table_prefix}woocommerce_tax_rates WHERE tax_rate_id = {$rate_id}");
290
+ break;
291
+ }
292
+ }
293
+
294
+ return $rate_details ? $rate_details->tax_rate_name : '';
295
+
296
+ }
297
+
298
+ public function export_xml( & $xmlWriter, $record, $options, $elId ){
299
+
300
+ if ( ! self::$is_active ) return;
301
+
302
+ $data_to_export = $this->prepare_export_data( $record, $options, $elId );
303
+
304
+ foreach ($data_to_export as $key => $data) {
305
+
306
+ if ( ! in_array($key, array('items', 'taxes', 'shipping', 'coupons', 'surcharge')) )
307
+ {
308
+ $xmlWriter->writeElement(str_replace("-", "_", sanitize_title($key)), $data);
309
+ }
310
+ }
311
+ }
312
+
313
+ public function render( & $i ){
314
+
315
+ if ( ! self::$is_active ) return;
316
+
317
+ foreach (self::$order_sections as $slug => $section) :
318
+ ?>
319
+ <p class="wpae-available-fields-group"><?php echo $section['title']; ?><span class="wpae-expander">+</span></p>
320
+ <div class="wpae-custom-field">
321
+ <?php if ( ! in_array($slug, array('order', 'customer', 'cf'))) : ?>
322
+ <div class="wpallexport-free-edition-notice">
323
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=wooco+orders&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export custom order data.','wp_all_export_plugin');?></a>
324
+ </div>
325
+ <?php endif; ?>
326
+ <ul>
327
+ <li <?php if ( ! in_array($slug, array('order', 'customer', 'cf'))) : ?>class="wpallexport_disabled"<?php endif; ?>>
328
+ <div class="default_column" rel="">
329
+ <label class="wpallexport-element-label"><?php echo __("All", "wp_all_export_plugin") . ' ' . $section['title'] . ' ' . __("Data", "wp_all_export_plugin"); ?></label>
330
+ <input type="hidden" name="rules[]" value="pmxe_<?php echo $slug;?>"/>
331
+ </div>
332
+ </li>
333
+ <?php
334
+ foreach ($section['meta'] as $cur_meta_key => $field) {
335
+ ?>
336
+ <li class="pmxe_<?php echo $slug; ?> <?php if ( ! in_array($slug, array('order', 'customer', 'cf'))) : ?>wpallexport_disabled<?php endif;?>">
337
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
338
+ <label class="wpallexport-xml-element">&lt;<?php echo (is_array($field)) ? $field['name'] : $field; ?>&gt;</label>
339
+ <input type="hidden" name="ids[]" value="1"/>
340
+ <input type="hidden" name="cc_label[]" value="<?php echo (is_array($field)) ? $field['label'] : $cur_meta_key; ?>"/>
341
+ <input type="hidden" name="cc_php[]" value=""/>
342
+ <input type="hidden" name="cc_code[]" value=""/>
343
+ <input type="hidden" name="cc_sql[]" value=""/>
344
+ <input type="hidden" name="cc_options[]" value="<?php echo (is_array($field)) ? $field['options'] : $slug;?>"/>
345
+ <input type="hidden" name="cc_type[]" value="<?php echo (is_array($field)) ? $field['type'] : 'woo_order'; ?>"/>
346
+ <input type="hidden" name="cc_value[]" value="<?php echo (is_array($field)) ? $field['label'] : $cur_meta_key; ?>"/>
347
+ <input type="hidden" name="cc_name[]" value="<?php echo (is_array($field)) ? $field['name'] : $field;?>"/>
348
+ </div>
349
+ </li>
350
+ <?php
351
+ $i++;
352
+ }
353
+ ?>
354
+ </ul>
355
+ </div>
356
+ <?php
357
+ endforeach;
358
+ }
359
+
360
+ public function render_filters(){
361
+
362
+ }
363
+
364
+ public function available_sections(){
365
+
366
+ $sections = array(
367
+ 'order' => array(
368
+ 'title' => __('Order', 'wp_all_export_plugin'),
369
+ 'meta' => $this->available_order_data()
370
+ ),
371
+ 'customer' => array(
372
+ 'title' => __('Customer', 'wp_all_export_plugin'),
373
+ 'meta' => $this->available_customer_data()
374
+ ),
375
+ 'items' => array(
376
+ 'title' => __('Items', 'wp_all_export_plugin'),
377
+ 'meta' => $this->available_order_default_product_data()
378
+ ),
379
+ 'taxes' => array(
380
+ 'title' => __('Taxes & Shipping', 'wp_all_export_plugin'),
381
+ 'meta' => $this->available_order_taxes_data()
382
+ ),
383
+ 'fees' => array(
384
+ 'title' => __('Fees & Discounts', 'wp_all_export_plugin'),
385
+ 'meta' => $this->available_order_fees_data()
386
+ ),
387
+ 'cf' => array(
388
+ 'title' => __('Advanced', 'wp_all_export_plugin'),
389
+ 'meta' => array()
390
+ ),
391
+ );
392
+
393
+ return apply_filters('wp_all_export_available_order_sections_filter', $sections);
394
+
395
+ }
396
+
397
+ /*
398
+ * Define the keys for orders informations to export
399
+ */
400
+ public function available_order_data()
401
+ {
402
+ $data = array(
403
+ 'ID' => __('Order ID', 'wp_all_export_plugin'),
404
+ '_order_key' => __('Order Key', 'wp_all_export_plugin'),
405
+ 'post_date' => __('Order Date', 'wp_all_export_plugin'),
406
+ '_completed_date' => __('Completed Date', 'wp_all_export_plugin'),
407
+ 'post_title' => __('Title', 'wp_all_export_plugin'),
408
+ 'post_status' => __('Order Status', 'wp_all_export_plugin'),
409
+ '_order_currency' => __('Order Currency', 'wp_all_export_plugin'),
410
+ '_payment_method_title' => __('Payment Method', 'wp_all_export_plugin'),
411
+ '_order_total' => __('Order Total', 'wp_all_export_plugin')
412
+ );
413
+
414
+ return apply_filters('wp_all_export_available_order_data_filter', $data);
415
+ }
416
+
417
+ /*
418
+ * Define the keys for general product informations to export
419
+ */
420
+ public function available_order_default_product_data()
421
+ {
422
+
423
+ $data = array(
424
+ '_product_id' => __('Product ID', 'wp_all_export_plugin'),
425
+ '__product_sku' => __('SKU', 'wp_all_export_plugin'),
426
+ '__product_title' => __('Product Name', 'wp_all_export_plugin'),
427
+ '__product_variation' => __('Product Variation Details', 'wp_all_export_plugin'),
428
+ '_qty' => __('Quantity', 'wp_all_export_plugin'),
429
+ '_line_subtotal' => __('Item Cost', 'wp_all_export_plugin'),
430
+ '_line_total' => __('Item Total', 'wp_all_export_plugin')
431
+ );
432
+
433
+ return apply_filters('wp_all_export_available_order_default_product_data_filter', $data);
434
+ }
435
+
436
+ public function available_order_taxes_data(){
437
+
438
+ $data = array(
439
+ 'tax_order_item_name' => __('Rate Code (per tax)', 'wp_all_export_plugin'),
440
+ 'tax_rate' => __('Rate Percentage (per tax)', 'wp_all_export_plugin'),
441
+ 'tax_amount' => __('Amount (per tax)', 'wp_all_export_plugin'),
442
+ '_order_tax' => __('Total Tax Amount', 'wp_all_export_plugin'),
443
+ 'shipping_order_item_name' => __('Shipping Method', 'wp_all_export_plugin'),
444
+ '_order_shipping' => __('Shipping Cost', 'wp_all_export_plugin')
445
+ );
446
+
447
+ return apply_filters('wp_all_export_available_order_default_taxes_data_filter', $data);
448
+ }
449
+
450
+ public function available_order_fees_data(){
451
+
452
+ $data = array(
453
+ 'discount_amount' => __('Discount Amount (per coupon)', 'wp_all_export_plugin'),
454
+ '__coupons_used' => __('Coupons Used', 'wp_all_export_plugin'),
455
+ '_cart_discount' => __('Total Discount Amount', 'wp_all_export_plugin'),
456
+ 'fee_line_total' => __('Fee Amount (per surcharge)', 'wp_all_export_plugin'),
457
+ '__total_fee_amount' => __('Total Fee Amount', 'wp_all_export_plugin')
458
+ );
459
+
460
+ return apply_filters('wp_all_export_available_order_fees_data_filter', $data);
461
+ }
462
+
463
+ public function available_customer_data()
464
+ {
465
+
466
+ $main_fields = array(
467
+ '_customer_user' => __('Customer User ID', 'wp_all_export_plugin'),
468
+ 'post_excerpt' => __('Customer Note', 'wp_all_export_plugin')
469
+ );
470
+
471
+ $data = array_merge($main_fields, $this->available_billing_information_data(), $this->available_shipping_information_data());
472
+
473
+ return apply_filters('wp_all_export_available_user_data_filter', $data);
474
+
475
+ }
476
+
477
+ public function available_billing_information_data()
478
+ {
479
+
480
+ $keys = array(
481
+ '_billing_first_name', '_billing_last_name', '_billing_company',
482
+ '_billing_address_1', '_billing_address_2', '_billing_city',
483
+ '_billing_postcode', '_billing_country', '_billing_state',
484
+ '_billing_email', '_billing_phone'
485
+ );
486
+
487
+ $data = $this->generate_friendly_titles($keys, 'billing');
488
+
489
+ return apply_filters('wp_all_export_available_billing_information_data_filter', $data);
490
+
491
+ }
492
+
493
+ public function available_shipping_information_data()
494
+ {
495
+
496
+ $keys = array(
497
+ '_shipping_first_name', '_shipping_last_name', '_shipping_company',
498
+ '_shipping_address_1', '_shipping_address_2', '_shipping_city',
499
+ '_shipping_postcode', '_shipping_country', '_shipping_state'
500
+ );
501
+
502
+ $data = $this->generate_friendly_titles($keys, 'shipping');
503
+
504
+ return apply_filters('wp_all_export_available_shipping_information_data_filter', $data);
505
+
506
+ }
507
+
508
+ public function generate_friendly_titles($keys, $keyword = ''){
509
+ $data = array();
510
+ foreach ($keys as $key) {
511
+
512
+ $key1 = ucwords(str_replace('_', ' ', $key));
513
+ $key2 = '';
514
+
515
+ if(strpos($key1, $keyword)!== false)
516
+ {
517
+ $key1 = str_replace($keyword, '', $key1);
518
+ $key2 = ' ('.__($keyword, 'wp_all_export_plugin').')';
519
+ }
520
+
521
+ $data[$key] = __(trim($key1), 'woocommerce').$key2;
522
+
523
+ }
524
+ return $data;
525
+ }
526
+
527
+ /**
528
+ * __get function.
529
+ *
530
+ * @access public
531
+ * @param mixed $key
532
+ * @return mixed
533
+ */
534
+ public function __get( $key ) {
535
+ return $this->get( $key );
536
+ }
537
+
538
+ /**
539
+ * Get a session variable
540
+ *
541
+ * @param string $key
542
+ * @param mixed $default used if the session variable isn't set
543
+ * @return mixed value of session variable
544
+ */
545
+ public function get( $key, $default = null ) {
546
+ return isset( $this->{$key} ) ? $this->{$key} : $default;
547
+ }
548
+
549
+ }
550
+ }
models/export/list.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
 
3
- class PMXE_Import_List extends PMXE_Model_List {
4
  public function __construct() {
5
  parent::__construct();
6
- //$this->setTable(PMXE_Plugin::getInstance()->getTablePrefix() . 'imports');
7
  }
8
  }
1
  <?php
2
 
3
+ class PMXE_Export_List extends PMXE_Model_List {
4
  public function __construct() {
5
  parent::__construct();
6
+ $this->setTable(PMXE_Plugin::getInstance()->getTablePrefix() . 'exports');
7
  }
8
  }
models/export/record.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class PMXE_Import_Record extends PMXE_Model_Record {
4
 
5
  /**
6
  * Initialize model instance
@@ -8,29 +8,39 @@ class PMXE_Import_Record extends PMXE_Model_Record {
8
  */
9
  public function __construct($data = array()) {
10
  parent::__construct($data);
11
- }
12
-
 
 
 
 
 
13
  /**
14
- * Perform import operation
15
- * @param string $xml XML string to import
16
- * @param callback[optional] $logger Method where progress messages are submmitted
17
- * @return PMXE_Import_Record
18
- * @chainable
19
  */
20
- public function process($xml, $logger = NULL, $chunk = false, $is_cron = false, $xpath_prefix = '') {
21
- add_filter('user_has_cap', array($this, '_filter_has_cap_unfiltered_html')); kses_init(); // do not perform special filtering for imported content
22
-
 
 
 
 
 
 
 
 
 
 
 
 
23
 
 
 
 
24
 
25
- remove_filter('user_has_cap', array($this, '_filter_has_cap_unfiltered_html')); kses_init(); // return any filtering rules back if they has been disabled for import procedure
26
-
27
- return $this;
28
  }
29
 
30
- public function _filter_has_cap_unfiltered_html($caps)
31
- {
32
- $caps['unfiltered_html'] = true;
33
- return $caps;
34
- }
35
-
36
  }
1
  <?php
2
 
3
+ class PMXE_Export_Record extends PMXE_Model_Record {
4
 
5
  /**
6
  * Initialize model instance
8
  */
9
  public function __construct($data = array()) {
10
  parent::__construct($data);
11
+ $this->setTable(PMXE_Plugin::getInstance()->getTablePrefix() . 'exports');
12
+ }
13
+
14
+ public function set_html_content_type(){
15
+ return 'text/html';
16
+ }
17
+
18
  /**
19
+ * @see parent::delete()
 
 
 
 
20
  */
21
+ public function delete() {
22
+ if ( ! empty($this->options['import_id']) and wp_all_export_is_compatible()){
23
+ $import = new PMXI_Import_Record();
24
+ $import->getById($this->options['import_id']);
25
+ if ( ! $import->isEmpty() and $import->parent_import_id == 99999 ){
26
+ $import->delete();
27
+ }
28
+ }
29
+ $export_file_path = wp_all_export_get_absolute_path($this->options['filepath']);
30
+ if ( @file_exists($export_file_path) ){
31
+ wp_all_export_remove_source($export_file_path);
32
+ }
33
+ if ( ! empty($this->attch_id) ){
34
+ wp_delete_attachment($this->attch_id, true);
35
+ }
36
 
37
+ $wp_uploads = wp_upload_dir();
38
+
39
+ $file_for_remote_access = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY . DIRECTORY_SEPARATOR . md5(PMXE_Plugin::getInstance()->getOption('cron_job_key') . $this->id) . '.' . $this->options['export_to'];
40
 
41
+ if ( @file_exists($file_for_remote_access)) @unlink($file_for_remote_access);
42
+
43
+ return parent::delete();
44
  }
45
 
 
 
 
 
 
 
46
  }
models/model.php CHANGED
File without changes
models/model/list.php CHANGED
File without changes
models/model/record.php CHANGED
File without changes
plugin.php DELETED
@@ -1,520 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: WP All Export
4
- Plugin URI: http://wordpress.org/plugins/wp-all-export/
5
- Description: The most powerful solution for exporting WordPress data to an XML file.
6
- Version: 0.9.1
7
- Author: Soflyy
8
- */
9
-
10
- if( ! defined( 'PMXE_SESSION_COOKIE' ) )
11
- define( 'PMXE_SESSION_COOKIE', '_PMXE_session' );
12
-
13
- /**
14
- * Plugin root dir with forward slashes as directory separator regardless of actuall DIRECTORY_SEPARATOR value
15
- * @var string
16
- */
17
- define('PMXE_ROOT_DIR', str_replace('\\', '/', dirname(__FILE__)));
18
- /**
19
- * Plugin root url for referencing static content
20
- * @var string
21
- */
22
- define('PMXE_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
23
- /**
24
- * Plugin prefix for making names unique (be aware that this variable is used in conjuction with naming convention,
25
- * i.e. in order to change it one must not only modify this constant but also rename all constants, classes and functions which
26
- * names composed using this prefix)
27
- * @var string
28
- */
29
- define('PMXE_PREFIX', 'pmxe_');
30
-
31
- define('PMXE_VERSION', '0.9.1');
32
-
33
- define('PMXE_EDITION', 'free');
34
-
35
- /**
36
- * Main plugin file, Introduces MVC pattern
37
- *
38
- * @singletone
39
- * @author Pavel Kulbakin <p.kulbakin@gmail.com>
40
- */
41
- final class PMXE_Plugin {
42
- /**
43
- * Singletone instance
44
- * @var PMXE_Plugin
45
- */
46
- protected static $instance;
47
-
48
- /**
49
- * Plugin options
50
- * @var array
51
- */
52
- protected $options = array();
53
-
54
- /**
55
- * Plugin root dir
56
- * @var string
57
- */
58
- const ROOT_DIR = PMXE_ROOT_DIR;
59
- /**
60
- * Plugin root URL
61
- * @var string
62
- */
63
- const ROOT_URL = PMXE_ROOT_URL;
64
- /**
65
- * Prefix used for names of shortcodes, action handlers, filter functions etc.
66
- * @var string
67
- */
68
- const PREFIX = PMXE_PREFIX;
69
- /**
70
- * Plugin file path
71
- * @var string
72
- */
73
- const FILE = __FILE__;
74
- /**
75
- * Max allowed file size (bytes) to import in default mode
76
- * @var int
77
- */
78
- const LARGE_SIZE = 0; // all files will importing in large import mode
79
-
80
- public static $session;
81
-
82
- /**
83
- * Return singletone instance
84
- * @return PMXE_Plugin
85
- */
86
- static public function getInstance() {
87
- if (self::$instance == NULL) {
88
- self::$instance = new self();
89
- }
90
- return self::$instance;
91
- }
92
-
93
- /**
94
- * Common logic for requestin plugin info fields
95
- */
96
- public function __call($method, $args) {
97
- if (preg_match('%^get(.+)%i', $method, $mtch)) {
98
- $info = get_plugin_data(self::FILE);
99
- if (isset($info[$mtch[1]])) {
100
- return $info[$mtch[1]];
101
- }
102
- }
103
- throw new Exception("Requested method " . get_class($this) . "::$method doesn't exist.");
104
- }
105
-
106
- /**
107
- * Get path to plagin dir relative to wordpress root
108
- * @param bool[optional] $noForwardSlash Whether path should be returned withot forwarding slash
109
- * @return string
110
- */
111
- public function getRelativePath($noForwardSlash = false) {
112
- $wp_root = str_replace('\\', '/', ABSPATH);
113
- return ($noForwardSlash ? '' : '/') . str_replace($wp_root, '', self::ROOT_DIR);
114
- }
115
-
116
- /**
117
- * Check whether plugin is activated as network one
118
- * @return bool
119
- */
120
- public function isNetwork() {
121
- if ( !is_multisite() )
122
- return false;
123
-
124
- $plugins = get_site_option('active_sitewide_plugins');
125
- if (isset($plugins[plugin_basename(self::FILE)]))
126
- return true;
127
-
128
- return false;
129
- }
130
-
131
- /**
132
- * Check whether permalinks is enabled
133
- * @return bool
134
- */
135
- public function isPermalinks() {
136
- global $wp_rewrite;
137
-
138
- return $wp_rewrite->using_permalinks();
139
- }
140
-
141
- /**
142
- * Return prefix for plugin database tables
143
- * @return string
144
- */
145
- public function getTablePrefix() {
146
- global $wpdb;
147
-
148
- //return ($this->isNetwork() ? $wpdb->base_prefix : $wpdb->prefix) . self::PREFIX;
149
- return $wpdb->prefix . self::PREFIX;
150
- }
151
-
152
- /**
153
- * Return prefix for wordpress database tables
154
- * @return string
155
- */
156
- public function getWPPrefix() {
157
- global $wpdb;
158
- return ($this->isNetwork()) ? $wpdb->base_prefix : $wpdb->prefix;
159
- }
160
-
161
- /**
162
- * Class constructor containing dispatching logic
163
- * @param string $rootDir Plugin root dir
164
- * @param string $pluginFilePath Plugin main file
165
- */
166
- protected function __construct() {
167
-
168
- $this->load_plugin_textdomain();
169
-
170
- // regirster autoloading method
171
- if (function_exists('__autoload') and ! in_array('__autoload', spl_autoload_functions())) { // make sure old way of autoloading classes is not broken
172
- spl_autoload_register('__autoload');
173
- }
174
- spl_autoload_register(array($this, '__autoload'));
175
-
176
- // register helpers
177
- if (is_dir(self::ROOT_DIR . '/helpers')) foreach (PMXE_Helper::safe_glob(self::ROOT_DIR . '/helpers/*.php', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH) as $filePath) {
178
- require_once $filePath;
179
- }
180
-
181
- // create history folder
182
- $uploads = wp_upload_dir();
183
-
184
- // init plugin options
185
- $option_name = get_class($this) . '_Options';
186
- $options_default = PMXE_Config::createFromFile(self::ROOT_DIR . '/config/options.php')->toArray();
187
- $this->options = array_intersect_key(get_option($option_name, array()), $options_default) + $options_default;
188
- $this->options = array_intersect_key($options_default, array_flip(array('info_api_url'))) + $this->options; // make sure hidden options apply upon plugin reactivation
189
-
190
- update_option($option_name, $this->options);
191
- $this->options = get_option(get_class($this) . '_Options');
192
-
193
- register_activation_hook(self::FILE, array($this, '__activation'));
194
-
195
- // register action handlers
196
- if (is_dir(self::ROOT_DIR . '/actions')) if (is_dir(self::ROOT_DIR . '/actions')) foreach (PMXE_Helper::safe_glob(self::ROOT_DIR . '/actions/*.php', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH) as $filePath) {
197
- require_once $filePath;
198
- $function = $actionName = basename($filePath, '.php');
199
- if (preg_match('%^(.+?)[_-](\d+)$%', $actionName, $m)) {
200
- $actionName = $m[1];
201
- $priority = intval($m[2]);
202
- } else {
203
- $priority = 10;
204
- }
205
- add_action($actionName, self::PREFIX . str_replace('-', '_', $function), $priority, 99); // since we don't know at this point how many parameters each plugin expects, we make sure they will be provided with all of them (it's unlikely any developer will specify more than 99 parameters in a function)
206
- }
207
-
208
- // register filter handlers
209
- if (is_dir(self::ROOT_DIR . '/filters')) foreach (PMXE_Helper::safe_glob(self::ROOT_DIR . '/filters/*.php', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH) as $filePath) {
210
- require_once $filePath;
211
- $function = $actionName = basename($filePath, '.php');
212
- if (preg_match('%^(.+?)[_-](\d+)$%', $actionName, $m)) {
213
- $actionName = $m[1];
214
- $priority = intval($m[2]);
215
- } else {
216
- $priority = 10;
217
- }
218
- add_filter($actionName, self::PREFIX . str_replace('-', '_', $function), $priority, 99); // since we don't know at this point how many parameters each plugin expects, we make sure they will be provided with all of them (it's unlikely any developer will specify more than 99 parameters in a function)
219
- }
220
-
221
- // register shortcodes handlers
222
- if (is_dir(self::ROOT_DIR . '/shortcodes')) foreach (PMXE_Helper::safe_glob(self::ROOT_DIR . '/shortcodes/*.php', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH) as $filePath) {
223
- $tag = strtolower(str_replace('/', '_', preg_replace('%^' . preg_quote(self::ROOT_DIR . '/shortcodes/', '%') . '|\.php$%', '', $filePath)));
224
- add_shortcode($tag, array($this, 'shortcodeDispatcher'));
225
- }
226
-
227
- // register admin page pre-dispatcher
228
- add_action('admin_init', array($this, '__adminInit'));
229
- }
230
-
231
- /**
232
- * pre-dispatching logic for admin page controllers
233
- */
234
- public function __adminInit() {
235
- $input = new PMXE_Input();
236
- $page = strtolower($input->getpost('page', ''));
237
- if (preg_match('%^' . preg_quote(str_replace('_', '-', self::PREFIX), '%') . '([\w-]+)$%', $page)) {
238
- $this->adminDispatcher($page, strtolower($input->getpost('action', 'index')));
239
- }
240
- }
241
-
242
- /**
243
- * Dispatch shorttag: create corresponding controller instance and call its index method
244
- * @param array $args Shortcode tag attributes
245
- * @param string $content Shortcode tag content
246
- * @param string $tag Shortcode tag name which is being dispatched
247
- * @return string
248
- */
249
- public function shortcodeDispatcher($args, $content, $tag) {
250
-
251
- $controllerName = self::PREFIX . preg_replace('%(^|_).%e', 'strtoupper("$0")', $tag); // capitalize first letters of class name parts and add prefix
252
- $controller = new $controllerName();
253
- if ( ! $controller instanceof PMXE_Controller) {
254
- throw new Exception("Shortcode `$tag` matches to a wrong controller type.");
255
- }
256
- ob_start();
257
- $controller->index($args, $content);
258
- return ob_get_clean();
259
- }
260
-
261
- /**
262
- * Dispatch admin page: call corresponding controller based on get parameter `page`
263
- * The method is called twice: 1st time as handler `parse_header` action and then as admin menu item handler
264
- * @param string[optional] $page When $page set to empty string ealier buffered content is outputted, otherwise controller is called based on $page value
265
- */
266
- public function adminDispatcher($page = '', $action = 'index') {
267
- static $buffer = NULL;
268
- static $buffer_callback = NULL;
269
- if ('' === $page) {
270
- if ( ! is_null($buffer)) {
271
- echo '<div class="wrap">';
272
- echo $buffer;
273
- do_action('pmxe_action_after');
274
- echo '</div>';
275
- } elseif ( ! is_null($buffer_callback)) {
276
- echo '<div class="wrap">';
277
- call_user_func($buffer_callback);
278
- do_action('pmxe_action_after');
279
- echo '</div>';
280
- } else {
281
- throw new Exception('There is no previousely buffered content to display.');
282
- }
283
- } else {
284
-
285
- // capitalize prefix and first letters of class name parts
286
- if (function_exists('preg_replace_callback')){
287
- $controllerName = preg_replace_callback('%(^' . preg_quote(self::PREFIX, '%') . '|_).%', array($this, "replace_callback"),str_replace('-', '_', $page));
288
- }
289
- else{
290
- $controllerName = preg_replace('%(^' . preg_quote(self::PREFIX, '%') . '|_).%e', 'strtoupper("$0")', str_replace('-', '_', $page));
291
- }
292
-
293
- $actionName = str_replace('-', '_', $action);
294
- if (method_exists($controllerName, $actionName)) {
295
-
296
- if ( ! get_current_user_id() or ! current_user_can('manage_options')) {
297
- // This nonce is not valid.
298
- die( 'Security check' );
299
-
300
- } else {
301
-
302
- $this->_admin_current_screen = (object)array(
303
- 'id' => $controllerName,
304
- 'base' => $controllerName,
305
- 'action' => $actionName,
306
- 'is_ajax' => isset($_SERVER['HTTP_X_REQUESTED_WITH']) and strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest',
307
- 'is_network' => is_network_admin(),
308
- 'is_user' => is_user_admin(),
309
- );
310
- add_filter('current_screen', array($this, 'getAdminCurrentScreen'));
311
- add_filter('admin_body_class', create_function('', 'return "' . PMXE_Plugin::PREFIX . 'plugin";'));
312
-
313
- $controller = new $controllerName();
314
- if ( ! $controller instanceof PMXE_Controller_Admin) {
315
- throw new Exception("Administration page `$page` matches to a wrong controller type.");
316
- }
317
-
318
- if ($this->_admin_current_screen->is_ajax) { // ajax request
319
- $controller->$action();
320
- do_action('pmxe_action_after');
321
- die(); // stop processing since we want to output only what controller is randered, nothing in addition
322
- } elseif ( ! $controller->isInline) {
323
- ob_start();
324
- $controller->$action();
325
- $buffer = ob_get_clean();
326
- } else {
327
- $buffer_callback = array($controller, $action);
328
- }
329
-
330
- }
331
-
332
- } else { // redirect to dashboard if requested page and/or action don't exist
333
- wp_redirect(admin_url()); die();
334
- }
335
- }
336
- }
337
-
338
- public function replace_callback($matches){
339
- return strtoupper($matches[0]);
340
- }
341
-
342
- protected $_admin_current_screen = NULL;
343
- public function getAdminCurrentScreen()
344
- {
345
- return $this->_admin_current_screen;
346
- }
347
-
348
- /**
349
- * Autoloader
350
- * It's assumed class name consists of prefix folloed by its name which in turn corresponds to location of source file
351
- * if `_` symbols replaced by directory path separator. File name consists of prefix folloed by last part in class name (i.e.
352
- * symbols after last `_` in class name)
353
- * When class has prefix it's source is looked in `models`, `controllers`, `shortcodes` folders, otherwise it looked in `core` or `library` folder
354
- *
355
- * @param string $className
356
- * @return bool
357
- */
358
- public function __autoload($className) {
359
- $is_prefix = false;
360
- $filePath = str_replace('_', '/', preg_replace('%^' . preg_quote(self::PREFIX, '%') . '%', '', strtolower($className), 1, $is_prefix)) . '.php';
361
- if ( ! $is_prefix) { // also check file with original letter case
362
- $filePathAlt = $className . '.php';
363
- }
364
- foreach ($is_prefix ? array('models', 'controllers', 'shortcodes', 'classes') : array('libraries') as $subdir) {
365
- $path = self::ROOT_DIR . '/' . $subdir . '/' . $filePath;
366
- if (is_file($path)) {
367
- require $path;
368
- return TRUE;
369
- }
370
- if ( ! $is_prefix) {
371
- $pathAlt = self::ROOT_DIR . '/' . $subdir . '/' . $filePathAlt;
372
- if (is_file($pathAlt)) {
373
- require $pathAlt;
374
- return TRUE;
375
- }
376
- }
377
- }
378
-
379
- return FALSE;
380
- }
381
-
382
- /**
383
- * Get plugin option
384
- * @param string[optional] $option Parameter to return, all array of options is returned if not set
385
- * @return mixed
386
- */
387
- public function getOption($option = NULL) {
388
- if (is_null($option)) {
389
- return $this->options;
390
- } else if (isset($this->options[$option])) {
391
- return $this->options[$option];
392
- } else {
393
- throw new Exception("Specified option is not defined for the plugin");
394
- }
395
- }
396
- /**
397
- * Update plugin option value
398
- * @param string $option Parameter name or array of name => value pairs
399
- * @param mixed[optional] $value New value for the option, if not set than 1st parameter is supposed to be array of name => value pairs
400
- * @return array
401
- */
402
- public function updateOption($option, $value = NULL) {
403
- is_null($value) or $option = array($option => $value);
404
- if (array_diff_key($option, $this->options)) {
405
- throw new Exception("Specified option is not defined for the plugin");
406
- }
407
- $this->options = $option + $this->options;
408
- update_option(get_class($this) . '_Options', $this->options);
409
-
410
- return $this->options;
411
- }
412
-
413
- /**
414
- * Plugin activation logic
415
- */
416
- public function __activation() {
417
- // uncaught exception doesn't prevent plugin from being activated, therefore replace it with fatal error so it does
418
- set_exception_handler(create_function('$e', 'trigger_error($e->getMessage(), E_USER_ERROR);'));
419
-
420
- // create plugin options
421
- $option_name = get_class($this) . '_Options';
422
- $options_default = PMXE_Config::createFromFile(self::ROOT_DIR . '/config/options.php')->toArray();
423
- $wpai_options = get_option($option_name, false);
424
- if ( ! $wpai_options ) update_option($option_name, $options_default);
425
-
426
- // create/update required database tables
427
- require_once ABSPATH . 'wp-admin/includes/upgrade.php';
428
- require self::ROOT_DIR . '/schema.php';
429
- global $wpdb;
430
-
431
- if (function_exists('is_multisite') && is_multisite()) {
432
- // check if it is a network activation - if so, run the activation function for each blog id
433
- if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) {
434
- $old_blog = $wpdb->blogid;
435
- // Get all blog ids
436
- $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
437
- foreach ($blogids as $blog_id) {
438
- switch_to_blog($blog_id);
439
- require self::ROOT_DIR . '/schema.php';
440
- dbDelta($plugin_queries);
441
- }
442
- switch_to_blog($old_blog);
443
- return;
444
- }
445
- }
446
-
447
- dbDelta($plugin_queries);
448
-
449
- }
450
-
451
- /**
452
- * Load Localisation files.
453
- *
454
- * Note: the first-loaded translation file overrides any following ones if the same translation is present
455
- *
456
- * @access public
457
- * @return void
458
- */
459
- public function load_plugin_textdomain() {
460
- $locale = apply_filters( 'plugin_locale', get_locale(), 'pmxe_plugin' );
461
-
462
- load_plugin_textdomain( 'PMXE_plugin', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" );
463
- }
464
-
465
- /**
466
- * Method returns default import options, main utility of the method is to avoid warnings when new
467
- * option is introduced but already registered imports don't have it
468
- */
469
- public static function get_default_import_options() {
470
- return array(
471
- 'cpt' => array(),
472
- 'export_to' => 'xml',
473
- 'is_export_title' => 1,
474
- 'is_export_content' => 1,
475
- 'custom_fields_list' => array(),
476
- 'is_export_custom_fields' => 1,
477
- 'export_custom_fields_logic' => 'full_export',
478
- 'taxonomies_list' => array(),
479
- 'is_export_categories' => 1,
480
- 'export_categories_logic' => 'full_export',
481
- 'is_export_images' => 1,
482
- 'export_images_logic' => array('urls', 'meta_data'),
483
- 'is_export_other' => 1,
484
- 'is_export_dates' => 1,
485
- 'is_export_parent' => 1,
486
- 'is_export_template' => 1,
487
- 'is_export_menu_order' => 1,
488
- 'is_export_status' => 1,
489
- 'is_export_format' => 1,
490
- 'is_export_author' => 1,
491
- 'is_export_slug' => 1,
492
- 'is_export_excerpt' => 1,
493
- 'is_export_attachments' => 1
494
- );
495
- }
496
-
497
- /*
498
- * Convert csv to xml
499
- */
500
- public static function csv_to_xml($csv_url){
501
-
502
- include_once(self::ROOT_DIR.'/libraries/XmlImportCsvParse.php');
503
-
504
- $csv = new PMXE_CsvParser($csv_url);
505
-
506
- $wp_uploads = wp_upload_dir();
507
- $tmpname = wp_unique_filename($wp_uploads['path'], str_replace("csv", "xml", basename($csv_url)));
508
- $xml_file = $wp_uploads['path'] .'/'. $tmpname;
509
- file_put_contents($xml_file, $csv->toXML());
510
- return $xml_file;
511
-
512
- }
513
-
514
- public static function is_ajax(){
515
- return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') ? true : false ;
516
- }
517
-
518
- }
519
-
520
- PMXE_Plugin::getInstance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,42 +1,68 @@
1
  === Export WordPress data to XML/CSV ===
2
- Contributors: soflyy
3
- Tags: wordpress, xml, csv, datafeed, export
4
- Requires at least: 3.6.1
5
- Tested up to: 4.1
6
- Stable tag: 0.9.1
7
 
8
- ALPHA: WP All Export makes it easy to export WordPress data into an XML file.
9
 
10
  == Description ==
11
 
12
- **Use at your own risk. PLEASE don’t leave a rating for us yet.**
13
 
14
- This is a very early ALPHA version of WP All Export.
 
15
 
16
- It’s not complete. There are tons of features that we’re going to put in here, like integration with WP All Import, customizing the export file, etc.
17
 
18
- **Right now ALL this plugin does is export an XML file.**
19
 
20
- WP All Export makes it easy to export WordPress data into an XML file.
21
 
22
- == Installation ==
23
 
24
- Either: -
25
 
26
- * Upload the plugin from the Plugins page in WordPress
27
- * Unzip wp-all-export.zip and upload the contents to /wp-content/plugins/, and then activate the plugin from the Plugins page in WordPress
 
 
 
 
 
 
 
 
 
 
 
28
 
 
29
 
30
- == Frequently Asked Questions ==
31
 
 
32
 
33
- == Screenshots ==
34
 
35
- 1. New Export
36
- 2. Export options
 
 
 
 
 
 
 
 
 
37
 
38
  == Changelog ==
39
 
 
 
 
40
  = 0.9.1 =
41
  * critical security fix - stopping non-logged in users from accessing adminInit http://www.wpallimport.com/2015/02/wp-import-4-1-1-mandatory-security-update/
42
 
1
  === Export WordPress data to XML/CSV ===
2
+ Contributors: soflyy, wpallimport
3
+ Requires at least: 4.1
4
+ Tested up to: 4.3
5
+ Stable tag: 1.0.0
6
+ Tags: wordpress csv export, wordpress xml export, xml, csv, datafeed, export, migrate, export csv from wordpress, export xml from wordpress, advanced xml export, advanced csv export, export data, bulk csv export, export custom post type, export woocommerce products, export woocommerce orders, migrate woocommerce, csv export, export csv, xml export, export xml, csv exporter, datafeed
7
 
8
+ WP All Export is an extremely powerful exporter that makes it easy to export any XML or CSV file from WordPress.
9
 
10
  == Description ==
11
 
12
+ WP All Export features a three step export process and an intuitive drag & drop interface that makes complicated export tasks simple and fast.
13
 
14
+ With WP All Export you can: migrate content from WordPress to another site, turn your WooCommerce store into an affiliate datafeed, generate filtered lists of pending orders, export the email addresses of new customers, export data for easy editing - and much more.
15
+ [youtube https://www.youtube.com/watch?v=a-z0R-Ldkqo /]
16
 
17
+ * **Turn your WordPress data into a customized CSV or XML**
18
 
19
+ * **Choose which data to export:** WP All Export's drag and drop interface makes it easy to select exactly which data you'd like to export
20
 
21
+ * **Structure your export file however you like:** Rename columns and XML elements, rearrange them, whatever you want to do.
22
 
23
+ * **Export any custom post type, any custom field:** Lots of plugins and themes store custom data in WordPress. You can export all of it with WP All Export.
24
 
25
+ * **Easy integration with WP All Import:** WP All Export will generate your WP All Import settings for you, making importing your data back into WordPress easy, simple, and fast.
26
 
27
+ **Wish you could edit your WordPress data in Excel? Now you can - export it with WP All Export, edit it, and then import it again with WP All Import.**
28
+
29
+ For technical support from the developers, please consider purchasing WP All Export Pro.
30
+
31
+ = WP All Export Professional Edition =
32
+
33
+ **WP All Export Pro** is a paid upgrade that includes premium support and adds the following features:
34
+
35
+ * **Add rules to filter data:** WP All Export Pro makes it easy to export specific datasets. Want to export all WooCommerce orders over $100? Want to export all of the green shirts from your WooCommerce store? Want to export all new posts from 2014, except the ones added by Steve?
36
+
37
+ You can with a simple to use interface on the ‘New Export’ page in WP All Export Pro.
38
+
39
+ * **Export WordPress users:** WP All Export Pro adds the ability to export WordPress users and all custom data associated with them. Available data is organized and cleaned up so you don’t need to know anything about how WordPress stores users in order to export them.
40
 
41
+ * **Export WooCommerce orders:** Export WooCommerce Order item data with WP All Export Pro. Just as with any other custom post type, you can export WooCommerce Orders with the free version of WP All Export. However, the order item data is stored by WooCommerce in several custom database tables and this custom data is only accessible with WP All Export Pro.
42
 
43
+ * **Pass data through custom PHP functions:** With WP All Export Pro you can pass your data through a custom function before it is added to your export file. This will allow you to manipulate your data any way you see fit.
44
 
45
+ * **Guaranteed technical support via e-mail.**
46
 
47
+ [Upgrade to the professional edition of WP All Export.](http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&utm_medium=wordpress-dot-org-slash-wpae&utm_campaign=free+wp+all+export+plugin)
48
 
49
+ == Premium Support ==
50
+ Upgrade to the professional edition of WP All Export for premium support.
51
+
52
+ E-mail: support@wpallimport.com
53
+
54
+ == Installation ==
55
+
56
+ Either: -
57
+
58
+ * Upload the plugin from the Plugins page in WordPress
59
+ * Unzip wp-all-export.zip and upload the contents to /wp-content/plugins/, and then activate the plugin from the Plugins page in WordPress
60
 
61
  == Changelog ==
62
 
63
+ = 1.0.0 =
64
+ * WP All Export exits beta
65
+
66
  = 0.9.1 =
67
  * critical security fix - stopping non-logged in users from accessing adminInit http://www.wpallimport.com/2015/02/wp-import-4-1-1-mandatory-security-update/
68
 
schema.php CHANGED
@@ -24,4 +24,22 @@ if ( ! empty($wpdb->collate))
24
 
25
  $table_prefix = PMXE_Plugin::getInstance()->getTablePrefix();
26
 
27
- $plugin_queries = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  $table_prefix = PMXE_Plugin::getInstance()->getTablePrefix();
26
 
27
+ $plugin_queries = <<<SCHEMA
28
+ CREATE TABLE {$table_prefix}exports (
29
+ id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
30
+ attch_id BIGINT(20) UNSIGNED NOT NULL,
31
+ options LONGTEXT,
32
+ scheduled VARCHAR(64) NOT NULL DEFAULT '',
33
+ registered_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
34
+ friendly_name VARCHAR(64) NOT NULL DEFAULT '',
35
+ exported BIGINT(20) NOT NULL DEFAULT 0,
36
+ canceled BOOL NOT NULL DEFAULT 0,
37
+ canceled_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
38
+ settings_update_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
39
+ last_activity DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
40
+ processing BOOL NOT NULL DEFAULT 0,
41
+ executing BOOL NOT NULL DEFAULT 0,
42
+ triggered BOOL NOT NULL DEFAULT 0,
43
+ PRIMARY KEY (id)
44
+ ) $charset_collate;
45
+ SCHEMA;
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
sessions/.gitkeep ADDED
File without changes
shortcodes/.gitkeep ADDED
File without changes
static/css/admin-ie.css CHANGED
File without changes
static/css/admin-wp-3.8.css CHANGED
File without changes
static/css/admin.css CHANGED
@@ -1,17 +1,240 @@
1
- /*@+ common */
2
- .pmxe_plugin hr {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  height: 1px;
4
  border-width: 0px;
5
  color: #ddd;
6
  background-color: #ddd;
7
  margin-bottom: 15px;
8
  }
9
- .pmxe_plugin a.button {
10
- /*padding: 5px 10px;
11
- margin: 1px;
12
- font-weight: bold;*/
13
- }
14
- .pmxe_plugin a.help {
15
  overflow: hidden;
16
  text-indent: -99999px;
17
  display: inline-block;
@@ -21,11 +244,13 @@
21
  background-image: url("../img/help.png");
22
  vertical-align: middle;
23
  margin-left: 5px;
 
 
24
  }
25
- .pmxe_plugin input.datepicker {
26
  width: 8em;
27
  }
28
- .pmxe_plugin button.ui-datepicker-trigger {
29
  background-image: url("../img/date-picker.gif");
30
  background-repeat: no-repeat;
31
  cursor: pointer;
@@ -35,1298 +260,3200 @@
35
  height: 18px;
36
  vertical-align: middle;
37
  }
38
- .pmxe_plugin .progress-msg {
39
  font-style: italic;
40
  display: none;
41
  }
42
- .pmxe_plugin .inner-content {
43
- max-width: 700px;
44
- }
45
- .pmxe_plugin .loading {
46
  cursor: progress;
47
  background-repeat: no-repeat;
48
  background-position: center;
49
  }
50
- .pmxe_plugin .preload {
51
- background-image: url("../img/loading.png");
52
  background-repeat: no-repeat;
53
- background-position: 50% 200px;
54
- }
55
- .pmxe_plugin a.add-new {
56
- font-size: 18px;
57
- background-color: #eee;
58
- cursor: pointer;
59
- padding: 6px 10px 6px 10px;
60
- line-height: normal;
61
- font-style: normal;
62
- color: #464646;
63
- border-color: #bbb;
64
- -moz-border-radius: 4px 4px 4px 4px;
65
- border-radius: 4px;
66
- border-style: solid;
67
- border-width: 1px;
68
- font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
69
- text-decoration: none;
70
  }
71
- .pmxe_plugin a.add-new:hover {
72
- border-color: #666666;
73
- color: #000;
 
 
74
  }
75
- .pmxe_plugin div.input {
76
- /*line-height: 25px;
77
- height: 25px;*/
78
- min-height: 21px;
79
- font-size: 12px !important;
 
 
 
 
 
 
80
  }
81
- .pmxe_plugin div.input > * {
82
- vertical-align: middle;
83
- }
84
- .pmxe_plugin .options input[type=text], .pmxe_plugin .options select {
85
- /*background: #fafafa !important;*/
86
- border: 1px solid #aaa !important;
87
- font-size: 12px !important;
 
88
  }
89
- .pmxe_plugin .note {
90
- color: #666666;
91
- font-size: 9px;
 
92
  }
93
- .pmxe_plugin div.sub {
94
- padding-left: 20px;
95
- font-size: 12px;
 
 
 
 
 
96
  }
97
- /* 2 column layout */
98
- .pmxe_plugin table.layout {
99
- clear: both;
100
- border-collapse: collapse;
101
- min-width: 770px;
102
- width: 100%;
103
  }
104
- .pmxe_plugin table.layout td {
105
- vertical-align: top;
106
- border: none;
107
- font-size: 12px !important;
 
 
108
  }
109
- .pmxe_plugin table.layout td.left {
110
- min-width: 490px;
111
- width: 70%;
 
 
 
 
 
112
  }
113
- .pmxe_plugin table.layout td.right {
114
- padding: 0px 0 16px 20px;
115
- width: 25%;
116
- min-width: 260px;
117
- position: relative;
118
  }
119
- .pmxe_plugin table.layout td.left > h2:first-child {
120
- margin-top: -22px;
121
- padding: 14px 0 20px;
122
- }
123
- .pmxe_plugin table.layout td.left hr {
124
- clear: both;
125
- }
126
- .pmxe_plugin.no-js table.layout td.left > h2:first-child {
127
- margin-top: 0px;
128
- }
129
- .pmxe_plugin table.layout div.left {
130
- min-width: 490px;
131
- width: 70%;
132
- float: left;
133
  }
134
- .pmxe_plugin table.layout div.right {
135
- padding: 0px 0 16px 20px;
136
- width: 25%;
137
- /*min-width: 260px; */
138
- position: relative;
 
139
  float: right;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
- /*@*/
142
-
143
- /*@+ Setting Form */
144
- .pmxe_plugin form.settings {
145
- width: 700px;
 
 
 
 
 
 
 
 
 
 
 
 
146
  }
147
- /*@*/
148
 
149
- /*@+ Choose File forms */
150
- .pmxe_plugin form.choose-file {
151
- padding-top: 20px;
152
- position: relative;
 
 
 
 
 
153
  }
154
- .pmxe_plugin form.choose-file h3 {
155
- margin-bottom: 5px;
 
 
 
156
  }
157
- .pmxe_plugin form.choose-file .label {
158
- font-size: 15px;
 
159
  }
160
- .pmxe_plugin form.choose-file input[type="text"],
161
- .pmxe_plugin form.choose-file input[type="password"] {
162
- width: 80px;
163
- font-size: 12px;
 
 
164
  }
165
- .pmxe_plugin form.choose-file input.regular-text,
166
- .pmxe_plugin form.choose-file select.regular-text {
167
- width: 100%;
 
168
  }
169
- .pmxe_plugin #wpcontent form.choose-file select[name="file"],
170
- .pmxe_plugin #wpcontent form.choose-file select[name="reimport"] {
171
- font-size: 12px;
 
 
 
 
 
 
 
172
  }
173
- .pmxe_plugin form.choose-file input[type="submit"].button {
174
- /*width: 150px;*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  }
176
- .pmxe_plugin form.choose-file div.input {
177
- margin-top: 20px;
 
 
 
 
 
 
 
 
178
  }
179
- /*@*/
180
-
181
- /*@+ Choose Elements form */
182
- .pmxe_plugin form.choose-elements input[type="text"] {
183
- width: 100%;
184
- max-width: 300px;
185
- min-width: 150px;
186
- }
187
- /*@*/
188
 
189
- /*@+ Template form */
190
- .pmxe_plugin form.template.edit {
191
- /*width: 700px;*/
 
 
192
  }
193
- .pmxe_plugin form.template .load-template {
194
- display: block;
195
- font-size: 12px;
 
 
 
 
 
 
196
  }
197
- .pmxe_plugin form.template .load-template select {
198
- width: 126px;
199
- }
200
-
201
- .pmxe_plugin #poststuff form.template h3 {
202
- margin: 1em 0 5px 2px;
203
- font-size: 1.17em;
204
- padding: 0px;
205
  }
206
- .pmxe_plugin #post-preview {
207
- font-size: 12px;
208
- }
209
- .pmxe_plugin #post-preview .error {
210
- margin: 5px 0;
211
  }
212
- .pmxe_plugin h3 .header-option {
213
- display: block;
214
- float: right;
215
- font-size: 12px;
216
- font-weight: normal;
217
  }
218
- /*@*/
219
-
220
- /*@+ Options form */
221
- .pmxe_plugin form.options.edit {
222
- /*width: 700px;*/
223
  }
224
 
225
- .pmxe_plugin .post-type-container,
226
- .pmxe_plugin .file-type-container {
227
- padding: 4px 10px 10px;
228
- border: 1px solid transparent;
229
- }
230
- .pmxe_plugin .post-type-container.selected,
231
- .pmxe_plugin .file-type-container.selected {
232
- background-color: #F1F1F1;
233
- border: 1px solid #ccc;
234
- padding-bottom: 10px;
235
  }
236
- .pmxe_plugin .post-type-container h3,
237
- .pmxe_plugin .file-type-container h3 {
238
- margin: 0px 0px;
239
  }
240
- .pmxe_plugin .post-type-container .post-type-options,
241
- .pmxe_plugin .file-type-container .file-type-options {
242
- margin: 15px 0px 0 30px;
243
  }
244
 
245
- .pmxe_plugin table.form-table {
246
- clear: none;
247
- margin-top: 0px;
248
  }
249
- .pmxe_plugin .post-type-options table.form-table {
250
- max-width: 500px;
251
  }
252
- .pmxe_plugin .post-type-options table.form-table td.delim {
253
- width: 50px;
254
- position: relative;
255
- display: block;
256
- }
257
- .pmxe_plugin .post-type-options table.form-table td.delim input {
258
- width: 20px;
259
- }
260
- .pmxe_plugin table.form-table.custom-params {
261
- max-width: 700px;
262
  }
263
- .pmxe_plugin table.form-table td,
264
- .pmxe_plugin table.form-table th {
265
- /*padding: 0;*/
266
- vertical-align: top;
267
- }
268
- .pmxe_plugin .post-type-options table.form-table th {
269
- width: 100px;
270
- }
271
- .pmxe_plugin .post-type-options table.form-table select {
272
- max-width: 300px;
273
- width:300px;
274
- }
275
- .pmxe_plugin table.form-table thead td {
276
- font-weight: bold;
277
- }
278
- .pmxe_plugin table.form-table.custom-params input {
279
- margin-left: 0;
280
- }
281
- .pmxe_plugin table.form-table tr.template {
282
- display: none;
283
- }
284
- /*@*/
285
 
286
- /*@+ XML representation */
287
- .pmxe_plugin .tag {
288
- background-color: #fff;
289
- position: absolute;
290
- width:95%;
291
- top: 0;
292
- margin-top: 45px;
293
- border-top: 1px solid #DFDFDF;
294
- -moz-border-radius-topleft: 4px;
295
- -webkit-border-top-left-radius: 4px;
296
- border-top-left-radius: 4px;
297
- -moz-border-radius-topright: 4px;
298
- -webkit-border-top-right-radius: 4px;
299
- border-top-right-radius: 4px;
300
  }
301
-
302
- .pmxe_plugin .options .tag{
303
- margin-top: 0px;
304
  }
305
- .pmxe_plugin .tag .title {
306
- font-weight: bold;
307
- padding: 6px 8px;
308
- color: #464646;
309
- background: #DFDFDF;
310
- font-size: 12px;
311
- border-top: 1px solid #DFDFDF;
312
- -moz-border-radius-topleft: 4px;
313
- -webkit-border-top-left-radius: 4px;
314
- border-top-left-radius: 4px;
315
- -moz-border-radius-topright: 4px;
316
- -webkit-border-top-right-radius: 4px;
317
- border-top-right-radius: 4px;
318
- }
319
- .pmxe_plugin .tag .xml {
320
- max-height: 525px;
321
- overflow: auto;
322
- border: 1px solid #DFDFDF;
323
- border-top:none;
324
- -moz-border-radius-bottomright: 4px;
325
- -webkit-border-bottom-right-radius: 4px;
326
- border-bottom-right-radius: 4px;
327
- -moz-border-radius-bottomleft: 4px;
328
- -webkit-border-bottom-left-radius: 4px;
329
- border-bottom-left-radius: 4px;
330
- }
331
- .pmxe_plugin .tag .navigation {
332
- float: right;
333
- margin: 2px -12px 0 0;
334
- }
335
- .pmxe_plugin .tag .navigation a,
336
- .pmxe_plugin .tag .navigation span {
337
- font-weight: bold;
338
- padding: 0 12px;
339
- text-decoration: none;
340
- }
341
-
342
- @media screen and (max-height: 700px) {
343
- .pmxe_plugin .tag {
344
- height:300px;
345
- }
346
- .pmxe_plugin .tag .xml {
347
- max-height: 265px;
348
- }
349
  }
350
 
351
- .xml {
352
- padding-left: 15px;
 
 
 
 
 
 
 
 
 
 
 
 
353
  }
354
- .xml-element {
355
- border: 1px solid transparent;
356
- margin: 1px 1px 1px 0;
357
  }
358
- .xml-element.selected > .xml-tag.opening .xml-tag-name {
359
- background-color: #B5E61D;
 
360
  }
361
- .xml-content {
362
- padding-left: 14px;
 
 
 
 
 
 
 
 
 
363
  }
364
- .xml-content.collapsed {
365
- display: none;
 
 
 
366
  }
367
- .xml-content.textonly.short {
368
- padding-left: 0px;
369
- display: inline;
 
 
 
 
 
 
 
 
 
 
 
 
370
  }
371
- .xml-tag {
372
- display: inline;
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  }
374
- .xml-tag-name {
375
- color: #906;
376
- font-weight: bold;
 
 
 
377
  }
378
- .xml-tag.opening .xml-tag-name {
379
- cursor: pointer;
 
380
  }
381
- .xml-attr-name {
382
- font-weight: bold;
383
- cursor: pointer;
 
 
 
 
 
384
  }
385
- .xml-attr-value {
386
- color: blue;
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  }
388
- .xml-expander {
389
- display: inline-block;
390
- width: 12px;
391
- margin-left: -12px;
392
- -moz-user-select: none;
393
- -khtml-user-select: none;
394
- -webkit-user-select: none;
395
- user-select: none;
396
- cursor: pointer;
397
- font-family: monospace;
398
- line-height: 100%;
399
- text-align: left;
400
- color: red;
401
  }
402
- .xml-more {
403
- color: red;
404
- font-size: 80%;
 
 
 
 
405
  }
406
- .xml.resetable .xml-element.lvl-mod4-3 > .xml-content {
407
- margin-left: -59px;
408
- margin-right: -8px;
409
- background-color: #fff;
410
- border: 1px dashed #906;
411
- border-left: 2px solid #906;
412
- border-right: none;
413
  }
414
- .xml.resetable .xml-element.lvl-mod4-3 > .xml-content.short {
415
- margin-left: 0;
416
- margin-right: 0;
417
- border: none;
418
- background-color: inherit;
419
  }
420
- /* xml table representation */
421
- tr.xml-element.selected .xml-tag.opening .xml-tag-name {
422
- background-color: #B5E61D;
423
  }
424
- table.xml td {
425
- padding-left: 20px;
 
 
 
 
 
 
 
 
 
 
 
426
  }
427
- table.xml td:first-child {
428
- width: 1px;
429
- padding-left: 0px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
430
  }
431
-
432
- table.xml,
433
- table.xml table {
434
- width: 100%;
435
- border-collapse:collapse;
436
- border-spacing:0;
437
  }
438
- /*@*/
 
 
 
 
439
 
440
- /*@+ table list */
441
- .pmxe_plugin table.widefat th {
442
- white-space: nowrap;
 
 
443
  }
444
- .pmxe_plugin table.widefat th.ASC a {
445
- background-image: url("../img/screen-options-right-up.gif");
446
- background-repeat: no-repeat;
447
- background-position: right center;
448
- padding-right: 19px;
449
  }
450
- .pmxe_plugin table.widefat th.DESC a {
451
- background-image: url("../img/screen-options-right.gif");
452
- background-repeat: no-repeat;
453
- background-position: right center;
454
- padding-right: 19px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  }
456
-
457
- .pmxe_plugin table.widefat.pmxe-admin-imports th.column-id {
458
- width: 35px;
 
459
  }
460
- .pmxe_plugin table.widefat.pmxe-admin-imports th.column-scheduled {
461
- width: 85px;
 
 
 
 
462
  }
463
- .pmxe_plugin table.widefat.pmxe-admin-imports th.column-registered_on {
464
- width: 130px;
465
  }
466
- .pmxe_plugin table.widefat.pmxe-admin-imports th.column-post_count {
467
- width: 105px;
 
 
468
  }
469
- /*@*/
 
 
 
 
 
 
 
470
 
471
  /*@+ fixes */
472
- .pmxe_plugin input[type="file"] {
473
  padding: 0; /* FIX height or <input type="file" /> for Safari & Chrome */
474
  }
475
- .pmxe_plugin .ui-widget-overlay {
476
  position: fixed !important; /* FIX: modal dialog overlay in IE 8 */
477
- background-color: #aaa !important; /* FIX: overlay color */
478
  }
479
- .pmxe_plugin .ui-dialog {
480
  position: absolute !important; /* FIX: for wordpress 3.1 not to add empty space */
481
  z-index: 999999;
482
  }
483
- .pmxe_plugin .ui-autocomplete {
484
- position: absolute;
485
- border-color: #ccc #444 #444 #aaa;
486
- cursor: default;
487
- -moz-border-radius: 0;
488
- border-radius: 0;
489
- max-height: 200px;
490
- max-width: 700px;
491
- overflow-y: auto;
492
- overflow-x: hidden;
493
- white-space: nowrap;
494
- font-size: 11px;
495
- }
496
- .pmxe_plugin .ui-autocomplete .ui-menu-item {
497
- padding: 0;
498
- margin: 0;
499
- }
500
- .pmxe_plugin .ui-autocomplete .ui-menu-item a {
501
- display: block;
502
- padding: 2px;
503
- padding-right: 20px; /* space for scroll bar */
504
- font-size: 11px;
505
- border: none;
506
- -moz-border-radius: 0;
507
- border-radius: 0;
508
- }
509
- .pmxe_plugin .ui-autocomplete .ui-menu-item a.ui-state-hover {
510
- background: #39f;
511
- color: #fff;
512
- }
513
- .pmxe_plugin input.autocomplete {
514
- background: url("../img/down.gif") no-repeat right top #fff;
515
- padding-right: 20px;
516
- cursor: default;
517
- font-size: 11px !important;
518
- }
519
  /*@*/
520
 
521
- .pmxe_plugin .taglines{
522
- font-size:13px;
523
- font-style: italic;
524
- display: block;
525
- color: #777;
526
- }
527
-
528
- .pmxe_plugin #process{ display:none; }
529
- .pmxe_plugin .load-options{ float:right; font-size:13px; position: relative; top: -30px; }
530
- .pmxe_plugin form.options table.layout td.right{
531
- width: 25%;
532
  }
533
- .pmxe_plugin .drag-element{
534
- background: url("../img/drag.png") top right no-repeat;
535
- cursor: pointer;
536
- padding-left: 25px;
537
- background-position: 0px 1px;
538
  }
539
- .sortable li{ position: relative;}
540
- .pmxe_plugin ol{
541
- margin-top: 6px;
542
- list-style: none;
 
 
 
 
 
 
 
543
  }
544
- .pmxe_plugin .no-margin{ margin:0px; }
545
- .pmxe_plugin .icon-item, .pmxe_plugin .add-new-custom{
546
- display: inline-block;
547
- width: 16px;
548
- height: 16px;
549
- margin: 0px 3px;
550
  }
551
- .pmxe_plugin .add-new-ico, .pmxe_plugin .add-new-custom{
552
- background: url("../img/ico-add-new.png") no-repeat 0px 4px;
553
- width:70px;
554
- height:25px;
555
- padding-left: 15px;
556
- color:#21759B;
557
  }
558
-
559
- .pmxe_plugin .remove-ico{
560
- background: url("../img/ico-remove.png") no-repeat;
561
- top:1px;
562
- right:0px;
563
- position: absolute;
564
  }
565
-
566
- .pmxe_plugin .hidden{ display: none; }
567
-
568
- .pmxe_plugin .fs11 { font-size:11px; }
569
-
570
- .pmxe_plugin .rel { position: relative; }
571
-
572
- #type_meta_select{ margin-bottom: 10px; height:1.8em; }
573
-
574
- .upload_process{
575
- border: none;
576
- padding: 1px;
577
  }
578
-
579
- #large_import_xpath{ display:none; }
580
- #large_import{ margin:0px 5px; }
581
- #download_pmxe_log{
582
- cursor: pointer;
583
- margin: 5px 0;
584
  display: none;
585
  }
586
- .pmxe_plugin .import_process_bar, .pmxe_plugin .import_percent{
587
- display: none;
588
  }
589
- /*.pmxe_plugin .import_progress{
590
- font-size: 14px !important;
591
- }*/
592
- .pmxe_plugin #processbar{
593
- text-align: center;
594
- visibility: hidden;
595
- height: 37px;
596
- padding-top: 18px;
597
- margin-bottom: 20px;
598
- border: 1px solid #AAAAAA;
599
- color: #222222;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
600
  position: relative;
 
 
 
 
 
601
  }
602
- .pmxe_plugin #processbar div{
603
- background: #aaa;
604
- height: 55px;
605
- width: 0%;
606
- position: absolute;
607
- opacity: 0.5;
608
- top:0;
609
  }
610
- .pmxe_plugin #import_progress{
611
- color: #000000;
612
- font-size: 13px;
613
- font-weight: bold;
614
- opacity: 1;
615
  }
616
- .pmxe_plugin #right_progress{ float:right; padding-right: 5px; }
617
- .pmxe_plugin #left_progress{ float:left; padding-left: 5px; }
618
- .pmxe_plugin #existing_meta_keys{
619
- margin-bottom: 10px;
620
- padding: 2px;
621
- width: 580px;
622
  }
623
- .pmxe_plugin #pmxe_tabs{
624
- /*display: none;*/
625
- padding-bottom: 20px;
 
 
 
 
626
  -moz-border-radius: 4px;
627
  -khtml-border-radius: 4px;
628
  -webkit-border-radius: 4px;
629
  border-radius: 4px;
 
 
 
 
 
 
630
  }
631
- .pmxe_plugin .pmxe_tab{
632
- display: none;
 
 
 
 
633
  }
634
- .pmxe_plugin .ui-widget-header{
635
  -moz-border-radius: 4px;
636
  -khtml-border-radius: 4px;
637
  -webkit-border-radius: 4px;
638
- border-radius: 4px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
639
  }
640
- .pmxe_plugin .ui-tabs .ui-tabs-nav li{
641
- -moz-border-top-left-radius: 4px;
642
- -khtml-border-top-left-radius: 4px;
643
- -webkit-border-top-left-radius: 4px;
644
- border-top-left-radius: 4px;
645
- -moz-border-top-right-radius: 4px;
646
- -khtml-border-top-right-radius: 4px;
647
- -webkit-border-top-right-radius: 4px;
648
- border-top-right-radius: 4px;
649
  }
650
- /*.pmxe_plugin .ui-widget-header{
651
- background: #F2FBD9;
652
- border: 1px solid #F2FBD9;
653
  }
654
- .pmxe_plugin .ui-state-default{
655
- border:none;
656
- font-size: 12px;
657
- font-weight: bold;
658
- background: #F2FBD9;
659
  }
660
- .pmxe_plugin .ui-state-active{
661
- background: #fff;
 
 
 
662
  }
663
- .pmxe_plugin .ui-tabs{
664
- padding: 0px;
665
- }*/
666
- #select-files{
667
- font-size: 11px !important;
668
- height:25px;
669
  }
670
- .pmxe_plugin .progress{
671
  position: relative;
672
- visibility: hidden;
673
- color: #009039;
674
- font-size: 13px;
675
- font-weight: bold;
676
- margin-top: 10px;
677
- width: 100%;
678
- text-align: center;
679
- border:1px solid #4297D7;
680
- -moz-border-radius: 4px;
681
- -khtml-border-radius: 4px;
682
- -webkit-border-radius: 4px;
683
- border-radius: 4px;
684
  }
685
- .pmxe_plugin #progressbar{
686
- border: medium none;
687
- left: 0;
688
- position: absolute;
689
- text-align: center;
690
- top: 8px;
691
- width: 100%;
692
- font-size: 12px;
693
- color:#333;
694
  }
695
- .pmxe_plugin #file_name{
696
- font-size: 16px;
697
- font-weight: bold;
698
- margin-left: 10px;
699
- float: right;
700
  }
701
- .pmxe_plugin .ui-progressbar .ui-progressbar-value { /*background-image: url("../img/progress_animated.gif");*/ }
702
- .pmxe_plugin form.choose-file .submit-buttons{
703
- /*bottom: -125px;
704
- position: absolute;
705
- right: -18px; */
 
706
  }
707
- .pmxe_plugin form#basic .submit-buttons{
708
- display: none;
 
 
 
 
 
 
 
 
709
  }
710
- .pmxe_plugin fieldset{
711
- padding: 20px;
712
- width:auto;
713
  }
714
- .pmxe_plugin .right fieldset{
715
- padding: 15px;
 
 
716
  }
717
- .pmxe_plugin .right fieldset input{
718
- max-width:none;
719
- padding:6px;
720
- margin:0px
721
  }
722
- .pmxe_plugin .right a{
723
- text-decoration: underline;
 
724
  }
725
- .pmxe_plugin fieldset legend{
726
- padding: 0px 5px;
727
- font-weight: bold;
 
 
728
  }
729
- .pmxe_plugin .options fieldset legend{
730
- font-size: 1.17em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
731
  }
732
- .pmxe_plugin .matches_count{
733
- font-weight: bold;
734
- color:#33AA28;
735
  }
736
- .pmxe_plugin .xpath_help{
737
- /*bottom: -40px;*/
 
 
 
 
 
738
  position: relative;
739
- text-align: center;
740
  }
741
- .pmxe_plugin .btns, .pmxe_plugin .btns input, .pmxe_plugin .btns a{
742
- float: right;
 
 
 
743
  }
744
- .pmxe_plugin .btns input{
745
- height: 19px;
746
- margin-left: 5px;
747
- padding-top: 0;
748
  }
749
- .pmxe_plugin .btns a{
750
- font-weight: bold;
751
- margin: 0 5px;
752
- padding: 4px 10px;
753
- width:70px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
  text-align: center;
 
 
 
 
755
  }
756
- .pmxe_plugin .col3{
757
- /*border-right: 1px solid #CCCCCC;*/
758
- float: left;
759
- /*height: 265px;*/
760
- width:33%;
761
- margin-bottom: 10px;
762
- /*padding: 0 1%;*/
 
 
 
 
 
 
763
  }
764
- .pmxe_plugin .col3.last{
 
765
  border: none;
 
 
 
 
 
 
 
 
 
766
  }
767
- .pmxe_plugin .col3 > div{
768
- /*margin-left: 20px;*/
 
 
 
 
 
769
  }
770
- .pmxe_plugin .col2{
771
- float: left;
772
- width: 50%;
773
  }
774
- .pmxe_plugin .col2 fieldset{
775
- border: 1px solid #CCCCCC;
776
- margin: 0 5px;
777
- padding: 5px 2% 5px 5px;
778
- text-align: center;
779
  }
780
- .pmxe_plugin input.small{
781
- width:25px;
782
- text-align: center;
 
 
 
783
  }
784
- .pmxe_plugin .post_taxonomy{
785
- margin-bottom: 15px;
786
- overflow: hidden;
787
- padding-bottom: 15px;
 
 
 
788
  }
789
- .pmxe_plugin .post_taxonomy .delim{
790
- padding-left: 25px;
 
791
  }
792
- .pmxe_plugin .post_taxonomy .delim .add-new-ico{
793
  float: right;
794
- margin-right: 10%;
795
- margin-top: 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
796
  }
797
- .pmxe_plugin .post_taxonomy ol.ui-sortable{
798
- padding-right: 0px;
 
 
 
 
799
  }
800
- .pmxe_plugin .optionsset{
801
- border:1px solid #ccc;
 
 
 
 
 
 
 
802
  }
803
- .pmxe_plugin .action.remove{
804
- display: block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
805
  position: relative;
 
 
806
  }
807
- .pmxe_plugin .action.remove a{
808
- background: url("../img/ico-remove.png") no-repeat scroll 0 0 transparent;
809
- height: 16px;
810
- position: absolute;
811
- right: 20px;
812
- width: 16px;
813
  }
814
- .pmxe_plugin .switcher-target-is_keep_former_posts{
 
 
 
815
  padding-left: 25px;
816
  }
817
- .pmxe_plugin form.options{
818
- position: relative;
819
  }
820
- .pmxe_plugin .options_buttons{
821
- bottom: -75px;
822
- display: block;
823
- position: absolute;
824
- right: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
825
  }
826
- .pmxe-button{
827
- border: 1px solid #BBBBBB;
828
- color: #464646;
829
- cursor: pointer;
830
- font-size: 18px !important;
831
- margin-left: 10px;
832
- padding: 15px 25px;
833
- text-decoration: none;
834
- -moz-border-radius: 3px;
835
- -khtml-border-radius: 3px;
836
- -webkit-border-radius: 3px;
837
- border-radius: 3px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
838
  }
839
- .pmxe-button:hover{
840
- background: #dfdfdf;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
841
  }
842
- .pmxe_plugin .ui-state-default a{
843
- font-size: 13px !important;
 
844
  }
845
- .pmxe_plugin .preview{
846
- float: none;
847
- /*line-height: 32px;
848
- position: relative;
849
  text-align: center;
850
- text-decoration: none;
851
- top: -1px;
852
- vertical-align: middle;*/
853
- }
854
- .pmxe_plugin .template-sidebar .tag{
855
- max-height:550px;
856
- }
857
- .pmxe_plugin .options .submit-buttons{
858
- float: right;
859
  position: relative;
860
- text-align: right;
861
- top: 10px;
862
  }
863
- .pmxe_plugin .back{
864
- color: #21759B;
865
- font-size: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
866
  position: relative;
867
- top: 3px;
868
- }
869
- .pmxe_plugin .separated_by{
870
- float: right;
871
- font-size: 12px;
872
- color: #999999;
873
- margin-right: 20px;
874
  }
875
- .pmxe_plugin .delim > label{
876
- color: #999999;
877
- font-size: 11px;
 
 
 
 
 
878
  }
879
- .pmxe_plugin .optionsset > table{
880
- border-bottom: 1px solid #CCCCCC;
881
- margin-bottom: 20px;
882
- width: 100%;
 
 
 
883
  }
884
- /* Log Bar - Step 5 */
885
- .pmxe_plugin #logwrapper{
886
- border: 1px solid #aaa;
887
- margin-bottom: 20px;
 
 
 
888
  }
889
- .pmxe_plugin #logbar{
890
- padding: 5px 0px;
891
  text-align: center;
892
- margin: 10px 0px;
893
- border: 1px solid #aaa;
894
- overflow: auto;
895
  }
896
- .pmxe_plugin .optionsset > table:last-child{
897
- border: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
898
  }
899
- .pmxe_plugin #download_log_separator, .pmxe_plugin #download_log{
 
 
 
 
 
 
 
 
 
 
 
 
900
  display: none;
901
  }
902
- .pmxe_plugin #loglist{
 
 
 
 
903
  border: 1px solid #AAAAAA;
904
- height: 400px;
905
  overflow: auto;
906
  }
907
- .pmxe_plugin #loglist > p{
908
  margin: 0;
909
  padding: 3px 5px;
910
  }
911
- .pmxe_plugin #loglist > p.odd{
912
  background: #dfdfdf;
913
  }
914
- .pmxe_plugin #process_notice{
915
- color: red;
916
- text-align: center;
 
 
 
 
 
 
 
917
  }
918
- .pmxe_plugin .reimported_notify{
919
- border: 1px solid #AFAFAF;
920
- margin-bottom: 20px;
921
- padding: 10px 20px;
922
  }
923
- .pmxe_plugin .reimported_notify p span{
924
- color:#ccc;
 
 
 
 
 
 
 
 
 
 
 
 
 
925
  }
926
- .pmxe_plugin .action_buttons{
927
- overflow: hidden;
928
- clear: both;
929
- padding-bottom: 10px;
930
  }
931
- /*.pmxe_plugin .action_buttons a{
932
- border: 1px solid #BBBBBB;
933
- -moz-border-radius: 3px;
934
- -khtml-border-radius: 3px;
935
- -webkit-border-radius: 3px;
936
- border-radius: 3px;
937
  color: #464646;
938
- cursor: pointer;
939
- font-size: 18px !important;
940
- margin-right: 10px;
941
- padding: 15px 25px;
942
- text-decoration: none;
943
- display: block;
944
- width:25px;
945
- float: left;
946
- }
947
- .pmxe_plugin .action_buttons a:hover{
948
- background: #dfdfdf;
949
- }*/
950
- .pmxe_plugin #current_element{
951
- color:green;
952
- }
953
- .pmxe_plugin #current_xml{ display: none;}
954
- .pmxe_plugin #goto_element{
955
- display: block;
956
- float: left;
957
- font-size: 18px;
958
- height: 46px;
959
- margin-right: 10px;
960
- min-width: 70px;
961
- padding-top: 5px;
962
  text-align: center;
963
- width: 70px !important;
964
- }
965
- .pmxe_plugin .choose-elements table tbody tr td{
966
- overflow: hidden;
 
 
 
 
967
  }
968
- .pmxe_plugin #plupload-ui h3{
969
- float: left;
970
- font-size: 13px;
971
- font-weight: normal;
972
- margin-bottom: 0;
973
- margin-top: 8px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
974
  }
975
- .pmxe_plugin #wp-content-media-buttons{
976
- display: none;
 
977
  }
978
- .pmxe_plugin label{
979
- /*-webkit-touch-callout: none;
980
  -webkit-user-select: none;
981
  -khtml-user-select: none;
982
  -moz-user-select: none;
983
  -ms-user-select: none;
984
- user-select: none;*/
985
- }
986
- .pmxe_plugin .large_button{
987
- /*margin-left: 10px;
988
- padding: 15px 25px;
989
- border: 1px solid #C5DBEC;*/
990
- height: 40px;
991
- line-height: 39px;
992
- margin-left: 10px;
993
- /*width: 90px;*/
994
- }
995
- .pmxe_plugin .drag-element .assign_post{
996
- float: left;
997
- margin-top: 2px;
998
- }
999
- .pmxe_plugin .drag-element .widefat{
1000
- margin-left: 1%;
1001
- width: 85%;
1002
- }
1003
- .pmxe_plugin .ui-tabs-hide{
1004
- display: none !important;
1005
- }
1006
- .pmxe_plugin .auto_nested{
1007
- float: left;
1008
- margin-left: 3px;
1009
- }
1010
- .pmxe_plugin .existing_meta_values{
1011
- clear: both;
1012
- display: block;
1013
- margin: 15px;
1014
- }
1015
- .pmxe_plugin .custom-params tr td{
1016
- width: 50%;
1017
- }
1018
- .pmxe_plugin .custom-params tr td.action{
1019
- width:100% !important;
1020
- }
1021
- .pmxe_plugin .load_options{
1022
- height: 0;
1023
- line-height: 0;
1024
- margin: 0;
1025
- padding: 0;
1026
- position: relative;
1027
- right: 10px;
1028
- text-align: right;
1029
- top: -35px;
1030
- width: 100%;
1031
- }
1032
- .pmxe_plugin .form-field textarea{
1033
- width:80%;
1034
- }
1035
-
1036
- /* Tabs */
1037
- .pmxe_plugin .nav-tab-wrapper{
1038
- display: none;
1039
  }
1040
- .pmxe_plugin h2.nav-tab-wrapper, h3.nav-tab-wrapper{
1041
- margin-bottom: 10px;
1042
  }
1043
- .pmxe_plugin .nav-tab{
1044
- margin-right: 0px !important;
 
1045
  }
1046
- .pmxe_plugin h2 .nav-tab{
1047
- font-size: 18px !important;
 
 
 
1048
  }
1049
- .pmxe_plugin #set_encoding{
1050
- line-height: 25px;
1051
- position: relative;
1052
- text-align: center;
1053
- top: -10px;
1054
- margin-top: -55px;
1055
  }
1056
- .pmxe_plugin #add_encoding{
1057
  display: none;
1058
  }
1059
- .pmxe_plugin #new_encoding{
1060
- border: 1px solid #BBBBBB;
1061
- -moz-border-radius: 3px;
1062
- -khtml-border-radius: 3px;
1063
- -webkit-border-radius: 3px;
1064
- border-radius: 3px;
1065
- }
1066
- .pmxe_plugin .options #set_encoding{
1067
- display: none;
1068
  }
1069
- .pmxe_plugin .set_csv_delimiter > li{
1070
- float: left;
1071
- padding: 0 3px;
1072
  }
1073
- /*.pmxe_plugin .set_csv_delimiter > li a.delimiter_selected{
 
 
1074
  font-weight: bold;
1075
- text-decoration: underline;
1076
- }
1077
- .pmxe_plugin .set_csv_delimiter{
1078
- float: left;
1079
- padding-top: 3px;
1080
- }*/
1081
- .pmxe_plugin .set_csv_delimiter{
1082
- padding-top: 5px;
1083
- }
1084
- .pmxe_plugin input[name="delimiter"]{
1085
- display: block;
1086
- float: left;
1087
- width: 25px !important;
1088
- height: 25px;
1089
- min-width: 25px !important;
1090
- position: relative;
1091
- top:-5px;
1092
- padding: 0 3px;
1093
- text-align: center;
1094
  }
1095
- .pmxe_plugin input[name="apply_delimiter"]{
1096
- border: 1px solid #BBBBBB;
1097
- -moz-border-radius: 3px;
1098
- -khtml-border-radius: 3px;
1099
- -webkit-border-radius: 3px;
1100
- border-radius: 3px;
1101
- padding: 3px 5px;
1102
- margin-left: 10px;
1103
- position: relative;
1104
- top:-4px;
1105
  cursor: pointer;
1106
  }
1107
- .pmxe_plugin .go_to{
1108
- float: left;
1109
- font-size: 23px;
1110
- line-height: 38px;
1111
- text-align: center;
1112
- }
1113
- .pmxe_plugin .fix_checkbox{
1114
- position: relative;
1115
- margin: 0px !important;
1116
- }
1117
- .pmxe_plugin .newline{
1118
- line-height: 16px;
1119
- }
1120
- .pmxe_plugin .button-primary:hover{
1121
- font-weight: normal;
1122
  }
1123
- .pmxe_plugin .hndle{
1124
- padding: 7px;
1125
- margin-bottom: 0px;
1126
- cursor: default !important;
1127
  }
1128
- .pmxe_plugin .inside{
1129
- margin: 0;
1130
- line-height: 20px;
1131
  }
1132
- .pmxe_plugin .inside input[type="text"]{
1133
- background: #fff;
 
 
 
 
 
 
 
 
 
 
 
1134
  }
1135
- .pmxe_plugin .postbox{
1136
- margin: 0;
 
1137
  }
1138
- .pmxe_plugin .txt_center{
1139
- text-align: center;
 
 
 
 
 
1140
  }
1141
- .pmxe_plugin div.meta-options{
1142
- padding: 10px 0px;
 
 
 
1143
  }
1144
- .pmxe_plugin input[name^="attribute_name"], .pmxe_plugin input[name^="variable_attribute_name"]{
1145
- width: 95% !important;
1146
  }
1147
- .pmxe_plugin .widefat{
1148
- background-color: #fff;
1149
- border-color: #DFDFDF;
1150
  }
1151
- .pmxe_plugin #woocommerce-product-data{
1152
- margin-bottom: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1153
  }
1154
- .pmxe_plugin .set_xpath{
1155
- left: 0;
1156
- padding-left: 15px;
1157
- position: absolute;
1158
- top: 0;
1159
  }
1160
- .pmxe_plugin .chosen-container-multi .chosen-choices li.search-field input[type="text"]{
1161
- height: 25px !important;
1162
- width: auto !important;
1163
  }
1164
- .pmxe_plugin .chosen-container-multi .chosen-choices{
1165
- margin: 5px 0px !important;
 
1166
  }
1167
- .pmxe_plugin .pmxe_tips_pointer{
1168
- position: absolute;
1169
- right: 0;
1170
  }
1171
- .pmxe_plugin .wp-pointer-content{
1172
- padding: 10px;
 
 
 
1173
  }
1174
- .pmxe_plugin .wp-pointer-content ul{
1175
- margin-left: 20px;
1176
  }
1177
- .pmxe_plugin .processing_info{
1178
- display: none;
 
1179
  }
1180
- .pmxe_plugin input[type="text"][name="tagno"]{
1181
- margin-left: 5px;
1182
- padding: 3px;
1183
- width: 40px;
1184
- border: 1px solid #BBBBBB;
1185
- -moz-border-radius: 3px;
1186
- -khtml-border-radius: 3px;
1187
- -webkit-border-radius: 3px;
1188
- border-radius: 3px;
1189
- text-align: center;
1190
  }
1191
- #post-preview div.title{
1192
- text-align:right;
1193
- border-bottom: 2px solid #ccc;
1194
- padding-bottom:5px;
1195
- font-style:italic;
1196
  }
1197
- .pmxe_plugin .pl17{
1198
- padding-left:17px;
 
 
 
 
1199
  }
 
1200
 
1201
  /*--------------------------------------------------------------------------
1202
  *
1203
- * Add-Ons
1204
  *
1205
  *-------------------------------------------------------------------------*/
1206
 
1207
- .pmxe_plugin #pmxe-add-ons {
1208
- margin-bottom: 20px;
 
1209
  }
1210
-
1211
- .pmxe_plugin .pmxe-add-on-group {
1212
- margin-top: 20px;
1213
- padding-top: 20px;
1214
- border-top: #F5F5F5 solid 1px;
1215
  }
1216
-
1217
- .pmxe_plugin .pmxe-add-on-group:first-child {
1218
- margin-top: 0;
1219
- padding-top: 0;
1220
- border-top: 0 none;
1221
  }
1222
 
1223
- .pmxe_plugin .pmxe-add-on {
1224
- float: left;
1225
- width: 220px;
1226
- margin: 10px;
1227
  }
1228
-
1229
- .pmxe_plugin .pmxe-add-on h3 {
1230
- margin-top: 0.5em;
1231
  }
1232
-
1233
- .pmxe_plugin .pmxe-add-on h3 a {
1234
- color: inherit;
1235
- text-decoration: none;
1236
  }
1237
-
1238
- .pmxe_plugin .pmxe-add-on .inner {
1239
- min-height: 145px;
1240
  }
1241
-
1242
- .pmxe_plugin .pmxe-add-on-active .button {
1243
- padding-left: 4px;
1244
  }
 
 
 
 
 
 
 
 
 
 
 
1245
 
1246
- .pmxe_plugin .pmxe-sprite-tick {
1247
- width: 14px;
1248
- height: 14px;
1249
- margin: 4px 5px 0 0;
1250
- background-position: 0px -300px;
1251
- }
1252
 
1253
- .pmxe_plugin .wp-box {
1254
- background: none repeat scroll 0 0 #FFFFFF;
1255
- border: 1px solid #E1E1E1;
1256
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
1257
- position: relative;
1258
  }
1259
- .pmxe_plugin .wp-box .inner {
1260
- padding: 15px;
 
1261
  }
1262
- .pmxe_plugin .wp-box .footer{
1263
- background: none repeat scroll 0 0 #F5F5F5;
1264
- border-top: 1px solid #E1E1E1;
1265
  overflow: hidden;
1266
- padding: 10px;
1267
- position: absolute;
1268
- bottom:0;
1269
- width:91%;
1270
  }
1271
 
1272
- #pmxe-add-ons .pmxe-add-on-title {
 
 
 
 
 
 
1273
  float: left;
1274
- width: 100%;
1275
- margin: 25px 0 25px;
1276
- border-top: #F5F5F5 solid 1px;
1277
  }
1278
- .pmxe_plugin .form-table td{
1279
- padding: 0px;
 
1280
  }
1281
- .pmxe_plugin #pmxe_value{
1282
- display: inline-block;
1283
- height: 28px;
1284
- margin: 0;
1285
- padding: 3px;
1286
- position: relative;
1287
- top: 2px;
1288
- width: 50px;
1289
  }
1290
- .pmxe_plugin #pmxe_add_rule{
1291
- display: block;
1292
- float: right;
1293
- margin: 5px;
 
 
 
 
 
 
 
 
 
 
1294
  }
1295
- .pmxe_plugin #filtering_rules{
1296
- border: 1px solid;
1297
- margin: 15px 0;
1298
- position: relative;
 
1299
  }
1300
- .pmxe_plugin .filtering_rules li{
1301
- position: relative;
 
 
 
1302
  }
1303
- .pmxe_plugin .filtering_rules li .condition{
1304
- padding: 2px;
1305
- display: block;
 
 
 
 
1306
  }
1307
- .pmxe_plugin .filtering_rules li .condition label{
1308
- margin: 0px 3px;
 
 
 
 
 
 
 
 
 
 
1309
  }
1310
- .pmxe_plugin .pmxe_group_rule{
1311
- margin-left: -55px;
 
 
 
 
1312
  }
1313
- .pmxe_plugin #apply_filters{
1314
- float: right;
 
 
 
 
 
 
 
 
 
1315
  }
1316
- .pmxe_plugin .filtering_rules li strong{
1317
- text-transform: uppercase;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1318
  }
1319
- .pmxe_plugin #pmxe_xml_element{
1320
- width:180px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1321
  }
1322
- .pmxe_plugin div.input label, .pmxe_plugin .form-field{
1323
- font-size: 12px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1324
  }
1325
- .pmxe_plugin input[type="radio"]{
1326
- margin-left: 4px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1327
  }
1328
- .pmxe_plugin .main_choise{
1329
- float: left;
1330
- margin-right: 5px;
1331
- padding: 5px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1332
  }
1
+ .wpallexport-plugin .preview_a_row, .wpallexport-plugin .add_column{
2
+ margin-top: 20px;
3
+ }
4
+ .wpallexport-plugin fieldset.column{
5
+ display: none;
6
+ }
7
+ .wpallexport-plugin fieldset.optionsset .template{
8
+ display: none;
9
+ }
10
+ .wpallexport-plugin .custom_column, .wpallexport-plugin .default_column{
11
+ background: none repeat scroll 0 0 #FFFFFF;
12
+ border: 1px solid #CCCCCC;
13
+ cursor: move;
14
+ /*float: left;*/
15
+ margin: 0 5px 5px 5px;
16
+ padding: 10px;
17
+ position: relative;
18
+ }
19
+ .wpallexport-plugin #wp_all_export_auto_generate_data{
20
+ background: #33aa28 none repeat scroll 0 0;
21
+ color: #fff;
22
+ display: block;
23
+ margin: 10px 5px;
24
+ padding: 10px;
25
+ text-align: center;
26
+ text-decoration: none;
27
+ }
28
+ .wpallexport-plugin .wpallexport-free-edition-notice{
29
+ display: block;
30
+ margin: 5px;
31
+ padding: 10px;
32
+ text-align: center;
33
+ background-color: #FFB8B8;
34
+ border: 1px solid #FF8383;
35
+ color: #000;
36
+ }
37
+ .wpallexport-plugin .upgrade_link{
38
+ color: #000 !important;
39
+ font-size: 1.3em;
40
+ text-decoration: underline !important;
41
+ }
42
+ .wpallexport-plugin .wpallexport-user-export-notice{
43
+ padding: 20px;
44
+ display: none;
45
+ width: 558px;
46
+ margin: 0 auto;
47
+ }
48
+ .wpallexport-plugin li.wpallexport_disabled div{
49
+ background: #dfdfdf;
50
+ }
51
+ .wpallexport-plugin .custom_column.active, .wpallexport-plugin .default_column.active{
52
+ background: #ccc;
53
+ }
54
+ .wpallexport-plugin fieldset.column .error{
55
+ background: pink;
56
+ }
57
+ .wpallexport-plugin #columns_to_export {
58
+ list-style-type: none;
59
+ margin: 0;
60
+ padding: 0;
61
+ height: 250px;
62
+ /*width: 450px; */
63
+ }
64
+ .wpallexport-plugin #columns_to_export li {
65
+ margin: 5px 3px 3px 0;
66
+ padding: 1px;
67
+ float: left;
68
+ min-width: 115px;
69
+ /*height: 90px; */
70
+ text-align: center;
71
+ }
72
+ .wpallexport-plugin .wpallexport-edit-row-title{
73
+ display: none;
74
+ }
75
+ .wpallexport-plugin .wpallexport-xml-element{
76
+ color: green;
77
+ }
78
+ .wpallexport-plugin .columns-to-export-content ol,
79
+ .wpallexport-plugin .pmxe-state-hover,
80
+ .wpallexport-plugin .pmxe-state-default{
81
+ width: 100%;
82
+ height: 235px;
83
+ border: 4px dashed #bbb;
84
+ margin-left: 0;
85
+ overflow: auto;
86
+ }
87
+ .wpallexport-plugin .av-state-default{
88
+ overflow: hidden;
89
+ height: 100%;
90
+ width: 100%;
91
+ border: 4px dashed #bbb;
92
+ }
93
+ .wpallexport-plugin .columns-to-export-content ol li.placeholder{
94
+ font-size: 20px;
95
+ line-height: 26px;
96
+ margin-bottom: 0;
97
+ margin-left: 25% !important;
98
+ margin-right: auto;
99
+ margin-top: 7% !important;
100
+ text-align: center;
101
+ width: 450px;
102
+ }
103
+ .wpallexport-plugin li.ui-draggable{
104
+ list-style: none !important;
105
+ }
106
+ .wpallexport-plugin #available_data{
107
+ padding: 0;
108
+ background: #fafafa;
109
+ border: 1px solid #ddd;
110
+ }
111
+ .wpallexport-plugin #available_data .title,
112
+ .wpallexport-plugin .wp-all-export-edit-column .title {
113
+ font-weight: bold;
114
+ padding: 12px 8px;
115
+ color: #464646;
116
+ background: #fff;
117
+ font-size: 12px;
118
+ text-align: center;
119
+ border-bottom: 1px solid #ddd;
120
+ -moz-border-radius-topleft: 4px;
121
+ -webkit-border-top-left-radius: 4px;
122
+ border-top-left-radius: 4px;
123
+ -moz-border-radius-topright: 4px;
124
+ -webkit-border-top-right-radius: 4px;
125
+ border-top-right-radius: 4px;
126
+ }
127
+ .wpallexport-plugin .wp-all-export-edit-column{
128
+
129
+ position: fixed;
130
+ top: 15%;
131
+ width: 715px;
132
+ z-index: 999999;
133
+ border: 1px solid #ccc;
134
+ display: none;
135
+ margin-bottom: 20px;
136
+ padding: 0 !important;
137
+ }
138
+ .wpallexport-plugin .wp-all-export-edit-column form{
139
+ /*padding: 10px;*/
140
+ background: #fff;
141
+ }
142
+ .wpallexport-plugin #available_data ul li .pmxe_remove_column{
143
+ display: none;
144
+ }
145
+ .wpallexport-plugin .wpae-available-fields-group{
146
+ background: none repeat scroll 0 0 white;
147
+ border: 1px dotted #ccc;
148
+ font-weight: bold;
149
+ margin: 5px;
150
+ padding: 10px;
151
+ cursor: pointer;
152
+ }
153
+ .wpallexport-plugin .wp-all-export-warning,
154
+ .wpallexport-plugin .wp-all-export-sku-warning,
155
+ .wpallexport-plugin .wp-all-export-advanced-query-warning,
156
+ .wpallexport-plugin .wp-all-export-product-type-warning{
157
+ /*border: 4px dashed #f0f0f0;
158
+ padding: 3px 6px;
159
+ background: #fef7f1;
160
+ margin-top: 10px;*/
161
+ clear: both;
162
+ background: none repeat scroll 0 0 #fff;
163
+ border-left: 4px solid #dd3d36;
164
+ box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.1);
165
+ margin: 0;
166
+ padding: 1px 12px;
167
+ }
168
+ .wpallexport-plugin .wpallexport-csv-delimiter{
169
+ float: right;
170
+ position: relative;
171
+ right: 30px;
172
+ top: -15px;
173
+ }
174
+ .wpallexport-plugin .wpallexport-csv-delimiter input[type="text"]{
175
+ vertical-align:middle;
176
+ font-size:11px;
177
+ background:#fff !important;
178
+ width: 40px !important;
179
+ text-align: center;
180
+ }
181
+ .wpallexport-plugin .wp-all-export-warning h3,
182
+ .wpallexport-plugin .wp-all-export-sku-warning h3,
183
+ .wpallexport-plugin .wp-all-export-advanced-query-warning h3,
184
+ .wpallexport-plugin .wp-all-export-product-type-warning h3{
185
+ font-size: 14px;
186
+ }
187
+ .wpallexport-plugin .wpae-available-fields-group .wpae-expander{
188
+ float: right;
189
+ }
190
+ .wpallexport-plugin .wpae-taxonomy-fields,
191
+ .wpallexport-plugin .wpae-custom-field,
192
+ .wpallexport-plugin .wpae-other-fields{
193
+ display: none;
194
+ }
195
+ .wpallexport-plugin .pmxe_remove_column{
196
+ color: red;
197
+ cursor: pointer;
198
+ font-weight: bold;
199
+ position: absolute;
200
+ right: -4px;
201
+ text-decoration: none;
202
+ top: -8px;
203
+ }
204
+ .wpallexport-plugin .pmxe_field_type{
205
+ /*width: 240px;*/
206
+ /*height: 30px;*/
207
+ }
208
+ .wpallexport-plugin .pmxe_preview{
209
+ width: 100%;
210
+ }
211
+ .wpallexport-plugin .pmxe_preview tr td{
212
+ border: 1px solid #ccc;
213
+ padding: 3px;
214
+ vertical-align: top;
215
+ }
216
+ .wpallexport-plugin .pmxe_date_format_wrapper{
217
+ display: none;
218
+ }
219
+
220
+
221
+ /*--------------------------------------------------------------------------
222
+ *
223
+ * Basic rules
224
+ *
225
+ *-------------------------------------------------------------------------*/
226
+
227
+ .wpallexport-plugin hr {
228
  height: 1px;
229
  border-width: 0px;
230
  color: #ddd;
231
  background-color: #ddd;
232
  margin-bottom: 15px;
233
  }
234
+ .wpallexport-plugin a:focus,
235
+ .wpallexport-plugin input:focus{ box-shadow: none; }
236
+
237
+ .wpallexport-plugin a.wpallexport-help {
 
 
238
  overflow: hidden;
239
  text-indent: -99999px;
240
  display: inline-block;
244
  background-image: url("../img/help.png");
245
  vertical-align: middle;
246
  margin-left: 5px;
247
+ position: relative;
248
+ top: 4px;
249
  }
250
+ .wpallexport-plugin input.datepicker {
251
  width: 8em;
252
  }
253
+ .wpallexport-plugin button.ui-datepicker-trigger {
254
  background-image: url("../img/date-picker.gif");
255
  background-repeat: no-repeat;
256
  cursor: pointer;
260
  height: 18px;
261
  vertical-align: middle;
262
  }
263
+ .wpallexport-plugin .progress-msg {
264
  font-style: italic;
265
  display: none;
266
  }
267
+ .wpallexport-plugin .loading {
 
 
 
268
  cursor: progress;
269
  background-repeat: no-repeat;
270
  background-position: center;
271
  }
272
+ .wpallexport-plugin .preload {
273
+ background-image: url("../img/loading-step-2.gif");
274
  background-repeat: no-repeat;
275
+ background-position: 50% 10px;
276
+ min-height: 35px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  }
278
+ .wpallexport-plugin .wpallexport-preview-preload {
279
+ background-image: url("../img/loading-step-2.gif");
280
+ background-repeat: no-repeat;
281
+ background-position: 50% 20px;
282
+ height: 80px;
283
  }
284
+ .wpallexport-plugin .back{
285
+ background: url("../img/back.png") no-repeat scroll 8% 50% #e4e6e6;
286
+ color: #777;
287
+ display: inline-block;
288
+ font-size: 14px;
289
+ font-weight: bold;
290
+ height: 46px;
291
+ line-height: 46px;
292
+ padding: 0 30px 0 40px;
293
+ position: relative;
294
+ text-decoration: none;
295
  }
296
+ .wpallexport-plugin .wpallexport-large-button{
297
+ box-shadow: none;
298
+ vertical-align:bottom !important;
299
+ height: 40px;
300
+ line-height: 39px;
301
+ /*margin-left: 10px;*/
302
+ background: url('../img/continue.png') no-repeat 93% 50% #425f9a;
303
+ border: none;
304
  }
305
+ .wpallexport-plugin .wpallexport-large-button:hover{
306
+ background: url('../img/continue.png') no-repeat 93% 50% #425f9a;
307
+ border: none;
308
+ box-shadow: none;
309
  }
310
+
311
+ /*@+ header */
312
+ .wpallexport-plugin .wpallexport-logo{
313
+ background: url('../img/logo.png');
314
+ width: 60px;
315
+ height: 51px;
316
+ float: left;
317
+ margin-right: 10px;
318
  }
319
+ .wpallexport-plugin .wpallexport-title{
320
+ float: left;
 
 
 
 
321
  }
322
+ .wpallexport-plugin .wpallexport-title p{
323
+ font-size: 18px !important;
324
+ line-height: 16px;
325
+ color: #777;
326
+ margin-top: 0;
327
+ margin-bottom: 0;
328
  }
329
+ .wpallexport-plugin .wpallexport-title h2,
330
+ .wpallexport-plugin .wpallexport-title h3{
331
+ font-size: 33px;
332
+ color: #425f9a;
333
+ font-weight: bold;
334
+ padding-top: 5px;
335
+ padding-right: 0;
336
+ margin-left: 2px;
337
  }
338
+ .wpallexport-plugin .wpallexport-title h3{
339
+ margin: 5px 0;
 
 
 
340
  }
341
+ .wpallexport-plugin .wpallexport-links{
342
+ float: right;
343
+ margin-right: 3px;
344
+ margin-top: 33px;
 
 
 
 
 
 
 
 
 
 
345
  }
346
+ .wpallexport-plugin .wpallexport-links a{
347
+ font-size: 12px;
348
+ text-decoration: none;
349
+ }
350
+ /*.wpallexport-plugin .wpallexport-support{
351
+ color: #777;
352
  float: right;
353
+ text-decoration: none;
354
+ background: url('../img/ui_4.0/support.png') 33px 12px no-repeat #fff;
355
+ display: block;
356
+ text-align: center;
357
+ border: 1px solid #ddd;
358
+ border-radius: 5px;
359
+ -moz-border-radius: 5px;
360
+ -khtml-border-radius: 5px;
361
+ -webkit-border-radius: 5px;
362
+ width: 100px;
363
+ height: 38px;
364
+ line-height: 39px;
365
+ margin-top: 8px;
366
+ padding-left: 38px;
367
+ font-size: 14px;
368
+ }*/
369
+ .wpallexport-plugin .pmxi_progress{
370
+ border-bottom: 1px solid #ddd;
371
+ -moz-border-radius-topleft: 4px;
372
+ -webkit-border-top-left-radius: 4px;
373
+ border-top-left-radius: 4px;
374
+ -moz-border-radius-topright: 4px;
375
+ -webkit-border-top-right-radius: 4px;
376
+ border-top-right-radius: 4px;
377
+ height: 76px;
378
  }
379
+ .wpallexport-plugin .wpallexport-step-1 .pmxi_progress{
380
+ background: url("../img/ui_4.0/step_1_bar.png") no-repeat scroll center center / contain #f1f2f2;
381
+ }
382
+ .wpallexport-plugin .wpallexport-step-2 .pmxi_progress{
383
+ background: url("../img/ui_4.0/step_2_bar.png") no-repeat scroll center center / contain #f1f2f2;
384
+ }
385
+ .wpallexport-plugin .wpallexport-step-3 .pmxi_progress{
386
+ background: url("../img/ui_4.0/step_3_bar.png") no-repeat scroll center center / contain #f1f2f2;
387
+ }
388
+ .wpallexport-plugin .wpallexport-step-4 .pmxi_progress{
389
+ background: url("../img/ui_4.0/step_4_bar.png") no-repeat scroll center center / contain #f1f2f2;
390
+ }
391
+ .wpallexport-plugin .wpallexport-step-5 .pmxi_progress{
392
+ background: url("../img/ui_4.0/step_5_bar.png") no-repeat scroll center center / contain #f1f2f2;
393
+ }
394
+ .wpallexport-plugin .wpallexport-step-6 .pmxi_progress{
395
+ background: url("../img/ui_4.0/step_6_bar.png") no-repeat scroll center center / contain #f1f2f2;
396
  }
 
397
 
398
+ .wpallexport-plugin .wpallexport-file-upload-result{
399
+ padding: 35px;
400
+ }
401
+ .wpallexport-plugin .wpallexport-step-2 .wpallexport-file-upload-result,
402
+ .wpallexport-plugin .wpallexport-step-3 .wpallexport-file-upload-result,
403
+ .wpallexport-plugin .wpallexport-step-4 .wpallexport-file-upload-result,
404
+ .wpallexport-plugin .wpallexport-step-5 .wpallexport-file-upload-result,
405
+ .wpallexport-plugin .wpallexport-step-6 .wpallexport-file-upload-result {
406
+ display: block;
407
  }
408
+ .wpallexport-plugin .wpallexport-file-upload-result h2{
409
+ float: left;
410
+ padding: 0;
411
+ margin-top: 7px !important;
412
+ height: 31px;
413
  }
414
+ .wpallexport-plugin .wpallexport-file-upload-result[rel=upload_type] h2{
415
+ background: url('../img/ui_4.0/cloud.png') no-repeat;
416
+ padding-left: 45px !important;
417
  }
418
+ .wpallexport-plugin .wpallexport-file-upload-result[rel=url_type] h2{
419
+ background: url('../img/ui_4.0/cloud_url.png') no-repeat;
420
+ padding-left: 45px !important;
421
+ font-size: 14px;
422
+ line-height: 35px;
423
+ height: 35px;
424
  }
425
+ .wpallexport-plugin .wpallexport-file-upload-result[rel=file_type] h2{
426
+ background: url('../img/ui_4.0/use_existing_green.png') no-repeat;
427
+ padding-left: 45px !important;
428
+ height: 35px;
429
  }
430
+ .wpallexport-plugin .wpallexport-file-upload-result h2 .wpallexport-uploaded-file-size{
431
+ color: #777;
432
+ }
433
+ .wpallexport-plugin .wpallexport-file-upload-result a{
434
+ text-decoration: none;
435
+ font-size: 18px;
436
+ margin-top: 12px;
437
+ float: right;
438
+ margin-left: 20px;
439
+ padding-left: 25px;
440
  }
441
+ .wpallexport-plugin .wpallexport-file-upload-result a:last-child{
442
+ margin-left: 0 !important;
443
+ }
444
+ .wpallexport-plugin .wpallexport-download-from-url{
445
+ background: none repeat scroll 0 0 #46ba69;
446
+ color: #fff;
447
+ display: inline-block;
448
+ font-size: 14px;
449
+ height: 19px;
450
+ padding: 15px;
451
+ position: relative;
452
+ text-decoration: none;
453
+ vertical-align: bottom;
454
+ }
455
+ .wpallexport-plugin .wpallexport-file-upload-result .wpallexport-change-uploaded-file{
456
+ color:#40acad;
457
+ }
458
+ .wpallexport-plugin .wpallexport-file-upload-result .wpallexport-change-uploaded-file:before{
459
+ color: #ddd;
460
+ content: "\f463";
461
+ float: left;
462
+ font-family: "dashicons";
463
+ font-size: 30px;
464
+ padding-right: 5px;
465
  }
466
+ .wpallexport-plugin .wpallexport-file-upload-result .wpallexport-remove-uploaded-file{
467
+ color:#dd4a58;
468
+ }
469
+ .wpallexport-plugin .wpallexport-file-upload-result .wpallexport-remove-uploaded-file:before{
470
+ color: #ddd;
471
+ content: "\f335";
472
+ display: inline-block;
473
+ float: left;
474
+ font-family: "dashicons";
475
+ font-size: 32px;
476
  }
477
+ /*@+*/
 
 
 
 
 
 
 
 
478
 
479
+ .wpallexport-plugin .wpallexport-collapsed .wpallexport-collapsed-header{
480
+ background: url('../img/collapser.png') no-repeat 98% 0;
481
+ height: 30px;
482
+ padding-left: 30px;
483
+ cursor: pointer;
484
  }
485
+ .wpallexport-plugin .wpallexport-collapsed .wpallexport-collapsed-header h3{
486
+ line-height: 30px;
487
+ color:#425e99;
488
+ -webkit-touch-callout: none;
489
+ -webkit-user-select: none;
490
+ -khtml-user-select: none;
491
+ -moz-user-select: none;
492
+ -ms-user-select: none;
493
+ user-select: none;
494
  }
495
+ .wpallexport-plugin .wpallexport-collapsed.closed .wpallexport-collapsed-header{
496
+ background: url('../img/collapser.png') no-repeat 98% -30px;
 
 
 
 
 
 
497
  }
498
+ .wpallexport-plugin .wpallexport-collapsed.closed .wpallexport-collapsed-header h3{
499
+ color:#777;
 
 
 
500
  }
501
+ .wpallexport-plugin .wpallexport-collapsed .wpallexport-collapsed-content{
502
+ display: none;
503
+ padding: 15px 25px 25px 25px;
504
+ position: relative;
 
505
  }
506
+ .wpallexport-plugin .wpallexport-collapsed-content-inner{
507
+ padding: 15px 25px 25px 25px;
 
 
 
508
  }
509
 
510
+ .wpallexport-plugin .step_description{
511
+ text-align: center;
512
+ overflow: hidden;
513
+ position: relative;
514
+ /*width: 1200px;*/
 
 
 
 
 
515
  }
516
+ .wpallexport-plugin .step_description h2{
517
+ color: #425f9a;
 
518
  }
519
+ .wpallexport-plugin .step_description h3{
520
+ color: #777;
 
521
  }
522
 
523
+ .wpallexport-plugin div.input > label{
524
+ color: #000;
 
525
  }
526
+ .wpallexport-plugin div.input.pmxi_checked > label{
527
+ color: #000;
528
  }
529
+
530
+ .wpallexport-plugin .ajax-console div.updated{
531
+ background: none;
532
+ border: none;
533
+ box-shadow: none;
 
 
 
 
 
534
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
 
536
+ .wpallexport-plugin .wpallexport-collapsed-content a,
537
+ .wpallexport-plugin .wp-pointer-content a,
538
+ .wpallexport-plugin .wpallexport-pointer-content a,
539
+ .wpallexport-plugin .wpallexport-collapsed-content h4{
540
+ color: #40acad;
541
+ text-decoration: none;
 
 
 
 
 
 
 
 
542
  }
543
+ .wpallexport-plugin div.error{
544
+ clear: both;
545
+ margin-top: 15px;
546
  }
547
+ .wpallexport-plugin .wp-pointer-content ul,
548
+ .wpallexport-plugin .wpallexport-pointer-content ul{
549
+ list-style: disc inside none;
550
+ margin: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
  }
552
 
553
+ .wpallexport-plugin a.add-new {
554
+ font-size: 18px;
555
+ background-color: #eee;
556
+ cursor: pointer;
557
+ padding: 6px 10px 6px 10px;
558
+ line-height: normal;
559
+ font-style: normal;
560
+ color: #464646;
561
+ border-color: #bbb;
562
+ -moz-border-radius: 4px 4px 4px 4px;
563
+ border-radius: 4px;
564
+ border-style: solid;
565
+ border-width: 1px;
566
+ text-decoration: none;
567
  }
568
+ .wpallexport-plugin a.add-new:hover {
569
+ border-color: #666666;
570
+ color: #000;
571
  }
572
+ .wpallexport-plugin div.input {
573
+ /*min-height: 21px;*/
574
+ font-size: 12px !important;
575
  }
576
+ .wpallexport-plugin div.input > * {
577
+ vertical-align: middle;
578
+ }
579
+ .wpallexport-plugin .wpallexport-template select,
580
+ .wpallexport-plugin .options select{
581
+ border: 1px solid #ddd;
582
+ font-size: 12px;
583
+ /*height: 25px;*/
584
+ width: auto;
585
+ padding: 2px;
586
+ color: #000;
587
  }
588
+ .wpallexport-plugin .wpallexport-template input[type="text"],
589
+ .wpallexport-plugin .options input[type="text"]{
590
+ height: auto;
591
+ color: #000;
592
+ font-size: 14px;
593
  }
594
+ .wpallexport-plugin .wpallexport-template .wpallexport-section select,
595
+ .wpallexport-plugin .options .wpallexport-section select{
596
+ font-size: 16px;
597
+ height: 40px;
598
+ /*padding: 10px;*/
599
+ border: 1px solid #ddd;
600
+ border-radius: 4px;
601
+ -moz-border-radius: 4px;
602
+ -khtml-border-radius: 4px;
603
+ -webkit-border-radius: 4px;
604
+ color: #777;
605
+ font-size: 15px !important;
606
+ width: 100%;
607
+ position: relative;
608
+ top: 0;
609
  }
610
+ .wpallexport-plugin .wpallexport-template .wpallexport-section input[type="text"],
611
+ .wpallexport-plugin .options .wpallexport-section input[type="text"],
612
+ .wpallexport-plugin .wp-pointer-content input[type="text"]
613
+ {
614
+ font-size: 14px;
615
+ height: 40px;
616
+ border: 1px solid #ddd;
617
+ border-radius: 4px;
618
+ -moz-border-radius: 4px;
619
+ -khtml-border-radius: 4px;
620
+ -webkit-border-radius: 4px;
621
+ color: #000;
622
+ font-size: 15px;
623
+ position: relative;
624
+ top: 0;
625
  }
626
+ .wpallexport-plugin .wpallexport-template select[multiple=multiple]{
627
+ height: auto !important;
628
+ }
629
+ .wpallexport-plugin .wpallexport-note {
630
+ color: #777;
631
+ font-size: 9px;
632
  }
633
+ .wpallexport-plugin div.sub {
634
+ padding-left: 20px;
635
+ font-size: 12px;
636
  }
637
+
638
+ .wpallexport-plugin .icon-item,
639
+ .wpallexport-plugin .add-new-custom,
640
+ .wpallexport-plugin .add-new-key{
641
+ display: inline-block;
642
+ width: 16px;
643
+ height: 16px;
644
+ margin: 0px 3px;
645
  }
646
+ .wpallexport-plugin .add-new-ico,
647
+ .wpallexport-plugin .add-new-cat,
648
+ .wpallexport-plugin .add-new-custom,
649
+ .wpallexport-plugin .add-new-key{
650
+ background: url("../img/ui_4.0/add.png") no-repeat 0px 5px;
651
+ font-size: 12px;
652
+ width:100px;
653
+ height:25px;
654
+ padding-left: 20px;
655
+ color:#21759B;
656
+ font-family: "Open Sans",​sans-serif;
657
+ padding-top: 2px;
658
+ text-decoration: underline;
659
+ display: block;
660
+ /*margin: 0 auto; */
661
  }
662
+
663
+ .wpallexport-plugin .remove-ico{
664
+ background: url("../img/trash.png") no-repeat;
665
+ top: 5px;
666
+ right: 0;
667
+ position: absolute;
668
+ width: 19px;
669
+ height: 22px;
 
 
 
 
 
670
  }
671
+ .wpallexport-plugin #columns .remove-field{
672
+ background: url("../img/remove.png") no-repeat;
673
+ top: -5px;
674
+ right: -11px;
675
+ position: absolute;
676
+ width: 16px;
677
+ height: 16px;
678
  }
679
+ .wpallexport-plugin .widefat{
680
+ background-color: #fff;
 
 
 
 
 
681
  }
682
+ .wpallexport-plugin .postbox{
683
+ margin: 0;
 
 
 
684
  }
685
+ .wpallexport-plugin .action.remove{
686
+ display: block;
687
+ position: relative;
688
  }
689
+ .wpallexport-plugin .action.remove a{
690
+ background: url("../img/trash.png") no-repeat scroll 0 0 transparent;
691
+ height: 22px;
692
+ position: absolute;
693
+ right: 20px;
694
+ top:0;
695
+ width: 19px;
696
+ }
697
+ .wpallexport-plugin .drag-element{
698
+ background: url("../img/drag.png") top right no-repeat;
699
+ cursor: pointer;
700
+ padding-left: 25px;
701
+ background-position: 0px 1px;
702
  }
703
+ .wpallexport-plugin .sortable li{ position: relative; }
704
+ .wpallexport-plugin ol{ margin-top: 6px; list-style: none; }
705
+ .wpallexport-plugin h2.wpallexport-wp-notices{ margin-top: 0px; padding: 0px; }
706
+ .wpallexport-plugin #footer-upgrade{
707
+ /*float: left !important;*/
708
+ }
709
+ .wpallexport-plugin .wpallexport-overlay {
710
+ display:none;
711
+ position:fixed;
712
+ z-index:99999;
713
+ opacity:0.7;
714
+ filter:alpha(opacity=70);
715
+ top:0;
716
+ right:0;
717
+ left:0;
718
+ bottom:0;
719
+ background:#777;
720
+ }
721
+ .wpallexport-plugin .wp-pointer{
722
+ z-index: 999999 !important;
723
+ }
724
+ .wpallexport-plugin .tipsy{
725
+ font-size: 14px !important;
726
  }
727
+ .wpallexport-plugin .assign_term{
728
+ left: -20px;
729
+ position: absolute;
730
+ top: 15px;
 
 
731
  }
732
+ /*--------------------------------------------------------------------------
733
+ *
734
+ * Helpers
735
+ *
736
+ *-------------------------------------------------------------------------*/
737
 
738
+ .wpallexport-plugin .rad0{
739
+ border-radius: 0px !important;
740
+ -moz-border-radius: 0px !important;
741
+ -khtml-border-radius: 0px !important;
742
+ -webkit-border-radius: 0px !important;
743
  }
744
+ .wpallexport-plugin .rad3{
745
+ border-radius: 3px;
746
+ -moz-border-radius: 3px;
747
+ -khtml-border-radius: 3px;
748
+ -webkit-border-radius: 3px;
749
  }
750
+ .wpallexport-plugin .rad4{
751
+ border-radius: 4px;
752
+ -moz-border-radius: 4px;
753
+ -khtml-border-radius: 4px;
754
+ -webkit-border-radius: 4px;
755
+ }
756
+ .wpallexport-plugin .rad5{
757
+ border-radius: 5px;
758
+ -moz-border-radius: 5px;
759
+ -khtml-border-radius: 5px;
760
+ -webkit-border-radius: 5px;
761
+ }
762
+ .wpallexport-plugin .rad10{
763
+ border-radius: 10px;
764
+ -moz-border-radius: 10px;
765
+ -khtml-border-radius: 10px;
766
+ -webkit-border-radius: 10px;
767
+ }
768
+ .wpallexport-plugin .rad14{
769
+ border-radius: 14px;
770
+ -moz-border-radius: 14px;
771
+ -khtml-border-radius: 14px;
772
+ -webkit-border-radius: 14px;
773
+ }
774
+ .wpallexport-plugin .pl17{ padding-left: 17px; }
775
+ .wpallexport-plugin .no-margin{ margin: 0px; }
776
+ .wpallexport-plugin .hidden{ display: none; }
777
+ .wpallexport-plugin .fs11 { font-size: 11px; }
778
+ .wpallexport-plugin .rel { position: relative; }
779
+ .wpallexport-plugin .txt_center{ text-align: center; }
780
+ .wpallexport-plugin .wpallexport-clear{
781
+ display: block;
782
+ clear: both;
783
  }
784
+ .wpallexport-plugin .ui-autocomplete{
785
+ max-height: 450px;
786
+ overflow: auto;
787
+ z-index: 999999;
788
  }
789
+ .wpallexport-plugin .wp-all-export-edit-column-buttons{
790
+ background: none repeat scroll 0 0 #f7f8f8;
791
+ border-top: 1px solid #ebebeb;
792
+ padding: 15px;
793
+ position: relative;
794
+ height: 38px;
795
  }
796
+ .wpallexport-plugin .wp-all-export-field-options{
797
+ padding: 10px;
798
  }
799
+ .wpallexport-plugin .wp-all-export-advanced-field-options{
800
+ display: block;
801
+ padding: 10px 0;
802
+ width: 100px;
803
  }
804
+ .wpallexport-plugin .wp-all-export-advanced-field-options-content{
805
+ display: none;
806
+ }
807
+ /*--------------------------------------------------------------------------
808
+ *
809
+ * Fixes & Other Stuff
810
+ *
811
+ *-------------------------------------------------------------------------*/
812
 
813
  /*@+ fixes */
814
+ .wpallexport-plugin input[type="file"] {
815
  padding: 0; /* FIX height or <input type="file" /> for Safari & Chrome */
816
  }
817
+ .wpallexport-plugin .ui-widget-overlay {
818
  position: fixed !important; /* FIX: modal dialog overlay in IE 8 */
819
+ background-color: #777 !important; /* FIX: overlay color */
820
  }
821
+ .wpallexport-plugin .ui-dialog {
822
  position: absolute !important; /* FIX: for wordpress 3.1 not to add empty space */
823
  z-index: 999999;
824
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
825
  /*@*/
826
 
827
+ /*@+ other stuff */
828
+ .wpallexport-plugin fieldset{
829
+ padding: 20px;
830
+ width:auto;
 
 
 
 
 
 
 
831
  }
832
+ .wpallexport-plugin .right fieldset{
833
+ padding: 15px;
 
 
 
834
  }
835
+ .wpallexport-plugin .right fieldset input{
836
+ max-width:none;
837
+ padding:6px;
838
+ margin:0px
839
+ }
840
+ .wpallexport-plugin .right a{
841
+ text-decoration: underline;
842
+ }
843
+ .wpallexport-plugin fieldset legend{
844
+ padding: 0px 5px;
845
+ font-weight: bold;
846
  }
847
+ .wpallexport-plugin .options fieldset legend{
848
+ font-size: 1.17em;
 
 
 
 
849
  }
850
+ .wpallexport-plugin .matches_count{
851
+ font-weight: bold;
852
+ color:#33AA28;
 
 
 
853
  }
854
+ .wpallexport-plugin input.small{
855
+ width:50px !important;
856
+ /*height: 30px !important;*/
857
+ text-align: center;
 
 
858
  }
859
+ .wpallexport-plugin .ui-state-default a{
860
+ font-size: 13px !important;
 
 
 
 
 
 
 
 
 
 
861
  }
862
+ .wpallexport-plugin #wp-content-media-buttons{
 
 
 
 
 
863
  display: none;
864
  }
865
+ .wpallexport-plugin .ui-tabs-hide{
866
+ display: none !important;
867
  }
868
+ .wpallexport-plugin .button-primary:hover{
869
+ font-weight: normal;
870
+ }
871
+ .wpallexport-plugin .hndle{
872
+ padding: 7px;
873
+ margin-bottom: 0px;
874
+ cursor: default !important;
875
+ }
876
+ .wpallexport-plugin .inside{
877
+ margin: 0;
878
+ line-height: 20px;
879
+ }
880
+ .wpallexport-plugin .inside input[type="text"]{
881
+ background: #fff;
882
+ }
883
+ /*@*/
884
+ .wpallexport-plugin .wpallexport-created-by{
885
+ color: #888;
886
+ display: block;
887
+ line-height: 31px;
888
+ margin: 0 auto;
889
+ opacity: 0.7;
890
+ overflow: hidden;
891
+ text-decoration: none;
892
+ vertical-align: inherit;
893
+ width: 139px;
894
+ margin-top: 20px;
895
+ font-size: 12px;
896
+ }
897
+ .wpallexport-plugin .wpallexport-created-by span{
898
+ background: url('../img/soflyy-logo.png') no-repeat;
899
+ display: block;
900
+ float: right;
901
+ width: 72px;
902
+ height: 32px;
903
+ }
904
+ .wpallexport-plugin .wpallexport-created-by:hover{
905
+ opacity: 1.0;
906
+ }
907
+ .wpallexport-plugin .wpallexport-preload-image{
908
+ display: none;
909
+ }
910
+ .wpallexport-plugin .wpallexport-cdata{
911
+ color: green;
912
+ font-weight: bold;
913
+ display: block;
914
+ clear: both;
915
+ }
916
+ .wpallexport-plugin .wpallexport-expired{
917
+ font-weight: bold;
918
+ font-size: 14px;
919
+ }
920
+
921
+ /*--------------------------------------------------------------------------
922
+ *
923
+ * WP All Export Layout
924
+ *
925
+ *-------------------------------------------------------------------------*/
926
+
927
+ /* 2 column wpallexport-layout */
928
+ .wpallexport-plugin table.wpallexport-layout {
929
+ clear: both;
930
+ border-collapse: collapse;
931
+ min-width: 770px;
932
+ }
933
+
934
+ .wpallexport-plugin .wpallexport-step-3 table.wpallexport-layout,
935
+ .wpallexport-plugin .wpallexport-step-4 table.wpallexport-layout{
936
+ width: 100%;
937
+ }
938
+
939
+ .wpallexport-plugin table.wpallexport-layout.wpallexport-step-1,
940
+ .wpallexport-plugin .wpallexport-step-2,
941
+ .wpallexport-plugin .wpallexport-step-3,
942
+ .wpallexport-plugin .wpallexport-step-4,
943
+ .wpallexport-plugin .wpallexport-step-5,
944
+ .wpallexport-plugin .wpallexport-step-6{
945
+ margin: 20px 0 0 0px;
946
+ }
947
+ .wpallexport-plugin table.wpallexport-layout td {
948
+ vertical-align: top;
949
+ border: none;
950
+ font-size: 12px !important;
951
+ }
952
+ .wpallexport-plugin table.wpallexport-layout td.left {
953
+ /*min-width: 490px;*/
954
+ width: 61%;
955
+ }
956
+ .wpallexport-plugin table.wpallexport-layout td.right {
957
+ padding: 10px 0 16px 20px;
958
+ width: 22%;
959
+ min-width: 260px;
960
+ position: relative;
961
+ }
962
+ .wpallexport-plugin table.wpallexport-layout td.left > h2:first-child {
963
+ margin-top: -22px;
964
+ padding: 14px 0 3px 0;
965
+ }
966
+ .wpallexport-plugin table.wpallexport-layout td.left hr {
967
+ clear: both;
968
+ }
969
+ .wpallexport-plugin.no-js table.wpallexport-layout td.left > h2:first-child {
970
+ margin-top: 0px;
971
+ }
972
+ .wpallexport-plugin table.wpallexport-layout div.left {
973
+ min-width: 490px;
974
+ width: 70%;
975
+ float: left;
976
+ }
977
+ .wpallexport-plugin table.wpallexport-layout div.right {
978
+ padding: 0px 0 16px 20px;
979
+ width: 25%;
980
+ /*min-width: 260px; */
981
+ position: relative;
982
+ float: right;
983
+ }
984
+ /*@*/
985
+
986
+ .wpallexport-plugin table.wpallexport-layout.wpallexport-step-1 tr td.left{
987
+ width: 100%;
988
+ }
989
+ .wpallexport-plugin form.options table.wpallexport-layout td.right{
990
+ width: 25%;
991
+ }
992
+
993
+ .wpallexport-plugin .wpallexport-content-section{
994
+ background: #fff;
995
+ border: 1px solid #ddd;
996
+ border-radius: 4px;
997
+ -moz-border-radius: 4px;
998
+ -khtml-border-radius: 4px;
999
+ -webkit-border-radius: 4px;
1000
+ margin-top: 20px;
1001
+ margin-bottom: 20px;
1002
+ padding-bottom: 15px;
1003
+ }
1004
+
1005
+ .wpallexport-plugin table.form-table {
1006
+ clear: none;
1007
+ margin-top: 0px;
1008
+ }
1009
+ .wpallexport-plugin table.form-table.custom-params {
1010
+ max-width: 700px;
1011
+ }
1012
+ .wpallexport-plugin table.form-table td,
1013
+ .wpallexport-plugin table.form-table th {
1014
+ vertical-align: top;
1015
+ }
1016
+ .wpallexport-plugin table.form-table thead td {
1017
+ font-weight: bold;
1018
+ }
1019
+ .wpallexport-plugin table.form-table.custom-params input {
1020
+ margin-left: 0;
1021
+ }
1022
+ .wpallexport-plugin table.form-table tr.template,
1023
+ .wpallexport-plugin table.form-table ol li.template,
1024
+ .wpallexport-plugin table.form-table ul li.template,
1025
+ .wpallexport-plugin table.cf-form-table tr.template,
1026
+ .wpallexport-plugin table.tax-form-table tr.template {
1027
+ display: none;
1028
+ }
1029
+
1030
+ .wpallexport-plugin .form-table td{
1031
+ padding: 0px;
1032
+ line-height: inherit !important;
1033
+ }
1034
+ .wpallexport-plugin form.settings .form-table td{
1035
+ padding: 15px 10px;
1036
+ }
1037
+ .wpallexport-plugin .form-table td label,
1038
+ .wpallexport-plugin .form-table td li,
1039
+ .wpallexport-plugin .form-table td p{
1040
+ line-height: 1.4em;
1041
+ }
1042
+ .wpallexport-plugin .form-table td label{
1043
+ display: inline-block;
1044
+ margin: 0.25em 0 0.5em !important;
1045
+ }
1046
+
1047
+ .wpallexport-plugin div.input label,
1048
+ .wpallexport-plugin .form-field{
1049
+ font-size: 12px !important;
1050
+ }
1051
+ .wpallexport-plugin input[type="radio"]{
1052
+ margin-left: 4px;
1053
+ }
1054
+
1055
+ .wpallexport-plugin .wpallexport-wrapper{
1056
+ width: 1200px;
1057
+ }
1058
+
1059
+ /*--------------------------------------------------------------------------
1060
+ *
1061
+ * Step 1 - choose file
1062
+ *
1063
+ *-------------------------------------------------------------------------*/
1064
+
1065
+ /*@+ Choose File forms */
1066
+ .wpallexport-plugin form.wpallexport-choose-file {
1067
+ margin-top: 15px;
1068
+ position: relative;
1069
+ }
1070
+ .wpallexport-plugin form.wpallexport-choose-file h3 {
1071
+ margin-bottom: 5px;
1072
+ }
1073
+ .wpallexport-plugin form.wpallexport-choose-file .label {
1074
+ font-size: 15px;
1075
+ }
1076
+ .wpallexport-plugin form.wpallexport-choose-file input[type="text"],
1077
+ .wpallexport-plugin form.wpallexport-choose-file input[type="password"] {
1078
+ width: 80px;
1079
+ font-size: 12px;
1080
+ }
1081
+ .wpallexport-plugin form.wpallexport-choose-file input.regular-text,
1082
+ .wpallexport-plugin form.wpallexport-choose-file select.regular-text {
1083
+ width: 100%;
1084
+ }
1085
+ .wpallexport-plugin #wpcontent form.wpallexport-choose-file select[name="file"],
1086
+ .wpallexport-plugin #wpcontent form.wpallexport-choose-file select[name="reimport"] {
1087
+ font-size: 12px;
1088
+ }
1089
+ .wpallexport-plugin form.wpallexport-choose-file input[type="submit"].button {
1090
+ /*width: 150px;*/
1091
+ }
1092
+ .wpallexport-plugin form.wpallexport-choose-file div.input {
1093
+ margin-top: 20px;
1094
+ }
1095
+ .wpallexport-plugin form.wpallexport-choose-file .wpallexport-submit-buttons{
1096
+ clear: both;
1097
+ text-align: center;
1098
+ display: none;
1099
+ }
1100
+ /*@*/
1101
+
1102
+ .wpallexport-plugin #select-files{
1103
+ height:35px;
1104
+ line-height: 35px;
1105
+ font-size: 18px;
1106
+ margin-top: 30px;
1107
+ display: inline-block;
1108
+ position: relative;
1109
+ z-index: 0;
1110
+ text-decoration: none;
1111
+ color: #888;
1112
+ background: url('../img/ui_4.0/select_files.png') no-repeat 0 2px;
1113
+ padding-left: 45px;
1114
+ }
1115
+ .wpallexport-plugin .wpallexport-progress{
1116
+ position: relative;
1117
+ display: none;
1118
+ color: #009039;
1119
+ font-size: 13px;
1120
+ font-weight: bold;
1121
+ margin-top: 10px;
1122
+ width: 100%;
1123
+ text-align: center;
1124
+ /*border:1px solid #4297D7;*/
1125
+ -moz-border-radius: 8px;
1126
+ -khtml-border-radius: 8px;
1127
+ -webkit-border-radius: 8px;
1128
+ border-radius: 8px;
1129
+ }
1130
+ .wpallexport-plugin #progressbar{
1131
+ border: medium none;
1132
+ text-align: center;
1133
+ width: 100%;
1134
+ font-size: 20px;
1135
+ color:#000;
1136
+ line-height: 35px;
1137
+ margin: 20px 0;
1138
+ }
1139
+ .wpallexport-plugin #progressbar span{ color:#777; }
1140
+
1141
+ .wpallexport-plugin #file_name{
1142
+ font-size: 16px;
1143
+ font-weight: bold;
1144
+ margin-left: 10px;
1145
+ float: right;
1146
+ }
1147
+
1148
+
1149
+ .wpallexport-plugin .wpallexport-import-types{
1150
+ margin: 37px 0 10px;
1151
+ text-align: center;
1152
+ }
1153
+ .wpallexport-plugin .wpallexport-import-types h2,
1154
+ .wpallexport-plugin .wpallexport-import-types h3{
1155
+ color:#40ad6e;
1156
+ font-size: 24px;
1157
+ margin-bottom: 25px;
1158
+ font-weight: normal;
1159
+ }
1160
+ .wpallexport-plugin .wpallexport-upload-type-container {
1161
+ display: none;
1162
+ text-align: center;
1163
+ padding: 0 55px;
1164
+ }
1165
+ .wpallexport-plugin a.wpallexport-import-from{
1166
+ color:#888;
1167
+ background: #f6f5f1;
1168
+ border: 1px solid #ddd;
1169
+ border-radius: 4px;
1170
+ -moz-border-radius: 4px;
1171
+ -khtml-border-radius: 4px;
1172
+ -webkit-border-radius: 4px;
1173
+ font-size: 20px;
1174
+ display: inline-block;
1175
+ height: 65px;
1176
+ width: 292px;
1177
+ text-decoration: none;
1178
+ margin: 5px;
1179
+ vertical-align: top;
1180
+ padding-top: 10px;
1181
+ }
1182
+ .wpallexport-plugin a.wpallexport-import-from.bind{
1183
+ color: #888;
1184
+ border-color: #cfceca;
1185
+ }
1186
+ .wpallexport-plugin a.wpallexport-import-from.selected{
1187
+ color:#fff;
1188
+ background: #46ba69;
1189
+ border: 1px solid #3da55c;
1190
+ }
1191
+ .wpallexport-plugin a.wpallexport-import-from span{
1192
+ display: inline-block;
1193
+ position: relative;
1194
+ }
1195
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-upload-type{
1196
+ padding-top: 15px;
1197
+ height: 60px;
1198
+ }
1199
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-upload-type span.wpallexport-icon{
1200
+ background: url('../img/ui_4.0/upload_sprite.png') 0 -30px no-repeat;
1201
+ width: 40px;
1202
+ height: 30px;
1203
+ top: 6px;
1204
+ left: -10px;
1205
+ }
1206
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-upload-type.selected span.wpallexport-icon{
1207
+ background: url('../img/ui_4.0/upload_sprite.png') 0 0 no-repeat;
1208
+ width: 40px;
1209
+ height: 30px;
1210
+ top: 6px;
1211
+ left: -10px;
1212
+ }
1213
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-url-type span.wpallexport-icon:before{
1214
+ content: "\f109";
1215
+ font-family: "dashicons";
1216
+ font-size: 33px;
1217
+ left: 23%;
1218
+ line-height: 10px;
1219
+ position: absolute;
1220
+ top: 12px;
1221
+ }
1222
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-url-type span.wpallexport-icon{
1223
+ width: 40px;
1224
+ height: 34px;
1225
+ top:10px;
1226
+ left: -10px;
1227
+ }
1228
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-url-type.selected span.wpallexport-icon{
1229
+ width: 40px;
1230
+ height: 34px;
1231
+ top:10px;
1232
+ left: -10px;
1233
+ }
1234
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-file-type span.wpallexport-icon:before{
1235
+ content: "\f107";
1236
+ font-family: "dashicons";
1237
+ font-size: 33px;
1238
+ left: 23%;
1239
+ line-height: 10px;
1240
+ position: absolute;
1241
+ top: 12px;
1242
+ }
1243
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-file-type span.wpallexport-icon{
1244
+ width: 32px;
1245
+ height: 34px;
1246
+ top:10px;
1247
+ left: -10px;
1248
+ }
1249
+ .wpallexport-plugin a.wpallexport-import-from.wpallexport-file-type.selected span.wpallexport-icon{
1250
+ width: 32px;
1251
+ height: 34px;
1252
+ top:10px;
1253
+ left: -10px;
1254
+ }
1255
+
1256
+ .wpallexport-plugin .wpallexport-upload-resource-step-one,
1257
+ .wpallexport-plugin .wpallexport-file-upload-result{
1258
+ background: #fff;
1259
+ border-top: 1px solid #ddd;
1260
+ border-right: 1px solid #ddd;
1261
+ border-left: 1px solid #ddd;
1262
+ border-bottom: 1px solid #ddd;
1263
+ /*margin-bottom: 20px;*/
1264
+ padding: 20px;
1265
+ padding-top: 0;
1266
+ }
1267
+ .wpallexport-plugin .wpallexport-choose-post-type{
1268
+ background: #fff;
1269
+ /*border-bottom: 1px solid #ddd;
1270
+ border-right: 1px solid #ddd;
1271
+ border-left: 1px solid #ddd;
1272
+ padding: 20px;
1273
+ padding-top: 0;
1274
+ -moz-border-radius-bottomright: 4px;
1275
+ -webkit-border-bottom-right-radius: 4px;
1276
+ border-bottom-right-radius: 4px;
1277
+ -moz-border-radius-bottomleft: 4px;
1278
+ -webkit-border-bottom-left-radius: 4px;
1279
+ border-bottom-left-radius: 4px;*/
1280
+ }
1281
+ /*.wpallexport-plugin .wpallexport-upload-resource-step-one,
1282
+ .wpallexport-plugin .wpallexport-upload-resource-step-two{
1283
+ border-top-left-radius: 4px;
1284
+ border-top-right-radius: 4px;
1285
+ border-bottom-right-radius: 4px;
1286
+ -moz-border-radius-topleft: 4px;
1287
+ -webkit-border-top-left-radius: 4px;
1288
+ -moz-border-radius-topright: 4px;
1289
+ -webkit-border-top-right-radius: 4px;
1290
+ -moz-border-radius-bottomleft: 4px;
1291
+ -webkit-border-bottom-left-radius: 4px;
1292
+ }*/
1293
+ .wpallexport-plugin .wpallexport-choose-post-type{ padding-top: 40px; }
1294
+ .wpallexport-plugin .wpallexport-file-upload-result{ padding-top: 30px; overflow: hidden; }
1295
+ .wpallexport-plugin .wpallexport-upload-resource-step-one{ padding-bottom: 40px; }
1296
+ .wpallexport-plugin .wpallexport-upload-resource-step-two{
1297
+ display: none;
1298
+ }
1299
+ .wpallexport-plugin .wpallexport-upload-resource-step-two h2{
1300
+ text-align: center;
1301
+ color: #4db278;
1302
+ padding: 0;
1303
+ margin: 20px 0;
1304
+ }
1305
+ .wpallexport-plugin .dd-select{
1306
+ border: 1px solid #ddd;
1307
+ }
1308
+ .wpallexport-plugin #custom_type_selector,
1309
+ .wpallexport-plugin #file_selector,
1310
+ .wpallexport-plugin #wp_query_selector{
1311
+ margin: 0 auto;
1312
+ margin-bottom: 20px;
1313
+ text-align: left;
1314
+ }
1315
+ .wpallexport-plugin .wpallexport-change-custom-type #custom_type_selector{
1316
+ margin: 0;
1317
+ }
1318
+ .wpallexport-plugin .wpallexport-change-custom-type #custom_type_selector .dd-option{
1319
+ padding: 10px 0 0 10px;
1320
+ }
1321
+ .wpallexport-plugin .wpallexport-change-custom-type #custom_type_selector .dd-select{
1322
+ padding: 5px 0 0;
1323
+ }
1324
+ .wpallexport-plugin #file_selector{
1325
+ margin-top: 30px;
1326
+ }
1327
+ .wpallexport-plugin #custom_type_selector .dd-options li,
1328
+ .wpallexport-plugin #file_selector .dd-options li,
1329
+ .wpallexport-plugin #wp_query_selector .dd-options li{
1330
+ margin-bottom: 0;
1331
+ }
1332
+ .wpallexport-plugin #custom_type_selector .dd-options li .dd-option,
1333
+ .wpallexport-plugin #file_selector .dd-options li .dd-option,
1334
+ .wpallexport-plugin #wp_query_selector .dd-options li .dd-option{
1335
+ font-size: 18px;
1336
+ color: #555;
1337
+ border: none;
1338
+ }
1339
+ /*.wpallexport-plugin #file_selector .dd-options li .dd-option{
1340
+ font-size: 18px;
1341
+ color: #ccc;
1342
+ border: none;
1343
+ }*/
1344
+ .wpallexport-plugin #custom_type_selector .dd-options li .dd-option:hover,
1345
+ .wpallexport-plugin #custom_type_selector .dd-options li .dd-option-selected,
1346
+ .wpallexport-plugin #file_selector .dd-options li .dd-option:hover,
1347
+ .wpallexport-plugin #file_selector .dd-options li .dd-option-selected,
1348
+ .wpallexport-plugin #wp_query_selector .dd-options li .dd-option:hover,
1349
+ .wpallexport-plugin #wp_query_selector .dd-options li .dd-option-selected{
1350
+ background: #eee;
1351
+ color: #555;
1352
+ }
1353
+ /*.wpallexport-plugin #file_selector .dd-options li .dd-option:hover,
1354
+ .wpallexport-plugin #file_selector .dd-options li .dd-option-selected{
1355
+ background: #40acad;
1356
+ color: #fff;
1357
+ }*/
1358
+ .wpallexport-plugin #custom_type_selector .dd-select,
1359
+ .wpallexport-plugin #file_selector .dd-select,
1360
+ .wpallexport-plugin #wp_query_selector .dd-select{
1361
+ background: #fff !important;
1362
+ padding: 10px 0;
1363
+ /*margin-left: -5px;*/
1364
+ }
1365
+ .wpallexport-plugin #custom_type_selector .dd-selected,
1366
+ .wpallexport-plugin #file_selector .dd-selected,
1367
+ .wpallexport-plugin #wp_query_selector .dd-selected{
1368
+ color: #000;
1369
+ font-weight: normal;
1370
+ font-size: 18px;
1371
+ padding: 0;
1372
+ padding: 0 10px;
1373
+ line-height: 24px;
1374
+ }
1375
+ .wpallexport-plugin .change_file #file_selector .dd-select,
1376
+ .wpallexport-plugin .change_file #wp_query_selector .dd-select{
1377
+ padding: 5px 0 0;
1378
+ }
1379
+ .wpallexport-plugin .change_file #file_selector .dd-options .dd-option,
1380
+ .wpallexport-plugin .change_file #wp_query_selector .dd-options .dd-option{
1381
+ padding: 0 10px;
1382
+ }
1383
+ .wpallexport-plugin .dd-options{
1384
+ /*left: -5px;*/
1385
+ }
1386
+ .wpallexport-plugin #file_selector .dd-selected .dd-selected-image{
1387
+ margin-left: 10px;
1388
+ }
1389
+ .wpallexport-plugin #file_selector .dd-options .dd-option .dd-option-text{
1390
+ position: relative;
1391
+ top: -2px;
1392
+ }
1393
+ .wpallexport-plugin .wpallexport-import-to{
1394
+ background: none repeat scroll 0 0 #f6f5f1;
1395
+ border: 1px solid #ddd;
1396
+ color: #888;
1397
+ display: inline-block;
1398
+ font-size: 18px;
1399
+ height: 50px;
1400
+ line-height: 24px;
1401
+ padding-top: 25px;
1402
+ text-align: center;
1403
+ text-decoration: none;
1404
+ width: 360px;
1405
+ margin-right: 10px;
1406
+ position: relative;
1407
+ }
1408
+ .wpallexport-plugin .wpallexport-import-to span.wpallexport-import-to-arrow{
1409
+ display: none;
1410
+ }
1411
+ .wpallexport-plugin .wpallexport-import-to.wpallexport-import-to-checked span.wpallexport-import-to-arrow{
1412
+ background: url('../img/ui_4.0/bottom_arrow.png') no-repeat;
1413
+ position: absolute;
1414
+ bottom: -12px;
1415
+ left: 48%;
1416
+ display: block;
1417
+ height: 14px;
1418
+ width: 24px;
1419
+ }
1420
+ .wpallexport-plugin .wpallexport-import-to.wpallexport-import-to-checked{
1421
+ background: #38A659;
1422
+ border: 1px solid #3da55c;
1423
+ color: #fff;
1424
+ }
1425
+ .wpallexport-plugin .wpallexport-import-to.wpallexport-to-new-items span.wpallexport-import-to-title:before{
1426
+ content: "\f464";
1427
+ /*display: inline-block;*/
1428
+ font-family: "dashicons";
1429
+ font-size: 33px;
1430
+ left: 27%;
1431
+ line-height: 10px;
1432
+ position: absolute;
1433
+ top: 33px;
1434
+ }
1435
+ .wpallexport-plugin .wpallexport-import-to.wpallexport-to-new-items.wpallexport-import-to-checked span.wpallexport-import-to-title:before,
1436
+ .wpallexport-plugin .wpallexport-import-to.wpallexport-to-existing-items.wpallexport-import-to-checked span.wpallexport-import-to-title:before{
1437
+ color: #a3ddb4;
1438
+ }
1439
+ .wpallexport-plugin .wpallexport-import-to.wpallexport-to-existing-items span.wpallexport-import-to-title:before{
1440
+ content: "\f321";
1441
+ /*display: inline-block;*/
1442
+ font-family: "dashicons";
1443
+ font-size: 33px;
1444
+ left: 23%;
1445
+ line-height: 10px;
1446
+ position: absolute;
1447
+ top: 33px;
1448
+ }
1449
+ .wpallexport-plugin #file_selector .dd-option .dashicon:before,
1450
+ .wpallexport-plugin #file_selector .dd-selected .dashicon:before {
1451
+ font-size: 24px;
1452
+ float: left;
1453
+ margin: 2px 5px 2px 2px;
1454
+ }
1455
+ .wpallexport-plugin #file_selector .dd-option .dashicon-post:before,
1456
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-post:before{
1457
+ font-family: "dashicons";
1458
+ content: "\f109";
1459
+ color: #555;
1460
+ }
1461
+ .wpallexport-plugin #file_selector .dd-option .dashicon-page:before,
1462
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-page:before{
1463
+ font-family: "dashicons";
1464
+ content: "\f105";
1465
+ color: #555;
1466
+ }
1467
+ .wpallexport-plugin #file_selector .dd-option .dashicon-product:before,
1468
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-product:before{
1469
+ font-family: "dashicons";
1470
+ content: "\f174";
1471
+ color: #555;
1472
+ margin-top: 0;
1473
+ }
1474
+ .wpallexport-plugin #file_selector .dd-option .dashicon-cpt:before,
1475
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-cpt:before{
1476
+ font-family: "dashicons";
1477
+ content: "\f333";
1478
+ color: #555;
1479
+ }
1480
+ .wpallexport-plugin #file_selector .dd-option .dashicon-import_users:before,
1481
+ .wpallexport-plugin #file_selector .dd-selected .dashicon-import_users:before{
1482
+ font-family: "dashicons";
1483
+ content: "\f110";
1484
+ color: #555;
1485
+ }
1486
+ .wpallexport-plugin #file_selector .dd-option:hover .dashicon:before,
1487
+ .wpallexport-plugin #file_selector .dd-option-selected .dashicon:before{
1488
+ color: #555;
1489
+ }
1490
+ .wpallexport-plugin #file_selector .dd-selected .dashicon:before{
1491
+ color:#46ba69;
1492
+ line-height: 24px;
1493
+ }
1494
+ .wpallexport-plugin input[name=url]{
1495
+ font-size: 18px !important;
1496
+ height: 49px;
1497
+ margin-top: 20px;
1498
+ padding: 5px;
1499
+ width: 75% !important;
1500
+ /*background: url('../img/ui_4.0/url.png') 10px -42px no-repeat;*/
1501
+ padding-left: 60px;
1502
+ border: 1px solid #ddd;
1503
+ border-radius: 4px;
1504
+ -moz-border-radius: 4px;
1505
+ -khtml-border-radius: 4px;
1506
+ -webkit-border-radius: 4px;
1507
+ color: #cfceca;
1508
+ margin-bottom: 0;
1509
+ }
1510
+ .wpallexport-plugin .wpallexport-url-icon:before{
1511
+ color: #cfceca;
1512
+ content: "\f103";
1513
+ font-family: "dashicons";
1514
+ font-size: 30px;
1515
+ left: 45px;
1516
+ position: relative;
1517
+ top: -14px;
1518
+ vertical-align: bottom;
1519
+ }
1520
+ .wpallexport-plugin .wpallexport-url-icon.focus:before{
1521
+ color: #333;
1522
+ }
1523
+ .wpallexport-plugin input[name=url].focus{
1524
+ background-position: 10px 8px;
1525
+ color:#333;
1526
+ font-size: 11px !important;
1527
+ }
1528
+ .wpallexport-plugin #plupload-ui h3{
1529
+ float: left;
1530
+ font-size: 13px;
1531
+ font-weight: normal;
1532
+ margin-bottom: 0;
1533
+ margin-top: 8px;
1534
+ }
1535
+ .wpallexport-plugin .wpallexport-reimported-notify{
1536
+ border: 1px solid #AFAFAF;
1537
+ margin-bottom: 20px;
1538
+ padding: 10px 20px;
1539
+ }
1540
+ .wpallexport-plugin .wpallexport-reimported-notify p span{
1541
+ color: #ccc;
1542
+ }
1543
+ .wpallexport-plugin .wpallexport-choose-data-type{
1544
+ text-align: center;
1545
+ margin-bottom: 30px;
1546
+ }
1547
+ .wpallexport-plugin #wpallexport-url-upload-status{
1548
+ margin: 10px;
1549
+ }
1550
+ .wpallexport-plugin .wpallexport-uploaded-file-name{
1551
+ color: #333;
1552
+ }
1553
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="new"]{
1554
+ margin-left: -13%;
1555
+ }
1556
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
1557
+ margin-left: -12%;
1558
+ }
1559
+ .wpallexport-plugin .wpallexport-extra-text-left{
1560
+ float: left;
1561
+ text-align: right;
1562
+ width: 37%;
1563
+ }
1564
+ .wpallexport-plugin .wpallexport-extra-text-right{
1565
+ float: right;
1566
+ text-align: left;
1567
+ width: 38%;
1568
+ }
1569
+ .wpallexport-plugin .wpallexport-new-records,
1570
+ .wpallexport-plugin .wpallexport-existing-records{
1571
+ display: none;
1572
+ color: #777;
1573
+ font-size: 18px;
1574
+ line-height: 50px;
1575
+ }
1576
+ .wpallexport-plugin .wpallexport-extra-text-below{
1577
+ max-width: 565px;
1578
+ margin: 0 auto;
1579
+ }
1580
+ .wpallexport-plugin .chosen-container-single .chosen-single{
1581
+ background: none;
1582
+ box-shadow: none;
1583
+ color: #555 !important;
1584
+ border: 1px solid #ddd;
1585
+ }
1586
+ .wpallexport-plugin .chosen-container-active.chosen-with-drop .chosen-single{
1587
+ background: none;
1588
+ }
1589
+ .wpallexport-plugin .wp_all_export_product_matching_mode{
1590
+ margin-left: 10px;
1591
+ }
1592
+ /*--------------------------------------------------------------------------
1593
+ *
1594
+ * Step 2 - XPath filtering
1595
+ *
1596
+ *-------------------------------------------------------------------------*/
1597
+
1598
+ .wpallexport-plugin .wpallexport-console{
1599
+ position:relative;
1600
+ padding:0;
1601
+ display:none;
1602
+ }
1603
+ .wpallexport-plugin .action_buttons{
1604
+ overflow: hidden;
1605
+ clear: both;
1606
+ padding: 10px;
1607
+ border-bottom: 1px solid #ddd;
1608
+ }
1609
+ .wpallexport-plugin .action_buttons .wpallexport-go-to{
1610
+ display: block;
1611
+ height: 21px;
1612
+ margin-top: 25px;
1613
+ text-decoration: none;
1614
+ width: 13px;
1615
+ }
1616
+ .wpallexport-plugin .action_buttons #prev_element{
1617
+ background: url('../img/ui_4.0/left_btn.png') no-repeat;
1618
+ margin-left: 15px;
1619
+ float: left;
1620
+ }
1621
+ .wpallexport-plugin .action_buttons #next_element{
1622
+ background: url('../img/ui_4.0/right_btn.png') no-repeat;
1623
+ margin-right: 15px;
1624
+ float: right;
1625
+ }
1626
+ .wpallexport-plugin .action_buttons .wpallexport-root-element{
1627
+ color: #46ba69;
1628
+ font-weight: bold;
1629
+ margin-top: 0;
1630
+ }
1631
+ .wpallexport-plugin #wp_all_export_value{
1632
+ display: inline-block;
1633
+ height: 28px;
1634
+ margin: 0;
1635
+ padding: 3px;
1636
+ position: relative;
1637
+ top: 2px;
1638
+ width: 50px;
1639
+ }
1640
+ .wpallexport-plugin #wp_all_export_add_rule{
1641
+ background: url("../img/rule.png") no-repeat scroll 10px 10px #dcdcdc;
1642
+ border: 1px solid #dcdcdc;
1643
+ border-radius: 5px;
1644
+ -moz-border-radius: 5px;
1645
+ -khtml-border-radius: 5px;
1646
+ -webkit-border-radius: 5px;
1647
+ color: #fff;
1648
+ display: inline-block;
1649
+ font-size: 14px;
1650
+ height: 18px;
1651
+ margin: 0;
1652
+ float: right;
1653
+ padding: 12px 40px 10px 50px;
1654
+ text-decoration: none;
1655
+ font-weight: bold;
1656
+ min-width: 60px;
1657
+ }
1658
+ .wpallexport-plugin #wp_all_export_apply_filters{
1659
+ background: url("../img/rule.png") no-repeat scroll 10px 10px #40acad;
1660
+ border: 1px solid #3a9c9d;
1661
+ border-radius: 5px;
1662
+ -moz-border-radius: 5px;
1663
+ -khtml-border-radius: 5px;
1664
+ -webkit-border-radius: 5px;
1665
+ color: #fff;
1666
+ display: inline-block;
1667
+ font-size: 14px;
1668
+ height: 21px;
1669
+ margin: 0;
1670
+ float: right;
1671
+ padding: 13px 40px 10px 50px;
1672
+ text-decoration: none;
1673
+ font-weight: bold;
1674
+ }
1675
+ .wpallexport-plugin #wp_all_export_apply_filters{
1676
+ float: right;
1677
+ margin-top: 35px;
1678
+ }
1679
+ .wpallexport-plugin .wp_all_export_rule_inputs .chosen-container-single input[type="text"]{
1680
+ width: 100% !important;
1681
+ }
1682
+ .wpallexport-plugin .wp_all_export_rule_inputs .chosen-container-single .chosen-single{
1683
+ height: 41px;
1684
+ line-height: 38px;
1685
+ font-size: 14px;
1686
+ }
1687
+ .wpallexport-plugin .wp_all_export_rule_inputs .chosen-container-single .chosen-single div{
1688
+ top: 9px;
1689
+ }
1690
+
1691
+ .wpallexport-plugin #wp_all_export_value{
1692
+ font-size: 16px;
1693
+ height: 42px;
1694
+ padding: 10px;
1695
+ border: 1px solid #ddd;
1696
+ border-radius: 5px;
1697
+ -moz-border-radius: 5px;
1698
+ -khtml-border-radius: 5px;
1699
+ -webkit-border-radius: 5px;
1700
+ color: #777;
1701
+ font-size: 15px !important;
1702
+ width: 100%;
1703
+ position: relative;
1704
+ top: 0;
1705
+ }
1706
+ .wpallexport-plugin #wp_all_export_filtering_rules{
1707
+ position: relative;
1708
+ padding: 0;
1709
+ }
1710
+ .wpallexport-plugin .wp_all_export_filtering_rules{
1711
+ margin: 0;
1712
+ }
1713
+ .wpallexport-plugin .wp_all_export_filtering_rules .drag-element{
1714
+ background: url('../img/list.png') no-repeat 0 3px;
1715
+ padding-left: 30px;
1716
+ height: 25px;
1717
+ }
1718
+ .wpallexport-plugin .wp_all_export_filtering_rules .drag-element .rule_element{
1719
+ display: inline-block;
1720
+ width: 30%;
1721
+ color:#46ba69;
1722
+ font-size: 14px;
1723
+ }
1724
+ .wpallexport-plugin .wp_all_export_filtering_rules .drag-element .rule_as_is{
1725
+ display: inline-block;
1726
+ width: 20%;
1727
+ color:#40acad;
1728
+ font-size: 14px;
1729
+ }
1730
+ .wpallexport-plugin .wp_all_export_filtering_rules .drag-element .rule_condition_value{
1731
+ display: inline-block;
1732
+ width: 20%;
1733
+ color:#000;
1734
+ font-size: 14px;
1735
+ }
1736
+ .wpallexport-plugin .wp_all_export_filtering_rules .drag-element .condition{
1737
+ display: inline-block;
1738
+ width: 25%;
1739
+ color: #000;
1740
+ font-size: 14px;
1741
+ }
1742
+ .wpallexport-plugin .wp_all_export_filtering_rules li{
1743
+ position: relative;
1744
+ padding: 10px 10px 10px 20px;
1745
+ margin: 5px;
1746
+ border: 1px solid #ddd;
1747
+ border-radius: 4px;
1748
+ -moz-border-radius: 4px;
1749
+ -khtml-border-radius: 4px;
1750
+ -webkit-border-radius: 4px;
1751
+ }
1752
+ .wpallexport-plugin .wp_all_export_filtering_rules li ol{
1753
+ margin-top: 10px;
1754
+ }
1755
+ .wpallexport-plugin .wp_all_export_filtering_rules li ol li{
1756
+ border: 1px dotted #ddd;
1757
+ }
1758
+ .wpallexport-plugin .wp_all_export_filtering_rules li .remove-ico{
1759
+ right: 4%;
1760
+ top:10px;
1761
+ }
1762
+ .wpallexport-plugin .wp_all_export_filtering_rules li .condition{
1763
+ padding: 2px;
1764
+ }
1765
+ .wpallexport-plugin .wp_all_export_filtering_rules li .condition label{
1766
+ margin: 0px 3px;
1767
+ }
1768
+ .wpallexport-plugin .wp_all_export_filtering_rules li strong{
1769
+ text-transform: uppercase;
1770
+ }
1771
+ .wpallexport-plugin .pmxi_group_rule{
1772
+ margin-left: -55px;
1773
+ }
1774
+ .wpallexport-plugin .wp_all_export_rule_inputs{
1775
+ /*float: left;*/
1776
+ }
1777
+ .wpallexport-plugin .wp_all_export_rule_inputs table{
1778
+ width: 100%;
1779
+ }
1780
+ .wpallexport-plugin .wp_all_export_rule_inputs table tr th{
1781
+ color: #000;
1782
+ font-weight: 16px;
1783
+ text-align: left;
1784
+ }
1785
+ .wpallexport-plugin .ajax-console .founded_records{
1786
+ background: url('../img/elements.png') no-repeat !important;
1787
+ padding-left: 80px;
1788
+ margin-bottom: 0;
1789
+ margin-left: 40px;
1790
+ margin-top: 25px;
1791
+ margin-bottom: 20px;
1792
+ position: relative;
1793
+ height: 63px;
1794
+ }
1795
+ .wpallexport-plugin .ajax-console .founded_records h3{
1796
+ color: #425f9a;
1797
+ margin-bottom: 0;
1798
+ margin-top: 3px;
1799
+ font-size: 22px;
1800
+ line-height: 28px;
1801
+ }
1802
+ .wpallexport-plugin .ajax-console .founded_records h4{
1803
+ color: #777;
1804
+ margin-top: 5px;
1805
+ font-size:20px;
1806
+ }
1807
+ .wpallexport-plugin .wpallexport-change-root-element{
1808
+ display: block;
1809
+ background: #f6f5f1;
1810
+ border: 1px solid #ecebe7;
1811
+ border-radius: 5px;
1812
+ -moz-border-radius: 5px;
1813
+ -khtml-border-radius: 5px;
1814
+ -webkit-border-radius: 5px;
1815
+ color: #777;
1816
+ font-size: 16px;
1817
+ text-decoration: none;
1818
+ margin: 5px 10px;
1819
+ padding: 10px;
1820
+ }
1821
+ .wpallexport-plugin .wpallexport-change-root-element:hover{
1822
+ color: #000;
1823
+ }
1824
+ .wpallexport-plugin .wpallexport-change-root-element.selected{
1825
+ background: #46ba69;
1826
+ border: 1px solid #3da55c;
1827
+ color: #fff;
1828
+ cursor: default;
1829
+ }
1830
+ .wpallexport-plugin .wpallexport-change-root-element .tag_name{
1831
+ display: inline-block;
1832
+ max-width: 87%;
1833
+ overflow: hidden;
1834
+ text-overflow: ellipsis;
1835
+ }
1836
+ .wpallexport-plugin .wpallexport-change-root-element .tag_count{
1837
+ float: right;
1838
+ background: url('../img/ui_4.0/element_arrow.png') no-repeat;
1839
+ display: inline-block;
1840
+ height: 15px;
1841
+ padding-left: 20px;
1842
+ position: relative;
1843
+ top: 2px;
1844
+ line-height: 15px;
1845
+ }
1846
+ .wpallexport-plugin .wpallexport-change-root-element.selected .tag_count{
1847
+ background: url('../img/ui_4.0/element_arrow.png') no-repeat 0px -15px;
1848
+ }
1849
+ .wpallexport-plugin .import_information{
1850
+ border-top: 1px solid #ddd;
1851
+ text-align: center;
1852
+ padding: 20px;
1853
+ }
1854
+ .wpallexport-plugin .import_information h3{
1855
+ text-align: center;
1856
+ color:#777;
1857
+ background: url('../img/ui_4.0/elements_notify.png') no-repeat;
1858
+ padding-left: 60px;
1859
+ height: 50px;
1860
+ display: inline-block;
1861
+ margin: 0 auto;
1862
+ line-height: 45px;
1863
+ }
1864
+ .wpallexport-plugin .import_information h3 span{
1865
+ color:#46ba69;
1866
+ }
1867
+ .wpallexport-plugin .wpallexport-set-csv-delimiter{
1868
+ padding-top: 5px;
1869
+ text-align: center;
1870
+ display: none;
1871
+ }
1872
+ .wpallexport-plugin #current_element{
1873
+ color:green;
1874
+ }
1875
+ .wpallexport-plugin #current_xml{ display: none;}
1876
+ .wpallexport-plugin #goto_element{
1877
+ font-size: 16px;
1878
+ height: 35px;
1879
+ margin-right: 10px;
1880
+ min-width: 50px;
1881
+ padding-top: 5px;
1882
+ text-align: center;
1883
+ width: 50px !important;
1884
+ }
1885
+ .wpallexport-plugin .wpallexport-choose-elements{
1886
+ /*width: 1200px;*/
1887
+ }
1888
+ .wpallexport-plugin .wpallexport-choose-elements table tbody tr td{
1889
+ overflow: hidden;
1890
+ }
1891
+ .wpallexport-plugin .wpallexport-elements-information{
1892
+ font-size: 20px;
1893
+ padding-top: 17px;
1894
+ margin-right: 10px;
1895
+ }
1896
+ /*--------------------------------------------------------------------------
1897
+ *
1898
+ * Step 3 - Template Builder
1899
+ *
1900
+ *-------------------------------------------------------------------------*/
1901
+
1902
+ /*@+ Template form */
1903
+ .wpallexport-plugin form.wpallexport-step-3 {
1904
+ /*width: 700px;*/
1905
+ position: fixed;
1906
+ width: 66.6%;
1907
+ margin-top: 0 !important;
1908
+ }
1909
+ .wpallexport-plugin form.wpallexport-template .load-template {
1910
+ display: block;
1911
+ font-size: 12px;
1912
+ }
1913
+
1914
+ .wpallexport-plugin form.wpallexport-step-3 .wpallexport-section .wpallexport-content-section{
1915
+ overflow: hidden;
1916
+ padding-bottom: 0;
1917
+ margin-top: 0;
1918
+ }
1919
+
1920
+ .wpallexport-plugin form.wpallexport-step-3 .wpallexport-section .wpallexport-content-section .wpallexport-collapsed-content{
1921
+ padding: 0;
1922
+ }
1923
+
1924
+ .wpallexport-plugin #poststuff{
1925
+ min-width: 200px;
1926
+ }
1927
+ .wpallexport-plugin #poststuff form.wpallexport-template h3 {
1928
+ margin: 1em 0 5px 2px;
1929
+ font-size: 1.17em;
1930
+ padding: 0px;
1931
+ }
1932
+ .wpallexport-plugin #post-preview {
1933
+ font-size: 12px;
1934
+ }
1935
+ .wpallexport-plugin #post-preview .error {
1936
+ margin: 5px 0;
1937
+ }
1938
+ .wpallexport-plugin h3 .header-option {
1939
+ display: block;
1940
+ float: right;
1941
+ font-size: 12px;
1942
+ font-weight: normal;
1943
+ }
1944
+ .wpallexport-plugin .builder_header{
1945
+ padding: 0 10px;
1946
+ width: 1200px;
1947
+ overflow: hidden;
1948
+ }
1949
+ .wpallexport-plugin .builder_header .left{
1950
+ float: left;
1951
+ }
1952
+ .wpallexport-plugin .builder_header .right{
1953
+ float:right;
1954
+ }
1955
+ .wpallexport-plugin .builder_header h3{
1956
+ color: #425F9A;
1957
+ margin-top: 0;
1958
+ font-size: 22px;
1959
+ margin-bottom: 0;
1960
+ }
1961
+ .wpallexport-plugin .builder_header h4{
1962
+ color: #777;
1963
+ margin-top: 10px;
1964
+ margin-bottom: 0;
1965
+ font-size: 18px;
1966
+ }
1967
+ .wpallexport-plugin .pmxi_option{
1968
+ padding: 3px 0;
1969
+ }
1970
+ .wpallexport-plugin .pmxi_option a.wpallexport-help{
1971
+ /*float: right;*/
1972
+ }
1973
+ .wpallexport-plugin .parse{
1974
+ text-decoration: none !important;
1975
+ }
1976
+ .wpallexport-plugin .nested_xml{
1977
+ display: none;
1978
+ }
1979
+ .wpallexport-plugin .nested_xml_tree{
1980
+ width: 70%;
1981
+ float: left;
1982
+ padding: 5px 15px;
1983
+ }
1984
+ .wpallexport-plugin .nested_actions{
1985
+ width:25%;
1986
+ float: right;
1987
+ }
1988
+ .wpallexport-plugin .nested_actions input[type="text"]{
1989
+ width:100%;
1990
+ padding: 7px;
1991
+ }
1992
+ .wpallexport-plugin .nested_xml_tree .green{
1993
+ color: green;
1994
+ padding-bottom: 10px;
1995
+ }
1996
+ .wpallexport-plugin .nested_xml_tree .red,
1997
+ .wpallexport-plugin .nested_msgs{
1998
+ color: red;
1999
+ padding-bottom: 10px;
2000
+ }
2001
+ .wpallexport-plugin .nested_files ul{
2002
+ list-style: decimal outside none;
2003
+ padding-left: 15px;
2004
+ }
2005
+ .wpallexport-plugin .template_input{
2006
+ margin-top: 20px;
2007
+ }
2008
+ .wpallexport-plugin .wp_all_export_preloader{
2009
+ background: url("../img/preloader.png");
2010
+ width: 80px;
2011
+ height: 10px;
2012
+ margin: 20px auto;
2013
+ display: none;
2014
+ }
2015
+ .wpallexport-plugin #filtering_result{
2016
+ float: left;
2017
+ }
2018
+ .wpallexport-plugin .wp_all_export_filter_preloader{
2019
+ background: url("../img/preloader.gif") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
2020
+ margin-top: 50px;
2021
+ height: 16px;
2022
+ line-height: 16px;
2023
+ padding-left: 20px;
2024
+ display: none;
2025
+ position: relative;
2026
+ float: right;
2027
+ }
2028
+ .wpallexport-plugin .sub_input{
2029
+ padding-left:17px;
2030
+ margin: 5px;
2031
+ }
2032
+ .wpallexport-plugin .main_choise{
2033
+ float: left;
2034
+ margin-right: 5px;
2035
+ }
2036
+ .wpallexport-plugin .specify_cf{
2037
+ left: 25%;
2038
+ top: 8px;
2039
+ background: #40acad;
2040
+ padding: 10px;
2041
+ position: relative;
2042
+ border-radius: 4px;
2043
+ -moz-border-radius: 4px;
2044
+ -khtml-border-radius: 4px;
2045
+ -webkit-border-radius: 4px;
2046
+ color: #fff !important;
2047
+ }
2048
+ .wpallexport-plugin .set_serialize.active,
2049
+ .wpallexport-plugin .set_mapping.active{
2050
+ font-weight: bold;
2051
+ }
2052
+ .wpallexport-plugin .custom_type{
2053
+ /*margin: 0 auto; */
2054
+ }
2055
+ .wpallexport-plugin .wpallexport-custom-fields textarea{
2056
+ border: 1px solid #ddd;
2057
+ border-radius: 4px;
2058
+ -moz-border-radius: 4px;
2059
+ -khtml-border-radius: 4px;
2060
+ -webkit-border-radius: 4px;
2061
+ padding: 6px 5px;
2062
+ font-size: 15px !important;
2063
+ height: 40px;
2064
+ float: left;
2065
+ margin-right: 5px;
2066
+ line-height: 25px;
2067
+ width: 68% !important;
2068
+ }
2069
+ .wpallexport-plugin .wpallexport-custom-fields .wpallexport-custom-fields-actions,
2070
+ .wpallexport-plugin .wpallexport-real-estate .wpallexport-custom-fields-actions{
2071
+ float: right;
2072
+ right: 30px;
2073
+ position: relative;
2074
+ /*padding: 0 10px;*/
2075
+ border: 1px solid #ddd;
2076
+ margin-bottom: 10px;
2077
+ }
2078
+ .wpallexport-plugin .wpallexport-step-3 div.custom_type{
2079
+ /*width: 80%;
2080
+ min-height: 65px;*/
2081
+ }
2082
+ .wpallexport-plugin span.remove{
2083
+ position: static !important;
2084
+ }
2085
+
2086
+ .wpallexport-plugin input[type="text"][name="tagno"]{
2087
+ margin-left: 5px;
2088
+ padding: 3px;
2089
+ width: 40px;
2090
+ border: 1px solid #BBBBBB;
2091
+ -moz-border-radius: 3px;
2092
+ -khtml-border-radius: 3px;
2093
+ -webkit-border-radius: 3px;
2094
+ border-radius: 3px;
2095
+ text-align: center;
2096
+ }
2097
+ .wpallexport-pointer-content {
2098
+ padding: 0 0 10px;
2099
  position: relative;
2100
+ font-size: 13px;
2101
+ background: #fff;
2102
+ border: 1px solid #dfdfdf;
2103
+ -webkit-box-shadow: 0 3px 6px rgba(0,0,0,0.075);
2104
+ box-shadow: 0 3px 6px rgba(0,0,0,0.075);
2105
  }
2106
+ #post-preview div.title{
2107
+ text-align:right;
2108
+ border-bottom: 1px solid #ccc;
2109
+ padding: 10px;
2110
+ /*font-style:italic;*/
 
 
2111
  }
2112
+ #post-preview .wpallexport-preview-content{
2113
+ padding: 15px;
2114
+ overflow: auto;
2115
+ max-height: 350px;
 
2116
  }
2117
+ #post-preview .wpallexport-preview-content .test_progress{
2118
+ clear: both;
 
 
 
 
2119
  }
2120
+ .wpallexport-plugin .preview,
2121
+ .wpallexport-plugin .preview_images,
2122
+ .wpallexport-plugin .preview_prices,
2123
+ .wpallexport-plugin .preview_taxonomies,
2124
+ .wpallexport-plugin .parse,
2125
+ .wpallexport-plugin .test_images{
2126
+ background: #40acad;
2127
  -moz-border-radius: 4px;
2128
  -khtml-border-radius: 4px;
2129
  -webkit-border-radius: 4px;
2130
  border-radius: 4px;
2131
+ clear: both;
2132
+ color: #fff !important;
2133
+ float: right;
2134
+ font-size: 14px;
2135
+ margin: 10px 0;
2136
+ padding: 10px 20px 10px 20px;
2137
  }
2138
+ .wpallexport-plugin .test_images{
2139
+ display: block;
2140
+ float: left;
2141
+ margin-bottom: 15px;
2142
+ margin-left: 0;
2143
+ margin-top: 0;
2144
  }
2145
+ .wpallexport-plugin .save_popup{
2146
  -moz-border-radius: 4px;
2147
  -khtml-border-radius: 4px;
2148
  -webkit-border-radius: 4px;
2149
+ border-radius: 4px;
2150
+ position: absolute;
2151
+ top: 41px;
2152
+ right: 60px;
2153
+ background: #40acad;
2154
+ padding: 10px 15px 10px 15px;
2155
+ color:#fff !important;
2156
+ }
2157
+ .wpallexport-plugin .autodetect_cf,
2158
+ .wpallexport-plugin .wpallexport-auto-detect-unique-key,
2159
+ .wpallexport-plugin .wpallexport-change-unique-key{
2160
+ -moz-border-radius: 4px;
2161
+ -khtml-border-radius: 4px;
2162
+ -webkit-border-radius: 4px;
2163
+ border-radius: 4px;
2164
+ background: #40acad;
2165
+ padding: 10px 15px 10px 15px;
2166
+ color:#fff !important;
2167
+ font-size: 14px;
2168
+ position: relative;
2169
+ top:-1px;
2170
  }
2171
+ .wpallexport-plugin .wpallexport-change-unique-key{
2172
+ background-position: 10px 12px;
2173
+ padding: 10px 15px 10px 15px;
 
 
 
 
 
 
2174
  }
2175
+ .wpallexport-plugin .autodetect_cf{
2176
+ display: inline-block;
2177
+ margin-bottom: 5px;
2178
  }
2179
+ .wpallexport-plugin .preview_taxonomies{
2180
+ float: none;
2181
+ /*padding: 5px 20px 5px 45px;*/
2182
+ margin-left: 10px;
 
2183
  }
2184
+ .wpallexport-plugin .set_xpath{
2185
+ left: 0;
2186
+ padding-left: 15px;
2187
+ position: absolute;
2188
+ top: 0;
2189
  }
2190
+ .wpallexport-plugin #woocommerce-product-data{
2191
+ margin-bottom: 20px;
2192
+ }
2193
+ .wpallexport-plugin input[name^="attribute_name"],
2194
+ .wpallexport-plugin input[name^="variable_attribute_name"]{
2195
+ width: 95% !important;
2196
  }
2197
+ .wpallexport-plugin .fix_checkbox{
2198
  position: relative;
2199
+ /*margin: 0px !important;*/
 
 
 
 
 
 
 
 
 
 
 
2200
  }
2201
+ .wpallexport-plugin .newline{
2202
+ line-height: 16px;
 
 
 
 
 
 
 
2203
  }
2204
+ .wpallexport-plugin #add_encoding{
2205
+ display: none;
 
 
 
2206
  }
2207
+ .wpallexport-plugin #new_encoding{
2208
+ border: 1px solid #BBBBBB;
2209
+ -moz-border-radius: 3px;
2210
+ -khtml-border-radius: 3px;
2211
+ -webkit-border-radius: 3px;
2212
+ border-radius: 3px;
2213
  }
2214
+ .wpallexport-plugin .load_options{
2215
+ height: 0;
2216
+ line-height: 0;
2217
+ margin: 0;
2218
+ padding: 0;
2219
+ position: relative;
2220
+ right: 10px;
2221
+ text-align: right;
2222
+ top: -35px;
2223
+ width: 100%;
2224
  }
2225
+ .wpallexport-plugin .custom-params tr td{
2226
+ /*width: 50%;*/
 
2227
  }
2228
+ .wpallexport-plugin .custom-params tr td.action{
2229
+ width: 100% !important;
2230
+ position: relative;
2231
+ display: block;
2232
  }
2233
+ .wpallexport-plugin .form-field textarea{
2234
+ width:80%;
 
 
2235
  }
2236
+ .wpallexport-plugin .drag-element .assign_post{
2237
+ float: left;
2238
+ margin-top: 2px;
2239
  }
2240
+ .wpallexport-plugin .post_taxonomy{
2241
+ /*margin-bottom: 15px;*/
2242
+ overflow: hidden;
2243
+ padding-left: 5px;
2244
+ /*padding-bottom: 15px;*/
2245
  }
2246
+ .wpallexport-plugin .post_taxonomy .delim{
2247
+ padding-left: 25px;
2248
+ }
2249
+ .wpallexport-plugin .post_taxonomy .delim .add-new-ico{
2250
+ float: left;
2251
+ margin-right: 10%;
2252
+ margin-top: 5px;
2253
+ }
2254
+ .wpallexport-plugin .post_taxonomy ol.ui-sortable{
2255
+ padding-right: 0px;
2256
+ }
2257
+ .wpallexport-plugin .post_taxonomy ol.ui-sortable .drag-element{
2258
+ background-position: 0 10px;
2259
+ }
2260
+ .wpallexport-plugin .post_taxonomy ol.ui-sortable .remove-ico{
2261
+ top: 8px;
2262
+ }
2263
+
2264
+ .wpallexport-plugin .separated_by{
2265
+ float: right;
2266
+ font-size: 12px;
2267
+ color: #999999;
2268
+ margin-right: 20px;
2269
  }
2270
+ .wpallexport-plugin .delim > label{
2271
+ color: #999999;
2272
+ font-size: 11px;
2273
  }
2274
+ .wpallexport-plugin .template-sidebar .tag{
2275
+ /*max-height: 550px;*/
2276
+ }
2277
+ .wpallexport-plugin .wp-pointer-content .action.remove a{
2278
+ top: 8px;
2279
+ }
2280
+ .wpallexport-plugin .wpallexport-drag-icon{
2281
  position: relative;
2282
+ top: 5px;
2283
  }
2284
+ .wpallexport-plugin .wpallexport-featured-images textarea{
2285
+ width: 70%;
2286
+ height: 70px;
2287
+ margin: 5px 0;
2288
+ padding-top: 5px;
2289
  }
2290
+ .wpallexport-plugin .wpallexport-placeholder{
2291
+ color: #888 !important;
 
 
2292
  }
2293
+ .wpallexport-plugin .ui-widget-overlay{
2294
+ background: #777 !important;
2295
+ z-index: 99999;
2296
+ }
2297
+ .wpallexport-plugin .auto_detect_sf{
2298
+ width: 80px;
2299
+ left: 0;
2300
+ }
2301
+ .wpallexport-plugin .ui-menu-item a{
2302
+ text-decoration: none;
2303
+ color: #777;
2304
+ }
2305
+ .wpallexport-plugin .ui-menu-item a.ui-state-focus,
2306
+ .wpallexport-plugin .ui-menu-item a.ui-state-active{
2307
+ margin: 0;
2308
+ }
2309
+ .wpallexport-plugin .ui-menu-item{
2310
+ border-bottom: 1px solid #777;
2311
+ }
2312
+ .wpallexport-plugin .ui-menu-item:last-child{
2313
+ border-bottom: none;
2314
+ }
2315
+ .wpallexport-plugin .cf_welcome,
2316
+ .wpallexport-plugin .cf_detect_result{
2317
+ position: relative;
2318
  text-align: center;
2319
+ padding-bottom: 15px;
2320
+ padding-top: 10px;
2321
+ border-bottom: 1px solid #ddd;
2322
+ border-top: 1px solid #ddd;
2323
  }
2324
+ .wpallexport-plugin .wpallexport-dismiss-cf-welcome{
2325
+ display: block;
2326
+ width: 100px;
2327
+ /*height: 16px;
2328
+ position: absolute;
2329
+ right: 10px;
2330
+ top: 30%;*/
2331
+ /*background: url('../img/ico-remove.png') no-repeat;*/
2332
+ margin: 0 auto;
2333
+ }
2334
+ .wpallexport-plugin .wpallexport-cf-options{
2335
+ display: block;
2336
+ padding: 10px 12px;
2337
  }
2338
+ .wpallexport-plugin .wpallexport-cf-menu{
2339
+ display: none;
2340
  border: none;
2341
+ -webkit-border-radius: 0px;
2342
+ -moz-border-radius: 0px;
2343
+ -o-border-radius: 0px;
2344
+ border-radius: 0px;
2345
+ border: 0px;
2346
+ padding: 0;
2347
+ /*padding-left: 12px;*/
2348
+ margin-bottom: 0;
2349
+ margin-top: 0;
2350
  }
2351
+ .wpallexport-plugin .wpallexport-cf-menu li{
2352
+ border-bottom: none;
2353
+ padding: 5px 0;
2354
+ padding-left: 16px;
2355
+ margin-bottom: 0;
2356
+ cursor: pointer;
2357
+ width: auto;
2358
  }
2359
+ .wpallexport-plugin .wpallexport-cf-menu li:hover{
2360
+ background: #fafafa;
 
2361
  }
2362
+ .wpallexport-plugin .wpallexport-cf-menu li.active{
2363
+ list-style: disc inside none;
2364
+ padding-left: 5px;
 
 
2365
  }
2366
+ .wpallexport-plugin .wpallexport-cf-menu li a{
2367
+ padding: 0;
2368
+ font-family: "Open Sans",​sans-serif;
2369
+ font-size: 12px;
2370
+ display: inline;
2371
+ color: #777;
2372
  }
2373
+ .wpallexport-plugin .ui-autocomplete li a:hover{
2374
+ border: none;
2375
+ -webkit-border-radius: 0px;
2376
+ -moz-border-radius: 0px;
2377
+ -o-border-radius: 0px;
2378
+ border-radius: 0px;
2379
+ border: 0px;
2380
  }
2381
+ .wpallexport-plugin .wpallexport-not-empty{
2382
+ /*display: block;
2383
+ padding: 5px;*/
2384
  }
2385
+ .wpallexport-plugin .wp-all-export-format{
2386
  float: right;
2387
+ height: 90px;
2388
+ margin-top: 15px;
2389
+ width: 200px;
2390
+ }
2391
+
2392
+ /*--------------------------------------------------------------------------
2393
+ *
2394
+ * Step 4 - Import Options
2395
+ *
2396
+ *-------------------------------------------------------------------------*/
2397
+
2398
+ .wpallexport-plugin .options .tag{
2399
+ margin-top: 0px;
2400
+ }
2401
+ .wpallexport-plugin .show_hints{
2402
+ color: #fff;
2403
+ padding: 10px;
2404
+ -moz-border-radius-topleft: 5px;
2405
+ -webkit-border-top-left-radius: 5px;
2406
+ border-top-left-radius: 5px;
2407
+ -moz-border-radius-bottomleft: 5px;
2408
+ -webkit-border-bottom-left-radius: 5px;
2409
+ border-bottom-left-radius: 5px;
2410
+ position: absolute;
2411
+ top: 18px;
2412
+ right: -1px;
2413
+ background: url('../img/ui_4.0/right_btn.png') no-repeat 95% 8px #40acad;
2414
+ padding-right: 30px;
2415
+ cursor: pointer;
2416
+ border: none;
2417
  }
2418
+ .wpallexport-plugin .show_hints:hover{
2419
+ color: #dfdfdf;
2420
+ }
2421
+
2422
+ .wpallexport-plugin .wp-pointer-arrow{
2423
+ display: none;
2424
  }
2425
+ .wpallexport-plugin .wp-pointer-content,
2426
+ .wpallexport-plugin .wpallexport-pointer-content{
2427
+ border: 1px solid #ecebe7;
2428
+ border-radius: 4px;
2429
+ -moz-border-radius: 4px;
2430
+ -khtml-border-radius: 4px;
2431
+ -webkit-border-radius: 4px;
2432
+ margin: 20px 10px 20px 20px;
2433
+ padding: 0;
2434
  }
2435
+ .wpallexport-plugin .wp-pointer-content fieldset{
2436
+ margin-top: 15px;
2437
+ }
2438
+ .wpallexport-plugin .wp-pointer-content .wp-pointer-buttons,
2439
+ .wpallexport-plugin .wpallexport-pointer-content .wp-pointer-buttons{
2440
+ padding: 15px;
2441
+ background: #f7f8f8;
2442
+ border-top: 1px solid #ebebeb;
2443
+ }
2444
+ .wpallexport-plugin .wp-pointer-content .wp-pointer-buttons a.close:before,
2445
+ .wpallexport-plugin .wpallexport-pointer-content .wp-pointer-buttons a.close:before{
2446
+ content:none;
2447
+ }
2448
+ .wpallexport-plugin .wp-pointer-content .wp-pointer-buttons a.close,
2449
+ .wpallexport-plugin .wpallexport-pointer-content .wp-pointer-buttons a.close{
2450
+ background: url('../img/remove.png') no-repeat 10px 10px #e4e6e6;
2451
+ padding: 10px 15px 10px 30px;
2452
+ color: #777;
2453
+ border-radius: 4px;
2454
+ -moz-border-radius: 4px;
2455
+ -khtml-border-radius: 4px;
2456
+ -webkit-border-radius: 4px;
2457
+ }
2458
+
2459
+ .wpallexport-plugin .options .wpallexport-submit-buttons{
2460
  position: relative;
2461
+ text-align: center;
2462
+ top: 10px;
2463
  }
2464
+ .wpallexport-plugin form.options{
2465
+ position: relative;
2466
+ margin-top: 10px !important;
2467
+ overflow: hidden;
 
 
2468
  }
2469
+ .wpallexport-plugin form.edit{
2470
+ overflow: hidden;
2471
+ }
2472
+ .wpallexport-plugin .switcher-target-is_keep_former_posts{
2473
  padding-left: 25px;
2474
  }
2475
+ .wpallexport-plugin .wpallexport-change-custom-type{
2476
+ margin-left: 6px;
2477
  }
2478
+
2479
+ /*--------------------------------------------------------------------------
2480
+ *
2481
+ * Step 5 - Confirm Import Settings
2482
+ *
2483
+ *-------------------------------------------------------------------------*/
2484
+
2485
+ /*.wpallexport-plugin .wpallexport-step-5 .wpallexport-section .wpallexport-content-section{
2486
+ border: none;
2487
+ -webkit-border-radius: 0px;
2488
+ -moz-border-radius: 0px;
2489
+ -o-border-radius: 0px;
2490
+ border-radius: 0px;
2491
+ border: 0px;
2492
+ background: none;
2493
+ margin: 0;
2494
+ padding: 0 10%;
2495
+ }*/
2496
+ .wpallexport-plugin .wpallexport-step-5 .wpallexport-section .wpallexport-collapsed-content{
2497
+ border-top: 1px solid #ebebeb;
2498
+ margin-top: 10px;
2499
+ padding-top: 10px;
2500
+ }
2501
+ .wpallexport-plugin .wpallexport-step-5 .wpallexport-section .wpallexport-collapsed-content p{
2502
+ color: #777;
2503
+ background: url('../img/ui_4.0/logo_small.png') no-repeat;
2504
+ padding-left: 35px;
2505
+ min-height: 26px;
2506
+ line-height: 28px;
2507
+ }
2508
+
2509
+ .wpallexport-plugin form.confirm{
2510
+ margin-bottom: 20px;
2511
+ margin-top: 20px;
2512
+ text-align: center;
2513
  }
2514
+ .wpallexport-plugin form.confirm input[type="submit"]{
2515
+ background: #46ba69;
2516
+ padding: 20px 30px 20px 30px;
2517
+ color: #fff;
2518
+ border: none;
2519
+ font-weight: bold;
2520
+ cursor: pointer;
2521
+ }
2522
+ .wpallexport-plugin form.confirm a{
2523
+ text-decoration: none;
2524
+ color: #777;
2525
+ }
2526
+ .wpallexport-plugin table.confirm ul {
2527
+ list-style: disc inside none;
2528
+ }
2529
+ .wpallexport-plugin table.confirm ul li ul{
2530
+ margin-left: 20px;
2531
+ margin-top: 5px;
2532
+ list-style: circle inside none;
2533
+ }
2534
+ /*.wpallexport-plugin #download_log_separator,
2535
+ .wpallexport-plugin #download_log{
2536
+ display: none;
2537
+ }*/
2538
+
2539
+ .wpallexport-plugin .wpallexport-ready-to-go{
2540
+ background: url("../img/elements.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0) !important;
2541
+ float: left;
2542
+ margin-left: 40px;
2543
+ margin-top: 25px;
2544
+ padding-left: 80px;
2545
+ text-align: left;
2546
  }
2547
+ .wpallexport-plugin .wpallexport-ready-to-go h3{
2548
+ color: #425f9a;
2549
+ margin-bottom: 0;
2550
+ margin-top: 3px;
2551
+ font-size: 22px;
2552
+ line-height: 28px;
2553
+ }
2554
+ .wpallexport-plugin .wpallexport-ready-to-go h4{
2555
+ color: #777;
2556
+ margin-top: 5px;
2557
+ font-size:20px;
2558
+ }
2559
+ .wpallexport-plugin .wpallexport-is-continue{
2560
+ text-align: left;
2561
+ float: left;
2562
+ margin: 12px 40px 12px 0px;
2563
+ }
2564
+ /*--------------------------------------------------------------------------
2565
+ *
2566
+ * Step 6 - Processing
2567
+ *
2568
+ *-------------------------------------------------------------------------*/
2569
+
2570
+ .wpallexport-plugin .pmxi_error_msg{
2571
+ color: #FF0000;
2572
+ display: block;
2573
+ font-size: 12px;
2574
+ line-height: 18px;
2575
+ padding: 2px;
2576
  }
2577
+ .wpallexport-plugin .wpallexport-upload-process{
2578
+ border: none;
2579
+ padding: 1px;
2580
  }
2581
+ .wpallexport-plugin #processbar{
 
 
 
2582
  text-align: center;
2583
+ visibility: hidden;
2584
+ height: 30px;
2585
+ margin-top: 18px;
2586
+ margin-bottom: 20px;
2587
+ background: #fff;
2588
+ color: #222222;
 
 
 
2589
  position: relative;
 
 
2590
  }
2591
+ .wpallexport-plugin #processbar div{
2592
+ background: #76d771;
2593
+ height: 30px;
2594
+ width: 0%;
2595
+ position: absolute;
2596
+ top:0;
2597
+ }
2598
+ .wpallexport-plugin #export_progress{
2599
+ color: #000000;
2600
+ font-size: 21px;
2601
+ /*font-weight: bold;*/
2602
+ display: block;
2603
+ width: 100%;
2604
+ text-align: center;
2605
+ opacity: 1;
2606
  position: relative;
2607
+ padding-top: 10px;
 
 
 
 
 
 
2608
  }
2609
+ .wpallexport-plugin #export_progress #center_progress{
2610
+ color:#46ba69;
2611
+ font-size: 60px;
2612
+ }
2613
+ .wpallexport-plugin #right_progress{
2614
+ position: absolute;
2615
+ right: 0;
2616
+ color:#777;
2617
  }
2618
+ .wpallexport-plugin #right_progress span{
2619
+ color:#000;
2620
+ }
2621
+ .wpallexport-plugin #left_progress{
2622
+ position: absolute;
2623
+ left: 0;
2624
+ color: #777;
2625
  }
2626
+ .wpallexport-plugin #left_progress #then{
2627
+ color:#000;
2628
+ }
2629
+ .wpallexport-plugin #existing_meta_keys{
2630
+ margin-bottom: 10px;
2631
+ padding: 2px;
2632
+ width: 580px;
2633
  }
2634
+ .wpallexport-plugin #export_finished{
2635
+ display: none;
2636
  text-align: center;
2637
+ padding-top: 30px;
 
 
2638
  }
2639
+ .wpallexport-plugin #export_finished .wpallexport-log-details{
2640
+ display: none;
2641
+ }
2642
+ .wpallexport-plugin #export_finished #download_log{
2643
+ background: url('../img/ui_4.0/view_log.png') no-repeat 2px 0px;
2644
+ }
2645
+ .wpallexport-plugin #export_finished #import_history{
2646
+ background: url('../img/ui_4.0/import_history.png') no-repeat 2px 0px;
2647
+ padding-left: 25px;
2648
+ }
2649
+ .wpallexport-plugin #export_finished #manage_imports{
2650
+ background: url('../img/ui_4.0/manage_imports.png') no-repeat 2px 0px;
2651
+ }
2652
+ .wpallexport-plugin #export_finished .export_finished_icon{
2653
+ /*background: url('../img/ui_4.0/export_finished.png') no-repeat center center;*/
2654
+ width: 100%;
2655
+ height: 255px;
2656
+ margin: 40px 0;
2657
+ }
2658
+ .wpallexport-plugin #export_finished h1{
2659
+ font-size: 48px;
2660
+ color: #46ba69;
2661
+ font-weight: normal;
2662
+ }
2663
+ .wpallexport-plugin #export_finished h3{
2664
+ font-size: 21px;
2665
+ color: #777;
2666
+ font-weight: normal;
2667
+ line-height: 30px;
2668
+ }
2669
+ .wpallexport-plugin #export_finished h3 span{
2670
+ color: #000;
2671
+ }
2672
+ .wpallexport-plugin #export_finished hr{
2673
+ margin: 20px 15%;
2674
+ }
2675
+ .wpallexport-plugin #export_finished a{
2676
+ color: #40acad;
2677
+ text-decoration: none;
2678
+ margin: 5px 10px;
2679
+ display: inline-block;
2680
+ height: 25px;
2681
+ }
2682
+ .wpallexport-plugin #process{ display:none; }
2683
+ .wpallexport-plugin .ui-widget-header{
2684
+ -moz-border-radius: 4px;
2685
+ -khtml-border-radius: 4px;
2686
+ -webkit-border-radius: 4px;
2687
+ border-radius: 4px;
2688
  }
2689
+ .wpallexport-plugin .ui-progressbar-value {
2690
+ background: #76d771 !important;
2691
+ border: none !important;
2692
+ -moz-border-radius: 8px;
2693
+ -khtml-border-radius: 8px;
2694
+ -webkit-border-radius: 8px;
2695
+ border-radius: 8px;
2696
+ }
2697
+ .wpallexport-plugin .wpallexport-modal-message{
2698
+ background: none repeat scroll 0 0 yellow;
2699
+ color: red;
2700
+ padding: 4px;
2701
+ margin-top: 10px;
2702
  display: none;
2703
  }
2704
+ .wpallexport-plugin #logwrapper{
2705
+ border: 1px solid #aaa;
2706
+ margin: 10px auto;
2707
+ }
2708
+ .wpallexport-plugin #loglist{
2709
  border: 1px solid #AAAAAA;
2710
+ height: 380px;
2711
  overflow: auto;
2712
  }
2713
+ .wpallexport-plugin #loglist > p{
2714
  margin: 0;
2715
  padding: 3px 5px;
2716
  }
2717
+ .wpallexport-plugin #loglist > p.odd{
2718
  background: #dfdfdf;
2719
  }
2720
+ /*--------------------------------------------------------------------------
2721
+ *
2722
+ * Reimport
2723
+ *
2724
+ *-------------------------------------------------------------------------*/
2725
+
2726
+ .wpallexport-plugin .info_ico{
2727
+ background: url('../img/ui_4.0/info.png') 0 50% no-repeat;
2728
+ padding: 10px 10px 10px 40px;
2729
+ color: #777;
2730
  }
2731
+ .wpallexport-plugin .drag_an_element_ico{
2732
+ background: url('../img/ui_4.0/drag.png') 0 50% no-repeat;
2733
+ padding: 10px 10px 10px 40px;
2734
+ color: #777;
2735
  }
2736
+
2737
+ /*--------------------------------------------------------------------------
2738
+ *
2739
+ * XML & CSV
2740
+ *
2741
+ *-------------------------------------------------------------------------*/
2742
+
2743
+ /*@+ XML representation */
2744
+ .wpallexport-plugin .tag {
2745
+ position: fixed;
2746
+ max-width: 450px;
2747
+ top: 127px;
2748
+ padding-bottom: 20px;
2749
+ margin-right: 15px;
2750
+ width: 22%;
2751
  }
2752
+ .wpallexport-plugin #wp-content-editor-tools{
2753
+ background: #fff !important;
 
 
2754
  }
2755
+ .wpallexport-plugin .tag .title {
2756
+ font-weight: bold;
2757
+ padding: 6px 8px;
 
 
 
2758
  color: #464646;
2759
+ background: #fff;
2760
+ font-size: 12px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2761
  text-align: center;
2762
+ border: 1px solid #ddd;
2763
+ border-bottom: 1px solid #ddd;
2764
+ -moz-border-radius-topleft: 4px;
2765
+ -webkit-border-top-left-radius: 4px;
2766
+ border-top-left-radius: 4px;
2767
+ -moz-border-radius-topright: 4px;
2768
+ -webkit-border-top-right-radius: 4px;
2769
+ border-top-right-radius: 4px;
2770
  }
2771
+ .wpallexport-plugin .tag .wpallexport-xml {
2772
+ /*max-height: 525px;*/
2773
+ max-width: 450px;
2774
+ overflow: auto;
2775
+ border: 1px solid #ddd;
2776
+ border-top:none;
2777
+ -moz-border-radius-bottomright: 4px;
2778
+ -webkit-border-bottom-right-radius: 4px;
2779
+ border-bottom-right-radius: 4px;
2780
+ -moz-border-radius-bottomleft: 4px;
2781
+ -webkit-border-bottom-left-radius: 4px;
2782
+ border-bottom-left-radius: 4px;
2783
+ background: #fafafa;
2784
+ }
2785
+ .wpallexport-plugin .tag .navigation {
2786
+ /*float: right;*/
2787
+ /*margin: 2px -12px 0 0;*/
2788
+ margin-bottom: 3px;
2789
+ margin-top: 3px;
2790
+ }
2791
+ .wpallexport-plugin .tag .navigation a,
2792
+ .wpallexport-plugin .tag .navigation span,
2793
+ #post-preview .navigation a,
2794
+ #post-preview .navigation span {
2795
+ font-weight: bold;
2796
+ padding: 0 12px;
2797
+ text-decoration: none;
2798
+ height: 25px;
2799
+ }
2800
+ .wpallexport-plugin .tag .navigation span.out_of{
2801
+ color:#777;
2802
+ margin-left: 0;
2803
+ }
2804
+ .wpallexport-plugin .tag .navigation .previous_element,
2805
+ #post-preview .navigation .previous_element{
2806
+ float: left;
2807
+ background: url('../img/left_btn.png') 5% 0 no-repeat;
2808
+ margin-top: 10px;
2809
+ }
2810
+ .wpallexport-plugin .tag .navigation .next_element,
2811
+ #post-preview .navigation .next_element{
2812
+ float: right;
2813
+ background: url('../img/right_btn.png') 95% 0 no-repeat;
2814
+ margin-top: 10px;
2815
+ }
2816
+
2817
+ @media screen and (max-height: 900px) {
2818
+ .wpallexport-plugin .tag {
2819
+ padding-bottom: 0px;
2820
+ }
2821
+ .wpallexport-plugin .tag .wpallexport-xml {
2822
+ /*max-height: 400px;*/
2823
+ }
2824
  }
2825
+
2826
+ .wpallexport-plugin .wpallexport-xml {
2827
+ /*padding-left: 15px;*/
2828
  }
2829
+ .wpallexport-plugin .wpallexport-xml .wpallexport-hasmenu{
 
2830
  -webkit-user-select: none;
2831
  -khtml-user-select: none;
2832
  -moz-user-select: none;
2833
  -ms-user-select: none;
2834
+ user-select: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2835
  }
2836
+ .wpallexport-plugin .wpallexport-xml .xml-element-xpaths{
2837
+ /*display: none;*/
2838
  }
2839
+ .wpallexport-plugin .xml-element {
2840
+ border: 1px solid transparent;
2841
+ margin: 1px 1px 1px 0;
2842
  }
2843
+ .wpallexport-plugin .xml-element .xml-element-xpaths{
2844
+ /*display: none;*/
2845
+ }
2846
+ .wpallexport-plugin .xml-element.selected > .xml-tag.opening .xml-tag-name {
2847
+ background-color: #B5E61D;
2848
  }
2849
+ .wpallexport-plugin .xml-content {
2850
+ padding-left: 14px;
2851
+ max-width: 500px;
2852
+ overflow: hidden;
 
 
2853
  }
2854
+ .wpallexport-plugin .xml-content.collapsed {
2855
  display: none;
2856
  }
2857
+ .wpallexport-plugin .xml-content.textonly.short {
2858
+ padding-left: 0px;
2859
+ display: inline;
 
 
 
 
 
 
2860
  }
2861
+ .wpallexport-plugin .xml-tag {
2862
+ display: inline;
 
2863
  }
2864
+ .wpallexport-plugin .xml-tag-name,
2865
+ .wpallexport-plugin .csv-tag-name {
2866
+ color: #40acad;
2867
  font-weight: bold;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2868
  }
2869
+ .wpallexport-plugin .xml-tag.opening .xml-tag-name {
 
 
 
 
 
 
 
 
 
2870
  cursor: pointer;
2871
  }
2872
+ .wpallexport-plugin .wpallexport-xml .xml-tag.opening .xml-tag-name{
2873
+ cursor: default;
 
 
 
 
 
 
 
 
 
 
 
 
 
2874
  }
2875
+ .wpallexport-plugin .xml-attr-name {
2876
+ font-weight: bold;
2877
+ cursor: pointer;
 
2878
  }
2879
+ .wpallexport-plugin .xml-attr-value {
2880
+ color: blue;
 
2881
  }
2882
+ .wpallexport-plugin .xml-expander {
2883
+ display: inline-block;
2884
+ width: 12px;
2885
+ margin-left: -12px;
2886
+ -moz-user-select: none;
2887
+ -khtml-user-select: none;
2888
+ -webkit-user-select: none;
2889
+ user-select: none;
2890
+ cursor: pointer;
2891
+ font-family: monospace;
2892
+ line-height: 100%;
2893
+ text-align: left;
2894
+ color: red;
2895
  }
2896
+ .wpallexport-plugin .xml-more {
2897
+ color: red;
2898
+ font-size: 80%;
2899
  }
2900
+ .wpallexport-plugin .xml.resetable .xml-element.lvl-mod4-3 > .xml-content {
2901
+ margin-left: -59px;
2902
+ margin-right: -8px;
2903
+ background-color: #fff;
2904
+ border: 1px dashed #906;
2905
+ border-left: 1px solid #906;
2906
+ border-right: none;
2907
  }
2908
+ .wpallexport-plugin .xml.resetable .xml-element.lvl-mod4-3 > .xml-content.short {
2909
+ margin-left: 0;
2910
+ margin-right: 0;
2911
+ border: none;
2912
+ background-color: inherit;
2913
  }
2914
+ .wpallexport-plugin .wpallexport-xml .xml-element.lvl-0 .xml-tag .xml-tag-name{
2915
+ color: #46ba69;
2916
  }
2917
+ .wpallexport-plugin .wpallexport-xml .xml-element.lvl-1 .xml-tag .xml-tag-name{
2918
+ color: #40acad;
 
2919
  }
2920
+ /*.wpallexport-plugin .csv_element .is_numeric{
2921
+ text-align: right;
2922
+ }*/
2923
+ .wpallexport-plugin .csv-content{
2924
+ overflow: hidden;
2925
+ margin-bottom: 15px;
2926
+ margin-top: 15px;
2927
+ padding-right: 15px;
2928
+ }
2929
+ .wpallexport-plugin .csv_element .csv-tag,
2930
+ .wpallexport-plugin .csv_element .xml-content{
2931
+ width: 46%;
2932
+ /*border: 1px solid #ccc;*/
2933
+ padding: 3px !important;
2934
+ display: block;
2935
+ float: left;
2936
  }
2937
+ .wpallexport-plugin .wpallexport-choose-elements .csv_element .csv-tag{
2938
+ width: 25%;
 
 
 
2939
  }
2940
+ .wpallexport-plugin .wpallexport-choose-elements .csv_element .xml-content{
2941
+ width: 70%;
 
2942
  }
2943
+ .wpallexport-plugin .csv_element .csv-tag{
2944
+ border-right: 1px solid #CCCCCC;
2945
+ margin-right: -1px;
2946
  }
2947
+ .wpallexport-plugin .csv_element .xml-content{
2948
+ border-left: 1px solid #ccc;
2949
+ width: 48%;
2950
  }
2951
+ .wpallexport-plugin .csv_element{
2952
+ border: 1px solid #ccc;
2953
+ overflow: hidden;
2954
+ width: 100%;
2955
+ background: #fff;
2956
  }
2957
+ .wpallexport-plugin .csv_element.lvl-0{
2958
+ border: none;
2959
  }
2960
+ /* xml table representation */
2961
+ .wpallexport-plugin tr.xml-element.selected .xml-tag.opening .xml-tag-name {
2962
+ background-color: #B5E61D;
2963
  }
2964
+ .wpallexport-plugin table.wpallexport-xml td {
2965
+ padding-left: 20px;
 
 
 
 
 
 
 
 
2966
  }
2967
+ .wpallexport-plugin table.wpallexport-xml td:first-child {
2968
+ width: 1px;
2969
+ padding-left: 0px;
 
 
2970
  }
2971
+
2972
+ .wpallexport-plugin table.wpallexport-xml,
2973
+ .wpallexport-plugin table.wpallexport-xml table {
2974
+ width: 100%;
2975
+ border-collapse:collapse;
2976
+ border-spacing:0;
2977
  }
2978
+ /*@*/
2979
 
2980
  /*--------------------------------------------------------------------------
2981
  *
2982
+ * Manage Imports
2983
  *
2984
  *-------------------------------------------------------------------------*/
2985
 
2986
+ /*@+ table list */
2987
+ .wpallexport-plugin table.widefat th {
2988
+ white-space: nowrap;
2989
  }
2990
+ .wpallexport-plugin table.widefat th.ASC a {
2991
+ background-image: url("../img/screen-options-right-up.gif");
2992
+ background-repeat: no-repeat;
2993
+ background-position: right center;
2994
+ padding-right: 19px;
2995
  }
2996
+ .wpallexport-plugin table.widefat th.DESC a {
2997
+ background-image: url("../img/screen-options-right.gif");
2998
+ background-repeat: no-repeat;
2999
+ background-position: right center;
3000
+ padding-right: 19px;
3001
  }
3002
 
3003
+ .wpallexport-plugin table.widefat.pmxi-admin-imports th.column-id {
3004
+ width: 35px;
 
 
3005
  }
3006
+ .wpallexport-plugin table.widefat.pmxi-admin-imports th.column-scheduled {
3007
+ width: 85px;
 
3008
  }
3009
+ .wpallexport-plugin table.widefat.pmxi-admin-imports th.column-registered_on {
3010
+ width: 130px;
 
 
3011
  }
3012
+ .wpallexport-plugin table.widefat.pmxi-admin-imports th.column-post_count {
3013
+ width: 105px;
 
3014
  }
3015
+ .wpallexport-plugin .wpallexport-disabled{
3016
+ color: #888 !important;
 
3017
  }
3018
+ /*@*/
3019
+ /*.wpallexport-plugin .pmxi-admin-imports a.delete{
3020
+ color: #FF0000;
3021
+ font-size: 18px;
3022
+ font-weight: bold;
3023
+ padding-top: 35px;
3024
+ vertical-align: middle;
3025
+ }*/
3026
+ .wpallexport-plugin table.wpallexport-layout{width:100%; margin-bottom: 100px;}
3027
+ .wpallexport-plugin table.wpallexport-layout td.left{float:left;}
3028
+ .wpallexport-plugin table.wpallexport-layout td.right{float:right;}
3029
 
3030
+ /*--------------------------------------------------------------------------
3031
+ *
3032
+ * Setting Page
3033
+ *
3034
+ *-------------------------------------------------------------------------*/
 
3035
 
3036
+ /*@+ Setting Form */
3037
+ .wpallexport-plugin form.settings {
3038
+ /*padding: 1px 12px;*/
 
 
3039
  }
3040
+ /*@*/
3041
+ .wpallexport-plugin form.settings p{
3042
+ font-size: 14px !important;
3043
  }
3044
+ .wpallexport-plugin form.settings .wpallexport-header{
 
 
3045
  overflow: hidden;
3046
+ height: 60px;
3047
+ padding-top: 10px;
 
 
3048
  }
3049
 
3050
+ .wpallexport-plugin .wpallexport-setting-wrapper{
3051
+ clear: both;
3052
+ overflow: hidden;
3053
+ margin: 15px 0;
3054
+ }
3055
+ .wpallexport-plugin .wpallexport-setting-label{
3056
+ width: 250px;
3057
  float: left;
3058
+ padding-top: 10px;
3059
+ font-weight: bold;
 
3060
  }
3061
+ .wpallexport-plugin .wpallexport-setting{
3062
+ float: left;
3063
+ width: 600px;
3064
  }
3065
+ .wpallexport-plugin .wpallexport-setting-note{
3066
+ color: #777;
3067
+ margin-top: 2px;
 
 
 
 
 
3068
  }
3069
+
3070
+ .wpallexport-plugin .save_action,
3071
+ .wpallexport-plugin .delete_action,
3072
+ .wpallexport-plugin .close_action{
3073
+ -moz-border-radius: 4px;
3074
+ -khtml-border-radius: 4px;
3075
+ -webkit-border-radius: 4px;
3076
+ border-radius: 4px;
3077
+ position: absolute;
3078
+ background: #40acad;
3079
+ padding: 9px 15px;
3080
+ color:#fff !important;
3081
+ cursor: pointer;
3082
+ width: 80px;
3083
  }
3084
+
3085
+ .wpallexport-plugin .save_action{
3086
+ bottom: 14px;
3087
+ right: 15px;
3088
+ background: #425f9a;
3089
  }
3090
+
3091
+ .wpallexport-plugin .delete_action{
3092
+ left: 110px;
3093
+ bottom: 14px;
3094
+ background: #e14d43;
3095
  }
3096
+
3097
+ .wpallexport-plugin .close_action{
3098
+ left: 20px;
3099
+ bottom: 14px;
3100
+ background: url("../img/remove.png") no-repeat scroll 10px 10px #e4e6e6;
3101
+ color: #777 !important;
3102
+ padding: 9px 15px 9px 30px;
3103
  }
3104
+
3105
+ /*--------------------------------------------------------------------------
3106
+ *
3107
+ * Media Queries
3108
+ *
3109
+ *-------------------------------------------------------------------------*/
3110
+
3111
+ @media screen and (min-width: 1630px) and (max-width: 1730px) {
3112
+
3113
+ .wpallexport-plugin .change_file a.wpallexport-import-from{
3114
+ width: 320px;
3115
+ }
3116
  }
3117
+
3118
+ @media screen and (min-width: 1530px) and (max-width: 1629px) {
3119
+
3120
+ .wpallexport-plugin .change_file a.wpallexport-import-from{
3121
+ width: 295px;
3122
+ }
3123
  }
3124
+
3125
+ @media screen and (min-width: 1416px) and (max-width: 1529px) {
3126
+
3127
+ .wpallexport-plugin .change_file a.wpallexport-import-from{
3128
+ width: 270px;
3129
+ }
3130
+
3131
+ .wpallexport-plugin .pmxi-admin-imports tr td em{
3132
+ display: block;
3133
+ max-width: 585px;
3134
+ }
3135
  }
3136
+
3137
+ @media screen and (min-width: 1350px) and (max-width: 1415px) {
3138
+ .wpallexport-plugin .wpallexport-wrapper{
3139
+ width: 1120px;
3140
+ }
3141
+ /*.wpallexport-plugin a.wpallexport-import-from{
3142
+ width: 292px;
3143
+ }*/
3144
+ .wpallexport-plugin .change_file a.wpallexport-import-from{
3145
+ width: 220px;
3146
+ font-size: 15px;
3147
+ }
3148
+ .wpallexport-plugin .wpallexport-custom-fields textarea{
3149
+ width: 60% !important;
3150
+ }
3151
+ .wpallexport-plugin .pmxi-admin-imports tr td em{
3152
+ display: block;
3153
+ max-width: 525px;
3154
+ }
3155
+ .wpallexport-plugin .wpallexport-extra-text-left{
3156
+ width: 36%;
3157
+ }
3158
+ .wpallexport-plugin .wpallexport-extra-text-right{
3159
+ width: 37%;
3160
+ }
3161
+ .wpallexport-plugin .wpallexport-is-continue{
3162
+ margin: 12px 10px 12px 0;
3163
+ }
3164
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="new"]{
3165
+ margin-left: -14%;
3166
+ }
3167
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3168
+ margin-left: -13%;
3169
+ }
3170
  }
3171
+
3172
+ @media screen and (min-width: 1250px) and (max-width: 1349px) {
3173
+ .wpallexport-plugin .wpallexport-wrapper{
3174
+ width: 1020px;
3175
+ }
3176
+ /*.wpallexport-plugin a.wpallexport-import-from{
3177
+ width: 292px;
3178
+ }*/
3179
+ .wpallexport-plugin .wpallexport-ready-to-go h4{
3180
+ font-size: 18px;
3181
+ }
3182
+ .wpallexport-plugin .change_file .wpallexport-import-types h3{
3183
+ font-size: 22px;
3184
+ }
3185
+ .wpallexport-plugin .change_file a.wpallexport-import-from{
3186
+ width: 220px;
3187
+ font-size: 15px;
3188
+ }
3189
+ .wpallexport-plugin .wpallexport-custom-fields textarea{
3190
+ width: 55% !important;
3191
+ }
3192
+ .wpallexport-plugin .pmxi-admin-imports tr td em{
3193
+ display: block;
3194
+ max-width: 425px;
3195
+ }
3196
+ .wpallexport-plugin .wpallexport-extra-text-left{
3197
+ width: 35%;
3198
+ }
3199
+ .wpallexport-plugin .wpallexport-extra-text-right{
3200
+ width: 35%;
3201
+ }
3202
+ .wpallexport-plugin .wpallexport-is-continue{
3203
+ margin: 12px 10px 12px 0;
3204
+ }
3205
+ .wpallexport-plugin .wpallexport-ready-to-go h3{
3206
+ font-size: 18px;
3207
+ }
3208
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="new"]{
3209
+ margin-left: -17%;
3210
+ }
3211
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3212
+ margin-left: -16%;
3213
+ }
3214
+ .wpallexport-plugin form.wpallexport-step-3{
3215
+ width: 60%;
3216
+ }
3217
  }
3218
+
3219
+ @media screen and (min-width: 1150px) and (max-width: 1249px) {
3220
+ .wpallexport-plugin .wpallexport-wrapper{
3221
+ width: 920px;
3222
+ }
3223
+ /*.wpallexport-plugin a.wpallexport-import-from{
3224
+ width: 292px;
3225
+ }*/
3226
+ .wpallexport-plugin .wpallexport-upload-type-container{
3227
+ padding: 0 40px;
3228
+ }
3229
+ .wpallexport-plugin .ajax-console .founded_records h4{
3230
+ font-size: 18px;
3231
+ }
3232
+ .wpallexport-plugin #pmxi_add_rule{
3233
+ padding: 13px 25px 10px 50px;
3234
+ }
3235
+ .wpallexport-plugin .wpallexport-ready-to-go h4{
3236
+ font-size: 15px;
3237
+ }
3238
+ .wpallexport-plugin #process_notice,
3239
+ .wpallexport-plugin #export_finished h3{
3240
+ font-size: 16px;
3241
+ }
3242
+ .wpallexport-plugin .change_file .wpallexport-import-types{
3243
+ margin-top: 15px;
3244
+ }
3245
+ .wpallexport-plugin .change_file .wpallexport-import-types h3{
3246
+ font-size: 18px;
3247
+ }
3248
+ .wpallexport-plugin .change_file a.wpallexport-import-from{
3249
+ width: 190px;
3250
+ font-size: 12px;
3251
+ }
3252
+ .wpallexport-plugin .wpallexport-custom-fields textarea{
3253
+ width: 50% !important;
3254
+ }
3255
+ .wpallexport-plugin .pmxi-admin-imports tr td em{
3256
+ display: block;
3257
+ max-width: 325px;
3258
+ }
3259
+ .wpallexport-plugin .wpallexport-extra-text-left{
3260
+ width: 33%;
3261
+ }
3262
+ .wpallexport-plugin .wpallexport-extra-text-right{
3263
+ width: 34%;
3264
+ }
3265
+ .wpallexport-plugin .wpallexport-new-records,
3266
+ .wpallexport-plugin .wpallexport-existing-records{
3267
+ font-size: 16px;
3268
+ }
3269
+ .wpallexport-plugin .wpallexport-is-continue{
3270
+ margin: 12px 10px 12px 0;
3271
+ }
3272
+ .wpallexport-plugin .wpallexport-ready-to-go h3{
3273
+ font-size: 14px;
3274
+ }
3275
+ .wpallexport-plugin .wpallexport-ready-to-go h4{
3276
+ font-size: 14px;
3277
+ }
3278
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="new"]{
3279
+ margin-left: -17%;
3280
+ }
3281
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3282
+ margin-left: -16%;
3283
+ }
3284
+ .wpallexport-plugin form.wpallexport-step-3{
3285
+ width: 55%;
3286
+ }
3287
  }
3288
+ @media screen and (min-width: 1050px) and (max-width: 1149px) {
3289
+ .wpallexport-plugin form.wpallexport-step-3{
3290
+ width: 55%;
3291
+ }
3292
+ .wpallexport-plugin .wpallexport-wrapper{
3293
+ width: 800px;
3294
+ }
3295
+ /*.wpallexport-plugin a.wpallexport-import-from{
3296
+ width: 292px;
3297
+ font-size: 15px;
3298
+ }*/
3299
+ .wpallexport-plugin .wpallexport-upload-type-container{
3300
+ padding: 0 40px;
3301
+ }
3302
+ .wpallexport-plugin .ajax-console .founded_records h4{
3303
+ font-size: 14px;
3304
+ }
3305
+ .wpallexport-plugin .wpallexport-ready-to-go h4{
3306
+ font-size: 12px;
3307
+ }
3308
+ .wpallexport-plugin form.confirm input[type="submit"]{
3309
+ padding: 20px 10px 20px 10px;
3310
+ }
3311
+ .wpallexport-plugin #process_notice,
3312
+ .wpallexport-plugin #export_finished h3{
3313
+ font-size: 14px;
3314
+ }
3315
+ .wpallexport-plugin #export_progress{
3316
+ font-size: 16px;
3317
+ }
3318
+ .wpallexport-plugin .change_file .wpallexport-import-types{
3319
+ margin-top: 15px;
3320
+ }
3321
+ .wpallexport-plugin .change_file .wpallexport-import-types h3{
3322
+ font-size: 18px;
3323
+ }
3324
+ .wpallexport-plugin .change_file a.wpallexport-import-from{
3325
+ width: 150px;
3326
+ font-size: 0px;
3327
+ }
3328
+ .wpallexport-plugin .change_file a.wpallexport-import-from .wpallexport-icon{
3329
+ left: 0 !important;
3330
+ }
3331
+ .wpallexport-plugin .wpallexport-custom-fields textarea{
3332
+ width: 45% !important;
3333
+ }
3334
+ .wpallexport-plugin .pmxi-admin-imports tr td em{
3335
+ display: block;
3336
+ max-width: 235px;
3337
+ }
3338
+ .wpallexport-plugin .wpallexport-extra-text-left{
3339
+ width: 30%;
3340
+ }
3341
+ .wpallexport-plugin .wpallexport-extra-text-right{
3342
+ width: 31%;
3343
+ }
3344
+ .wpallexport-plugin .wpallexport-new-records,
3345
+ .wpallexport-plugin .wpallexport-existing-records{
3346
+ font-size: 12px;
3347
+ }
3348
+ .wpallexport-plugin .wpallexport-is-continue{
3349
+ margin: 12px 10px 12px 0;
3350
+ }
3351
+ .wpallexport-plugin .wpallexport-ready-to-go h3{
3352
+ font-size: 11px;
3353
+ line-height: 20px;
3354
+ margin-top: 10px;
3355
+ }
3356
+ .wpallexport-plugin .wpallexport-ready-to-go h4{
3357
+ font-size: 11px;
3358
+ }
3359
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="new"]{
3360
+ margin-left: -17%;
3361
+ }
3362
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3363
+ margin-left: -16%;
3364
+ }
3365
  }
3366
+ @media screen and (max-width: 1049px) {
3367
+ .wpallexport-plugin .wpallexport-wrapper{
3368
+ width: 760px;
3369
+ }
3370
+ /*.wpallexport-plugin a.wpallexport-import-from{
3371
+ width: 300px;
3372
+ font-size: 15px;
3373
+ }*/
3374
+ .wpallexport-plugin .wpallexport-upload-type-container{
3375
+ padding: 0 40px;
3376
+ }
3377
+ .wpallexport-plugin .wpallexport-import-to{
3378
+ width: 330px;
3379
+ }
3380
+ .wpallexport-plugin .ajax-console .founded_records h4{
3381
+ font-size: 13px;
3382
+ }
3383
+ .wpallexport-plugin .wpallexport-ready-to-go h4{
3384
+ font-size: 12px;
3385
+ }
3386
+ .wpallexport-plugin form.confirm input[type="submit"]{
3387
+ padding: 20px 10px 20px 10px;
3388
+ }
3389
+ .wpallexport-plugin #process_notice,
3390
+ .wpallexport-plugin #export_finished h3{
3391
+ font-size: 13px;
3392
+ }
3393
+ .wpallexport-plugin #export_progress{
3394
+ font-size: 16px;
3395
+ }
3396
+
3397
+ .wpallexport-plugin .change_file .wpallexport-import-types{
3398
+ margin-top: 15px;
3399
+ }
3400
+ .wpallexport-plugin .change_file .wpallexport-import-types h3{
3401
+ font-size: 14px;
3402
+ }
3403
+ .wpallexport-plugin .change_file a.wpallexport-import-from{
3404
+ width: 130px;
3405
+ font-size: 0px;
3406
+ }
3407
+ .wpallexport-plugin .change_file a.wpallexport-import-from .wpallexport-icon{
3408
+ left: 0 !important;
3409
+ }
3410
+ .wpallexport-plugin .change_file #select-files{
3411
+ font-size: 14px;
3412
+ }
3413
+ .wpallexport-plugin .wpallexport-import-to.wpallexport-to-new-items span.wpallexport-import-to-title:before{
3414
+ left: 25%;
3415
+ }
3416
+ .wpallexport-plugin .wpallexport-import-to.wpallexport-to-existing-items span.wpallexport-import-to-title:before{
3417
+ left: 20%;
3418
+ }
3419
+ .wpallexport-plugin .wpallexport-custom-fields textarea{
3420
+ width: 45% !important;
3421
+ }
3422
+ .wpallexport-plugin .pmxi-admin-imports tr td em{
3423
+ display: block;
3424
+ max-width: 225px;
3425
+ }
3426
+ .wpallexport-plugin .wpallexport-extra-text-left{
3427
+ width: 29%;
3428
+ }
3429
+ .wpallexport-plugin .wpallexport-extra-text-right{
3430
+ width: 30%;
3431
+ }
3432
+ .wpallexport-plugin .wpallexport-new-records,
3433
+ .wpallexport-plugin .wpallexport-existing-records{
3434
+ font-size: 11px;
3435
+ }
3436
+ .wpallexport-plugin .wpallexport-ready-to-go{
3437
+ padding-left: 70px;
3438
+ }
3439
+ .wpallexport-plugin .wpallexport-is-continue{
3440
+ margin: 12px 10px 12px 0;
3441
+ }
3442
+ .wpallexport-plugin .wpallexport-ready-to-go h3{
3443
+ font-size: 11px;
3444
+ line-height: 20px;
3445
+ margin-top: 10px;
3446
+ }
3447
+ .wpallexport-plugin .wpallexport-ready-to-go h4{
3448
+ font-size: 11px;
3449
+ }
3450
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="new"]{
3451
+ margin-left: -17%;
3452
+ }
3453
+ .wpallexport-plugin .wpallexport-choose-import-direction[rel="matching"]{
3454
+ margin-left: -16%;
3455
+ }
3456
+ .wpallexport-plugin form.wpallexport-step-3{
3457
+ width: 55%;
3458
+ }
3459
  }
static/img/add-ons/acf-thumb.jpg DELETED
Binary file
static/img/add-ons/woo-commerce-thumb.jpg DELETED
Binary file
static/img/back.png ADDED
Binary file
static/img/collapser.png ADDED
Binary file
static/img/continue.png ADDED
Binary file
static/img/date-picker.gif CHANGED
File without changes
static/img/down.gif CHANGED
File without changes
static/img/drag.png CHANGED
File without changes
static/img/elements.png ADDED
Binary file
static/img/help.png CHANGED
Binary file
static/img/ico-add-new.png CHANGED
File without changes
static/img/ico-remove.png CHANGED
File without changes
static/img/import-templates.png ADDED
Binary file
static/img/left_btn.png ADDED
Binary file
static/img/list.png ADDED
Binary file
static/img/loading.png CHANGED
File without changes
static/img/logo.png ADDED
Binary file
static/img/preloader.png ADDED
Binary file
static/img/progress_animated.gif CHANGED
File without changes
static/img/remove.png ADDED
Binary file
static/img/right_btn.png ADDED
Binary file
static/img/rule.png ADDED
Binary file
static/img/screen-options-right-up.gif CHANGED
File without changes
static/img/screen-options-right.gif CHANGED
File without changes
static/img/soflyy-logo.png ADDED
Binary file
static/img/stars.png CHANGED
File without changes
static/img/trash.png ADDED
Binary file
static/img/xmlicon.png CHANGED
Binary file
static/js/admin.js CHANGED
@@ -2,15 +2,16 @@
2
  * plugin admin area javascript
3
  */
4
  (function($){$(function () {
5
- if ( ! $('body.pmxe_plugin').length) return; // do not execute any code if we are not on plugin page
 
6
 
7
  // fix layout position
8
  setTimeout(function () {
9
- $('table.layout').length && $('table.layout td.left h2:first-child').css('margin-top', $('.wrap').offset().top - $('table.layout').offset().top);
10
  }, 10);
11
 
12
  // help icons
13
- $('a.help').tipsy({
14
  gravity: function() {
15
  var ver = 'n';
16
  if ($(document).scrollTop() < $(this).offset().top - $('.tipsy').height() - 2) {
@@ -53,91 +54,1090 @@
53
  // autoselect input content on click
54
  $('input.selectable').live('click', function () {
55
  $(this).select();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
- // input tags with title
59
- $('input[title]').each(function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  var $this = $(this);
61
- $this.bind('focus', function () {
62
- if ('' == $(this).val() || $(this).val() == $(this).attr('title')) {
63
- $(this).removeClass('note').val('');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
- }).bind('blur', function () {
66
- if ('' == $(this).val() || $(this).val() == $(this).attr('title')) {
67
- $(this).addClass('note').val($(this).attr('title'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
- }).blur();
70
- $this.parents('form').bind('submit', function () {
71
- if ($this.val() == $this.attr('title')) {
72
- $this.val('');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
  });
75
- });
76
 
77
- // datepicker
78
- $('input.datepicker').datepicker({
79
- dateFormat: 'yy-mm-dd',
80
- showOn: 'button',
81
- buttonText: '',
82
- constrainInput: false,
83
- showAnim: 'fadeIn',
84
- showOptions: 'fast'
85
- }).bind('change', function () {
86
- var selectedDate = $(this).val();
87
- var instance = $(this).data('datepicker');
88
- var date = null;
89
- if ('' != selectedDate) {
90
- try {
91
- date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
92
- } catch (e) {
93
- date = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
95
- }
96
- if ($(this).hasClass('range-from')) {
97
- $(this).parent().find('.datepicker.range-to').datepicker("option", "minDate", date);
98
- }
99
- if ($(this).hasClass('range-to')) {
100
- $(this).parent().find('.datepicker.range-from').datepicker("option", "maxDate", date);
101
- }
102
- }).change();
103
- $('.ui-datepicker').hide(); // fix: make sure datepicker doesn't break wordpress layout upon initialization
104
-
105
- // no-enter-submit forms
106
- $('form.no-enter-submit').find('input,select,textarea').not('*[type="submit"]').keydown(function (e) {
107
- if (13 == e.keyCode) e.preventDefault();
108
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
- // enter-submit form on step 1
111
- if ($('.pmxe_step_1').length){
112
- $('body').keydown(function (e) {
113
- if (13 == e.keyCode){
114
- $('form.choose-file').submit();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
116
  });
117
- }
118
-
119
- // choose file form: option selection dynamic
120
- // options form: highlight options of selected post type
121
- $('form.choose-post-type input[name="type"]').click(function() {
122
- var $container = $(this).parents('.file-type-container');
123
- $('.file-type-container').not($container).removeClass('selected').find('.file-type-options').hide();
124
- $container.addClass('selected').find('.file-type-options').show();
125
- }).filter(':checked').click();
126
-
127
- // options form: add / remove custom params
128
- $('.form-table a.action[href="#add"]').live('click', function () {
129
- var $template = $(this).parents('table').first().find('tr.template');
130
- $template.clone(true).insertBefore($template).css('display', 'none').removeClass('template').fadeIn();
131
- return false;
132
- });
133
-
134
- $('.form-table .action.remove a').live('click', function () {
135
- $(this).parents('tr').first().remove();
136
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  });
138
-
139
- $('.pmxe_choosen').each(function(){
140
- $(this).find(".choosen_input").select2({tags: $(this).find('.choosen_values').html().split(',')});
141
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  });})(jQuery);
2
  * plugin admin area javascript
3
  */
4
  (function($){$(function () {
5
+
6
+ if ( ! $('body.wpallexport-plugin').length) return; // do not execute any code if we are not on plugin page
7
 
8
  // fix layout position
9
  setTimeout(function () {
10
+ $('table.wpallexport-layout').length && $('table.wpallexport-layout td.left h2:first-child').css('margin-top', $('.wrap').offset().top - $('table.wpallexport-layout').offset().top);
11
  }, 10);
12
 
13
  // help icons
14
+ $('a.wpallexport-help').tipsy({
15
  gravity: function() {
16
  var ver = 'n';
17
  if ($(document).scrollTop() < $(this).offset().top - $('.tipsy').height() - 2) {
54
  // autoselect input content on click
55
  $('input.selectable').live('click', function () {
56
  $(this).select();
57
+ });
58
+
59
+ $('.pmxe_choosen').each(function(){
60
+ $(this).find(".choosen_input").select2({tags: $(this).find('.choosen_values').html().split(',')});
61
+ });
62
+
63
+ // choose file form: option selection dynamic
64
+ // options form: highlight options of selected post type
65
+ $('form.choose-post-type input[name="type"]').click(function() {
66
+ var $container = $(this).parents('.file-type-container');
67
+ $('.file-type-container').not($container).removeClass('selected').find('.file-type-options').hide();
68
+ $container.addClass('selected').find('.file-type-options').show();
69
+ }).filter(':checked').click();
70
+
71
+ $('.wpallexport-collapsed').each(function(){
72
+
73
+ if ( ! $(this).hasClass('closed')) $(this).find('.wpallexport-collapsed-content:first').slideDown();
74
+
75
  });
76
+
77
+ $('.wpallexport-collapsed').find('.wpallexport-collapsed-header').live('click', function(){
78
+ var $parent = $(this).parents('.wpallexport-collapsed:first');
79
+ if ($parent.hasClass('closed')){
80
+ $parent.removeClass('closed');
81
+ $parent.find('.wpallexport-collapsed-content:first').slideDown();
82
+ }
83
+ else{
84
+ $parent.addClass('closed');
85
+ $parent.find('.wpallexport-collapsed-content:first').slideUp();
86
+ }
87
+ });
88
+
89
+ // Export filtering
90
 
91
+ var init_filtering_fields = function(){
92
+
93
+ var wp_all_export_rules_config = {
94
+ '#wp_all_export_xml_element' : {width:"98%"},
95
+ '#wp_all_export_rule' : {width:"98%"},
96
+ }
97
+
98
+ for (var selector in wp_all_export_rules_config) {
99
+
100
+ $(selector).chosen(wp_all_export_rules_config[selector]);
101
+
102
+ if (selector == '#wp_all_export_xml_element'){
103
+
104
+ $(selector).on('change', function(evt, params) {
105
+
106
+ $('#wp_all_export_available_rules').html('<div class="wp_all_export_preloader" style="display:block;"></div>');
107
+
108
+ var request = {
109
+ action: 'export_available_rules',
110
+ data: {'selected' : params.selected},
111
+ security: wp_all_export_security
112
+ };
113
+ $.ajax({
114
+ type: 'POST',
115
+ url: ajaxurl,
116
+ data: request,
117
+ success: function(response) {
118
+ $('#wp_all_export_available_rules').html(response.html);
119
+ $('#wp_all_export_rule').chosen({width:"98%"});
120
+ $('#wp_all_export_rule').on('change', function(evt, params) {
121
+ if (params.selected == 'is_empty' || params.selected == 'is_not_empty')
122
+ $('#wp_all_export_value').hide();
123
+ else
124
+ $('#wp_all_export_value').show();
125
+ });
126
+ },
127
+ dataType: "json"
128
+ });
129
+ });
130
+ }
131
+ }
132
+
133
+ }
134
+
135
+ var is_first_load = true;
136
+
137
+ var filtering = function(postType){
138
+
139
+ var request = {
140
+ action: 'export_filtering',
141
+ data: {'cpt' : postType, 'export_type' : 'specific', 'filter_rules_hierarhy' : '', 'product_matching_mode' : 'strict'},
142
+ security: wp_all_export_security
143
+ };
144
+
145
+ if (is_first_load == false || postType != '') $('.wp_all_export_preloader').show();
146
+
147
+ is_first_load = false;
148
+
149
+ $.ajax({
150
+ type: 'POST',
151
+ url: ajaxurl,
152
+ data: request,
153
+ success: function(response) {
154
+
155
+ $('.wp_all_export_preloader').hide();
156
+
157
+ if (postType != '')
158
+ {
159
+
160
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').html(response.html);
161
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
162
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').addClass('closed');
163
+ //$('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
164
+
165
+ init_filtering_fields();
166
+
167
+ }
168
+ else
169
+ {
170
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
171
+ //$('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
172
+ }
173
+
174
+ },
175
+ error: function( jqXHR, textStatus ) {
176
+
177
+ $('.wp_all_export_preloader').hide();
178
+
179
+ },
180
+ dataType: "json"
181
+ });
182
+
183
+ }
184
+
185
+ $('#wp_all_export_rule').change(function(){
186
+ if ($(this).val() == 'is_empty' || $(this).val() == 'is_not_empty')
187
+ $('#wp_all_export_value').hide();
188
+ else
189
+ $('#wp_all_export_value').show();
190
+ });
191
+
192
+ // step 1 ( chose & filter export data )
193
+ $('.wpallexport-step-1').each(function(){
194
+
195
+ var $wrap = $('.wrap');
196
+
197
+ var formHeight = $wrap.height();
198
+
199
+ $('.wpallexport-import-from').click(function(){
200
+
201
+ var showImportType = false;
202
+
203
+ switch ($(this).attr('rel')){
204
+ case 'specific_type':
205
+ if ($('input[name=cpt]').val() != ''){
206
+
207
+ if ($('input[name=cpt]').val() == 'users'){
208
+ $('.wpallexport-user-export-notice').show();
209
+ showImportType = false;
210
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
211
+ }
212
+ else
213
+ {
214
+ $('.wpallexport-user-export-notice').hide();
215
+ showImportType = true;
216
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideDown();
217
+ }
218
+ }
219
+ else
220
+ {
221
+ $('.wpallexport-user-export-notice').hide();
222
+ showImportType = false;
223
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
224
+ }
225
+ break;
226
+ case 'advanced_type':
227
+ if ($('input[name=wp_query_selector]').val() == 'wp_user_query')
228
+ {
229
+ $('.wpallexport-user-export-notice').show();
230
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
231
+ showImportType = false;
232
+ }
233
+ else
234
+ {
235
+ $('.wpallexport-user-export-notice').hide();
236
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
237
+ showImportType = true;
238
+ }
239
+ break;
240
+ }
241
+
242
+ $('.wpallexport-import-from').removeClass('selected').addClass('bind');
243
+ $(this).addClass('selected').removeClass('bind');
244
+ $('.wpallexport-choose-file').find('.wpallexport-upload-type-container').hide();
245
+ $('.wpallexport-choose-file').find('.wpallexport-upload-type-container[rel=' + $(this).attr('rel') + ']').show();
246
+ $('.wpallexport-choose-file').find('input[name=export_type]').val( $(this).attr('rel').replace('_type', '') );
247
+
248
+ if ( ! showImportType)
249
+ {
250
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
251
+ }
252
+ else
253
+ {
254
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
255
+ }
256
+
257
+ });
258
+
259
+ $('.wpallexport-import-from.selected').click();
260
+
261
+ $('#file_selector').ddslick({
262
+ width: 600,
263
+ onSelected: function(selectedData){
264
+
265
+ if (selectedData.selectedData.value != ""){
266
+
267
+ $('#file_selector').find('.dd-selected').css({'color':'#555'});
268
+
269
+ var i = 0;
270
+ var postType = selectedData.selectedData.value;
271
+ $('#file_selector').find('.dd-option-value').each(function(){
272
+ if (postType == $(this).val()) return false;
273
+ i++;
274
+ });
275
+
276
+ $('.wpallexport-choose-file').find('input[name=cpt]').val(postType);
277
+
278
+ if (postType == 'users')
279
+ {
280
+ $('.wpallexport-user-export-notice').show();
281
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
282
+ }
283
+ else
284
+ {
285
+ $('.wpallexport-user-export-notice').hide();
286
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
287
+ }
288
+
289
+ filtering(postType);
290
+
291
+ }
292
+ else
293
+ {
294
+ $('.wpallexport-user-export-notice').hide();
295
+ $('.wpallexport-choose-file').find('input[name=cpt]').val('');
296
+ $('#file_selector').find('.dd-selected').css({'color':'#cfceca'});
297
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
298
+
299
+ switch ($('.wpallexport-import-from.selected').attr('rel')){
300
+ case 'specific_type':
301
+ filtering($('input[name=cpt]').val());
302
+ break;
303
+ case 'advanced_type':
304
+ //if ($('input[name=wp_query]').val() != ''){
305
+ // $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
306
+ // }
307
+ // else{
308
+ // $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
309
+ // }
310
+ break;
311
+ }
312
+ }
313
+ }
314
+ });
315
+
316
+ $('form.wpallexport-choose-file').find('input[type=submit]').click(function(e){
317
+ e.preventDefault();
318
+
319
+ $('.hierarhy-output').each(function(){
320
+ var sortable = $('.wp_all_export_filtering_rules.ui-sortable');
321
+ if (sortable.length){
322
+ $(this).val(window.JSON.stringify(sortable.pmxe_nestedSortable('toArray', {startDepthCount: 0})));
323
+ }
324
+ });
325
+
326
+ $(this).parents('form:first').submit();
327
+ });
328
+
329
+ $('#wp_query_selector').ddslick({
330
+ width: 600,
331
+ onSelected: function(selectedData){
332
+
333
+ if ( ! $('.wp_query:visible').length ) return;
334
+
335
+ if (selectedData.selectedData.value != ""){
336
+
337
+ $('#wp_query_selector').find('.dd-selected').css({'color':'#555'});
338
+ var queryType = selectedData.selectedData.value;
339
+ if (queryType == 'wp_query')
340
+ {
341
+ $('.wpallexport-user-export-notice').hide();
342
+ $('textarea[name=wp_query]').attr("placeholder", "'post_type' => 'post', 'post_status' => array( 'pending', 'draft', 'future' )");
343
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').show();
344
+ }
345
+ else
346
+ {
347
+ $('.wpallexport-user-export-notice').show();
348
+ $('textarea[name=wp_query]').attr("placeholder", "'role' => 'Administrator'");
349
+ $('.wpallexport-choose-file').find('.wpallexport-submit-buttons').hide();
350
+ }
351
+ $('input[name=wp_query_selector]').val(queryType);
352
+ }
353
+ else
354
+ {
355
+ $('.wpallexport-user-export-notice').hide();
356
+ $('#wp_query_selector').find('.dd-selected').css({'color':'#cfceca'});
357
+ $('.wpallexport-choose-file').find('.wpallexport-upload-resource-step-two').slideUp();
358
+ }
359
+ }
360
+ });
361
+
362
+ });
363
+ //[/End Step 1]
364
+
365
+ // step 2 ( export template )
366
+ $('.wpallexport-export-template').each(function(){
367
+
368
+ var offset = $('#available_data').offset();
369
+
370
+ var offsetTop = $('.error:visible').length ? offset.top + 45 : offset.top;
371
+
372
+ $('.wpallexport-step-3').css({'top': (offsetTop) + 'px'});
373
+
374
+ $is_show_warning = true;
375
+ $is_show_sku_warning = 2;
376
+ $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
377
+ $('#columns').find('li').each(function(){
378
+ if ($(this).find('input[name^=cc_type]').val() == 'id'){
379
+ $is_show_warning = false;
380
+ }
381
+ if ($(this).find('input[name^=cc_label]').val() == '_sku'){
382
+ $is_show_sku_warning--;
383
+ }
384
+ if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
385
+ $is_show_sku_warning--;
386
+ }
387
+ if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
388
+ $is_show_advanced_query_warning = 0;
389
+ }
390
+ });
391
+
392
+ if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
393
+ if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
394
+ if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
395
+
396
+ var $sortable = $( "#columns" );
397
+
398
+ $( "#available_data li:not(.wpallexport_disabled)" ).draggable({
399
+ appendTo: "body",
400
+ helper: "clone"
401
+ });
402
+
403
+ var outsideContainer = 0;
404
+
405
+ // this one control if the draggable is outside the droppable area
406
+ $('#columns_to_export').droppable({
407
+ accept : '.ui-sortable-helper'
408
+ });
409
+
410
+ $( "#columns_to_export" ).on( "dropout", function( event, ui ) {
411
+ outsideContainer = 1;
412
+ ui.draggable.find('.custom_column').css('background', 'pink');
413
+ } );
414
+
415
+ $( "#columns_to_export" ).on( "dropover", function( event, ui ) {
416
+ outsideContainer = 0;
417
+ ui.draggable.find('.custom_column').css('background', 'none');
418
+ } );
419
+
420
+ // this one control if the draggable is dropped
421
+ $('body, form.wpallexport-template').droppable({
422
+ accept : '.ui-sortable-helper',
423
+ drop : function(event, ui){
424
+ if(outsideContainer == 1){
425
+ ui.draggable.remove();
426
+ }else{
427
+ ui.draggable.find('.custom_column').css('background', 'none');
428
+ }
429
+ }
430
+ });
431
+
432
+ $( "#columns_to_export ol" ).droppable({
433
+ activeClass: "pmxe-state-default",
434
+ hoverClass: "pmxe-state-hover",
435
+ accept: ":not(.ui-sortable-helper)",
436
+ drop: function( event, ui ) {
437
+ $( this ).find( ".placeholder" ).hide();
438
+
439
+ if (ui.draggable.find('input[name^=rules]').length){
440
+ $('li.' + ui.draggable.find('input[name^=rules]').val()).each(function(){
441
+ var $value = $(this).find('input[name^=cc_value]').val();
442
+ var $add_field = true;
443
+ $('#columns').find('li').each(function(){
444
+ if ($(this).find('input[name^=cc_value]').val() == $value){
445
+ $add_field = false;
446
+ }
447
+ });
448
+ if ($add_field)
449
+ {
450
+ $( "<li></li>" ).html( $(this).html() ).appendTo( $( "#columns_to_export ol" ) );
451
+ $('#columns').find('li:last').find('div:first').attr('rel', $('#columns').find('li:not(.placeholder)').length);
452
+ }
453
+ });
454
+ }
455
+ else{
456
+ $( "<li></li>" ).html( ui.draggable.html() ).appendTo( this );
457
+ $('#columns').find('li:last').find('div:first').attr('rel', $('#columns').find('li:not(.placeholder)').length);
458
+ }
459
+
460
+ $is_show_warning = true;
461
+ $is_show_sku_warning = 2;
462
+ $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
463
+ $('#columns').find('li').each(function(){
464
+ if ($(this).find('input[name^=cc_type]').val() == 'id'){
465
+ $is_show_warning = false;
466
+ }
467
+ if ($(this).find('input[name^=cc_label]').val() == '_sku'){
468
+ $is_show_sku_warning--;
469
+ }
470
+ if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
471
+ $is_show_sku_warning--;
472
+ }
473
+ if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
474
+ $is_show_advanced_query_warning = 0;
475
+ }
476
+ });
477
+
478
+ if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
479
+ if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
480
+ if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
481
+
482
+ }
483
+ }).sortable({
484
+ items: "li:not(.placeholder)",
485
+ sort: function() {
486
+ // gets added unintentionally by droppable interacting with sortable
487
+ // using connectWithSortable fixes this, but doesn't allow you to customize active/hoverClass options
488
+ $( this ).removeClass( "ui-state-default" );
489
+ }
490
+ });
491
+
492
  var $this = $(this);
493
+ var $addAnother = $this.find('input.add_column');
494
+ var $addAnotherForm = $('fieldset.wp-all-export-edit-column');
495
+ var $template = $(this).find('.custom_column.template');
496
+
497
+ if (typeof wpPointerL10n != "undefined") wpPointerL10n.dismiss = 'Close';
498
+
499
+ /**
500
+ * Add Another btn click
501
+ */
502
+ $addAnother.click(function(){
503
+ $addAnotherForm.find('form')[0].reset();
504
+ $addAnotherForm.removeAttr('rel');
505
+ $addAnotherForm.removeClass('dc').addClass('cc');
506
+ $addAnotherForm.find('.cc_field').hide();
507
+
508
+ $addAnotherForm.find('.wpallexport-edit-row-title').hide();
509
+ $addAnotherForm.find('.wpallexport-add-row-title').show();
510
+ $addAnotherForm.find('div[class^=switcher-target]').hide();
511
+ $addAnotherForm.find('#coperate_php').removeAttr('checked');
512
+ $addAnotherForm.find('input.column_name').parents('div.input:first').show();
513
+
514
+ $('.custom_column').removeClass('active');
515
+
516
+ $addAnotherForm.find('select[name=column_value_type]').find('option').each(function(){
517
+ if ($(this).val() == 'id')
518
+ $(this).attr({'selected':'selected'}).click();
519
+ else
520
+ $(this).removeAttr('selected');
521
+ });
522
+
523
+ $('.wp-all-export-chosen-select').trigger('chosen:updated');
524
+
525
+ $('.wpallexport-overlay').show();
526
+ $addAnotherForm.show();
527
+
528
+ });
529
+ /**
530
+ * Delete custom column action
531
+ */
532
+ $addAnotherForm.find('.delete_action').click(function(){
533
+
534
+ $('.custom_column').removeClass('active');
535
+
536
+ $('.custom_column[rel='+ $addAnotherForm.attr('rel') +']').parents('li:first').fadeOut().remove();
537
+
538
+ if ( ! $('#columns').find('li:visible').length ){
539
+ $('#columns').find( ".placeholder" ).show();
540
  }
541
+
542
+ $is_show_warning = true;
543
+ $is_show_sku_warning = 2;
544
+ $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
545
+ $('#columns').find('li:not(.placeholder)').each(function(i, e){
546
+ $(this).find('div.custom_column:first').attr('rel', i + 1);
547
+ if ($(this).find('input[name^=cc_type]').val() == 'id'){
548
+ $is_show_warning = false;
549
+ }
550
+ if ($(this).find('input[name^=cc_label]').val() == '_sku'){
551
+ $is_show_sku_warning--;
552
+ }
553
+ if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
554
+ $is_show_sku_warning--;
555
+ }
556
+ if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
557
+ $is_show_advanced_query_warning = 0;
558
+ }
559
+ });
560
+
561
+ if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
562
+ if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
563
+ if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
564
+
565
+ $addAnotherForm.fadeOut();
566
+ $('.wpallexport-overlay').hide();
567
+ });
568
+
569
+ $('.remove-field').live('click', function(e){
570
+ e.stopPropagation();
571
+ $(this).parents('li:first').fadeOut().remove();
572
+ if ( ! $('#columns').find('li:visible').length ){
573
+ $('#columns').find( ".placeholder" ).show();
574
  }
575
+
576
+ $is_show_warning = true;
577
+ $is_show_sku_warning = 2;
578
+ $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
579
+ $('#columns').find('li:not(.placeholder)').each(function(i, e){
580
+ $(this).find('div.custom_column:first').attr('rel', i + 1);
581
+ if ($(this).find('input[name^=cc_type]').val() == 'id'){
582
+ $is_show_warning = false;
583
+ }
584
+ if ($(this).find('input[name^=cc_label]').val() == '_sku'){
585
+ $is_show_sku_warning--;
586
+ }
587
+ if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
588
+ $is_show_sku_warning--;
589
+ }
590
+ if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
591
+ $is_show_advanced_query_warning = 0;
592
+ }
593
+ });
594
+
595
+ if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
596
+ if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
597
+ if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
598
+ });
599
+
600
+ /**
601
+ * Add/Edit custom column action
602
+ */
603
+ $addAnotherForm.find('.save_action').click(function(){
604
+
605
+ var $value_type = $addAnotherForm.find('select[name=column_value_type]');
606
+ var $php_code = $addAnotherForm.find('.php_code:visible');
607
+ var $name = $addAnotherForm.find('input.column_name');
608
+ var $export_data_type = $addAnotherForm.find('input[name=export_data_type]');
609
+
610
+ var $save = true;
611
+
612
+ if ($export_data_type.val() == 'shop_order'){
613
+ $name.val($value_type.find('option:selected').html());
614
+ }
615
+
616
+ if ($name.val() == '')
617
+ {
618
+ $save = false;
619
+ $name.addClass('error');
620
+ }
621
+
622
+ if ($save)
623
+ {
624
+ var $clone = ($addAnotherForm.attr('rel')) ? $('#columns').find('.custom_column[rel='+ $addAnotherForm.attr('rel') +']') : $template.clone(true);
625
+ if (!parseInt($addAnotherForm.attr('rel'))) $clone.attr('rel', $('#columns').find('.custom_column').length + 1);
626
+
627
+ $clone.find('input[name^=cc_php]').val($addAnotherForm.find('#coperate_php').is(':checked') ? '1' : '0');
628
+ $clone.find('input[name^=cc_code]').val($php_code.val());
629
+ $clone.find('input[name^=cc_sql]').val($addAnotherForm.find('textarea.column_value').val());
630
+ $clone.find('input[name^=cc_name]').val($name.val());
631
+
632
+ if ($export_data_type.val() == 'shop_order'){
633
+ $clone.find('input[name^=cc_type]').val('woo_order');
634
+ }
635
+ else{
636
+ $clone.find('input[name^=cc_type]').val($value_type.val());
637
+ }
638
+
639
+ $clone.find('label.wpallexport-xml-element').html("&lt;" + $name.val() + "&gt;");
640
+
641
+ if (!parseInt($addAnotherForm.attr('rel'))){
642
+ $( "#columns" ).find( ".placeholder" ).hide();
643
+ $sortable.append('<li></li>');
644
+ $sortable.find('li:last').append($clone.removeClass('template').fadeIn());
645
+ }
646
+
647
+ var availableData = $('#available_data');
648
+
649
+ switch ( $clone.find('input[name^=cc_type]').val() ){
650
+ case 'media':
651
+ $clone.find('input[name^=cc_options]').val($addAnotherForm.find('select.media_field_export_data').val());
652
+ break;
653
+ case 'date':
654
+ var $dateType = $addAnotherForm.find('select.date_field_export_data').val();
655
+ if ($dateType == 'unix')
656
+ $clone.find('input[name^=cc_options]').val('unix');
657
+ else
658
+ $clone.find('input[name^=cc_options]').val($('.pmxe_date_format').val());
659
+ break;
660
+ case 'cf':
661
+ var $value = $addAnotherForm.find('.cf_direct_value');
662
+ $clone.find('input[name^=cc_value]').val($value.val());
663
+ $clone.find('input[name^=cc_label]').val($value.val());
664
+ break;
665
+ case 'acf':
666
+ var $value = $addAnotherForm.find('.acf_direct_value');
667
+ $clone.find('input[name^=cc_value]').val($value.val());
668
+ $clone.find('input[name^=cc_label]').val($value.val());
669
+ availableData.find('.custom_column').each(function(){
670
+ if ($(this).find('input[name^=cc_value]').val() == $value.val()){
671
+ $clone.find('input[name^=cc_options]').val($(this).find('input[name^=cc_options]').val());
672
+ }
673
+ });
674
+ break;
675
+ case 'woo':
676
+ var $value = $addAnotherForm.find('.woo_direct_value');
677
+ $clone.find('input[name^=cc_value]').val($value.val());
678
+ $clone.find('input[name^=cc_label]').val($value.val());
679
+ break;
680
+ case 'attr':
681
+ var $value = $addAnotherForm.find('.attr_direct_value');
682
+ $clone.find('input[name^=cc_value]').val($value.val());
683
+ $clone.find('input[name^=cc_label]').val($value.val());
684
+ break;
685
+ case 'cats':
686
+ var $value = $addAnotherForm.find('.cats_direct_value');
687
+ $clone.find('input[name^=cc_value]').val($value.val());
688
+ $clone.find('input[name^=cc_label]').val($value.val());
689
+ break;
690
+ case 'woo_order':
691
+ $clone.find('input[name^=cc_value]').val($value_type.val());
692
+ $clone.find('input[name^=cc_label]').val($value_type.val());
693
+ $clone.find('input[name^=cc_options]').val($value_type.find('option:selected').attr('rel'));
694
+ break;
695
+ default:
696
+ $clone.find('input[name^=cc_label]').val($value_type.val());
697
+ break;
698
+ }
699
+
700
+ $is_show_warning = true;
701
+ $is_show_sku_warning = 2;
702
+ $is_show_advanced_query_warning = $('.wp-all-export-advanced-query-warning').length;
703
+ $('#columns').find('li').each(function(){
704
+ if ($(this).find('input[name^=cc_type]').val() == 'id'){
705
+ $is_show_warning = false;
706
+ }
707
+ if ($(this).find('input[name^=cc_label]').val() == '_sku'){
708
+ $is_show_sku_warning--;
709
+ }
710
+ if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
711
+ $is_show_sku_warning--;
712
+ }
713
+ if ($(this).find('input[name^=cc_label]').val() == 'post_type'){
714
+ $is_show_advanced_query_warning = 0;
715
+ }
716
+ });
717
+
718
+ if ($is_show_warning) $('.wp-all-export-warning').show(); else $('.wp-all-export-warning').hide();
719
+ if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
720
+ if ($is_show_advanced_query_warning > 0) $('.wp-all-export-advanced-query-warning').show(); else $('.wp-all-export-advanced-query-warning').hide();
721
+
722
+ $addAnotherForm.hide();
723
+
724
+ $('.wpallexport-overlay').hide();
725
+
726
+ $('.custom_column').removeClass('active');
727
+
728
  }
729
  });
 
730
 
731
+ $addAnotherForm.find('input[type=text], textarea').focus(function(){$(this).removeClass('error');});
732
+
733
+ /**
734
+ * Click on column for edit
735
+ */
736
+ $('#columns').find('.custom_column').live('click', function(){
737
+ $addAnotherForm.find('form')[0].reset();
738
+ $addAnotherForm.removeClass('dc').addClass('cc');
739
+ $addAnotherForm.attr('rel', $(this).attr('rel'));
740
+
741
+ $addAnotherForm.find('.wpallexport-add-row-title').hide();
742
+ $addAnotherForm.find('.wpallexport-edit-row-title').show();
743
+
744
+ $addAnotherForm.find('input.column_name').parents('div.input:first').show();
745
+
746
+ $addAnotherForm.find('.cc_field').hide();
747
+ $('.custom_column').removeClass('active');
748
+ $(this).addClass('active');
749
+
750
+ var $export_data_type = $addAnotherForm.find('input[name=export_data_type]');
751
+ var $type = '';
752
+
753
+ // set field type
754
+ if ($export_data_type.val() == 'shop_order'){
755
+ $type = $(this).find('input[name^=cc_value]');
756
+ $addAnotherForm.find('select[name=column_value_type]').find('option').each(function(){
757
+ if ($(this).val() == $type.val())
758
+ $(this).attr({'selected':'selected'}).click();
759
+ else
760
+ $(this).removeAttr('selected');
761
+ });
762
  }
763
+ else{
764
+ $type = $(this).find('input[name^=cc_type]');
765
+ $addAnotherForm.find('select[name=column_value_type]').find('option').each(function(){
766
+ if ($(this).val() == $type.val())
767
+ $(this).attr({'selected':'selected'}).click();
768
+ else
769
+ $(this).removeAttr('selected');
770
+ });
771
+ }
772
+
773
+ $('.wp-all-export-chosen-select').trigger('chosen:updated');
774
+
775
+ // set php snipped
776
+ var $php_code = $(this).find('input[name^=cc_code]');
777
+ var $is_php = parseInt($(this).find('input[name^=cc_php]').val());
778
+
779
+ if ($is_php){
780
+ $addAnotherForm.find('#coperate_php').attr({'checked':'checked'});
781
+ $addAnotherForm.find('#coperate_php').parents('div.input:first').find('div[class^=switcher-target]').show();
782
+ }
783
+ else{
784
+ $addAnotherForm.find('#coperate_php').removeAttr('checked');
785
+ $addAnotherForm.find('#coperate_php').parents('div.input:first').find('div[class^=switcher-target]').hide();
786
+ }
787
+
788
+ $addAnotherForm.find('#coperate_php').parents('div.input:first').find('.php_code').val($php_code.val());
789
+
790
+ var $options = $(this).find('input[name^=cc_options]').val();
791
+
792
+ switch ( $type.val() ){
793
+ case 'sql':
794
+ $addAnotherForm.find('textarea.column_value').val($(this).find('input[name^=cc_sql]').val());
795
+ $addAnotherForm.find('.sql_field_type').show();
796
+ break;
797
+ case 'cf':
798
+ $addAnotherForm.find('.cf_direct_value').val($(this).find('input[name^=cc_value]').val());
799
+ $addAnotherForm.find('.cf_field_type').show();
800
+ break;
801
+ case 'acf':
802
+ $addAnotherForm.find('.acf_direct_value').val($(this).find('input[name^=cc_value]').val());
803
+ $addAnotherForm.find('.acf_field_type').show();
804
+ break;
805
+ case 'woo':
806
+ $addAnotherForm.find('.woo_direct_value').val($(this).find('input[name^=cc_value]').val());
807
+ $addAnotherForm.find('.woo_field_type').show();
808
+ break;
809
+ case 'attr':
810
+ $addAnotherForm.find('.attr_direct_value').val($(this).find('input[name^=cc_value]').val());
811
+ $addAnotherForm.find('.attr_field_type').show();
812
+ break;
813
+ case 'cats':
814
+ $addAnotherForm.find('.cats_direct_value').val($(this).find('input[name^=cc_value]').val());
815
+ $addAnotherForm.find('.cats_field_type').show();
816
+ break;
817
+ case 'date':
818
+ $addAnotherForm.find('select.date_field_export_data').find('option').each(function(){
819
+ if ($(this).val() == $options || $options != 'unix' && $(this).val() == 'php')
820
+ $(this).attr({'selected':'selected'}).click();
821
+ else
822
+ $(this).removeAttr('selected');
823
+ });
824
 
825
+ if ($options != 'php' && $options != 'unix'){
826
+ $('.pmxe_date_format').val($options);
827
+ $('.pmxe_date_format_wrapper').show();
828
+ }
829
+ else
830
+ $('.pmxe_date_format').val('');
831
+ $addAnotherForm.find('.date_field_type').show();
832
+ break;
833
+ case 'media':
834
+ $addAnotherForm.find('select.media_field_export_data').find('option').each(function(){
835
+ if ($(this).val() == $options)
836
+ $(this).attr({'selected':'selected'}).click();
837
+ else
838
+ $(this).removeAttr('selected');
839
+ });
840
+ $addAnotherForm.find('.media_field_type').show();
841
+ break;
842
+ }
843
+
844
+ $addAnotherForm.find('input.column_name').val($(this).find('input[name^=cc_name]').val());
845
+ $addAnotherForm.show();
846
+ $('.wpallexport-overlay').show();
847
+
848
+ });
849
+
850
+ $is_show_sku_warning = 2;
851
+ $('#columns').find('li').each(function(){
852
+ if ($(this).find('input[name^=cc_label]').val() == '_sku'){
853
+ $is_show_sku_warning--;
854
+ }
855
+ if ($(this).find('input[name^=cc_label]').val() == 'product_type'){
856
+ $is_show_sku_warning--;
857
  }
858
  });
859
+
860
+ if ($is_show_sku_warning > 0) $('.wp-all-export-sku-warning').show(); else $('.wp-all-export-sku-warning').hide();
861
+
862
+ /**
863
+ * Preview export file
864
+ */
865
+
866
+ var doPreview = function( ths, tagno ){
867
+
868
+ $('.wpallexport-overlay').show();
869
+
870
+ ths.pointer({
871
+ content: '<div class="wpallexport-preview-preload wpallexport-pointer-preview"></div>',
872
+ position: {
873
+ edge: 'right',
874
+ align: 'center'
875
+ },
876
+ pointerWidth: 715,
877
+ close: function() {
878
+ $.post( ajaxurl, {
879
+ pointer: 'pksn1',
880
+ action: 'dismiss-wp-pointer'
881
+ });
882
+ $('.wpallexport-overlay').hide();
883
+ }
884
+ }).pointer('open');
885
+
886
+ var $pointer = $('.wpallexport-pointer-preview').parents('.wp-pointer').first();
887
+
888
+ var $leftOffset = ($(window).width() - 715)/2;
889
+
890
+ $pointer.css({'position':'fixed', 'top' : '15%', 'left' : $leftOffset + 'px'});
891
+
892
+ var request = {
893
+ action: 'export_preview',
894
+ data: $('form.wpallexport-step-3').serialize(),
895
+ tagno: tagno,
896
+ security: wp_all_export_security
897
+ };
898
+
899
+ $.ajax({
900
+ type: 'POST',
901
+ url: ajaxurl + ((typeof export_id != "undefined") ? '?id=' + export_id : ''),
902
+ data: request,
903
+ success: function(response) {
904
+
905
+ ths.pointer({'content' : response.html});
906
+
907
+ $pointer.css({'position':'fixed', 'top' : '15%', 'left' : $leftOffset + 'px'});
908
+
909
+ var $preview = $('.wpallexport-preview');
910
+
911
+ $preview.parent('.wp-pointer-content').removeClass('wp-pointer-content').addClass('wpallexport-pointer-content');
912
+
913
+ $preview.find('.navigation a').unbind('click').die('click').live('click', function () {
914
+
915
+ tagno += '#prev' == $(this).attr('href') ? -1 : 1;
916
+
917
+ doPreview(ths, tagno);
918
+
919
+ });
920
+
921
+ },
922
+ error: function( jqXHR, textStatus ) {
923
+
924
+ ths.pointer({'content' : jqXHR.responseText});
925
+
926
+ },
927
+ dataType: "json"
928
+ });
929
+
930
+ };
931
+
932
+ $(this).find('.preview_a_row').click( function(){
933
+ doPreview($(this), 1);
934
+ });
935
+
936
+ $('.wpae-available-fields-group').click(function(){
937
+ var $mode = $(this).find('.wpae-expander').text();
938
+ $(this).next('div').slideToggle();
939
+ if ($mode == '+') $(this).find('.wpae-expander').text('-'); else $(this).find('.wpae-expander').text('+');
940
+ });
941
+
942
+ $('.pmxe_remove_column').live('click', function(){
943
+ $(this).parents('li:first').remove();
944
+ });
945
+
946
+ $('.close_action').click(function(){
947
+ $(this).parents('fieldset:first').hide();
948
+ $('.wpallexport-overlay').hide();
949
+ $('#columns').find('div.active').removeClass('active');
950
+ });
951
+
952
+ $('.cf_direct_value').each(function(){
953
+ $(this).autocomplete({
954
+ source: eval('__META_KEYS'),
955
+ minLength: 0
956
+ }).click(function () {
957
+ $(this).autocomplete('search', '');
958
+ $(this).attr('rel', '');
959
+ });
960
+ });
961
+
962
+ $('.woo_direct_value').each(function(){
963
+ $(this).autocomplete({
964
+ source: eval('__WOO_KEYS'),
965
+ minLength: 0
966
+ }).click(function () {
967
+ $(this).autocomplete('search', '');
968
+ $(this).attr('rel', '');
969
+ });
970
+ });
971
+
972
+ $('.attr_direct_value').each(function(){
973
+ $(this).autocomplete({
974
+ source: eval('__ATTR_KEYS'),
975
+ minLength: 0
976
+ }).click(function () {
977
+ $(this).autocomplete('search', '');
978
+ $(this).attr('rel', '');
979
+ });
980
+ });
981
+
982
+ $('.acf_direct_value').each(function(){
983
+ $(this).autocomplete({
984
+ source: eval('__ACF_KEYS'),
985
+ minLength: 0
986
+ }).click(function () {
987
+ $(this).autocomplete('search', '');
988
+ $(this).attr('rel', '');
989
+ });
990
+ });
991
+
992
+ $('.cats_direct_value').each(function(){
993
+ $(this).autocomplete({
994
+ source: eval('__TAXES_KEYS'),
995
+ minLength: 0
996
+ }).click(function () {
997
+ $(this).autocomplete('search', '');
998
+ $(this).attr('rel', '');
999
+ });
1000
+ });
1001
+
1002
+ $('.date_field_export_data').change(function(){
1003
+ if ($(this).val() == "unix")
1004
+ $('.pmxe_date_format_wrapper').hide();
1005
+ else
1006
+ $('.pmxe_date_format_wrapper').show();
1007
+ });
1008
+
1009
+ $('.xml-expander').live('click', function () {
1010
+ var method;
1011
+ if ('-' == $(this).text()) {
1012
+ $(this).text('+');
1013
+ method = 'addClass';
1014
+ } else {
1015
+ $(this).text('-');
1016
+ method = 'removeClass';
1017
+ }
1018
+ // for nested representation based on div
1019
+ $(this).parent().find('> .xml-content')[method]('collapsed');
1020
+ // for nested representation based on tr
1021
+ var $tr = $(this).parent().parent().filter('tr.xml-element').next()[method]('collapsed');
1022
+ });
1023
+
1024
+ $('.wp-all-export-edit-column').css('left', ($( document ).width()/2) - 355 );
1025
+
1026
+ var wp_all_export_config = {
1027
+ '.wp-all-export-chosen-select' : {width:"50%"}
1028
+ }
1029
+
1030
+ for (var selector in wp_all_export_config) {
1031
+ $(selector).chosen(wp_all_export_config[selector]);
1032
+ $(selector).on('change', function(evt, params) {
1033
+ $('.cc_field').hide();
1034
+ switch ($(selector).val()){
1035
+ case 'media':
1036
+ $('.media_field_type').show();
1037
+ break;
1038
+ case 'date':
1039
+ $('.date_field_type').show();
1040
+ break;
1041
+ case 'sql':
1042
+ $('.sql_field_type').show();
1043
+ break;
1044
+ case 'cf':
1045
+ $('.cf_field_type').show();
1046
+ break;
1047
+ case 'acf':
1048
+ $('.acf_field_type').show();
1049
+ break;
1050
+ case 'woo':
1051
+ $('.woo_field_type').show();
1052
+ break;
1053
+ case 'attr':
1054
+ $('.attr_field_type').show();
1055
+ break;
1056
+ case 'cats':
1057
+ $('.cats_field_type').show();
1058
+ break;
1059
+ }
1060
+ });
1061
+ }
1062
+
1063
+ $('.wp-all-export-advanced-field-options').click(function(){
1064
+ if ($(this).find('span').html() == '+'){
1065
+ $(this).find('span').html('-');
1066
+ $('.wp-all-export-advanced-field-options-content').fadeIn();
1067
+ }
1068
+ else{
1069
+ $(this).find('span').html('+');
1070
+ $('.wp-all-export-advanced-field-options-content').hide();
1071
+ }
1072
+ });
1073
+
1074
+ // Auto generate available data
1075
+ $('#wp_all_export_auto_generate_data').click(function(){
1076
+
1077
+ $('ol#columns').find('li:not(.placeholder)').fadeOut().remove();
1078
+
1079
+ $('#available_data').find('li.wp_all_export_auto_generate, li.pmxe_cats').each(function(i, e){
1080
+ var clone = $(this).clone();
1081
+ clone.attr('rel', i);
1082
+ $( "<li></li>" ).html( clone.html() ).appendTo( $( "#columns_to_export ol" ) );
1083
+ });
1084
+
1085
+ });
1086
+
1087
  });
1088
+ //[/End Step 2]
1089
+
1090
+ // step 3 ( export options )
1091
+ if ( $('.wpallexport-step-4').length ){
1092
+
1093
+ if ($('input[name^=selected_post_type]').length){
1094
+
1095
+ var postType = $('input[name^=selected_post_type]').val();
1096
+
1097
+ init_filtering_fields();
1098
+
1099
+ $('form.choose-export-options').find('input[type=submit]').click(function(e){
1100
+ e.preventDefault();
1101
+
1102
+ $('.hierarhy-output').each(function(){
1103
+ var sortable = $('.wp_all_export_filtering_rules.ui-sortable');
1104
+ if (sortable.length){
1105
+ $(this).val(window.JSON.stringify(sortable.pmxe_nestedSortable('toArray', {startDepthCount: 0})));
1106
+ }
1107
+ });
1108
+
1109
+ $(this).parents('form:first').submit();
1110
+ });
1111
+
1112
+ }
1113
+
1114
+ }
1115
+ //[/End Step 3]
1116
+
1117
+ // additional functionality
1118
+
1119
+ $('.wpallexport-overlay').click(function(){
1120
+ $('.wp-pointer').hide();
1121
+ $('#columns').find('div.active').removeClass('active');
1122
+ $('fieldset.wp-all-export-edit-column').hide();
1123
+ $(this).hide();
1124
+ });
1125
+
1126
+ var fix_tag_position = function(){
1127
+ if ( $('.wpallexport-step-3').length ){
1128
+ var offset = $('#available_data').offset();
1129
+
1130
+ if ($(document).scrollTop() > offset.top){
1131
+ $('.wpallexport-step-3').css({'top':'10px'});
1132
+ }
1133
+ else{
1134
+ $('.wpallexport-step-3').css({'top': (offset.top - $(document).scrollTop()) + 'px'});
1135
+ }
1136
+ }
1137
+ }
1138
+
1139
+ $(document).scroll(function() {
1140
+ fix_tag_position();
1141
+ });
1142
 
1143
  });})(jQuery);
static/js/jquery/chosen.jquery.js ADDED
@@ -0,0 +1,1263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Chosen, a Select Box Enhancer for jQuery and Prototype
3
+ by Patrick Filler for Harvest, http://getharvest.com
4
+
5
+ Version 1.4.2
6
+ Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2015 Harvest http://getharvest.com
8
+
9
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
+ This file is generated by `grunt build`, do not edit it by hand.
11
+ */
12
+
13
+ (function() {
14
+ var $, AbstractChosen, Chosen, SelectParser, _ref,
15
+ __hasProp = {}.hasOwnProperty,
16
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
17
+
18
+ SelectParser = (function() {
19
+ function SelectParser() {
20
+ this.options_index = 0;
21
+ this.parsed = [];
22
+ }
23
+
24
+ SelectParser.prototype.add_node = function(child) {
25
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
26
+ return this.add_group(child);
27
+ } else {
28
+ return this.add_option(child);
29
+ }
30
+ };
31
+
32
+ SelectParser.prototype.add_group = function(group) {
33
+ var group_position, option, _i, _len, _ref, _results;
34
+ group_position = this.parsed.length;
35
+ this.parsed.push({
36
+ array_index: group_position,
37
+ group: true,
38
+ label: this.escapeExpression(group.label),
39
+ title: group.title ? group.title : void 0,
40
+ children: 0,
41
+ disabled: group.disabled,
42
+ classes: group.className
43
+ });
44
+ _ref = group.childNodes;
45
+ _results = [];
46
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
47
+ option = _ref[_i];
48
+ _results.push(this.add_option(option, group_position, group.disabled));
49
+ }
50
+ return _results;
51
+ };
52
+
53
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
54
+ if (option.nodeName.toUpperCase() === "OPTION") {
55
+ if (option.text !== "") {
56
+ if (group_position != null) {
57
+ this.parsed[group_position].children += 1;
58
+ }
59
+ this.parsed.push({
60
+ array_index: this.parsed.length,
61
+ options_index: this.options_index,
62
+ value: option.value,
63
+ text: option.text,
64
+ html: option.innerHTML,
65
+ title: option.title ? option.title : void 0,
66
+ selected: option.selected,
67
+ disabled: group_disabled === true ? group_disabled : option.disabled,
68
+ group_array_index: group_position,
69
+ group_label: group_position != null ? this.parsed[group_position].label : null,
70
+ classes: option.className,
71
+ style: option.style.cssText
72
+ });
73
+ } else {
74
+ this.parsed.push({
75
+ array_index: this.parsed.length,
76
+ options_index: this.options_index,
77
+ empty: true
78
+ });
79
+ }
80
+ return this.options_index += 1;
81
+ }
82
+ };
83
+
84
+ SelectParser.prototype.escapeExpression = function(text) {
85
+ var map, unsafe_chars;
86
+ if ((text == null) || text === false) {
87
+ return "";
88
+ }
89
+ if (!/[\&\<\>\"\'\`]/.test(text)) {
90
+ return text;
91
+ }
92
+ map = {
93
+ "<": "&lt;",
94
+ ">": "&gt;",
95
+ '"': "&quot;",
96
+ "'": "&#x27;",
97
+ "`": "&#x60;"
98
+ };
99
+ unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
100
+ return text.replace(unsafe_chars, function(chr) {
101
+ return map[chr] || "&amp;";
102
+ });
103
+ };
104
+
105
+ return SelectParser;
106
+
107
+ })();
108
+
109
+ SelectParser.select_to_array = function(select) {
110
+ var child, parser, _i, _len, _ref;
111
+ parser = new SelectParser();
112
+ _ref = select.childNodes;
113
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
114
+ child = _ref[_i];
115
+ parser.add_node(child);
116
+ }
117
+ return parser.parsed;
118
+ };
119
+
120
+ AbstractChosen = (function() {
121
+ function AbstractChosen(form_field, options) {
122
+ this.form_field = form_field;
123
+ this.options = options != null ? options : {};
124
+ if (!AbstractChosen.browser_is_supported()) {
125
+ return;
126
+ }
127
+ this.is_multiple = this.form_field.multiple;
128
+ this.set_default_text();
129
+ this.set_default_values();
130
+ this.setup();
131
+ this.set_up_html();
132
+ this.register_observers();
133
+ this.on_ready();
134
+ }
135
+
136
+ AbstractChosen.prototype.set_default_values = function() {
137
+ var _this = this;
138
+ this.click_test_action = function(evt) {
139
+ return _this.test_active_click(evt);
140
+ };
141
+ this.activate_action = function(evt) {
142
+ return _this.activate_field(evt);
143
+ };
144
+ this.active_field = false;
145
+ this.mouse_on_container = false;
146
+ this.results_showing = false;
147
+ this.result_highlighted = null;
148
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
149
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
150
+ this.disable_search = this.options.disable_search || false;
151
+ this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
152
+ this.group_search = this.options.group_search != null ? this.options.group_search : true;
153
+ this.search_contains = this.options.search_contains || false;
154
+ this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
155
+ this.max_selected_options = this.options.max_selected_options || Infinity;
156
+ this.inherit_select_classes = this.options.inherit_select_classes || false;
157
+ this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
158
+ this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
159
+ return this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
160
+ };
161
+
162
+ AbstractChosen.prototype.set_default_text = function() {
163
+ if (this.form_field.getAttribute("data-placeholder")) {
164
+ this.default_text = this.form_field.getAttribute("data-placeholder");
165
+ } else if (this.is_multiple) {
166
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
167
+ } else {
168
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
169
+ }
170
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
171
+ };
172
+
173
+ AbstractChosen.prototype.choice_label = function(item) {
174
+ if (this.include_group_label_in_selected && (item.group_label != null)) {
175
+ return "<b class='group-name'>" + item.group_label + "</b>" + item.html;
176
+ } else {
177
+ return item.html;
178
+ }
179
+ };
180
+
181
+ AbstractChosen.prototype.mouse_enter = function() {
182
+ return this.mouse_on_container = true;
183
+ };
184
+
185
+ AbstractChosen.prototype.mouse_leave = function() {
186
+ return this.mouse_on_container = false;
187
+ };
188
+
189
+ AbstractChosen.prototype.input_focus = function(evt) {
190
+ var _this = this;
191
+ if (this.is_multiple) {
192
+ if (!this.active_field) {
193
+ return setTimeout((function() {
194
+ return _this.container_mousedown();
195
+ }), 50);
196
+ }
197
+ } else {
198
+ if (!this.active_field) {
199
+ return this.activate_field();
200
+ }
201
+ }
202
+ };
203
+
204
+ AbstractChosen.prototype.input_blur = function(evt) {
205
+ var _this = this;
206
+ if (!this.mouse_on_container) {
207
+ this.active_field = false;
208
+ return setTimeout((function() {
209
+ return _this.blur_test();
210
+ }), 100);
211
+ }
212
+ };
213
+
214
+ AbstractChosen.prototype.results_option_build = function(options) {
215
+ var content, data, _i, _len, _ref;
216
+ content = '';
217
+ _ref = this.results_data;
218
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
219
+ data = _ref[_i];
220
+ if (data.group) {
221
+ content += this.result_add_group(data);
222
+ } else {
223
+ content += this.result_add_option(data);
224
+ }
225
+ if (options != null ? options.first : void 0) {
226
+ if (data.selected && this.is_multiple) {
227
+ this.choice_build(data);
228
+ } else if (data.selected && !this.is_multiple) {
229
+ this.single_set_selected_text(this.choice_label(data));
230
+ }
231
+ }
232
+ }
233
+ return content;
234
+ };
235
+
236
+ AbstractChosen.prototype.result_add_option = function(option) {
237
+ var classes, option_el;
238
+ if (!option.search_match) {
239
+ return '';
240
+ }
241
+ if (!this.include_option_in_results(option)) {
242
+ return '';
243
+ }
244
+ classes = [];
245
+ if (!option.disabled && !(option.selected && this.is_multiple)) {
246
+ classes.push("active-result");
247
+ }
248
+ if (option.disabled && !(option.selected && this.is_multiple)) {
249
+ classes.push("disabled-result");
250
+ }
251
+ if (option.selected) {
252
+ classes.push("result-selected");
253
+ }
254
+ if (option.group_array_index != null) {
255
+ classes.push("group-option");
256
+ }
257
+ if (option.classes !== "") {
258
+ classes.push(option.classes);
259
+ }
260
+ option_el = document.createElement("li");
261
+ option_el.className = classes.join(" ");
262
+ option_el.style.cssText = option.style;
263
+ option_el.setAttribute("data-option-array-index", option.array_index);
264
+ option_el.innerHTML = option.search_text;
265
+ if (option.title) {
266
+ option_el.title = option.title;
267
+ }
268
+ return this.outerHTML(option_el);
269
+ };
270
+
271
+ AbstractChosen.prototype.result_add_group = function(group) {
272
+ var classes, group_el;
273
+ if (!(group.search_match || group.group_match)) {
274
+ return '';
275
+ }
276
+ if (!(group.active_options > 0)) {
277
+ return '';
278
+ }
279
+ classes = [];
280
+ classes.push("group-result");
281
+ if (group.classes) {
282
+ classes.push(group.classes);
283
+ }
284
+ group_el = document.createElement("li");
285
+ group_el.className = classes.join(" ");
286
+ group_el.innerHTML = group.search_text;
287
+ if (group.title) {
288
+ group_el.title = group.title;
289
+ }
290
+ return this.outerHTML(group_el);
291
+ };
292
+
293
+ AbstractChosen.prototype.results_update_field = function() {
294
+ this.set_default_text();
295
+ if (!this.is_multiple) {
296
+ this.results_reset_cleanup();
297
+ }
298
+ this.result_clear_highlight();
299
+ this.results_build();
300
+ if (this.results_showing) {
301
+ return this.winnow_results();
302
+ }
303
+ };
304
+
305
+ AbstractChosen.prototype.reset_single_select_options = function() {
306
+ var result, _i, _len, _ref, _results;
307
+ _ref = this.results_data;
308
+ _results = [];
309
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
310
+ result = _ref[_i];
311
+ if (result.selected) {
312
+ _results.push(result.selected = false);
313
+ } else {
314
+ _results.push(void 0);
315
+ }
316
+ }
317
+ return _results;
318
+ };
319
+
320
+ AbstractChosen.prototype.results_toggle = function() {
321
+ if (this.results_showing) {
322
+ return this.results_hide();
323
+ } else {
324
+ return this.results_show();
325
+ }
326
+ };
327
+
328
+ AbstractChosen.prototype.results_search = function(evt) {
329
+ if (this.results_showing) {
330
+ return this.winnow_results();
331
+ } else {
332
+ return this.results_show();
333
+ }
334
+ };
335
+
336
+ AbstractChosen.prototype.winnow_results = function() {
337
+ var escapedSearchText, option, regex, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
338
+ this.no_results_clear();
339
+ results = 0;
340
+ searchText = this.get_search_text();
341
+ escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
342
+ zregex = new RegExp(escapedSearchText, 'i');
343
+ regex = this.get_search_regex(escapedSearchText);
344
+ _ref = this.results_data;
345
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
346
+ option = _ref[_i];
347
+ option.search_match = false;
348
+ results_group = null;
349
+ if (this.include_option_in_results(option)) {
350
+ if (option.group) {
351
+ option.group_match = false;
352
+ option.active_options = 0;
353
+ }
354
+ if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
355
+ results_group = this.results_data[option.group_array_index];
356
+ if (results_group.active_options === 0 && results_group.search_match) {
357
+ results += 1;
358
+ }
359
+ results_group.active_options += 1;
360
+ }
361
+ option.search_text = option.group ? option.label : option.html;
362
+ if (!(option.group && !this.group_search)) {
363
+ option.search_match = this.search_string_match(option.search_text, regex);
364
+ if (option.search_match && !option.group) {
365
+ results += 1;
366
+ }
367
+ if (option.search_match) {
368
+ if (searchText.length) {
369
+ startpos = option.search_text.search(zregex);
370
+ text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
371
+ option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
372
+ }
373
+ if (results_group != null) {
374
+ results_group.group_match = true;
375
+ }
376
+ } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
377
+ option.search_match = true;
378
+ }
379
+ }
380
+ }
381
+ }
382
+ this.result_clear_highlight();
383
+ if (results < 1 && searchText.length) {
384
+ this.update_results_content("");
385
+ return this.no_results(searchText);
386
+ } else {
387
+ this.update_results_content(this.results_option_build());
388
+ return this.winnow_results_set_highlight();
389
+ }
390
+ };
391
+
392
+ AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
393
+ var regex_anchor;
394
+ regex_anchor = this.search_contains ? "" : "^";
395
+ return new RegExp(regex_anchor + escaped_search_string, 'i');
396
+ };
397
+
398
+ AbstractChosen.prototype.search_string_match = function(search_string, regex) {
399
+ var part, parts, _i, _len;
400
+ if (regex.test(search_string)) {
401
+ return true;
402
+ } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
403
+ parts = search_string.replace(/\[|\]/g, "").split(" ");
404
+ if (parts.length) {
405
+ for (_i = 0, _len = parts.length; _i < _len; _i++) {
406
+ part = parts[_i];
407
+ if (regex.test(part)) {
408
+ return true;
409
+ }
410
+ }
411
+ }
412
+ }
413
+ };
414
+
415
+ AbstractChosen.prototype.choices_count = function() {
416
+ var option, _i, _len, _ref;
417
+ if (this.selected_option_count != null) {
418
+ return this.selected_option_count;
419
+ }
420
+ this.selected_option_count = 0;
421
+ _ref = this.form_field.options;
422
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
423
+ option = _ref[_i];
424
+ if (option.selected) {
425
+ this.selected_option_count += 1;
426
+ }
427
+ }
428
+ return this.selected_option_count;
429
+ };
430
+
431
+ AbstractChosen.prototype.choices_click = function(evt) {
432
+ evt.preventDefault();
433
+ if (!(this.results_showing || this.is_disabled)) {
434
+ return this.results_show();
435
+ }
436
+ };
437
+
438
+ AbstractChosen.prototype.keyup_checker = function(evt) {
439
+ var stroke, _ref;
440
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
441
+ this.search_field_scale();
442
+ switch (stroke) {
443
+ case 8:
444
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
445
+ return this.keydown_backstroke();
446
+ } else if (!this.pending_backstroke) {
447
+ this.result_clear_highlight();
448
+ return this.results_search();
449
+ }
450
+ break;
451
+ case 13:
452
+ evt.preventDefault();
453
+ if (this.results_showing) {
454
+ if (!this.is_multiple || this.result_highlight) {
455
+ return this.result_select(evt);
456
+ }
457
+ $(this.form_field).append('<option>' + $(evt.target).val() + '</option>');
458
+ $(this.form_field).trigger('chosen:updated');
459
+ this.result_highlight = this.search_results.find('li.active-result').last();
460
+ return this.result_select(evt);
461
+ }
462
+ break;
463
+ case 27:
464
+ if (this.results_showing) {
465
+ this.results_hide();
466
+ }
467
+ return true;
468
+ case 9:
469
+ case 38:
470
+ case 40:
471
+ case 16:
472
+ case 91:
473
+ case 17:
474
+ break;
475
+ default:
476
+ return this.results_search();
477
+ }
478
+ };
479
+
480
+ AbstractChosen.prototype.clipboard_event_checker = function(evt) {
481
+ var _this = this;
482
+ return setTimeout((function() {
483
+ return _this.results_search();
484
+ }), 50);
485
+ };
486
+
487
+ AbstractChosen.prototype.container_width = function() {
488
+ if (this.options.width != null) {
489
+ return this.options.width;
490
+ } else {
491
+ return "" + this.form_field.offsetWidth + "px";
492
+ }
493
+ };
494
+
495
+ AbstractChosen.prototype.include_option_in_results = function(option) {
496
+ if (this.is_multiple && (!this.display_selected_options && option.selected)) {
497
+ return false;
498
+ }
499
+ if (!this.display_disabled_options && option.disabled) {
500
+ return false;
501
+ }
502
+ if (option.empty) {
503
+ return false;
504
+ }
505
+ return true;
506
+ };
507
+
508
+ AbstractChosen.prototype.search_results_touchstart = function(evt) {
509
+ this.touch_started = true;
510
+ return this.search_results_mouseover(evt);
511
+ };
512
+
513
+ AbstractChosen.prototype.search_results_touchmove = function(evt) {
514
+ this.touch_started = false;
515
+ return this.search_results_mouseout(evt);
516
+ };
517
+
518
+ AbstractChosen.prototype.search_results_touchend = function(evt) {
519
+ if (this.touch_started) {
520
+ return this.search_results_mouseup(evt);
521
+ }
522
+ };
523
+
524
+ AbstractChosen.prototype.outerHTML = function(element) {
525
+ var tmp;
526
+ if (element.outerHTML) {
527
+ return element.outerHTML;
528
+ }
529
+ tmp = document.createElement("div");
530
+ tmp.appendChild(element);
531
+ return tmp.innerHTML;
532
+ };
533
+
534
+ AbstractChosen.browser_is_supported = function() {
535
+ if (window.navigator.appName === "Microsoft Internet Explorer") {
536
+ return document.documentMode >= 8;
537
+ }
538
+ if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
539
+ return false;
540
+ }
541
+ if (/Android/i.test(window.navigator.userAgent)) {
542
+ if (/Mobile/i.test(window.navigator.userAgent)) {
543
+ return false;
544
+ }
545
+ }
546
+ return true;
547
+ };
548
+
549
+ AbstractChosen.default_multiple_text = "Select Some Options";
550
+
551
+ AbstractChosen.default_single_text = "Select an Option";
552
+
553
+ AbstractChosen.default_no_result_text = "No results match";
554
+
555
+ return AbstractChosen;
556
+
557
+ })();
558
+
559
+ $ = jQuery;
560
+
561
+ $.fn.extend({
562
+ chosen: function(options) {
563
+ if (!AbstractChosen.browser_is_supported()) {
564
+ return this;
565
+ }
566
+ return this.each(function(input_field) {
567
+ var $this, chosen;
568
+ $this = $(this);
569
+ chosen = $this.data('chosen');
570
+ if (options === 'destroy' && chosen instanceof Chosen) {
571
+ chosen.destroy();
572
+ } else if (!(chosen instanceof Chosen)) {
573
+ $this.data('chosen', new Chosen(this, options));
574
+ }
575
+ });
576
+ }
577
+ });
578
+
579
+ Chosen = (function(_super) {
580
+ __extends(Chosen, _super);
581
+
582
+ function Chosen() {
583
+ _ref = Chosen.__super__.constructor.apply(this, arguments);
584
+ return _ref;
585
+ }
586
+
587
+ Chosen.prototype.setup = function() {
588
+ this.form_field_jq = $(this.form_field);
589
+ this.current_selectedIndex = this.form_field.selectedIndex;
590
+ return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
591
+ };
592
+
593
+ Chosen.prototype.set_up_html = function() {
594
+ var container_classes, container_props;
595
+ container_classes = ["chosen-container"];
596
+ container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
597
+ if (this.inherit_select_classes && this.form_field.className) {
598
+ container_classes.push(this.form_field.className);
599
+ }
600
+ if (this.is_rtl) {
601
+ container_classes.push("chosen-rtl");
602
+ }
603
+ container_props = {
604
+ 'class': container_classes.join(' '),
605
+ 'style': "width: " + (this.container_width()) + ";",
606
+ 'title': this.form_field.title
607
+ };
608
+ if (this.form_field.id.length) {
609
+ container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
610
+ }
611
+ this.container = $("<div />", container_props);
612
+ if (this.is_multiple) {
613
+ this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
614
+ } else {
615
+ this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
616
+ }
617
+ this.form_field_jq.hide().after(this.container);
618
+ this.dropdown = this.container.find('div.chosen-drop').first();
619
+ this.search_field = this.container.find('input').first();
620
+ this.search_results = this.container.find('ul.chosen-results').first();
621
+ this.search_field_scale();
622
+ this.search_no_results = this.container.find('li.no-results').first();
623
+ if (this.is_multiple) {
624
+ this.search_choices = this.container.find('ul.chosen-choices').first();
625
+ this.search_container = this.container.find('li.search-field').first();
626
+ } else {
627
+ this.search_container = this.container.find('div.chosen-search').first();
628
+ this.selected_item = this.container.find('.chosen-single').first();
629
+ }
630
+ this.results_build();
631
+ this.set_tab_index();
632
+ return this.set_label_behavior();
633
+ };
634
+
635
+ Chosen.prototype.on_ready = function() {
636
+ return this.form_field_jq.trigger("chosen:ready", {
637
+ chosen: this
638
+ });
639
+ };
640
+
641
+ Chosen.prototype.register_observers = function() {
642
+ var _this = this;
643
+ this.container.bind('touchstart.chosen', function(evt) {
644
+ _this.container_mousedown(evt);
645
+ return evt.preventDefault();
646
+ });
647
+ this.container.bind('touchend.chosen', function(evt) {
648
+ _this.container_mouseup(evt);
649
+ return evt.preventDefault();
650
+ });
651
+ this.container.bind('mousedown.chosen', function(evt) {
652
+ _this.container_mousedown(evt);
653
+ });
654
+ this.container.bind('mouseup.chosen', function(evt) {
655
+ _this.container_mouseup(evt);
656
+ });
657
+ this.container.bind('mouseenter.chosen', function(evt) {
658
+ _this.mouse_enter(evt);
659
+ });
660
+ this.container.bind('mouseleave.chosen', function(evt) {
661
+ _this.mouse_leave(evt);
662
+ });
663
+ this.search_results.bind('mouseup.chosen', function(evt) {
664
+ _this.search_results_mouseup(evt);
665
+ });
666
+ this.search_results.bind('mouseover.chosen', function(evt) {
667
+ _this.search_results_mouseover(evt);
668
+ });
669
+ this.search_results.bind('mouseout.chosen', function(evt) {
670
+ _this.search_results_mouseout(evt);
671
+ });
672
+ this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
673
+ _this.search_results_mousewheel(evt);
674
+ });
675
+ this.search_results.bind('touchstart.chosen', function(evt) {
676
+ _this.search_results_touchstart(evt);
677
+ });
678
+ this.search_results.bind('touchmove.chosen', function(evt) {
679
+ _this.search_results_touchmove(evt);
680
+ });
681
+ this.search_results.bind('touchend.chosen', function(evt) {
682
+ _this.search_results_touchend(evt);
683
+ });
684
+ this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
685
+ _this.results_update_field(evt);
686
+ });
687
+ this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
688
+ _this.activate_field(evt);
689
+ });
690
+ this.form_field_jq.bind("chosen:open.chosen", function(evt) {
691
+ _this.container_mousedown(evt);
692
+ });
693
+ this.form_field_jq.bind("chosen:close.chosen", function(evt) {
694
+ _this.input_blur(evt);
695
+ });
696
+ this.search_field.bind('blur.chosen', function(evt) {
697
+ _this.input_blur(evt);
698
+ });
699
+ this.search_field.bind('keyup.chosen', function(evt) {
700
+ _this.keyup_checker(evt);
701
+ });
702
+ this.search_field.bind('keydown.chosen', function(evt) {
703
+ _this.keydown_checker(evt);
704
+ });
705
+ this.search_field.bind('focus.chosen', function(evt) {
706
+ _this.input_focus(evt);
707
+ });
708
+ this.search_field.bind('cut.chosen', function(evt) {
709
+ _this.clipboard_event_checker(evt);
710
+ });
711
+ this.search_field.bind('paste.chosen', function(evt) {
712
+ _this.clipboard_event_checker(evt);
713
+ });
714
+ if (this.is_multiple) {
715
+ return this.search_choices.bind('click.chosen', function(evt) {
716
+ _this.choices_click(evt);
717
+ });
718
+ } else {
719
+ return this.container.bind('click.chosen', function(evt) {
720
+ evt.preventDefault();
721
+ });
722
+ }
723
+ };
724
+
725
+ Chosen.prototype.destroy = function() {
726
+ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
727
+ if (this.search_field[0].tabIndex) {
728
+ this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
729
+ }
730
+ this.container.remove();
731
+ this.form_field_jq.removeData('chosen');
732
+ return this.form_field_jq.show();
733
+ };
734
+
735
+ Chosen.prototype.search_field_disabled = function() {
736
+ this.is_disabled = this.form_field_jq[0].disabled;
737
+ if (this.is_disabled) {
738
+ this.container.addClass('chosen-disabled');
739
+ this.search_field[0].disabled = true;
740
+ if (!this.is_multiple) {
741
+ this.selected_item.unbind("focus.chosen", this.activate_action);
742
+ }
743
+ return this.close_field();
744
+ } else {
745
+ this.container.removeClass('chosen-disabled');
746
+ this.search_field[0].disabled = false;
747
+ if (!this.is_multiple) {
748
+ return this.selected_item.bind("focus.chosen", this.activate_action);
749
+ }
750
+ }
751
+ };
752
+
753
+ Chosen.prototype.container_mousedown = function(evt) {
754
+ if (!this.is_disabled) {
755
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
756
+ evt.preventDefault();
757
+ }
758
+ if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
759
+ if (!this.active_field) {
760
+ if (this.is_multiple) {
761
+ this.search_field.val("");
762
+ }
763
+ $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
764
+ this.results_show();
765
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
766
+ evt.preventDefault();
767
+ this.results_toggle();
768
+ }
769
+ return this.activate_field();
770
+ }
771
+ }
772
+ };
773
+
774
+ Chosen.prototype.container_mouseup = function(evt) {
775
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
776
+ return this.results_reset(evt);
777
+ }
778
+ };
779
+
780
+ Chosen.prototype.search_results_mousewheel = function(evt) {
781
+ var delta;
782
+ if (evt.originalEvent) {
783
+ delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
784
+ }
785
+ if (delta != null) {
786
+ evt.preventDefault();
787
+ if (evt.type === 'DOMMouseScroll') {
788
+ delta = delta * 40;
789
+ }
790
+ return this.search_results.scrollTop(delta + this.search_results.scrollTop());
791
+ }
792
+ };
793
+
794
+ Chosen.prototype.blur_test = function(evt) {
795
+ if (!this.active_field && this.container.hasClass("chosen-container-active")) {
796
+ return this.close_field();
797
+ }
798
+ };
799
+
800
+ Chosen.prototype.close_field = function() {
801
+ $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
802
+ this.active_field = false;
803
+ this.results_hide();
804
+ this.container.removeClass("chosen-container-active");
805
+ this.clear_backstroke();
806
+ this.show_search_field_default();
807
+ return this.search_field_scale();
808
+ };
809
+
810
+ Chosen.prototype.activate_field = function() {
811
+ this.container.addClass("chosen-container-active");
812
+ this.active_field = true;
813
+ this.search_field.val(this.search_field.val());
814
+ return this.search_field.focus();
815
+ };
816
+
817
+ Chosen.prototype.test_active_click = function(evt) {
818
+ var active_container;
819
+ active_container = $(evt.target).closest('.chosen-container');
820
+ if (active_container.length && this.container[0] === active_container[0]) {
821
+ return this.active_field = true;
822
+ } else {
823
+ return this.close_field();
824
+ }
825
+ };
826
+
827
+ Chosen.prototype.results_build = function() {
828
+ this.parsing = true;
829
+ this.selected_option_count = null;
830
+ this.results_data = SelectParser.select_to_array(this.form_field);
831
+ if (this.is_multiple) {
832
+ this.search_choices.find("li.search-choice").remove();
833
+ } else if (!this.is_multiple) {
834
+ this.single_set_selected_text();
835
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
836
+ this.search_field[0].readOnly = true;
837
+ this.container.addClass("chosen-container-single-nosearch");
838
+ } else {
839
+ this.search_field[0].readOnly = false;
840
+ this.container.removeClass("chosen-container-single-nosearch");
841
+ }
842
+ }
843
+ this.update_results_content(this.results_option_build({
844
+ first: true
845
+ }));
846
+ this.search_field_disabled();
847
+ this.show_search_field_default();
848
+ this.search_field_scale();
849
+ return this.parsing = false;
850
+ };
851
+
852
+ Chosen.prototype.result_do_highlight = function(el) {
853
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
854
+ if (el.length) {
855
+ this.result_clear_highlight();
856
+ this.result_highlight = el;
857
+ this.result_highlight.addClass("highlighted");
858
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
859
+ visible_top = this.search_results.scrollTop();
860
+ visible_bottom = maxHeight + visible_top;
861
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
862
+ high_bottom = high_top + this.result_highlight.outerHeight();
863
+ if (high_bottom >= visible_bottom) {
864
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
865
+ } else if (high_top < visible_top) {
866
+ return this.search_results.scrollTop(high_top);
867
+ }
868
+ }
869
+ };
870
+
871
+ Chosen.prototype.result_clear_highlight = function() {
872
+ if (this.result_highlight) {
873
+ this.result_highlight.removeClass("highlighted");
874
+ }
875
+ return this.result_highlight = null;
876
+ };
877
+
878
+ Chosen.prototype.results_show = function() {
879
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
880
+ this.form_field_jq.trigger("chosen:maxselected", {
881
+ chosen: this
882
+ });
883
+ return false;
884
+ }
885
+ this.container.addClass("chosen-with-drop");
886
+ this.results_showing = true;
887
+ this.search_field.focus();
888
+ this.search_field.val(this.search_field.val());
889
+ this.winnow_results();
890
+ return this.form_field_jq.trigger("chosen:showing_dropdown", {
891
+ chosen: this
892
+ });
893
+ };
894
+
895
+ Chosen.prototype.update_results_content = function(content) {
896
+ return this.search_results.html(content);
897
+ };
898
+
899
+ Chosen.prototype.results_hide = function() {
900
+ if (this.results_showing) {
901
+ this.result_clear_highlight();
902
+ this.container.removeClass("chosen-with-drop");
903
+ this.form_field_jq.trigger("chosen:hiding_dropdown", {
904
+ chosen: this
905
+ });
906
+ }
907
+ return this.results_showing = false;
908
+ };
909
+
910
+ Chosen.prototype.set_tab_index = function(el) {
911
+ var ti;
912
+ if (this.form_field.tabIndex) {
913
+ ti = this.form_field.tabIndex;
914
+ this.form_field.tabIndex = -1;
915
+ return this.search_field[0].tabIndex = ti;
916
+ }
917
+ };
918
+
919
+ Chosen.prototype.set_label_behavior = function() {
920
+ var _this = this;
921
+ this.form_field_label = this.form_field_jq.parents("label");
922
+ if (!this.form_field_label.length && this.form_field.id.length) {
923
+ this.form_field_label = $("label[for='" + this.form_field.id + "']");
924
+ }
925
+ if (this.form_field_label.length > 0) {
926
+ return this.form_field_label.bind('click.chosen', function(evt) {
927
+ if (_this.is_multiple) {
928
+ return _this.container_mousedown(evt);
929
+ } else {
930
+ return _this.activate_field();
931
+ }
932
+ });
933
+ }
934
+ };
935
+
936
+ Chosen.prototype.show_search_field_default = function() {
937
+ if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
938
+ this.search_field.val(this.default_text);
939
+ return this.search_field.addClass("default");
940
+ } else {
941
+ this.search_field.val("");
942
+ return this.search_field.removeClass("default");
943
+ }
944
+ };
945
+
946
+ Chosen.prototype.search_results_mouseup = function(evt) {
947
+ var target;
948
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
949
+ if (target.length) {
950
+ this.result_highlight = target;
951
+ this.result_select(evt);
952
+ return this.search_field.focus();
953
+ }
954
+ };
955
+
956
+ Chosen.prototype.search_results_mouseover = function(evt) {
957
+ var target;
958
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
959
+ if (target) {
960
+ return this.result_do_highlight(target);
961
+ }
962
+ };
963
+
964
+ Chosen.prototype.search_results_mouseout = function(evt) {
965
+ if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
966
+ return this.result_clear_highlight();
967
+ }
968
+ };
969
+
970
+ Chosen.prototype.choice_build = function(item) {
971
+ var choice, close_link,
972
+ _this = this;
973
+ choice = $('<li />', {
974
+ "class": "search-choice"
975
+ }).html("<span>" + (this.choice_label(item)) + "</span>");
976
+ if (item.disabled) {
977
+ choice.addClass('search-choice-disabled');
978
+ } else {
979
+ close_link = $('<a />', {
980
+ "class": 'search-choice-close',
981
+ 'data-option-array-index': item.array_index
982
+ });
983
+ close_link.bind('click.chosen', function(evt) {
984
+ return _this.choice_destroy_link_click(evt);
985
+ });
986
+ choice.append(close_link);
987
+ }
988
+ return this.search_container.before(choice);
989
+ };
990
+
991
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
992
+ evt.preventDefault();
993
+ evt.stopPropagation();
994
+ if (!this.is_disabled) {
995
+ return this.choice_destroy($(evt.target));
996
+ }
997
+ };
998
+
999
+ Chosen.prototype.choice_destroy = function(link) {
1000
+ if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
1001
+ this.show_search_field_default();
1002
+ if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
1003
+ this.results_hide();
1004
+ }
1005
+ link.parents('li').first().remove();
1006
+ return this.search_field_scale();
1007
+ }
1008
+ };
1009
+
1010
+ Chosen.prototype.results_reset = function() {
1011
+ this.reset_single_select_options();
1012
+ this.form_field.options[0].selected = true;
1013
+ this.single_set_selected_text();
1014
+ this.show_search_field_default();
1015
+ this.results_reset_cleanup();
1016
+ this.form_field_jq.trigger("change");
1017
+ if (this.active_field) {
1018
+ return this.results_hide();
1019
+ }
1020
+ };
1021
+
1022
+ Chosen.prototype.results_reset_cleanup = function() {
1023
+ this.current_selectedIndex = this.form_field.selectedIndex;
1024
+ return this.selected_item.find("abbr").remove();
1025
+ };
1026
+
1027
+ Chosen.prototype.result_select = function(evt) {
1028
+ var high, item;
1029
+ if (this.result_highlight) {
1030
+ high = this.result_highlight;
1031
+ this.result_clear_highlight();
1032
+ if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1033
+ this.form_field_jq.trigger("chosen:maxselected", {
1034
+ chosen: this
1035
+ });
1036
+ return false;
1037
+ }
1038
+ if (this.is_multiple) {
1039
+ high.removeClass("active-result");
1040
+ } else {
1041
+ this.reset_single_select_options();
1042
+ }
1043
+ high.addClass("result-selected");
1044
+ item = this.results_data[high[0].getAttribute("data-option-array-index")];
1045
+ item.selected = true;
1046
+ this.form_field.options[item.options_index].selected = true;
1047
+ this.selected_option_count = null;
1048
+ if (this.is_multiple) {
1049
+ this.choice_build(item);
1050
+ } else {
1051
+ this.single_set_selected_text(this.choice_label(item));
1052
+ }
1053
+ if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
1054
+ this.results_hide();
1055
+ }
1056
+ this.search_field.val("");
1057
+ if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1058
+ this.form_field_jq.trigger("change", {
1059
+ 'selected': this.form_field.options[item.options_index].value
1060
+ });
1061
+ }
1062
+ this.current_selectedIndex = this.form_field.selectedIndex;
1063
+ evt.preventDefault();
1064
+ return this.search_field_scale();
1065
+ }
1066
+ };
1067
+
1068
+ Chosen.prototype.single_set_selected_text = function(text) {
1069
+ if (text == null) {
1070
+ text = this.default_text;
1071
+ }
1072
+ if (text === this.default_text) {
1073
+ this.selected_item.addClass("chosen-default");
1074
+ } else {
1075
+ this.single_deselect_control_build();
1076
+ this.selected_item.removeClass("chosen-default");
1077
+ }
1078
+ return this.selected_item.find("span").html(text);
1079
+ };
1080
+
1081
+ Chosen.prototype.result_deselect = function(pos) {
1082
+ var result_data;
1083
+ result_data = this.results_data[pos];
1084
+ if (!this.form_field.options[result_data.options_index].disabled) {
1085
+ result_data.selected = false;
1086
+ this.form_field.options[result_data.options_index].selected = false;
1087
+ this.selected_option_count = null;
1088
+ this.result_clear_highlight();
1089
+ if (this.results_showing) {
1090
+ this.winnow_results();
1091
+ }
1092
+ this.form_field_jq.trigger("change", {
1093
+ deselected: this.form_field.options[result_data.options_index].value
1094
+ });
1095
+ this.search_field_scale();
1096
+ return true;
1097
+ } else {
1098
+ return false;
1099
+ }
1100
+ };
1101
+
1102
+ Chosen.prototype.single_deselect_control_build = function() {
1103
+ if (!this.allow_single_deselect) {
1104
+ return;
1105
+ }
1106
+ if (!this.selected_item.find("abbr").length) {
1107
+ this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
1108
+ }
1109
+ return this.selected_item.addClass("chosen-single-with-deselect");
1110
+ };
1111
+
1112
+ Chosen.prototype.get_search_text = function() {
1113
+ return $('<div/>').text($.trim(this.search_field.val())).html();
1114
+ };
1115
+
1116
+ Chosen.prototype.winnow_results_set_highlight = function() {
1117
+ var do_high, selected_results;
1118
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
1119
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
1120
+ if (do_high != null) {
1121
+ return this.result_do_highlight(do_high);
1122
+ }
1123
+ };
1124
+
1125
+ Chosen.prototype.no_results = function(terms) {
1126
+ var no_results_html;
1127
+ no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
1128
+ no_results_html.find("span").first().html(terms);
1129
+ this.search_results.append(no_results_html);
1130
+ return this.form_field_jq.trigger("chosen:no_results", {
1131
+ chosen: this
1132
+ });
1133
+ };
1134
+
1135
+ Chosen.prototype.no_results_clear = function() {
1136
+ return this.search_results.find(".no-results").remove();
1137
+ };
1138
+
1139
+ Chosen.prototype.keydown_arrow = function() {
1140
+ var next_sib;
1141
+ if (this.results_showing && this.result_highlight) {
1142
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
1143
+ if (next_sib) {
1144
+ return this.result_do_highlight(next_sib);
1145
+ }
1146
+ } else {
1147
+ return this.results_show();
1148
+ }
1149
+ };
1150
+
1151
+ Chosen.prototype.keyup_arrow = function() {
1152
+ var prev_sibs;
1153
+ if (!this.results_showing && !this.is_multiple) {
1154
+ return this.results_show();
1155
+ } else if (this.result_highlight) {
1156
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
1157
+ if (prev_sibs.length) {
1158
+ return this.result_do_highlight(prev_sibs.first());
1159
+ } else {
1160
+ if (this.choices_count() > 0) {
1161
+ this.results_hide();
1162
+ }
1163
+ return this.result_clear_highlight();
1164
+ }
1165
+ }
1166
+ };
1167
+
1168
+ Chosen.prototype.keydown_backstroke = function() {
1169
+ var next_available_destroy;
1170
+ if (this.pending_backstroke) {
1171
+ this.choice_destroy(this.pending_backstroke.find("a").first());
1172
+ return this.clear_backstroke();
1173
+ } else {
1174
+ next_available_destroy = this.search_container.siblings("li.search-choice").last();
1175
+ if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
1176
+ this.pending_backstroke = next_available_destroy;
1177
+ if (this.single_backstroke_delete) {
1178
+ return this.keydown_backstroke();
1179
+ } else {
1180
+ return this.pending_backstroke.addClass("search-choice-focus");
1181
+ }
1182
+ }
1183
+ }
1184
+ };
1185
+
1186
+ Chosen.prototype.clear_backstroke = function() {
1187
+ if (this.pending_backstroke) {
1188
+ this.pending_backstroke.removeClass("search-choice-focus");
1189
+ }
1190
+ return this.pending_backstroke = null;
1191
+ };
1192
+
1193
+ Chosen.prototype.keydown_checker = function(evt) {
1194
+ var stroke, _ref1;
1195
+ stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
1196
+ this.search_field_scale();
1197
+ if (stroke !== 8 && this.pending_backstroke) {
1198
+ this.clear_backstroke();
1199
+ }
1200
+ switch (stroke) {
1201
+ case 8:
1202
+ this.backstroke_length = this.search_field.val().length;
1203
+ break;
1204
+ case 9:
1205
+ if (this.results_showing && !this.is_multiple) {
1206
+ this.result_select(evt);
1207
+ }
1208
+ this.mouse_on_container = false;
1209
+ break;
1210
+ case 13:
1211
+ if (this.results_showing) {
1212
+ evt.preventDefault();
1213
+ }
1214
+ break;
1215
+ case 32:
1216
+ if (this.disable_search) {
1217
+ evt.preventDefault();
1218
+ }
1219
+ break;
1220
+ case 38:
1221
+ evt.preventDefault();
1222
+ this.keyup_arrow();
1223
+ break;
1224
+ case 40:
1225
+ evt.preventDefault();
1226
+ this.keydown_arrow();
1227
+ break;
1228
+ }
1229
+ };
1230
+
1231
+ Chosen.prototype.search_field_scale = function() {
1232
+ var div, f_width, h, style, style_block, styles, w, _i, _len;
1233
+ if (this.is_multiple) {
1234
+ h = 0;
1235
+ w = 0;
1236
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1237
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1238
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
1239
+ style = styles[_i];
1240
+ style_block += style + ":" + this.search_field.css(style) + ";";
1241
+ }
1242
+ div = $('<div />', {
1243
+ 'style': style_block
1244
+ });
1245
+ div.text(this.search_field.val());
1246
+ $('body').append(div);
1247
+ w = div.width() + 25;
1248
+ div.remove();
1249
+ f_width = this.container.outerWidth();
1250
+ if (w > f_width - 10) {
1251
+ w = f_width - 10;
1252
+ }
1253
+ return this.search_field.css({
1254
+ 'width': w + 'px'
1255
+ });
1256
+ }
1257
+ };
1258
+
1259
+ return Chosen;
1260
+
1261
+ })(AbstractChosen);
1262
+
1263
+ }).call(this);
static/js/jquery/chosen.jquery.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /* Chosen v1.4.0 | (c) 2011-2015 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
+ (function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1},AbstractChosen.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"<b class='group-name'>"+a.group_label+"</b>"+a.html:a.html},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(){var a=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return a.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(){var a=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return a.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f;for(b="",f=this.results_data,d=0,e=f.length;e>d;d++)c=f[d],b+=c.group?this.result_add_group(c):this.result_add_option(c),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(c.html));return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match?this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):"":""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return a.search_match||a.group_match?a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):"":""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),(!b.group||this.group_search)&&(b.search_text=b.group?b.label:b.html,b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+"</em>"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+"<em>"+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b;return b=this.search_contains?"":"^",new RegExp(b+a,"i")},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(){var a=this;return setTimeout(function(){return a.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(){var c,d;c=a(this),d=c.data("chosen"),"destroy"===b&&d instanceof Chosen?d.destroy():d instanceof Chosen||c.data("chosen",new Chosen(this,b))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){a.container_mousedown(b)}),this.container.bind("touchend.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(){var a;return this.form_field.tabIndex?(a=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=a):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(b)+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":a("<div/>").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}).call(this);
static/js/jquery/css/chosen/chosen-sprite.png ADDED
Binary file
static/js/jquery/css/chosen/chosen-sprite@2x.png ADDED
Binary file
static/js/jquery/css/chosen/chosen.css ADDED
@@ -0,0 +1,450 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Chosen, a Select Box Enhancer for jQuery and Prototype
3
+ by Patrick Filler for Harvest, http://getharvest.com
4
+
5
+ Version 1.4.0
6
+ Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2015 Harvest http://getharvest.com
8
+
9
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
+ This file is generated by `grunt build`, do not edit it by hand.
11
+ */
12
+
13
+ /* @group Base */
14
+ .chosen-container {
15
+ position: relative;
16
+ display: inline-block;
17
+ vertical-align: middle;
18
+ font-size: 13px;
19
+ zoom: 1;
20
+ *display: inline;
21
+ -webkit-user-select: none;
22
+ -moz-user-select: none;
23
+ user-select: none;
24
+ }
25
+ .chosen-container * {
26
+ -webkit-box-sizing: border-box;
27
+ -moz-box-sizing: border-box;
28
+ box-sizing: border-box;
29
+ }
30
+ .chosen-container .chosen-drop {
31
+ position: absolute;
32
+ top: 100%;
33
+ left: -9999px;
34
+ z-index: 1010;
35
+ width: 100%;
36
+ border: 1px solid #aaa;
37
+ border-top: 0;
38
+ background: #fff;
39
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
40
+ }
41
+ .chosen-container.chosen-with-drop .chosen-drop {
42
+ left: 0;
43
+ }
44
+ .chosen-container a {
45
+ cursor: pointer;
46
+ }
47
+ .chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
48
+ margin-right: 4px;
49
+ overflow: hidden;
50
+ white-space: nowrap;
51
+ text-overflow: ellipsis;
52
+ font-weight: normal;
53
+ color: #999999;
54
+ }
55
+ .chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
56
+ content: ":";
57
+ padding-left: 2px;
58
+ vertical-align: top;
59
+ }
60
+
61
+ /* @end */
62
+ /* @group Single Chosen */
63
+ .chosen-container-single .chosen-single {
64
+ position: relative;
65
+ display: block;
66
+ overflow: hidden;
67
+ padding: 0 0 0 8px;
68
+ height: 25px;
69
+ border: 1px solid #aaa;
70
+ border-radius: 5px;
71
+ background-color: #fff;
72
+ background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
73
+ background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
74
+ background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
75
+ background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
76
+ background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
77
+ background-clip: padding-box;
78
+ box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
79
+ color: #444;
80
+ text-decoration: none;
81
+ white-space: nowrap;
82
+ line-height: 24px;
83
+ }
84
+ .chosen-container-single .chosen-default {
85
+ color: #999;
86
+ }
87
+ .chosen-container-single .chosen-single span {
88
+ display: block;
89
+ overflow: hidden;
90
+ margin-right: 26px;
91
+ text-overflow: ellipsis;
92
+ white-space: nowrap;
93
+ }
94
+ .chosen-container-single .chosen-single-with-deselect span {
95
+ margin-right: 38px;
96
+ }
97
+ .chosen-container-single .chosen-single abbr {
98
+ position: absolute;
99
+ top: 6px;
100
+ right: 26px;
101
+ display: block;
102
+ width: 12px;
103
+ height: 12px;
104
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
105
+ font-size: 1px;
106
+ }
107
+ .chosen-container-single .chosen-single abbr:hover {
108
+ background-position: -42px -10px;
109
+ }
110
+ .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
111
+ background-position: -42px -10px;
112
+ }
113
+ .chosen-container-single .chosen-single div {
114
+ position: absolute;
115
+ top: 0;
116
+ right: 0;
117
+ display: block;
118
+ width: 18px;
119
+ height: 100%;
120
+ }
121
+ .chosen-container-single .chosen-single div b {
122
+ display: block;
123
+ width: 100%;
124
+ height: 100%;
125
+ background: url('chosen-sprite.png') no-repeat 0px 2px;
126
+ }
127
+ .chosen-container-single .chosen-search {
128
+ position: relative;
129
+ z-index: 1010;
130
+ margin: 0;
131
+ padding: 3px 4px;
132
+ white-space: nowrap;
133
+ }
134
+ .chosen-container-single .chosen-search input[type="text"] {
135
+ margin: 1px 0;
136
+ padding: 4px 20px 4px 5px;
137
+ width: 100%;
138
+ height: auto;
139
+ outline: 0;
140
+ border: 1px solid #aaa;
141
+ background: white url('chosen-sprite.png') no-repeat 100% -20px;
142
+ background: url('chosen-sprite.png') no-repeat 100% -20px;
143
+ font-size: 1em;
144
+ font-family: sans-serif;
145
+ line-height: normal;
146
+ border-radius: 0;
147
+ }
148
+ .chosen-container-single .chosen-drop {
149
+ margin-top: -1px;
150
+ border-radius: 0 0 4px 4px;
151
+ background-clip: padding-box;
152
+ }
153
+ .chosen-container-single.chosen-container-single-nosearch .chosen-search {
154
+ position: absolute;
155
+ left: -9999px;
156
+ }
157
+
158
+ /* @end */
159
+ /* @group Results */
160
+ .chosen-container .chosen-results {
161
+ color: #444;
162
+ position: relative;
163
+ overflow-x: hidden;
164
+ overflow-y: auto;
165
+ margin: 0 4px 4px 0;
166
+ padding: 0 0 0 4px;
167
+ max-height: 240px;
168
+ -webkit-overflow-scrolling: touch;
169
+ }
170
+ .chosen-container .chosen-results li {
171
+ display: none;
172
+ margin: 0;
173
+ padding: 5px 6px;
174
+ list-style: none;
175
+ line-height: 15px;
176
+ word-wrap: break-word;
177
+ -webkit-touch-callout: none;
178
+ }
179
+ .chosen-container .chosen-results li.active-result {
180
+ display: list-item;
181
+ cursor: pointer;
182
+ }
183
+ .chosen-container .chosen-results li.disabled-result {
184
+ display: list-item;
185
+ color: #ccc;
186
+ cursor: default;
187
+ }
188
+ .chosen-container .chosen-results li.highlighted {
189
+ background-color: #3875d7;
190
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
191
+ background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
192
+ background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
193
+ background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
194
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
195
+ color: #fff;
196
+ }
197
+ .chosen-container .chosen-results li.no-results {
198
+ color: #777;
199
+ display: list-item;
200
+ background: #f4f4f4;
201
+ }
202
+ .chosen-container .chosen-results li.group-result {
203
+ display: list-item;
204
+ font-weight: bold;
205
+ cursor: default;
206
+ }
207
+ .chosen-container .chosen-results li.group-option {
208
+ padding-left: 15px;
209
+ }
210
+ .chosen-container .chosen-results li em {
211
+ font-style: normal;
212
+ text-decoration: underline;
213
+ }
214
+
215
+ /* @end */
216
+ /* @group Multi Chosen */
217
+ .chosen-container-multi .chosen-choices {
218
+ position: relative;
219
+ overflow: hidden;
220
+ margin: 0;
221
+ padding: 0 5px;
222
+ width: 100%;
223
+ height: auto !important;
224
+ height: 1%;
225
+ border: 1px solid #aaa;
226
+ background-color: #fff;
227
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
228
+ background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
229
+ background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
230
+ background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
231
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
232
+ cursor: text;
233
+ }
234
+ .chosen-container-multi .chosen-choices li {
235
+ float: left;
236
+ list-style: none;
237
+ }
238
+ .chosen-container-multi .chosen-choices li.search-field {
239
+ margin: 0;
240
+ padding: 0;
241
+ white-space: nowrap;
242
+ }
243
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
244
+ margin: 1px 0;
245
+ padding: 0;
246
+ height: 25px;
247
+ outline: 0;
248
+ border: 0 !important;
249
+ background: transparent !important;
250
+ box-shadow: none;
251
+ color: #999;
252
+ font-size: 100%;
253
+ font-family: sans-serif;
254
+ line-height: normal;
255
+ border-radius: 0;
256
+ }
257
+ .chosen-container-multi .chosen-choices li.search-choice {
258
+ position: relative;
259
+ margin: 3px 5px 3px 0;
260
+ padding: 3px 20px 3px 5px;
261
+ border: 1px solid #aaa;
262
+ max-width: 100%;
263
+ border-radius: 3px;
264
+ background-color: #eeeeee;
265
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
266
+ background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
267
+ background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
268
+ background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
269
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
270
+ background-size: 100% 19px;
271
+ background-repeat: repeat-x;
272
+ background-clip: padding-box;
273
+ box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
274
+ color: #333;
275
+ line-height: 13px;
276
+ cursor: default;
277
+ }
278
+ .chosen-container-multi .chosen-choices li.search-choice span {
279
+ word-wrap: break-word;
280
+ }
281
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
282
+ position: absolute;
283
+ top: 4px;
284
+ right: 3px;
285
+ display: block;
286
+ width: 12px;
287
+ height: 12px;
288
+ background: url('chosen-sprite.png') -42px 1px no-repeat;
289
+ font-size: 1px;
290
+ }
291
+ .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
292
+ background-position: -42px -10px;
293
+ }
294
+ .chosen-container-multi .chosen-choices li.search-choice-disabled {
295
+ padding-right: 5px;
296
+ border: 1px solid #ccc;
297
+ background-color: #e4e4e4;
298
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
299
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
300
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
301
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
302
+ background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
303
+ color: #666;
304
+ }
305
+ .chosen-container-multi .chosen-choices li.search-choice-focus {
306
+ background: #d4d4d4;
307
+ }
308
+ .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
309
+ background-position: -42px -10px;
310
+ }
311
+ .chosen-container-multi .chosen-results {
312
+ margin: 0;
313
+ padding: 0;
314
+ }
315
+ .chosen-container-multi .chosen-drop .result-selected {
316
+ display: list-item;
317
+ color: #ccc;
318
+ cursor: default;
319
+ }
320
+
321
+ /* @end */
322
+ /* @group Active */
323
+ .chosen-container-active .chosen-single {
324
+ border: 1px solid #5897fb;
325
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
326
+ }
327
+ .chosen-container-active.chosen-with-drop .chosen-single {
328
+ border: 1px solid #aaa;
329
+ -moz-border-radius-bottomright: 0;
330
+ border-bottom-right-radius: 0;
331
+ -moz-border-radius-bottomleft: 0;
332
+ border-bottom-left-radius: 0;
333
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
334
+ background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
335
+ background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
336
+ background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
337
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
338
+ box-shadow: 0 1px 0 #fff inset;
339
+ }
340
+ .chosen-container-active.chosen-with-drop .chosen-single div {
341
+ border-left: none;
342
+ background: transparent;
343
+ }
344
+ .chosen-container-active.chosen-with-drop .chosen-single div b {
345
+ background-position: -18px 2px;
346
+ }
347
+ .chosen-container-active .chosen-choices {
348
+ border: 1px solid #5897fb;
349
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
350
+ }
351
+ .chosen-container-active .chosen-choices li.search-field input[type="text"] {
352
+ color: #222 !important;
353
+ }
354
+
355
+ /* @end */
356
+ /* @group Disabled Support */
357
+ .chosen-disabled {
358
+ opacity: 0.5 !important;
359
+ cursor: default;
360
+ }
361
+ .chosen-disabled .chosen-single {
362
+ cursor: default;
363
+ }
364
+ .chosen-disabled .chosen-choices .search-choice .search-choice-close {
365
+ cursor: default;
366
+ }
367
+
368
+ /* @end */
369
+ /* @group Right to Left */
370
+ .chosen-rtl {
371
+ text-align: right;
372
+ }
373
+ .chosen-rtl .chosen-single {
374
+ overflow: visible;
375
+ padding: 0 8px 0 0;
376
+ }
377
+ .chosen-rtl .chosen-single span {
378
+ margin-right: 0;
379
+ margin-left: 26px;
380
+ direction: rtl;
381
+ }
382
+ .chosen-rtl .chosen-single-with-deselect span {
383
+ margin-left: 38px;
384
+ }
385
+ .chosen-rtl .chosen-single div {
386
+ right: auto;
387
+ left: 3px;
388
+ }
389
+ .chosen-rtl .chosen-single abbr {
390
+ right: auto;
391
+ left: 26px;
392
+ }
393
+ .chosen-rtl .chosen-choices li {
394
+ float: right;
395
+ }
396
+ .chosen-rtl .chosen-choices li.search-field input[type="text"] {
397
+ direction: rtl;
398
+ }
399
+ .chosen-rtl .chosen-choices li.search-choice {
400
+ margin: 3px 5px 3px 0;
401
+ padding: 3px 5px 3px 19px;
402
+ }
403
+ .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
404
+ right: auto;
405
+ left: 4px;
406
+ }
407
+ .chosen-rtl.chosen-container-single-nosearch .chosen-search,
408
+ .chosen-rtl .chosen-drop {
409
+ left: 9999px;
410
+ }
411
+ .chosen-rtl.chosen-container-single .chosen-results {
412
+ margin: 0 0 4px 4px;
413
+ padding: 0 4px 0 0;
414
+ }
415
+ .chosen-rtl .chosen-results li.group-option {
416
+ padding-right: 15px;
417
+ padding-left: 0;
418
+ }
419
+ .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
420
+ border-right: none;
421
+ }
422
+ .chosen-rtl .chosen-search input[type="text"] {
423
+ padding: 4px 5px 4px 20px;
424
+ background: white url('chosen-sprite.png') no-repeat -30px -20px;
425
+ background: url('chosen-sprite.png') no-repeat -30px -20px;
426
+ direction: rtl;
427
+ }
428
+ .chosen-rtl.chosen-container-single .chosen-single div b {
429
+ background-position: 6px 2px;
430
+ }
431
+ .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
432
+ background-position: -12px 2px;
433
+ }
434
+
435
+ /* @end */
436
+ /* @group Retina compatibility */
437
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
438
+ .chosen-rtl .chosen-search input[type="text"],
439
+ .chosen-container-single .chosen-single abbr,
440
+ .chosen-container-single .chosen-single div b,
441
+ .chosen-container-single .chosen-search input[type="text"],
442
+ .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
443
+ .chosen-container .chosen-results-scroll-down span,
444
+ .chosen-container .chosen-results-scroll-up span {
445
+ background-image: url('chosen-sprite@2x.png') !important;
446
+ background-size: 52px 37px !important;
447
+ background-repeat: no-repeat !important;
448
+ }
449
+ }
450
+ /* @end */
static/js/jquery/css/redmond/images/animated-overlay.gif CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100_1.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-icons_217bc0_256x240.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-icons_2e83ff_256x240.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-icons_469bdd_256x240.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-icons_6da8d5_256x240.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-icons_cd0a0a_256x240.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-icons_d8e7f3_256x240.png CHANGED
File without changes
static/js/jquery/css/redmond/images/ui-icons_f9bd01_256x240.png CHANGED
File without changes
static/js/jquery/css/redmond/jquery-ui.css CHANGED
File without changes
static/js/jquery/css/select2/select2-bootstrap.css CHANGED
File without changes
static/js/jquery/css/select2/select2-spinner.gif CHANGED
File without changes
static/js/jquery/css/select2/select2.css CHANGED
File without changes
static/js/jquery/css/select2/select2.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/tipsy.gif CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-icons_222222_256x240.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-icons_454545_256x240.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-icons_888888_256x240.png CHANGED
File without changes
static/js/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png CHANGED
File without changes
static/js/jquery/css/smoothness/jquery-ui.css CHANGED
File without changes
static/js/jquery/css/smoothness/jquery.tipsy.css CHANGED
@@ -1,4 +1,4 @@
1
- .tipsy { padding: 5px; font-size: 0.85em; position: absolute; z-index: 100000; line-height: 1.3em; max-width: 320px;}
2
  .tipsy-inner { padding: 2px 4px 2px 4px; background-color: white; border: 1px solid #333;}
3
  .tipsy-arrow { position: absolute; background: url('images/tipsy.gif') no-repeat top left; width: 9px; height: 5px; }
4
  .tipsy-n .tipsy-arrow { top: 0; left: 50%; margin-left: -4px; }
1
+ .tipsy { padding: 5px; font-size: 0.85em; position: absolute; z-index: 999999; line-height: 1.3em; max-width: 320px;}
2
  .tipsy-inner { padding: 2px 4px 2px 4px; background-color: white; border: 1px solid #333;}
3
  .tipsy-arrow { position: absolute; background: url('images/tipsy.gif') no-repeat top left; width: 9px; height: 5px; }
4
  .tipsy-n .tipsy-arrow { top: 0; left: 50%; margin-left: -4px; }
static/js/jquery/jquery.ddslick.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function (a) { function g(a, b) { var c = a.data("ddslick"); var d = a.find(".dd-selected"), e = d.siblings(".dd-selected-value"), f = a.find(".dd-options"), g = d.siblings(".dd-pointer"), h = a.find(".dd-option").eq(b), k = h.closest("li"), l = c.settings, m = c.settings.data[b]; a.find(".dd-option").removeClass("dd-option-selected"); h.addClass("dd-option-selected"); c.selectedIndex = b; c.selectedItem = k; c.selectedData = m; if (l.showSelectedHTML) { d.html((m.text ? '<label class="dd-selected-text ' + (m.imageSrc ? m.imageSrc : "") + '">' + m.text + "</label>" : "") + (m.description ? '<small class="dd-selected-description dd-desc' + (l.truncateDescription ? " dd-selected-description-truncated" : "") + '" >' + m.description + "</small>" : "")) } else d.html(m.text); e.val(m.value); c.original.val(m.value); a.data("ddslick", c); i(a); j(a); if (typeof l.onSelected == "function") { l.onSelected.call(this, c) } } function h(b) { var c = b.find(".dd-select"), d = c.siblings(".dd-options"), e = c.find(".dd-pointer"), f = d.is(":visible"); a(".dd-click-off-close").not(d).slideUp(50); a(".dd-pointer").removeClass("dd-pointer-up"); if (f) { d.slideUp("fast", function(){ var l = b.data("ddslick"); l.settings.onSlideUpOptions.call(this); }); e.removeClass("dd-pointer-up") } else { d.slideDown("fast", function(){ var l = b.data("ddslick"); l.settings.onSlideDownOptions.call(this); }); e.addClass("dd-pointer-up") } k(b) } function i(a) { a.find(".dd-options").slideUp(50); a.find(".dd-pointer").removeClass("dd-pointer-up").removeClass("dd-pointer-up") } function j(a) { var b = a.find(".dd-select").css("height"); var c = a.find(".dd-selected-description"); var d = a.find(".dd-selected-image"); if (c.length <= 0 && d.length > 0) { a.find(".dd-selected-text").css("lineHeight", b) } } function k(b) { b.find(".dd-option").each(function () { var c = a(this); var d = c.css("height"); var e = c.find(".dd-option-description"); var f = b.find(".dd-option-image"); if (e.length <= 0 && f.length > 0) { c.find(".dd-option-text").css("lineHeight", d) } }) } a.fn.ddslick = function (c) { if (b[c]) { return b[c].apply(this, Array.prototype.slice.call(arguments, 1)) } else if (typeof c === "object" || !c) { return b.init.apply(this, arguments) } else { a.error("Method " + c + " does not exists.") } }; var b = {}, c = { data: [], keepJSONItemsOnTop: false, width: "98%", height: null, background: "#eee", selectText: "", defaultSelectedIndex: null, truncateDescription: true, imagePosition: "left", showSelectedHTML: true, clickOffToClose: true, onSelected: function () { }, onSlideDownOptions: function() { }, onSlideUpOptions: function() { } }, d = '<div class="dd-select"><input class="dd-selected-value" type="hidden" /><a class="dd-selected"></a><span class="dd-pointer dd-pointer-down"></span></div>', e = '<ul class="dd-options"></ul>', f = '<style id="css-ddslick" type="text/css">' + ".dd-select{ border-radius:4px; -moz-border-radius: 4px; -khtml-border-radius: 4px; -webkit-border-radius: 4px; border:solid 1px #ccc; position:relative; cursor:pointer;}" + ".dd-desc { color:#aaa; display:block; overflow: hidden; font-weight:normal; line-height: 1.4em; }" + ".dd-selected{ overflow:hidden; display:block; padding:10px; font-weight:bold;}" + ".dd-pointer{ width:0; height:0; position:absolute; right:10px; top:50%; margin-top:-3px;}" + ".dd-pointer-down{ border:solid 5px transparent; border-top:solid 5px #000; }" + ".dd-pointer-up{border:solid 5px transparent !important; border-bottom:solid 5px #000 !important; margin-top:-8px;}" + ".dd-options{ border:solid 1px #ccc; border-top:none; list-style:none; box-shadow:0px 1px 5px #ddd; display:none; position:absolute; z-index:2000; margin:0; padding:0;background:#fff; overflow:auto;}" + ".dd-option{ padding:10px; display:block; border-bottom:solid 1px #ddd; overflow:hidden; text-decoration:none; color:#333; cursor:pointer;-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out;-o-transition: all 0.25s ease-in-out;-ms-transition: all 0.25s ease-in-out; }" + ".dd-options > li:last-child > .dd-option{ border-bottom:none;}" + ".dd-option:hover{ background:#f3f3f3; color:#000;}" + ".dd-selected-description-truncated { text-overflow: ellipsis; white-space:nowrap; }" + ".dd-option-selected { background:#f6f6f6; }" + ".dd-option-image, .dd-selected-image { vertical-align:middle; float:left; margin-right:5px; max-width:64px;}" + ".dd-image-right { float:right; margin-right:15px; margin-left:5px;}" + ".dd-container{ position:relative;}​ .dd-selected-text { font-weight:bold}​</style>"; if (a("#css-ddslick").length <= 0) { a(f).appendTo("head") } b.init = function (b) { var b = a.extend({}, c, b); return this.each(function () { var c = a(this), f = c.data("ddslick"); if (!f) { var i = [], j = b.data; c.find("option").each(function () { var b = a(this), c = b.data(); i.push({ text: a.trim(b.text()), value: b.val(), selected: b.is(":selected"), description: c.description, imageSrc: c.imagesrc }) }); if (b.keepJSONItemsOnTop) a.merge(b.data, i); else b.data = a.merge(i, b.data); var k = c, l = a('<div id="' + c.attr("id") + '"></div>'); c.replaceWith(l); c = l; c.addClass("dd-container").append(d).append(e); var i = c.find(".dd-select"), m = c.find(".dd-options"); m.css({ width: b.width }); i.css({ width: b.width, background: b.background }); c.css({ width: b.width }); if (b.height != null) m.css({ height: b.height, overflow: "auto" }); a.each(b.data, function (a, c) { if (c.selected) b.defaultSelectedIndex = a; m.append("<li>" + '<a class="dd-option">' + (c.value ? ' <input class="dd-option-value" type="hidden" value="' + c.value + '" />' : "") + (c.text ? ' <label class="dd-option-text ' + (c.imageSrc ? c.imageSrc : "") + '">' + c.text + "</label>" : "") + (c.description ? ' <small class="dd-option-description dd-desc">' + c.description + "</small>" : "") + "</a>" + "</li>") }); var n = { settings: b, original: k, selectedIndex: -1, selectedItem: null, selectedData: null }; c.data("ddslick", n); if (b.selectText.length > 0 && b.defaultSelectedIndex == null) { c.find(".dd-selected").html(b.selectText) } else { var o = b.defaultSelectedIndex != null && b.defaultSelectedIndex >= 0 && b.defaultSelectedIndex < b.data.length ? b.defaultSelectedIndex : 0; g(c, o) } c.find(".dd-select").on("click.ddslick", function () { h(c) }); c.find(".dd-option").on("click.ddslick", function () { g(c, a(this).closest("li").index()) }); if (b.clickOffToClose) { m.addClass("dd-click-off-close"); c.on("click.ddslick", function (a) { a.stopPropagation() }); a("body").on("click", function () { a(".dd-click-off-close").slideUp(50).siblings(".dd-select").find(".dd-pointer").removeClass("dd-pointer-up") }) } } }) }; b.select = function (b) { return this.each(function () { if (b.index) g(a(this), b.index) }) }; b.open = function () { return this.each(function () { var b = a(this), c = b.data("ddslick"); if (c) h(b) }) }; b.close = function () { return this.each(function () { var b = a(this), c = b.data("ddslick"); if (c) i(b) }) }; b.destroy = function () { return this.each(function () { var b = a(this), c = b.data("ddslick"); if (c) { var d = c.original; b.removeData("ddslick").unbind(".ddslick").replaceWith(d) } }) } })(jQuery)
static/js/jquery/{jquery.mjs.nestedSortable.js → jquery.mjs.pmxe_nestedSortable.js} RENAMED
@@ -13,12 +13,12 @@
13
 
14
  (function($) {
15
 
16
- $.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, {
17
 
18
  options: {
19
  tabSize: 20,
20
- disableNesting: 'mjs-nestedSortable-no-nesting',
21
- errorClass: 'mjs-nestedSortable-error',
22
  listType: 'ol',
23
  maxLevels: 0,
24
  protectRoot: false,
@@ -28,18 +28,18 @@
28
  },
29
 
30
  _create: function() {
31
- this.element.data('sortable', this.element.data('nestedSortable'));
32
 
33
  if (!this.element.is(this.options.listType))
34
- throw new Error('nestedSortable: Please check the listType option is set to your actual list type');
35
 
36
  return $.ui.sortable.prototype._create.apply(this, arguments);
37
  },
38
 
39
  destroy: function() {
40
  this.element
41
- .removeData("nestedSortable")
42
- .unbind(".nestedSortable");
43
  return $.ui.sortable.prototype.destroy.apply(this, arguments);
44
  },
45
 
@@ -345,7 +345,10 @@
345
  }
346
 
347
  if (id) {
348
- ret.push({"item_id": id[2], "parent_id": pid, "delim": $(item).parents('.post_taxonomy:first').find('input.tax_delim').val(), "left": left, "right": right, "xpath":$(item).find('input.widefat').val(), "assign":$(item).find('input.assign_post:first').is(':checked'), "auto_nested":$(item).parents('.post_taxonomy:first').find('input.taxonomy_auto_nested').is(':checked')});
 
 
 
349
  }
350
 
351
  left = right + 1;
@@ -395,7 +398,7 @@
395
  _isAllowed: function(parentItem, level, levels) {
396
  var o = this.options,
397
  isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false,
398
- maxLevels = this.placeholder.closest('.ui-sortable').nestedSortable('option', 'maxLevels'); // this takes into account the maxLevels set to the recipient list
399
 
400
  // Is the root protected?
401
  // Are we trying to nest under a no-nest?
@@ -422,5 +425,5 @@
422
 
423
  }));
424
 
425
- $.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options);
426
  })(jQuery);
13
 
14
  (function($) {
15
 
16
+ $.widget("mjs.pmxe_nestedSortable", $.extend({}, $.ui.sortable.prototype, {
17
 
18
  options: {
19
  tabSize: 20,
20
+ disableNesting: 'mjs-pmxe_nestedSortable-no-nesting',
21
+ errorClass: 'mjs-pmxe_nestedSortable-error',
22
  listType: 'ol',
23
  maxLevels: 0,
24
  protectRoot: false,
28
  },
29
 
30
  _create: function() {
31
+ this.element.data('sortable', this.element.data('pmxe_nestedSortable'));
32
 
33
  if (!this.element.is(this.options.listType))
34
+ throw new Error('pmxe_nestedSortable: Please check the listType option is set to your actual list type');
35
 
36
  return $.ui.sortable.prototype._create.apply(this, arguments);
37
  },
38
 
39
  destroy: function() {
40
  this.element
41
+ .removeData("pmxe_nestedSortable")
42
+ .unbind(".pmxe_nestedSortable");
43
  return $.ui.sortable.prototype.destroy.apply(this, arguments);
44
  },
45
 
345
  }
346
 
347
  if (id) {
348
+
349
+ var clause = ($(item).find('.condition').is(':visible')) ? $(item).find('input.rule_condition:checked').val().toUpperCase() : false;
350
+
351
+ ret.push({"item_id": id[2], "left": left, "right": right, "parent_id": pid, "element":$(item).find('input.wp_all_export_xml_element').val(), "title" : $(item).find('input.wp_all_export_xml_element_title').val(), "condition" : $(item).find('input.wp_all_export_rule').val(), "value" : $(item).find('input.wp_all_export_value').val(), "clause" : clause });
352
  }
353
 
354
  left = right + 1;
398
  _isAllowed: function(parentItem, level, levels) {
399
  var o = this.options,
400
  isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false,
401
+ maxLevels = this.placeholder.closest('.ui-sortable').pmxe_nestedSortable('option', 'maxLevels'); // this takes into account the maxLevels set to the recipient list
402
 
403
  // Is the root protected?
404
  // Are we trying to nest under a no-nest?
425
 
426
  }));
427
 
428
+ $.mjs.pmxe_nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.pmxe_nestedSortable.prototype.options);
429
  })(jQuery);
static/js/jquery/jquery.tipsy.js CHANGED
File without changes
static/js/jquery/moment.js CHANGED
File without changes
static/js/jquery/select2.min.js CHANGED
File without changes
static/js/jquery/ui.autocomplete.js CHANGED
File without changes
static/js/jquery/ui.datepicker.js CHANGED
File without changes
static/js/pmxe.js CHANGED
File without changes
views/admin/export/element.php DELETED
@@ -1,183 +0,0 @@
1
- <table class="layout pmxe_step_2">
2
- <tr>
3
- <td class="left">
4
- <h2><?php _e('Export to XML/CSV - Step 2: Choose Which data to export', 'pmxe_plugin') ?></h2>
5
-
6
- <?php if ($this->errors->get_error_codes()): ?>
7
- <?php $this->error() ?>
8
- <?php endif; ?>
9
-
10
- <h3><?php printf('Selected custom post types for export: %s', implode(", ", $post['cpt'])); ?></h3>
11
-
12
- <fieldset class="optionsset">
13
- <legend><?php _e('Data to export', 'pmxe_plugin'); ?></legend>
14
- <form method="post" class="choose-export-data no-enter-submit" enctype="multipart/form-data" autocomplete="off">
15
- <input type="hidden" name="is_submitted" value="1" />
16
- <div class="input">
17
-
18
- <div class="input">
19
- <input type="hidden" name="is_export_title" value="0" />
20
- <input type="checkbox" id="is_export_title" name="is_export_title" value="1" <?php echo $post['is_export_title'] ? 'checked="checked"': '' ?> />
21
- <label for="is_export_title"><?php _e('Post Title', 'pmxe_plugin') ?></label>
22
- </div>
23
- <div class="input">
24
- <input type="hidden" name="is_export_content" value="0" />
25
- <input type="checkbox" id="is_export_content" name="is_export_content" value="1" <?php echo $post['is_export_content'] ? 'checked="checked"': '' ?> />
26
- <label for="is_export_content"><?php _e('Post Content', 'pmxe_plugin') ?></label>
27
- </div>
28
-
29
- <div class="input">
30
- <input type="hidden" name="custom_fields_list" value="0" />
31
- <input type="hidden" name="is_export_custom_fields" value="0" />
32
- <input type="checkbox" id="is_export_custom_fields" name="is_export_custom_fields" value="1" <?php echo $post['is_export_custom_fields'] ? 'checked="checked"': '' ?> class="switcher"/>
33
- <label for="is_export_custom_fields"><?php _e('Custom Fields', 'pmxe_plugin') ?></label>
34
- <div class="switcher-target-is_export_custom_fields" style="padding-left:17px;">
35
- <?php
36
- $existing_meta_keys = array();
37
- $hide_fields = array('_wp_page_template', '_edit_lock', '_edit_last', '_wp_trash_meta_status', '_wp_trash_meta_time');
38
- if (!empty($meta_keys) and $meta_keys->count()):
39
- foreach ($meta_keys as $meta_key) { if (in_array($meta_key['meta_key'], $hide_fields) or strpos($meta_key['meta_key'], '_wp') === 0) continue;
40
- $existing_meta_keys[] = $meta_key['meta_key'];
41
- }
42
- endif;
43
- ?>
44
- <div class="input">
45
- <input type="radio" id="export_custom_fields_logic_only" name="export_custom_fields_logic" value="only" <?php echo ( "only" == $post['export_custom_fields_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
46
- <label for="export_custom_fields_logic_only"><?php _e('I only need a data from a few custom fields. Export these custom fields.', 'pmxe_plugin') ?></label>
47
- <div class="switcher-target-export_custom_fields_logic_only pmxe_choosen" style="padding-left:17px;">
48
-
49
- <span class="hidden choosen_values"><?php if (!empty($existing_meta_keys)) echo implode(',', $existing_meta_keys);?></span>
50
- <input class="choosen_input" value="<?php if (!empty($post['custom_fields_list']) and "only" == $post['export_custom_fields_logic']) echo implode(',', $post['custom_fields_list']); ?>" type="hidden" name="custom_fields_list"/>
51
- </div>
52
- </div>
53
- <div class="input">
54
- <input type="radio" id="export_custom_fields_logic_full_update" name="export_custom_fields_logic" value="full_export" <?php echo ( "full_export" == $post['export_custom_fields_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
55
- <label for="export_custom_fields_logic_full_update"><?php _e('I want a gaint messy data file that\'s confusing and hard to read. Export ALL Cutom Fields.', 'pmxe_plugin') ?></label>
56
- </div>
57
- </div>
58
- </div>
59
-
60
- <div class="input">
61
- <input type="hidden" name="taxonomies_list" value="0" />
62
- <input type="hidden" name="is_export_categories" value="0" />
63
- <input type="checkbox" id="is_export_categories" name="is_export_categories" value="1" class="switcher" <?php echo $post['is_export_categories'] ? 'checked="checked"': '' ?> />
64
- <label for="is_export_categories"><?php _e('Taxonomies (incl. Categories and Tags)', 'pmxe_plugin') ?></label>
65
- <div class="switcher-target-is_export_categories" style="padding-left:17px;">
66
- <div class="input" style="margin-bottom:3px;">
67
- <input type="radio" id="export_categories_logic_full_update" name="export_categories_logic" value="full_export" <?php echo ( "full_export" == $post['export_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
68
- <label for="export_categories_logic_full_update" style="position:relative; top:1px;"><?php _e('Export all taxonomies', 'pmxe_plugin') ?></label>
69
- </div>
70
- <?php
71
- global $wp_taxonomies;
72
- $existing_taxonomies = array();
73
-
74
- foreach ($wp_taxonomies as $key => $obj) {
75
- $existing_taxonomies[] = $obj->name;
76
- }
77
-
78
- ?>
79
- <div class="input" style="margin-bottom:3px;">
80
- <input type="radio" id="export_categories_logic_only" name="export_categories_logic" value="only" <?php echo ( "only" == $post['export_categories_logic'] ) ? 'checked="checked"': '' ?> class="switcher"/>
81
- <label for="export_categories_logic_only" style="position:relative; top:1px;"><?php _e('Only export these taxonomies.', 'pmxe_plugin') ?></label>
82
- <div class="switcher-target-export_categories_logic_only pmxe_choosen" style="padding-left:17px;">
83
- <span class="hidden choosen_values"><?php if (!empty($existing_taxonomies)) echo implode(',', $existing_taxonomies);?></span>
84
- <input class="choosen_input" value="<?php if (!empty($post['taxonomies_list']) and "only" == $post['export_categories_logic']) echo implode(',', $post['taxonomies_list']); ?>" type="hidden" name="taxonomies_list"/>
85
- </div>
86
- </div>
87
- </div>
88
- </div>
89
-
90
- <div class="input">
91
- <input type="hidden" name="is_export_images" value="0" />
92
- <input type="checkbox" id="is_export_images" name="is_export_images" value="1" <?php echo $post['is_export_images'] ? 'checked="checked"': '' ?> class="switcher" />
93
- <label for="is_export_images"><?php _e('Media Gallery', 'pmxe_plugin') ?></label>
94
- <div class="switcher-target-is_export_images" style="padding-left:17px;">
95
- <div class="input" style="margin-bottom:3px;">
96
- <input type="checkbox" id="export_images_logic_urls" name="export_images_logic[]" value="urls" <?php echo ( in_array("urls", $post['export_images_logic']) ) ? 'checked="checked"': '' ?> />
97
- <label for="export_images_logic_urls" style="position:relative; top:1px;"><?php _e('Image URLs', 'pmxe_plugin') ?></label>
98
- </div>
99
- <div class="input" style="margin-bottom:3px;">
100
- <input type="checkbox" id="export_images_logic_meta_data" name="export_images_logic[]" value="meta_data" <?php echo ( in_array("meta_data", $post['export_images_logic']) ) ? 'checked="checked"': '' ?> />
101
- <label for="export_images_logic_meta_data" style="position:relative; top:1px;"><?php _e('Import Meta Data', 'pmxe_plugin') ?></label>
102
- </div>
103
- </div>
104
- </div>
105
-
106
- <div class="input">
107
- <input type="hidden" name="is_export_other" value="0" />
108
- <input type="checkbox" id="is_export_other" name="is_export_other" value="1" <?php echo $post['is_export_other'] ? 'checked="checked"': '' ?> class="switcher" />
109
- <label for="is_export_other"><?php _e('Other Stuff', 'pmxe_plugin') ?></label>
110
- <div class="switcher-target-is_export_other" style="padding-left:17px;">
111
- <div class="input">
112
- <input type="hidden" name="is_export_dates" value="0" />
113
- <input type="checkbox" id="is_export_dates" name="is_export_dates" value="1" <?php echo $post['is_export_dates'] ? 'checked="checked"': '' ?> />
114
- <label for="is_export_dates"><?php _e('Dates', 'pmxe_plugin') ?></label>
115
- </div>
116
- <div class="input">
117
- <input type="hidden" name="is_export_parent" value="0" />
118
- <input type="checkbox" id="is_export_parent" name="is_export_parent" value="1" <?php echo $post['is_export_parent'] ? 'checked="checked"': '' ?> />
119
- <label for="is_export_parent"><?php _e('Parent', 'pmxe_plugin') ?></label>
120
- </div>
121
- <div class="input">
122
- <input type="hidden" name="is_export_template" value="0" />
123
- <input type="checkbox" id="is_export_template" name="is_export_template" value="1" <?php echo $post['is_export_template'] ? 'checked="checked"': '' ?> />
124
- <label for="is_export_template"><?php _e('Template', 'pmxe_plugin') ?></label>
125
- </div>
126
- <div class="input">
127
- <input type="hidden" name="is_export_menu_order" value="0" />
128
- <input type="checkbox" id="is_export_menu_order" name="is_export_menu_order" value="1" <?php echo $post['is_export_menu_order'] ? 'checked="checked"': '' ?> />
129
- <label for="is_export_menu_order"><?php _e('Order', 'pmxe_plugin') ?></label>
130
- </div>
131
- <div class="input">
132
- <input type="hidden" name="is_export_status" value="0" />
133
- <input type="checkbox" id="is_export_status" name="is_export_status" value="1" <?php echo $post['is_export_status'] ? 'checked="checked"': '' ?> />
134
- <label for="is_export_status"><?php _e('Status', 'pmxe_plugin') ?></label>
135
- </div>
136
- <div class="input">
137
- <input type="hidden" name="is_export_format" value="0" />
138
- <input type="checkbox" id="is_export_format" name="is_export_format" value="1" <?php echo $post['is_export_format'] ? 'checked="checked"': '' ?> />
139
- <label for="is_export_format"><?php _e('Format', 'pmxe_plugin') ?></label>
140
- </div>
141
- <div class="input">
142
- <input type="hidden" name="is_export_author" value="0" />
143
- <input type="checkbox" id="is_export_author" name="is_export_author" value="1" <?php echo $post['is_export_author'] ? 'checked="checked"': '' ?> />
144
- <label for="is_export_author"><?php _e('Author', 'pmxe_plugin') ?></label>
145
- </div>
146
- <div class="input">
147
- <input type="hidden" name="is_export_slug" value="0" />
148
- <input type="checkbox" id="is_export_slug" name="is_export_slug" value="1" <?php echo $post['is_export_slug'] ? 'checked="checked"': '' ?> />
149
- <label for="is_export_slug"><?php _e('Slug', 'pmxe_plugin') ?></label>
150
- </div>
151
- <div class="input">
152
- <input type="hidden" name="is_export_excerpt" value="0" />
153
- <input type="checkbox" id="is_export_excerpt" name="is_export_excerpt" value="1" <?php echo $post['is_export_excerpt'] ? 'checked="checked"': '' ?> />
154
- <label for="is_export_excerpt"><?php _e('Excerpt/Short Description', 'pmxe_plugin') ?></label>
155
- </div>
156
- <div class="input">
157
- <input type="hidden" name="is_export_attachments" value="0" />
158
- <input type="checkbox" id="is_export_attachments" name="is_export_attachments" value="1" <?php echo $post['is_export_attachments'] ? 'checked="checked"': '' ?> />
159
- <label for="is_export_attachments"><?php _e('Attachment URLs', 'pmxe_plugin') ?></label>
160
- </div>
161
-
162
- </div>
163
- </div>
164
- </div>
165
- <p class="submit-buttons" style="text-align:right;">
166
- <?php wp_nonce_field('element', '_wpnonce_element') ?>
167
- <input type="hidden" name="is_submitted" value="1" />
168
-
169
- <a href="<?php echo $this->baseUrl ?>" class="back"><?php _e('Back', 'pmxe_plugin') ?></a>
170
-
171
- <input type="submit" class="button button-primary button-hero large_button" name="export_to" value="<?php _e('Export XML', 'pmxe_plugin') ?>" />
172
-
173
- <input type="submit" class="button button-primary button-hero large_button" name="export_to" value="<?php _e('Export CSV', 'pmxe_plugin') ?>" />
174
-
175
- </p>
176
- </form>
177
- </fieldset>
178
- </td>
179
- <td class="right">
180
- &nbsp;
181
- </td>
182
- </tr>
183
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
views/admin/export/index.php CHANGED
@@ -1,61 +1,124 @@
1
- <table class="layout pmxe_step_1">
2
  <tr>
3
  <td class="left">
4
- <h2><?php _e('Export to XML/CSV - Step 1: Choose Which posts to export', 'pmxe_plugin') ?></h2>
5
-
6
- <?php if ($this->errors->get_error_codes()): ?>
7
- <?php $this->error() ?>
8
- <?php endif ?>
9
-
10
- <?php do_action('pmxe_choose_file_header'); ?>
11
- <form method="post" class="choose-post-type no-enter-submit" enctype="multipart/form-data" autocomplete="off">
12
- <input type="hidden" name="is_submitted" value="1" />
13
- <?php wp_nonce_field('type_specific-cpt', '_wpnonce_type_specific-cpt') ?>
14
- <div class="file-type-container">
15
- <h3>
16
- <input type="radio" id="type_specific" name="type" value="specific" checked="checked" />
17
- <label for="type_specific"><?php _e('Export a specific post type', 'pmxe_plugin') ?></label>
18
- </h3>
19
- <div class="file-type-options">
20
- <?php $custom_types = get_post_types(array('_builtin' => false), 'objects'); ?>
21
- <select name="cpt">
22
- <option value="post"><?php _e('Posts','pmxe_plugin');?></option>
23
- <option value="page"><?php _e('Pages','pmxe_plugin');?></option>
24
- <?php if (count($custom_types)): ?>
25
- <?php foreach ($custom_types as $key => $ct):?>
26
- <option value="<?php echo $key;?>"><?php echo $ct->labels->name; ?></option>
27
- <?php endforeach ?>
28
- <?php endif ?>
29
- </select>
30
- </div>
31
- </div>
32
- <div class="file-type-container">
33
- <h3>
34
- <input type="radio" id="type_multiple" name="type" value="url" />
35
- <label for="type_multiple"><?php _e('Export multiple post types', 'pmxe_plugin') ?></label>
36
- </h3>
37
- <div class="file-type-options">
38
- <input type="checkbox" name="cpt[]" value="post" id="posts"/> <label for="posts"><?php _e('Posts', 'pmxe_plugin'); ?></label>
39
- <input type="checkbox" name="cpt[]" value="page" id="pages"/> <label for="pages"><?php _e('Pages', 'pmxe_plugin'); ?></label>
40
- <?php if (count($custom_types)): ?>
41
- <?php foreach ($custom_types as $key => $ct):?>
42
- <input type="checkbox" name="cpt[]" value="<?php echo $key; ?>" id="<?php echo $key; ?>"/> <label for="<?php echo $key; ?>"><?php echo $ct->labels->name ?></label>
43
- <?php endforeach ?>
44
- <?php endif ?>
45
  </div>
46
- </div>
47
- <div id="url_upload_status"></div>
48
- <p class="submit-buttons">
49
- <input type="hidden" name="is_submitted" value="1" />
50
- <?php wp_nonce_field('choose-cpt', '_wpnonce_choose-cpt') ?>
51
- <input type="submit" class="button button-primary button-hero large_button" value="<?php _e('Next', 'pmxe_plugin') ?>" id="advanced_upload"/>
52
- </p>
53
- <br />
54
- <table><tr><td class="note"></td></tr></table>
55
- </form>
56
- </td>
57
- <td class="right">
58
- &nbsp;
59
- </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  </tr>
61
  </table>
1
+ <table class="wpallexport-layout wpallexport-step-1">
2
  <tr>
3
  <td class="left">
4
+ <div class="wpallexport-wrapper">
5
+ <h2 class="wpallexport-wp-notices"></h2>
6
+ <div class="wpallexport-header">
7
+ <div class="wpallexport-logo"></div>
8
+ <div class="wpallexport-title">
9
+ <p><?php _e('WP All Export', 'wp_all_export_plugin'); ?></p>
10
+ <h2><?php _e('Export to XML / CSV', 'wp_all_export_plugin'); ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  </div>
12
+ <div class="wpallexport-links">
13
+ <a href="http://www.wpallimport.com/support/" target="_blank"><?php _e('Support', 'wp_all_export_plugin'); ?></a> | <a href="http://www.wpallimport.com/documentation/" target="_blank"><?php _e('Documentation', 'wp_all_export_plugin'); ?></a>
14
+ </div>
15
+ </div>
16
+
17
+ <div class="clear"></div>
18
+
19
+ <?php if ($this->errors->get_error_codes()): ?>
20
+ <?php $this->error() ?>
21
+ <?php endif ?>
22
+
23
+ <form method="post" class="wpallexport-choose-file" enctype="multipart/form-data" autocomplete="off">
24
+
25
+ <div class="wpallexport-upload-resource-step-one rad4">
26
+
27
+ <div class="clear"></div>
28
+
29
+ <div class="wpallexport-import-types">
30
+ <h2><?php _e('First, choose what to export.', 'wp_all_export_plugin'); ?></h2>
31
+ <a class="wpallexport-import-from wpallexport-url-type <?php echo 'specific' == $post['export_type'] ? 'selected' : '' ?>" rel="specific_type" href="javascript:void(0);">
32
+ <span class="wpallexport-icon"></span>
33
+ <span class="wpallexport-icon-label"><?php _e('Specific Post Type', 'wp_all_export_plugin'); ?></span>
34
+ </a>
35
+ <a class="wpallexport-import-from wpallexport-file-type <?php echo 'advanced' == $post['export_type'] ? 'selected' : '' ?>" rel="advanced_type" href="javascript:void(0);">
36
+ <span class="wpallexport-icon"></span>
37
+ <span class="wpallexport-icon-label"><?php _e('WP_Query Results', 'wp_all_export_plugin'); ?></span>
38
+ </a>
39
+ </div>
40
+
41
+ <input type="hidden" value="<?php echo $post['export_type']; ?>" name="export_type"/>
42
+
43
+ <div class="wpallexport-upload-type-container" rel="specific_type">
44
+
45
+ <div class="wpallexport-file-type-options">
46
+
47
+ <?php
48
+ $custom_types = get_post_types(array('_builtin' => true), 'objects') + get_post_types(array('_builtin' => false, 'show_ui' => true), 'objects');
49
+ foreach ($custom_types as $key => $ct) {
50
+ if (in_array($key, array('attachment', 'revision', 'nav_menu_item', 'import_users'))) unset($custom_types[$key]);
51
+ }
52
+ $custom_types = apply_filters( 'wpallexport_custom_types', $custom_types );
53
+ ?>
54
+
55
+ <select id="file_selector">
56
+ <option value=""><?php _e('Choose a post type...', 'wp_all_export_plugin'); ?></option>
57
+ <?php if (count($custom_types)): ?>
58
+ <?php foreach ($custom_types as $key => $ct):?>
59
+ <?php
60
+ $image_src = 'dashicon-cpt';
61
+ if ( in_array($key, array('post', 'page', 'product', 'import_users') ) )
62
+ $image_src = 'dashicon-' . $key;
63
+ ?>
64
+ <option value="<?php echo $key;?>" data-imagesrc="dashicon <?php echo $image_src; ?>" <?php if ($key == $post['cpt']) echo 'selected="selected"'; ?>><?php echo $ct->labels->name; ?></option>
65
+ <?php endforeach ?>
66
+ <?php endif ?>
67
+ <option value="users" data-imagesrc="dashicon dashicon-import_users" <?php if ('users' == $post['cpt']) echo 'selected="selected"'; ?>><?php _e("Users", "wp_all_export_plugin"); ?></option>
68
+ </select>
69
+
70
+ <input type="hidden" name="cpt" value="<?php echo $post['cpt']; ?>"/>
71
+
72
+ </div>
73
+
74
+ <div class="wpallexport-free-edition-notice wpallexport-user-export-notice">
75
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=export-users&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export users.','wp_all_export_plugin');?></a>
76
+ </div>
77
+
78
+ </div>
79
+
80
+ <div class="wpallexport-upload-type-container" rel="advanced_type">
81
+ <div class="wpallexport-file-type-options">
82
+
83
+ <select id="wp_query_selector">
84
+ <option value="wp_query" <?php if ('wp_query' == $post['wp_query_selector']) echo 'selected="selected"'; ?>><?php _e('Post Type Query', 'wp_all_export_plugin'); ?></option>
85
+ <option value="wp_user_query" <?php if ('wp_user_query' == $post['wp_query_selector']) echo 'selected="selected"'; ?>><?php _e('User Query', 'wp_all_export_plugin'); ?></option>
86
+ </select>
87
+
88
+ <div class="wpallexport-free-edition-notice wpallexport-user-export-notice" style="margin-bottom: 20px;">
89
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=export-users&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to export users.','wp_all_export_plugin');?></a>
90
+ </div>
91
+
92
+ <input type="hidden" name="wp_query_selector" value="<?php echo $post['wp_query_selector'];?>">
93
+ <textarea class="wp_query" rows="10" cols="80" name="wp_query" placeholder="'post_type' => 'post', 'post_status' => array( 'pending', 'draft', 'future' )" style="width: 600px;"><?php echo esc_html($post['wp_query']); ?></textarea>
94
+
95
+ </div>
96
+
97
+ </div>
98
+
99
+ <div class="wp_all_export_preloader"></div>
100
+
101
+ <input type="hidden" class="hierarhy-output" name="filter_rules_hierarhy" value="<?php echo esc_html($post['filter_rules_hierarhy']);?>"/>
102
+
103
+ </div>
104
+
105
+ <div class="wpallexport-upload-resource-step-two rad4 wpallexport-collapsed closed">
106
+
107
+ </div>
108
+
109
+ <p class="wpallexport-submit-buttons" <?php if ('advanced' == $post['export_type']) echo 'style="display:block;"';?>>
110
+ <input type="hidden" name="custom_type" value="">
111
+ <input type="hidden" name="is_submitted" value="1" />
112
+ <?php wp_nonce_field('choose-cpt', '_wpnonce_choose-cpt'); ?>
113
+ <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Continue to Step 2', 'wp_all_export_plugin') ?>" id="advanced_upload"/>
114
+ </p>
115
+
116
+ <table><tr><td class="wpallexport-note"></td></tr></table>
117
+ </form>
118
+
119
+ <a href="http://soflyy.com/" target="_blank" class="wpallexport-created-by"><?php _e('Created by', 'wp_all_export_plugin'); ?> <span></span></a>
120
+
121
+ </div>
122
+ </td>
123
  </tr>
124
  </table>
views/admin/export/options.php ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $isWizard = $this->isWizard;
3
+ $baseUrl = $this->baseUrl;
4
+ ?>
5
+
6
+ <div class="wpallexport-step-4">
7
+
8
+ <h2 class="wpallexport-wp-notices"></h2>
9
+
10
+ <div class="wpallexport-wrapper">
11
+ <h2 class="wpallexport-wp-notices"></h2>
12
+ <div class="wpallexport-header">
13
+ <div class="wpallexport-logo"></div>
14
+ <div class="wpallexport-title">
15
+ <p><?php _e('WP All Export', 'wp_all_export_plugin'); ?></p>
16
+ <h2><?php _e('Export to XML / CSV', 'wp_all_export_plugin'); ?></h2>
17
+ </div>
18
+ <div class="wpallexport-links">
19
+ <a href="http://www.wpallimport.com/support/" target="_blank"><?php _e('Support', 'wp_all_export_plugin'); ?></a> | <a href="http://www.wpallimport.com/documentation/" target="_blank"><?php _e('Documentation', 'wp_all_export_plugin'); ?></a>
20
+ </div>
21
+ </div>
22
+ <div class="clear"></div>
23
+ </div>
24
+
25
+ <table class="wpallexport-layout">
26
+ <tr>
27
+ <td class="left" style="width: 100%;">
28
+
29
+ <?php do_action('pmxe_options_header', $isWizard, $post); ?>
30
+
31
+ <div class="ajax-console">
32
+ <?php if ($this->errors->get_error_codes()): ?>
33
+ <?php $this->error() ?>
34
+ <?php endif ?>
35
+ </div>
36
+
37
+ <?php if ($isWizard): ?>
38
+
39
+ <div class="wpallexport-content-section" style="padding: 0 30px 0 0; overflow: hidden; margin-bottom: 0;">
40
+
41
+ <div class="wpallexport-ready-to-go">
42
+
43
+ <h3><?php _e('Your export is ready to run.', 'wp_all_export_plugin'); ?></h3>
44
+
45
+ <h4><?php printf(__('WP All Export will export %d %s.'), PMXE_Plugin::$session->found_posts, wp_all_export_get_cpt_name($post['cpt'])); ?></h4>
46
+
47
+ </div>
48
+
49
+ <form class="confirm <?php echo ! $isWizard ? 'edit' : '' ?>" method="post" style="float:right;">
50
+
51
+ <?php wp_nonce_field('options', '_wpnonce_options') ?>
52
+ <input type="hidden" name="is_submitted" value="1" />
53
+
54
+ <input type="submit" class="rad10" value="<?php _e('Confirm & Run Export', 'wp_all_export_plugin') ?>" />
55
+ </form>
56
+
57
+ </div>
58
+
59
+ <?php endif; ?>
60
+
61
+ <div class="clear"></div>
62
+
63
+ <form class="<?php echo ! $isWizard ? 'edit' : 'options' ?> choose-export-options" method="post" enctype="multipart/form-data" autocomplete="off" <?php echo ! $isWizard ? 'style="overflow:visible;"' : '' ?>>
64
+
65
+ <?php if ( ! $isWizard and $post['export_type'] == 'specific'): ?>
66
+
67
+ <div class="wpallexport-collapsed wpallexport-section closed">
68
+ <div class="wpallexport-content-section">
69
+ <div class="wpallexport-collapsed-header" style="padding-left: 25px;">
70
+ <h3><?php _e('Filters','wp_all_export_plugin');?></h3>
71
+ </div>
72
+ <div class="wpallexport-collapsed-content" style="padding: 0;">
73
+ <div class="wpallexport-collapsed-content-inner">
74
+ <div class="wpallexport-free-edition-notice" style="padding: 20px; margin-bottom: 10px;">
75
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&amp;utm_medium=in-plugin&amp;utm_campaign=download-from-url"><?php _e('Upgrade to the professional edition of WP All Export to use this feature.','wp_all_export_plugin');?></a>
76
+ </div>
77
+ <input type="hidden" name="selected_post_type" value="<?php echo array_shift($post['cpt']); ?>"/>
78
+ <div class="wp_all_export_rule_inputs">
79
+ <table>
80
+ <tr>
81
+ <th><?php _e('Element', 'wp_all_export_plugin'); ?></th>
82
+ <th><?php _e('Rule', 'wp_all_export_plugin'); ?></th>
83
+ <th><?php _e('Value', 'wp_all_export_plugin'); ?></th>
84
+ <th>&nbsp;</th>
85
+ </tr>
86
+ <tr>
87
+ <td style="width: 25%;">
88
+ <select id="wp_all_export_xml_element" disabled="disabled">
89
+ <option value=""><?php _e('Select Element', 'wp_all_export_plugin'); ?></option>
90
+ <?php echo $engine->render_filters(); ?>
91
+ </select>
92
+ </td>
93
+ <td style="width: 25%;" id="wp_all_export_available_rules">
94
+ <select id="wp_all_export_rule" disabled="disabled">
95
+ <option value=""><?php _e('Select Rule', 'wp_all_export_plugin'); ?></option>
96
+ </select>
97
+ </td>
98
+ <td style="width: 25%;">
99
+ <input id="wp_all_export_value" type="text" placeholder="value" value="" disabled="disabled"/>
100
+ </td>
101
+ <td style="width: 15%;">
102
+ <a id="wp_all_export_add_rule" href="javascript:void(0);"><?php _e('Add Rule', 'wp_all_export_plugin');?></a>
103
+ </td>
104
+ </tr>
105
+ </table>
106
+ </div>
107
+ <div id="wpallexport-filters" style="padding:0;">
108
+ <div class="wpallexport-content-section" style="padding:0; border: none;">
109
+ <fieldset id="wp_all_export_filtering_rules">
110
+ <?php
111
+ $filter_rules = $post['filter_rules_hierarhy'];
112
+ $filter_rules_hierarhy = json_decode($filter_rules);
113
+ if ( empty($filter_rules_hierarhy) or ! is_array($filter_rules_hierarhy) ):
114
+ ?>
115
+ <p style="margin:20px 0 5px; text-align:center;"><?php _e('No filtering options. Add filtering options to only export records matching some specified criteria.', 'wp_all_export_plugin');?></p>
116
+ <?php
117
+ endif;
118
+ ?>
119
+ <ol class="wp_all_export_filtering_rules">
120
+ <?php
121
+ if ( ! empty($filter_rules_hierarhy) and is_array($filter_rules_hierarhy) ):
122
+ $rulenumber = 0;
123
+ foreach ($filter_rules_hierarhy as $rule) {
124
+
125
+ if ( is_null($rule->parent_id) )
126
+ {
127
+ $rulenumber++;
128
+ ?>
129
+ <li id="item_<?php echo $rulenumber;?>" class="dragging">
130
+ <div class="drag-element">
131
+ <input type="hidden" value="<?php echo $rule->element; ?>" class="wp_all_export_xml_element" name="wp_all_export_xml_element[<?php echo $rulenumber; ?>]"/>
132
+ <input type="hidden" value="<?php echo $rule->title; ?>" class="wp_all_export_xml_element_title" name="wp_all_export_xml_element_title[<?php echo $rulenumber; ?>]"/>
133
+ <input type="hidden" value="<?php echo $rule->condition; ?>" class="wp_all_export_rule" name="wp_all_export_rule[<?php echo $rulenumber; ?>]"/>
134
+ <input type="hidden" value="<?php echo $rule->value; ?>" class="wp_all_export_value" name="wp_all_export_value[<?php echo $rulenumber; ?>]"/>
135
+ <span class="rule_element"><?php echo $rule->title; ?></span>
136
+ <span class="rule_as_is"><?php echo $rule->condition; ?></span>
137
+ <span class="rule_condition_value"><?php echo $rule->value; ?></span>
138
+ <span class="condition" <?php if ($rulenumber == count($filter_rules_hierarhy)):?>style="display:none;"<?php endif; ?>>
139
+ <label for="rule_and_<?php echo $rulenumber; ?>">AND</label>
140
+ <input id="rule_and_<?php echo $rulenumber; ?>" type="radio" value="and" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'AND'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
141
+ <label for="rule_or_<?php echo $rulenumber; ?>">OR</label>
142
+ <input id="rule_or_<?php echo $rulenumber; ?>" type="radio" value="or" name="rule[<?php echo $rulenumber; ?>]" <?php if ($rule->clause == 'OR'): ?>checked="checked"<?php endif; ?> class="rule_condition"/>
143
+ </span>
144
+ </div>
145
+ <a href="javascript:void(0);" class="icon-item remove-ico"></a>
146
+ <?php echo wp_all_export_reverse_rules_html($filter_rules_hierarhy, $rule, $rulenumber); ?>
147
+ </li>
148
+ <?php
149
+ }
150
+ }
151
+ endif;
152
+ ?>
153
+ </ol>
154
+ <div class="clear"></div>
155
+
156
+ </fieldset>
157
+
158
+ <?php if ( @in_array("product", $post["cpt"]) and class_exists('WooCommerce')) : ?>
159
+
160
+ <div class="input wp_all_export_product_matching_mode" <?php if (empty($filter_rules_hierarhy)): ?>style="display:none;"<?php endif; ?>>
161
+ <?php $product_matching_mode = $post['product_matching_mode']; ?>
162
+ <label><?php _e("Variable product matching rules: ", "wp_all_export_plugin"); ?></label>
163
+ <select name="product_matching_mode">
164
+ <option value="strict" <?php echo ( $product_matching_mode == 'strict' ) ? 'selected="selected"' : ''; ?>><?php _e("Strict", "wp_all_export_plugin"); ?></option>
165
+ <option value="permissive" <?php echo ( $product_matching_mode == 'permissive' ) ? 'selected="selected"' : ''; ?>><?php _e("Permissive", "wp_all_export_plugin"); ?></option>
166
+ </select>
167
+ <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('Strict matching requires all variations to pass in order for the product to be exported. Permissive matching allows the product to be exported if any of the variations pass.', 'wp_all_export_plugin'); ?>">?</a>
168
+ </div>
169
+
170
+ <?php endif; ?>
171
+
172
+ </div>
173
+ </div>
174
+ </div>
175
+
176
+ <input type="hidden" class="hierarhy-output" name="filter_rules_hierarhy" value="<?php echo esc_html($post['filter_rules_hierarhy']);?>"/>
177
+
178
+ </div>
179
+ </div>
180
+ </div>
181
+
182
+ <?php endif; ?>
183
+
184
+ <div class="wpallexport-template">
185
+ <div class="wpallexport-collapsed wpallexport-section">
186
+ <div class="wpallexport-content-section">
187
+ <div class="wpallexport-collapsed-header" style="padding-left: 25px;">
188
+ <h3><?php _e('Advanced Export','wp_all_export_plugin');?></h3>
189
+ </div>
190
+ <div class="wpallexport-collapsed-content" style="padding: 0;">
191
+ <div class="wpallexport-collapsed-content-inner">
192
+ <table class="form-table" style="max-width:none;">
193
+ <tr>
194
+ <td colspan="3">
195
+ <div class="input" style="margin:5px 0px;">
196
+ <label for="records_per_request"><?php _e('In each iteration, process', 'wp_all_export_plugin');?> <input type="text" name="records_per_iteration" style="vertical-align:middle; font-size:11px; background:#fff !important; width: 40px; text-align:center;" value="<?php echo esc_attr($post['records_per_iteration']) ?>" /> <?php _e('records', 'wp_all_export_plugin'); ?></label>
197
+ <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php _e('WP All Export must be able to process this many records in less than your server\'s timeout settings. If your export fails before completion, to troubleshoot you should lower this number.', 'wp_all_export_plugin'); ?>">?</a>
198
+ </div>
199
+ <!--h4><?php _e('File Type:', 'pmxe_plugin'); ?></h4-->
200
+
201
+ <br>
202
+ <hr>
203
+ <p style="text-align:right;">
204
+ <div class="input">
205
+ <label for="save_import_as" style="width: 103px;"><?php _e('Friendly Name:','pmxe_plugin');?></label>
206
+ <input type="text" name="friendly_name" title="<?php _e('Save friendly name...', 'pmxi_plugin') ?>" style="vertical-align:middle; background:#fff !important;" value="<?php echo esc_attr($post['friendly_name']) ?>" />
207
+ </div>
208
+ </p>
209
+ </td>
210
+ </tr>
211
+ </table>
212
+ </div>
213
+ </div>
214
+ </div>
215
+ </div>
216
+ </div>
217
+
218
+ <p class="wpallexport-submit-buttons" style="text-align: center;">
219
+ <?php wp_nonce_field('options', '_wpnonce_options') ?>
220
+ <input type="hidden" name="is_submitted" value="1" />
221
+
222
+ <?php if ($isWizard): ?>
223
+
224
+ <a href="<?php echo apply_filters('pmxi_options_back_link', add_query_arg('action', 'template', $this->baseUrl), $isWizard); ?>" class="back rad3"><?php _e('Back to Step 2', 'wp_all_export_plugin') ?></a>
225
+
226
+ <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Confirm & Run Export', 'wp_all_export_plugin') ?>" />
227
+
228
+ <?php else: ?>
229
+ <a href="<?php echo apply_filters('pmxi_options_back_link', remove_query_arg('id', remove_query_arg('action', $this->baseUrl)), $isWizard); ?>" class="back rad3"><?php _e('Back to Manage Exports', 'wp_all_export_plugin') ?></a>
230
+ <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e('Save Export Configuration', 'wp_all_export_plugin') ?>" />
231
+ <?php endif ?>
232
+ </p>
233
+
234
+
235
+ </form>
236
+
237
+ <a href="http://soflyy.com/" target="_blank" class="wpallexport-created-by"><?php _e('Created by', 'wp_all_export_plugin'); ?> <span></span></a>
238
+
239
+ </td>
240
+ </tr>
241
+ </table>
242
+
243
+ </div>
244
+
245
+ <div class="wpallexport-overlay"></div>
views/admin/export/process.php CHANGED
@@ -1,21 +1,55 @@
1
- <table class="layout pmxe_step_3">
2
- <tr>
3
- <td class="left">
4
- <h2><?php _e('Export XML - <span id="status">Exporting...</span>', 'pmxe_plugin') ?></h2>
5
 
6
- <hr />
7
- <p id="process_notice"><?php _e('Exporting may take some time. Please do not close your browser or refresh the page until the process is complete.', 'pmxe_plugin') ?></p>
8
 
9
- </td>
10
- <td class="right">
11
- &nbsp;
12
- </td>
13
- </tr>
14
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  <script type="text/javascript">
17
  //<![CDATA[
18
- (function($){
 
19
  $('#status').each(function () {
20
  var $this = $(this);
21
  if ($this.html().match(/\.{3}$/)) {
@@ -31,28 +65,82 @@
31
  }
32
  }, 1000);
33
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  });
35
 
36
  var request = {
37
- action:'export',
 
38
  };
39
 
40
- $.ajax({
41
- type: 'POST',
42
- url: ajaxurl,
43
- data: request,
44
- success: function(response) {
45
- $('#status').html('Complete');
46
- window.onbeforeunload = false;
47
- window.location.href = "<?php echo add_query_arg('action', 'download', $this->baseUrl); ?>";
48
- },
49
- dataType: "json"
50
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  window.onbeforeunload = function () {
53
  return 'WARNING:\nExport process in under way, leaving the page will interrupt\nthe operation and most likely to cause leftovers in posts.';
54
- };
55
- })(jQuery);
 
56
 
57
  //]]>
58
  </script>
 
 
 
 
1
 
2
+ <h2 class="wpallexport-wp-notices"></h2>
 
3
 
4
+ <div class="inner-content wpallexport-step-6 wpallexport-wrapper">
5
+
6
+ <div class="wpallexport-header">
7
+ <div class="wpallexport-logo"></div>
8
+ <div class="wpallexport-title">
9
+ <p><?php _e('WP All Export', 'wp_all_export_plugin'); ?></p>
10
+ <h2><?php _e('Export to XML / CSV', 'wp_all_export_plugin'); ?></h2>
11
+ </div>
12
+ <div class="wpallexport-links">
13
+ <a href="http://www.wpallimport.com/support/" target="_blank"><?php _e('Support', 'wp_all_export_plugin'); ?></a> | <a href="http://www.wpallimport.com/documentation/" target="_blank"><?php _e('Documentation', 'wp_all_export_plugin'); ?></a>
14
+ </div>
15
+
16
+ <div class="clear"></div>
17
+ <div class="processing_step_1">
18
+
19
+ <div class="clear"></div>
20
+
21
+ <div class="step_description">
22
+ <h2><?php _e('Export <span id="status">in Progress...</span>', 'wp_all_export_plugin') ?></h2>
23
+ <h3 id="process_notice"><?php _e('Exporting may take some time. Please do not close your browser or refresh the page until the process is complete.', 'wp_all_export_plugin'); ?></h3>
24
+ </div>
25
+ <div id="processbar" class="rad14">
26
+ <div class="rad14"></div>
27
+ </div>
28
+ <div id="export_progress">
29
+ <span id="left_progress"><?php _e('Time Elapsed', 'wp_all_export_plugin');?> <span id="then">00:00:00</span></span>
30
+ <span id="center_progress"><span id="percents_count">0</span>%</span>
31
+ <span id="right_progress"><?php _e('Exported','wp_all_export_plugin');?> <span id="created_count"><?php echo $update_previous->exported; ?></span></span>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="export_finished">
36
+ <!--h1><?php _e('Export Complete!', 'wp_all_export_plugin'); ?></h1-->
37
+ <h3><?php _e('WP All Export successfully exported your data!','wp_all_export_plugin'); ?></h3>
38
+ <h3><a href="<?php echo add_query_arg(array('action' => 'download', '_wpnonce' => wp_create_nonce( '_wpnonce-download_feed' )), $this->baseUrl); ?>" id="download_log" style="text-decoration: underline;"><?php _e('Download Exported Data', 'wp_all_export_plugin'); ?></a></h3>
39
+ <hr>
40
+ <a href="<?php echo add_query_arg(array('page' => 'pmxe-admin-manage'), remove_query_arg(array('id','page'), $this->baseUrl)); ?>" id="manage_imports"><?php _e('Manage Exports', 'wp_all_export_plugin') ?></a>
41
+ </div>
42
+
43
+ </div>
44
+
45
+ <a href="http://soflyy.com/" target="_blank" class="wpallexport-created-by"><?php _e('Created by', 'wp_all_export_plugin'); ?> <span></span></a>
46
+
47
+ </div>
48
 
49
  <script type="text/javascript">
50
  //<![CDATA[
51
+ (function($){$(function () {
52
+
53
  $('#status').each(function () {
54
  var $this = $(this);
55
  if ($this.html().match(/\.{3}$/)) {
65
  }
66
  }, 1000);
67
  }
68
+
69
+ var then = $('#then');
70
+ start_date = moment().sod();
71
+ update = function(){
72
+ var duration = moment.duration({'seconds' : 1});
73
+ start_date.add(duration);
74
+
75
+ if ($('#process_notice').is(':visible')) then.html(start_date.format('HH:mm:ss'));
76
+ };
77
+ update();
78
+ setInterval(update, 1000);
79
+
80
+ var $this = $(this);
81
+
82
+ interval = setInterval(function () {
83
+
84
+ var percents = $('#percents_count').html();
85
+ $('#processbar div').css({'width': ((parseInt(percents) > 100 || percents == undefined) ? 100 : percents) + '%'});
86
+
87
+
88
+ }, 1000);
89
+
90
+ $('#processbar').css({'visibility':'visible'});
91
+
92
  });
93
 
94
  var request = {
95
+ action:'wpallexport',
96
+ security: wp_all_export_security
97
  };
98
 
99
+ function wp_all_export_process(){
100
+ $.ajax({
101
+ type: 'POST',
102
+ url: ajaxurl + ((typeof export_id != "undefined") ? '?id=' + export_id : ''),
103
+ data: request,
104
+ success: function(response) {
105
+
106
+ $('#created_count').html(response.exported);
107
+ $('#percents_count').html(response.percentage);
108
+ $('#processbar div').css({'width': response.percentage + '%'});
109
+
110
+ if (response.done)
111
+ {
112
+ $('#status').html('Complete');
113
+ window.onbeforeunload = false;
114
+
115
+ setTimeout(function() {
116
+
117
+ $('#export_finished').fadeIn();
118
+
119
+ }, 1000);
120
+
121
+ //window.location.href = "<?php echo add_query_arg('action', 'download', $this->baseUrl); ?>";
122
+ }
123
+ else
124
+ {
125
+ wp_all_export_process();
126
+ }
127
+ },
128
+ error:function(request, status, error){
129
+ $('#status').html('Error');
130
+ window.onbeforeunload = false;
131
+ $('#process_notice').after(request.responseText);
132
+ },
133
+ dataType: "json"
134
+ });
135
+ };
136
+
137
+ wp_all_export_process();
138
 
139
  window.onbeforeunload = function () {
140
  return 'WARNING:\nExport process in under way, leaving the page will interrupt\nthe operation and most likely to cause leftovers in posts.';
141
+ };
142
+
143
+ });})(jQuery);
144
 
145
  //]]>
146
  </script>
views/admin/export/template.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2 class="wpallexport-wp-notices"></h2>
2
+
3
+ <div class="wpallexport-wrapper">
4
+ <div class="wpallexport-header">
5
+ <div class="wpallexport-logo"></div>
6
+ <div class="wpallexport-title">
7
+ <p><?php _e('WP All Export', 'wp_all_export_plugin'); ?></p>
8
+ <h2><?php _e('Export to XML / CSV', 'wp_all_export_plugin'); ?></h2>
9
+ </div>
10
+ <div class="wpallexport-links">
11
+ <a href="http://www.wpallimport.com/support/" target="_blank"><?php _e('Support', 'wp_all_export_plugin'); ?></a> | <a href="http://www.wpallimport.com/documentation/" target="_blank"><?php _e('Documentation', 'wp_all_export_plugin'); ?></a>
12
+ </div>
13
+ </div>
14
+ <div class="clear"></div>
15
+ </div>
16
+
17
+ <div class="clear"></div>
18
+
19
+ <div class="wpallexport-content-section wpallexport-console" style="display: block; margin-bottom: 0;">
20
+ <div class="ajax-console">
21
+ <div class="founded_records">
22
+ <h3><span class="matches_count"><?php echo PMXE_Plugin::$session->found_posts; ?></span> <strong><?php echo wp_all_export_get_cpt_name($post['cpt']); ?></strong> will be exported</h3>
23
+ <h4><?php _e("Choose data to include in the export file."); ?></h4>
24
+ </div>
25
+ </div>
26
+ </div>
27
+
28
+ <table class="wpallexport-layout wpallexport-export-template">
29
+ <tr style="height: 500px;">
30
+ <td class="left">
31
+
32
+ <script type="text/javascript">
33
+ __META_KEYS = <?php echo json_encode(array_values($existing_meta_keys)); ?>;
34
+ __ACF_KEYS = <?php echo json_encode($existing_acf_meta_keys); ?>;
35
+ __TAXES_KEYS = <?php echo json_encode($existing_taxonomies); ?>;
36
+ __ATTR_KEYS = <?php echo json_encode($existing_attributes); ?>;
37
+ __WOO_KEYS = <?php echo json_encode($woo_data); ?>;
38
+ </script>
39
+
40
+ <?php do_action('pmxe_template_header', $this->isWizard, $post); ?>
41
+
42
+ <?php if ($this->errors->get_error_codes()): ?>
43
+ <?php $this->error(); ?>
44
+ <?php endif ?>
45
+
46
+ <form class="wpallexport-template <?php echo ! $this->isWizard ? 'edit' : '' ?> wpallexport-step-3" method="post">
47
+ <div class="wpallexport-collapsed wpallexport-section">
48
+ <div class="wpallexport-content-section">
49
+ <div class="wpallexport-collapsed-content">
50
+ <fieldset class="optionsset" style="padding: 20px;">
51
+ <div id="columns_to_export">
52
+ <div class="columns-to-export-content" style="padding-right: 8px;">
53
+ <ol id="columns" class="rad4">
54
+ <?php
55
+ $i = 0;
56
+ $new_export = false;
57
+ if ( ! empty($post['ids']) ){
58
+ foreach ($post['ids'] as $ID => $value) {
59
+ if (is_numeric($ID)){ if (empty($post['cc_name'][$ID])) continue;
60
+ ?>
61
+ <li>
62
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
63
+ <label class="wpallexport-xml-element">&lt;<?php echo (!empty($post['cc_name'][$ID])) ? $post['cc_name'][$ID] : $post['cc_label'][$ID]; ?>&gt;</label>
64
+ <input type="hidden" name="ids[]" value="1"/>
65
+ <input type="hidden" name="cc_label[]" value="<?php echo (!empty($post['cc_label'][$ID])) ? $post['cc_label'][$ID] : ''; ?>"/>
66
+ <input type="hidden" name="cc_php[]" value="<?php echo (!empty($post['cc_php'][$ID])) ? $post['cc_php'][$ID] : 0; ?>"/>
67
+ <input type="hidden" name="cc_code[]" value="<?php echo (!empty($post['cc_code'][$ID])) ? $post['cc_code'][$ID] : ''; ?>"/>
68
+ <input type="hidden" name="cc_sql[]" value="<?php echo (!empty($post['cc_sql'][$ID])) ? $post['cc_sql'][$ID] : ''; ?>"/>
69
+ <input type="hidden" name="cc_type[]" value="<?php echo $post['cc_type'][$ID]; ?>"/>
70
+ <input type="hidden" name="cc_options[]" value="<?php echo esc_html($post['cc_options'][$ID]); ?>"/>
71
+ <input type="hidden" name="cc_value[]" value="<?php echo esc_attr($post['cc_value'][$ID]); ?>"/>
72
+ <input type="hidden" name="cc_name[]" value="<?php echo (!empty($post['cc_name'][$ID])) ? $post['cc_name'][$ID] : str_replace(" ", "_", $post['cc_label'][$ID]); ?>"/>
73
+ <!--a href="javascript:void(0);" title="<?php _e('Delete field', 'wp_all_export_plugin'); ?>" class="icon-item remove-field"></a-->
74
+ </div>
75
+ </li>
76
+ <?php
77
+ $i++;
78
+ }
79
+ }
80
+ }
81
+ elseif ($this->isWizard)
82
+ {
83
+ $new_export = true;
84
+ if ( empty($post['cpt']) and ! XmlExportWooCommerceOrder::$is_active and ! XmlExportUser::$is_active ){
85
+ $init_fields[] =
86
+ array(
87
+ 'label' => 'post_type',
88
+ 'name' => 'post_type',
89
+ 'type' => 'post_type'
90
+ );
91
+ }
92
+ foreach ($init_fields as $k => $field) {
93
+ ?>
94
+ <li>
95
+ <div class="custom_column" rel="<?php echo ($i + 1);?>">
96
+ <label class="wpallexport-xml-element">&lt;<?php echo $field['name']; ?>&gt;</label>
97
+ <input type="hidden" name="ids[]" value="1"/>
98
+ <input type="hidden" name="cc_label[]" value="<?php echo $field['label']; ?>"/>
99
+ <input type="hidden" name="cc_php[]" value=""/>
100
+ <input type="hidden" name="cc_code[]" value=""/>
101
+ <input type="hidden" name="cc_sql[]" value=""/>
102
+ <input type="hidden" name="cc_options[]" value="<?php echo (empty($field['options'])) ? '' : $field['options']; ?>"/>
103
+ <input type="hidden" name="cc_type[]" value="<?php echo $field['type']; ?>"/>
104
+ <input type="hidden" name="cc_value[]" value="<?php echo $field['label']; ?>"/>
105
+ <input type="hidden" name="cc_name[]" value="<?php echo $field['name'];?>"/>
106
+ <!--a href="javascript:void(0);" title="<?php _e('Delete field', 'wp_all_export_plugin'); ?>" class="icon-item remove-field"></a-->
107
+ </div>
108
+ </li>
109
+ <?php
110
+ $i++;
111
+ }
112
+
113
+ }
114
+ ?>
115
+ <li class="placeholder" <?php if ( ! empty($post['ids']) and count($post['ids']) > 1 or $new_export) echo 'style="display:none;"'; ?>><?php _e("Drop & drop data from \"Available Data\" on the right to include it in the export or click \"Add Field To Export\" below.", "wp_all_export_plugin"); ?></li>
116
+ <?php
117
+ ?>
118
+ </ol>
119
+ </div>
120
+ </div>
121
+
122
+ <div class="custom_column template">
123
+ <label class="wpallexport-xml-element"></label>
124
+ <input type="hidden" name="ids[]" value="1"/>
125
+ <input type="hidden" name="cc_label[]" value=""/>
126
+ <input type="hidden" name="cc_php[]" value=""/>
127
+ <input type="hidden" name="cc_code[]" value=""/>
128
+ <input type="hidden" name="cc_sql[]" value=""/>
129
+ <input type="hidden" name="cc_type[]" value=""/>
130
+ <input type="hidden" name="cc_options[]" value=""/>
131
+ <input type="hidden" name="cc_value[]" value=""/>
132
+ <input type="hidden" name="cc_name[]" value=""/>
133
+ <!--a href="javascript:void(0);" title="<?php _e('Delete field', 'wp_all_export_plugin'); ?>" class="icon-item remove-field"></a-->
134
+ </div>
135
+
136
+ <!-- Warning Messages -->
137
+ <?php if ( ! XmlExportWooCommerceOrder::$is_active ) : ?>
138
+ <div class="wp-all-export-warning" <?php if ( empty($post['ids']) or count($post['ids']) > 1 ) echo 'style="display:none;"'; ?>>
139
+ <p><?php _e("Warning: without an ID column, you won't be able to re-import this data using WP All Import.", "wp_all_export_plugin"); ?></p>
140
+ </div>
141
+ <?php endif; ?>
142
+
143
+ <?php if ( XmlExportWooCommerce::$is_active ) : ?>
144
+ <div class="wp-all-export-sku-warning" <?php echo 'style="display:none;"'; ?>>
145
+ <p><?php _e("Warning: without _sku and product_type columns, you won't be able to re-import this data using WP All Import.", "wp_all_export_plugin"); ?></p>
146
+ </div>
147
+ <?php endif; ?>
148
+
149
+ <?php if ( empty($post['cpt']) and ! XmlExportWooCommerceOrder::$is_active and ! XmlExportUser::$is_active ) : ?>
150
+ <div class="wp-all-export-advanced-query-warning" <?php echo 'style="display:none;"'; ?>>
151
+ <p><?php _e("Warning: without post_type column, you won't be able to re-import this data using WP All Import.", "wp_all_export_plugin"); ?></p>
152
+ </div>
153
+ <?php endif; ?>
154
+
155
+ <!-- Add New Field Button -->
156
+ <div class="input" style="float: left;">
157
+ <input type="button" value="<?php _e('Add Field To Export', 'wp_all_export_plugin');?>" class="button-primary add_column">
158
+ <?php if ( XmlExportWooCommerceOrder::$is_active ): ?>
159
+ <div class="input switcher-target-export_to_csv" style="margin-top: 10px;">
160
+ <input type="hidden" name="order_item_per_row" value="0"/>
161
+ <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; ?>/>
162
+ <label for="order_item_per_row"><?php _e("Display each product in its own row"); ?></label>
163
+ <a href="#help" class="wpallexport-help" style="position: relative; top: 0px;" title="<?php _e('If an order contains multiple products, each product have its own row.', 'wp_all_export_plugin'); ?>">?</a>
164
+ </div>
165
+ <?php endif; ?>
166
+ </div>
167
+
168
+ <!-- Preview a Row Button -->
169
+ <div class="input" style="float: right;">
170
+ <input type="button" value="<?php _e('Preview A Row', 'wp_all_export_plugin');?>" class="button-primary preview_a_row">
171
+ </div>
172
+
173
+ <!-- Export File Format -->
174
+ <div class="input wp-all-export-format">
175
+ <div class="input" style="float: left; padding-bottom: 5px;">
176
+ <label><?php _e("Export File Format:", "wp_all_export_plugin"); ?></label>
177
+ </div>
178
+ <div class="clear"></div>
179
+ <div class="input">
180
+ <input type="radio" id="export_to_xml" class="switcher" name="export_to" value="xml" <?php echo 'csv' != $post['export_to'] ? 'checked="checked"': '' ?>/>
181
+ <label for="export_to_xml"><?php _e('XML', 'wp_all_export_plugin' )?></label><br>
182
+ </div>
183
+ <div class="input">
184
+ <input type="radio" id="export_to_csv" class="switcher" name="export_to" value="csv" <?php echo 'csv' == $post['export_to'] ? 'checked="checked"': '' ?>/>
185
+ <label for="export_to_csv"><?php _e('CSV', 'wp_all_export_plugin' )?></label>
186
+ <div class="switcher-target-export_to_csv wpallexport-csv-delimiter">
187
+ <div class="input" style="padding: 5px;">
188
+ <label style="width: 80px;"><?php _e('Delimiter:','wp_all_export_plugin');?></label> <input type="text" name="delimiter" value="<?php echo esc_attr($post['delimiter']) ?>" />
189
+ </div>
190
+ </div>
191
+ </div>
192
+ </div>
193
+ </fieldset>
194
+ </div>
195
+ </div>
196
+ </div>
197
+
198
+ <hr>
199
+
200
+ <div class="wpallexport-submit-buttons">
201
+
202
+ <div style="text-align:center; width:100%;">
203
+ <?php wp_nonce_field('template', '_wpnonce_template'); ?>
204
+ <input type="hidden" name="is_submitted" value="1" />
205
+
206
+ <?php if ( ! $this->isWizard ): ?>
207
+ <a href="<?php echo remove_query_arg('id', remove_query_arg('action', $this->baseUrl)); ?>" class="back rad3" style="float:none;"><?php _e('Back to Manage Exports', 'wp_all_export_plugin') ?></a>
208
+ <?php endif; ?>
209
+ <input type="submit" class="button button-primary button-hero wpallexport-large-button" value="<?php _e( ($this->isWizard) ? 'Continue to Step 3' : 'Update Template', 'wp_all_export_plugin') ?>" />
210
+ </div>
211
+
212
+ </div>
213
+
214
+ <a href="http://soflyy.com/" target="_blank" class="wpallexport-created-by"><?php _e('Created by', 'wp_all_export_plugin'); ?> <span></span></a>
215
+
216
+ </form>
217
+
218
+ </td>
219
+
220
+ <td class="right template-sidebar">
221
+
222
+ <fieldset id="available_data" class="optionsset rad4">
223
+
224
+ <div class="title"><?php _e('Available Data', 'wp_all_export_plugin'); ?></div>
225
+
226
+ <div class="wpallexport-xml resetable">
227
+
228
+ <?php if ( XmlExportWooCommerce::$is_active ) : ?>
229
+
230
+ <a href="javascript:void(0);" id="wp_all_export_auto_generate_data" class="rad4"><?php _e('Auto Generate', 'wp_all_export_plugin'); ?></a>
231
+
232
+ <?php endif; ?>
233
+
234
+ <ul>
235
+
236
+ <?php echo $available_data_view; ?>
237
+
238
+ </ul>
239
+
240
+ </div>
241
+
242
+ </fieldset>
243
+ </td>
244
+ </tr>
245
+ </table>
246
+
247
+ <fieldset class="optionsset column rad4 wp-all-export-edit-column">
248
+
249
+ <div class="title"><span class="wpallexport-add-row-title"><?php _e('Add Field To Export','wp_all_export_plugin');?></span><span class="wpallexport-edit-row-title"><?php _e('Edit Export Field','wp_all_export_plugin');?></span></div>
250
+
251
+ <?php
252
+
253
+ if ( XmlExportEngine::$is_user_export )
254
+ {
255
+ include_once 'template/new_field_user.php';
256
+ }
257
+ else
258
+ {
259
+ if ( in_array('shop_order', XmlExportEngine::$post_types))
260
+ {
261
+ include_once 'template/new_field_shop_order.php';
262
+ }
263
+ else
264
+ {
265
+ include_once 'template/new_field_cpt.php';
266
+ }
267
+ }
268
+
269
+ ?>
270
+
271
+ </fieldset>
272
+
273
+ <div class="wpallexport-overlay"></div>
views/admin/export/template/new_field_cpt.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form>
2
+ <div class="wp-all-export-field-options">
3
+ <div class="input" style="margin-bottom:10px;">
4
+ <label for="column_value_default" style="padding:4px; display: block;"><?php _e('What field would you like to export?', 'wp_all_export_plugin' )?></label>
5
+ <div class="clear"></div>
6
+ <select class="wp-all-export-chosen-select" name="column_value_type" style="width:350px;">
7
+ <optgroup label="Standard">
8
+ <option value="id"><?php _e("ID", "wp_all_export_plugin"); ?></option>
9
+ <option value="title"><?php _e("Title", "wp_all_export_plugin"); ?></option>
10
+ <option value="content"><?php _e("Content", "wp_all_export_plugin"); ?></option>
11
+ <option value="excerpt"><?php _e("Excerpt", "wp_all_export_plugin"); ?></option>
12
+ <option value="date"><?php _e("Date", "wp_all_export_plugin"); ?></option>
13
+ <option value="post_type"><?php _e("Post Type", "wp_all_export_plugin"); ?></option>
14
+ <option value="cats"><?php _e("Categories / Taxonomies", "wp_all_export_plugin"); ?></option>
15
+ <option value="cf"><?php _e("Custom Field / Post Meta", "wp_all_export_plugin"); ?></option>
16
+ <option value="media"><?php _e("Images / Media", "wp_all_export_plugin"); ?></option>
17
+ <option value="attachments"><?php _e("Attachment", "wp_all_export_plugin"); ?></option>
18
+ </optgroup>
19
+ <optgroup label="Other">
20
+ <option value="status"><?php _e("Post Status", "wp_all_export_plugin"); ?></option>
21
+ <option value="author"><?php _e("Author", "wp_all_export_plugin"); ?></option>
22
+ <option value="slug"><?php _e("Post Slug", "wp_all_export_plugin"); ?></option>
23
+ <option value="format"><?php _e("Post Format", "wp_all_export_plugin"); ?></option>
24
+ <option value="template"><?php _e("Template", "wp_all_export_plugin"); ?></option>
25
+ <option value="parent"><?php _e("Parent", "wp_all_export_plugin"); ?></option>
26
+ <option value="order"><?php _e("Menu Order", "wp_all_export_plugin"); ?></option>
27
+ <option value="permalink"><?php _e("Permalink", "wp_all_export_plugin"); ?></option>
28
+ </optgroup>
29
+ <?php if ( class_exists( 'acf' ) or class_exists('WooCommerce')) : ?>
30
+ <optgroup label="Integrations">
31
+ <?php if ( class_exists('WooCommerce') and (empty($post['cpt']) or in_array('product', $post['cpt']))) : ?>
32
+ <option value="woo"><?php _e("WooCommerce Data", "wp_all_export_plugin"); ?></option>
33
+ <option value="attr"><?php _e("WooCommerce Taxonomies", "wp_all_export_plugin"); ?></option>
34
+ <?php endif; ?>
35
+ <?php if ( class_exists('WooCommerce') and (empty($post['cpt']) or in_array('shop_order', $post['cpt']))) : ?>
36
+ <option value="woo_order"><?php _e("WooCommerce Order", "wp_all_export_plugin"); ?></option>
37
+ <?php endif; ?>
38
+ <?php if ( class_exists( 'acf' ) and ! empty($acf_groups) ) : ?>
39
+ <option value="acf"><?php _e("Advanced Custom Fields", "wp_all_export_plugin"); ?></option>
40
+ <?php endif; ?>
41
+ </optgroup>
42
+ <?php endif; ?>
43
+ <optgroup label="Advanced">
44
+ <option value="sql"><?php _e("SQL Query", "wp_all_export_plugin"); ?></option>
45
+ </optgroup>
46
+ </select>
47
+ </div>
48
+
49
+ <input type="hidden" name="export_data_type" value="cpt"/>
50
+
51
+ <div class="input cc_field cf_field_type" style="margin-left: 20px; margin-bottom: 10px;">
52
+ <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
53
+ <input type="text" class="cf_direct_value autocomplete" value="" style="width:50%;"/>
54
+ </div>
55
+ <div class="input cc_field acf_field_type" style="margin-left: 20px; margin-bottom: 10px;">
56
+ <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
57
+ <input type="text" class="acf_direct_value autocomplete" value="" style="width:50%;"/>
58
+ </div>
59
+ <div class="input cc_field woo_field_type" style="margin-left: 20px; margin-bottom: 10px;">
60
+ <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
61
+ <input type="text" class="woo_direct_value autocomplete" value="" style="width:50%;"/>
62
+ </div>
63
+ <div class="input cc_field attr_field_type" style="margin-left: 20px; margin-bottom: 10px;">
64
+ <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
65
+ <input type="text" class="attr_direct_value autocomplete" value="" style="width:50%;"/>
66
+ </div>
67
+ <div class="input cc_field cats_field_type" style="margin-left: 20px; margin-bottom: 10px;">
68
+ <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
69
+ <input type="text" class="cats_direct_value autocomplete" value="" style="width:50%;"/>
70
+ </div>
71
+
72
+ <div class="input">
73
+ <label style="padding:4px; display: block;"><?php _e('What would you like to name the column/element in your exported file?','wp_all_export_plugin');?></label>
74
+ <div class="clear"></div>
75
+ <input type="text" class="column_name" value="" style="width:50%"/>
76
+ </div>
77
+
78
+ <a href="javascript:void(0);" class="wp-all-export-advanced-field-options"><span>+</span> <?php _e("Advanced", 'wp_all_export_plugin'); ?></a>
79
+
80
+ <div class="wp-all-export-advanced-field-options-content">
81
+ <div class="input cc_field sql_field_type">
82
+ <a href="#help" rel="sql" class="help" style="display:none;" title="<?php _e('%%ID%% will be replaced with the ID of the post being exported, example: SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND meta_key=\'your_meta_key\';', 'wp_all_export_plugin'); ?>">?</a>
83
+ <textarea style="width:100%;" rows="5" class="column_value"></textarea>
84
+ </div>
85
+ <div class="input cc_field media_field_type">
86
+ <select class="media_field_export_data">
87
+ <option value="urls"><?php _e("Export Image URLs", "wp_all_export_plugin");?></option>
88
+ <option value="filenames"><?php _e("Export Image Filenames", "wp_all_export_plugin");?></option>
89
+ <option value="filepaths"><?php _e("Export Image File Paths", "wp_all_export_plugin");?></option>
90
+ </select>
91
+ </div>
92
+ <div class="input cc_field date_field_type">
93
+ <select class="date_field_export_data" style="width: 100%; height: 30px;">
94
+ <option value="unix"><?php _e("UNIX timestamp - PHP time()", "wp_all_export_plugin");?></option>
95
+ <option value="php"><?php _e("Natural Language PHP date()", "wp_all_export_plugin");?></option>
96
+ </select>
97
+ <div class="input pmxe_date_format_wrapper">
98
+ <label><?php _e("date() Format", "wp_all_export_plugin"); ?></label>
99
+ <br>
100
+ <input type="text" class="pmxe_date_format" value="" placeholder="Y-m-d H:i:s" style="width: 100%;"/>
101
+ </div>
102
+ </div>
103
+ <div class="input php_snipped" style="margin-top:10px;">
104
+ <input type="checkbox" id="coperate_php" name="coperate_php" value="1" class="switcher" style="float: left; margin: 2px;"/>
105
+ <label for="coperate_php"><?php _e("Export the value returned by a PHP function", "wp_all_export_plugin"); ?></label>
106
+ <a href="#help" class="wpallexport-help" title="<?php _e('The value of the field chosen for export will be passed to the PHP function.', 'wp_all_export_plugin'); ?>" style="top: 0;">?</a>
107
+ <div class="switcher-target-coperate_php" style="margin-top:5px;">
108
+ <div class="wpallexport-free-edition-notice" style="margin: 15px 0;">
109
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=custom-php&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to enable custom PHP functions.','wp_all_export_plugin');?></a>
110
+ </div>
111
+
112
+ <?php echo "&lt;?php ";?>
113
+ <input type="text" class="php_code" value="" style="width:50%;" placeholder='your_function_name'/>
114
+ <?php echo "(\$value); ?&gt;"; ?>
115
+ </div>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ <br>
120
+ <div class="input wp-all-export-edit-column-buttons">
121
+ <input type="button" class="delete_action" value="<?php _e("Delete", "wp_all_export_plugin"); ?>" style="border: none;"/>
122
+ <input type="button" class="save_action" value="<?php _e("Done", "wp_all_export_plugin"); ?>" style="border: none;"/>
123
+ <input type="button" class="close_action" value="<?php _e("Close", "wp_all_export_plugin"); ?>" style="border: none;"/>
124
+ </div>
125
+
126
+ </form>
views/admin/export/template/new_field_shop_order.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form>
2
+ <div class="wp-all-export-field-options">
3
+ <div class="input" style="margin-bottom:10px;">
4
+ <label for="column_value_default" style="padding:4px; display: block;"><?php _e('What field would you like to export?', 'wp_all_export_plugin' )?></label>
5
+ <div class="clear"></div>
6
+ <select class="wp-all-export-chosen-select" name="column_value_type" style="width:350px;">
7
+
8
+ <?php foreach (XmlExportWooCommerceOrder::$order_sections as $section_key => $section) : ?>
9
+
10
+ <optgroup label="<?php echo $section['title']; ?>">
11
+ <?php foreach ($section['meta'] as $field_key => $field) : ?>
12
+ <option value="<?php echo $field_key; ?>" rel="<?php echo ( ! empty($field['options']) ) ? $field['options'] : $section_key; ?>"><?php echo (is_array($field)) ? $field['name'] : $field; ?></option>
13
+ <?php endforeach; ?>
14
+ </optgroup>
15
+
16
+ <?php endforeach; ?>
17
+
18
+ <optgroup label="Advanced">
19
+ <option value="sql"><?php _e("SQL Query", "wp_all_export_plugin"); ?></option>
20
+ </optgroup>
21
+
22
+ </select>
23
+ </div>
24
+
25
+ <!--div class="input">
26
+ <label style="padding:4px; display: block;"><?php _e('What would you like to name the column/element in your exported file?','wp_all_export_plugin');?></label>
27
+ <div class="clear"></div>
28
+ <input type="text" class="column_name" value="" style="width:50%"/>
29
+ </div-->
30
+ <input type="hidden" class="column_name" value=""/>
31
+ <input type="hidden" name="export_data_type" value="shop_order"/>
32
+
33
+ <a href="javascript:void(0);" class="wp-all-export-advanced-field-options"><span>+</span> <?php _e("Advanced", 'wp_all_export_plugin'); ?></a>
34
+
35
+ <div class="wp-all-export-advanced-field-options-content">
36
+ <div class="input cc_field sql_field_type">
37
+ <a href="#help" rel="sql" class="help" style="display:none;" title="<?php _e('%%ID%% will be replaced with the ID of the post being exported, example: SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND meta_key=\'your_meta_key\';', 'wp_all_export_plugin'); ?>">?</a>
38
+ <textarea style="width:100%;" rows="5" class="column_value"></textarea>
39
+ </div>
40
+ <div class="input cc_field date_field_type">
41
+ <select class="date_field_export_data" style="width: 100%; height: 30px;">
42
+ <option value="unix"><?php _e("UNIX timestamp - PHP time()", "wp_all_export_plugin");?></option>
43
+ <option value="php"><?php _e("Natural Language PHP date()", "wp_all_export_plugin");?></option>
44
+ </select>
45
+ <div class="input pmxe_date_format_wrapper">
46
+ <label><?php _e("date() Format", "wp_all_export_plugin"); ?></label>
47
+ <br>
48
+ <input type="text" class="pmxe_date_format" value="" placeholder="Y-m-d H:i:s" style="width: 100%;"/>
49
+ </div>
50
+ </div>
51
+ <div class="input php_snipped" style="margin-top:10px;">
52
+ <input type="checkbox" id="coperate_php" name="coperate_php" value="1" class="switcher" style="float: left; margin: 2px;"/>
53
+ <label for="coperate_php"><?php _e("Export the value returned by a PHP function", "wp_all_export_plugin"); ?></label>
54
+ <a href="#help" class="wpallexport-help" title="<?php _e('The value of the field chosen for export will be passed to the PHP function.', 'wp_all_export_plugin'); ?>" style="top: 0;">?</a>
55
+ <div class="switcher-target-coperate_php" style="margin-top:5px;">
56
+ <div class="wpallexport-free-edition-notice" style="margin: 15px 0;">
57
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=custom-php&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to enable custom PHP functions.','wp_all_export_plugin');?></a>
58
+ </div>
59
+ <?php echo "&lt;?php ";?>
60
+ <input type="text" class="php_code" value="" style="width:50%;" placeholder='your_function_name'/>
61
+ <?php echo "(\$value); ?&gt;"; ?>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <br>
67
+ <div class="input wp-all-export-edit-column-buttons">
68
+ <input type="button" class="delete_action" value="<?php _e("Delete", "wp_all_export_plugin"); ?>" style="border: none;"/>
69
+ <input type="button" class="save_action" value="<?php _e("Done", "wp_all_export_plugin"); ?>" style="border: none;"/>
70
+ <input type="button" class="close_action" value="<?php _e("Close", "wp_all_export_plugin"); ?>" style="border: none;"/>
71
+ </div>
72
+
73
+ </form>
views/admin/export/template/new_field_user.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form>
2
+ <div class="wp-all-export-field-options">
3
+ <div class="input" style="margin-bottom:10px;">
4
+ <label for="column_value_default" style="padding:4px; display: block;"><?php _e('What field would you like to export?', 'wp_all_export_plugin' )?></label>
5
+ <div class="clear"></div>
6
+ <select class="wp-all-export-chosen-select" name="column_value_type" style="width:350px;">
7
+ <optgroup label="Standard">
8
+ <option value="id"><?php _e("ID", "wp_all_export_plugin"); ?></option>
9
+ <option value="user_login"><?php _e("Login", "wp_all_export_plugin"); ?></option>
10
+ <option value="user_email"><?php _e("Email", "wp_all_export_plugin"); ?></option>
11
+ <option value="first_name"><?php _e("First Name", "wp_all_export_plugin"); ?></option>
12
+ <option value="last_name"><?php _e("Last Name", "wp_all_export_plugin"); ?></option>
13
+ <option value="user_registered"><?php _e("Registered Date", "wp_all_export_plugin"); ?></option>
14
+ <option value="user_nicename"><?php _e("Nicename", "wp_all_export_plugin"); ?></option>
15
+ <option value="user_url"><?php _e("URL", "wp_all_export_plugin"); ?></option>
16
+ <option value="display_name"><?php _e("Display Name", "wp_all_export_plugin"); ?></option>
17
+ <option value="nickname"><?php _e("Nickname", "wp_all_export_plugin"); ?></option>
18
+ <option value="description"><?php _e("Description", "wp_all_export_plugin"); ?></option>
19
+ </optgroup>
20
+ <optgroup label="Advanced">
21
+ <option value="user_pass"><?php _e("Password", "wp_all_export_plugin"); ?></option>
22
+ <option value="user_activation_key"><?php _e("Activation Key", "wp_all_export_plugin"); ?></option>
23
+ <option value="user_status"><?php _e("Status", "wp_all_export_plugin"); ?></option>
24
+ <option value="wp_capabilities"><?php _e("Roles", "wp_all_export_plugin"); ?></option>
25
+ <option value="cf"><?php _e("Custom Field / User Meta", "wp_all_export_plugin"); ?></option>
26
+ </optgroup>
27
+ <?php if ( class_exists( 'acf' )) : ?>
28
+ <optgroup label="Integrations">
29
+ <?php if ( class_exists( 'acf' ) and ! empty($acf_groups) ) : ?>
30
+ <option value="acf"><?php _e("Advanced Custom Fields", "wp_all_export_plugin"); ?></option>
31
+ <?php endif; ?>
32
+ </optgroup>
33
+ <?php endif; ?>
34
+ <optgroup label="Advanced">
35
+ <option value="sql"><?php _e("SQL Query", "wp_all_export_plugin"); ?></option>
36
+ </optgroup>
37
+ </select>
38
+ </div>
39
+
40
+ <input type="hidden" name="export_data_type" value="user"/>
41
+
42
+ <div class="input cc_field cf_field_type" style="margin-left: 20px; margin-bottom: 10px;">
43
+ <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
44
+ <input type="text" class="cf_direct_value autocomplete" value="" style="width:50%;"/>
45
+ </div>
46
+ <div class="input cc_field acf_field_type" style="margin-left: 20px; margin-bottom: 10px;">
47
+ <label style="padding:4px; display: block;"><?php _e('Field Name', 'wp_all_export_plugin'); ?></label>
48
+ <input type="text" class="acf_direct_value autocomplete" value="" style="width:50%;"/>
49
+ </div>
50
+
51
+ <div class="input">
52
+ <label style="padding:4px; display: block;"><?php _e('What would you like to name the column/element in your exported file?','wp_all_export_plugin');?></label>
53
+ <div class="clear"></div>
54
+ <input type="text" class="column_name" value="" style="width:50%"/>
55
+ </div>
56
+
57
+ <a href="javascript:void(0);" class="wp-all-export-advanced-field-options"><span>+</span> <?php _e("Advanced", 'wp_all_export_plugin'); ?></a>
58
+
59
+ <div class="wp-all-export-advanced-field-options-content">
60
+ <div class="input cc_field sql_field_type">
61
+ <a href="#help" rel="sql" class="help" style="display:none;" title="<?php _e('%%ID%% will be replaced with the ID of the post being exported, example: SELECT meta_value FROM wp_postmeta WHERE post_id=%%ID%% AND meta_key=\'your_meta_key\';', 'wp_all_export_plugin'); ?>">?</a>
62
+ <textarea style="width:100%;" rows="5" class="column_value"></textarea>
63
+ </div>
64
+ <div class="input cc_field date_field_type">
65
+ <select class="date_field_export_data" style="width: 100%; height: 30px;">
66
+ <option value="unix"><?php _e("UNIX timestamp - PHP time()", "wp_all_export_plugin");?></option>
67
+ <option value="php"><?php _e("Natural Language PHP date()", "wp_all_export_plugin");?></option>
68
+ </select>
69
+ <div class="input pmxe_date_format_wrapper">
70
+ <label><?php _e("date() Format", "wp_all_export_plugin"); ?></label>
71
+ <br>
72
+ <input type="text" class="pmxe_date_format" value="" placeholder="Y-m-d H:i:s" style="width: 100%;"/>
73
+ </div>
74
+ </div>
75
+ <div class="input php_snipped" style="margin-top:10px;">
76
+ <input type="checkbox" id="coperate_php" name="coperate_php" value="1" class="switcher" style="float: left; margin: 2px;"/>
77
+ <label for="coperate_php"><?php _e("Export the value returned by a PHP function", "wp_all_export_plugin"); ?></label>
78
+ <a href="#help" class="wpallexport-help" title="<?php _e('The value of the field chosen for export will be passed to the PHP function.', 'wp_all_export_plugin'); ?>" style="top: 0;">?</a>
79
+ <div class="switcher-target-coperate_php" style="margin-top:5px;">
80
+ <div class="wpallexport-free-edition-notice" style="margin: 15px 0;">
81
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=custom-php&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to enable custom PHP functions.','wp_all_export_plugin');?></a>
82
+ </div>
83
+ <?php echo "&lt;?php ";?>
84
+ <input type="text" class="php_code" value="" style="width:50%;" placeholder='your_function_name'/>
85
+ <?php echo "(\$value); ?&gt;"; ?>
86
+ </div>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ <br>
91
+ <div class="input wp-all-export-edit-column-buttons">
92
+ <input type="button" class="delete_action" value="<?php _e("Delete", "wp_all_export_plugin"); ?>" style="border: none;"/>
93
+ <input type="button" class="save_action" value="<?php _e("Done", "wp_all_export_plugin"); ?>" style="border: none;"/>
94
+ <input type="button" class="close_action" value="<?php _e("Close", "wp_all_export_plugin"); ?>" style="border: none;"/>
95
+ </div>
96
+
97
+ </form>
views/admin/feedback/index.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+
3
+ <h2>Help make WP All Export better.</h2>
4
+
5
+ <table class="layout">
6
+ <tbody>
7
+ <tr>
8
+ <td class="left">
9
+ <p style="font-size: 1.3em !important;">
10
+ <b>E-mail</b> - <a href="mailto:support@wpallimport.com?Subject=WP%20All%20Export%20feedback">support@wpallimport.com</a><br>
11
+ <b>Support Form </b> - <a target="_blank" href="http://www.wpallimport.com/support/?utm_source=wordpress.org&utm_medium=feedback-page&utm_campaign=free+wp+all+export+plugin">http://www.wpallimport.com/support</a>
12
+ </p>
13
+
14
+ <p style="font-size: 1.3em !important;">Thanks for using WP All Export.</p>
15
+
16
+ <p style="font-size: 1.3em !important;">Every day we work to improve WP All Export and we can't do that without hearing from you.</br>We'd love for you to get in touch and tell us about your experiences with WP All Export.</p>
17
+
18
+ <p style="font-size: 1.3em !important;"><b>Which tasks do you use WP All Export for?</b></p>
19
+
20
+ <p style="font-size: 1.3em !important;"><b>What do you wish WP All Export was able to do?</b></p>
21
+
22
+ <p style="font-size: 1.3em !important;"><b>What is the most frustrating part of using WP All Export?</b></p>
23
+
24
+ </td>
25
+ <td class="right">&nbsp;</td>
26
+ </tr>
27
+ </tbody>
28
+ </table>
29
+ </div>
views/admin/help/index.php CHANGED
@@ -1,13 +1,25 @@
1
- <h2><?php _e('WP All Export Support', 'PMXE_plugin') ?></h2>
 
 
2
 
3
- <table class="layout">
4
- <tr>
5
- <td class="left">
6
- <p style='font-size: 1.3em;'>
7
- <b>E-mail</b> - <a href='mailto:support@soflyy.com'>support@soflyy.com</a><br />
8
- <b>Support page</b> - <a href='http://www.wpallimport.com/support?utm_source=wordpress.org&utm_medium=support&utm_campaign=free+plugin' target='_blank'>http://www.wpallimport.com/support</a>
9
- </p>
10
- </td>
11
- <td class="right">&nbsp;</td>
12
- </tr>
13
- </table>
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+
3
+ <h2><?php _e('WP All Export Support','wp_all_export_plugin');?></h2>
4
 
5
+ <table class="layout">
6
+ <tbody>
7
+ <tr>
8
+ <td class="left">
9
+ <p style="font-size: 1.3em !important;">
10
+ <b>E-mail</b> - <a href="mailto:support@wpallimport.com?Subject=WP%20All%20Export">support@wpallimport.com</a><br>
11
+ <b>Support Form </b> - <a target="_blank" href="http://www.wpallimport.com/support/?utm_source=wordpress.org&utm_medium=support-page&utm_campaign=free+wp+all+export+plugin">http://www.wpallimport.com/support</a>
12
+ </p>
13
+
14
+ <p style="font-size: 1.3em !important;"><?php _e('Thanks for installing the free version of WP All Export.', 'wp_all_export_plugin');?></p>
15
+
16
+ <p style="font-size: 1.3em !important;"><?php _e('While we do our best to provide technical support to users of the free version, we must prioritize requests from pro users.</br>If you need any help with WP All Export e-mail us at the address above or submit a ticket through the support form.', 'wp_all_export_plugin');?></p>
17
+
18
+ <p style="font-size: 1.3em !important;"><a href="http://www.wpallimport.com/export/?utm_source=wordpress.org&utm_medium=support-page&utm_campaign=free+wp+all+export+plugin" target="_blank"><?php _e('For premium support, please upgrade to the professional edition of WP All Export.', 'wp_all_export_plugin');?></a></p>
19
+
20
+ </td>
21
+ <td class="right">&nbsp;</td>
22
+ </tr>
23
+ </tbody>
24
+ </table>
25
+ </div>
views/admin/manage/bulk.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>Bulk Delete Exports</h2>
2
+
3
+ <form method="post">
4
+ <input type="hidden" name="action" value="bulk" />
5
+ <input type="hidden" name="bulk-action" value="<?php echo esc_attr($action) ?>" />
6
+ <?php foreach ($ids as $id): ?>
7
+ <input type="hidden" name="items[]" value="<?php echo esc_attr($id) ?>" />
8
+ <?php endforeach ?>
9
+
10
+ <p><?php printf(__('Are you sure you want to delete <strong>%s</strong> selected %s?', 'pmxe_plugin'), $items->count(), _n('export', 'exports', $items->count(), 'pmxe_plugin')) ?></p>
11
+
12
+ <p class="submit">
13
+ <?php wp_nonce_field('bulk-exports', '_wpnonce_bulk-exports') ?>
14
+ <input type="hidden" name="is_confirmed" value="1" />
15
+ <input type="submit" class="button-primary" value="Delete" />
16
+ </p>
17
+ </form>
views/admin/manage/delete.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2><?php _e('Delete Export', 'pmxe_plugin') ?></h2>
2
+
3
+ <form method="post">
4
+ <p><?php printf(__('Are you sure you want to delete <strong>%s</strong> export?', 'pmxe_plugin'), $item->friendly_name) ?></p>
5
+ <p class="submit">
6
+ <?php wp_nonce_field('delete-export', '_wpnonce_delete-export') ?>
7
+ <input type="hidden" name="is_confirmed" value="1" />
8
+ <input type="submit" class="button-primary" value="Delete" />
9
+ </p>
10
+
11
+ </form>
views/admin/manage/index.php ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wpallexport-header" style="overflow:hidden; height: 60px; padding-top: 10px; margin-bottom: -20px;">
2
+ <div class="wpallexport-logo"></div>
3
+ <div class="wpallexport-title">
4
+ <p><?php _e('WP All Export', 'wp_all_export_plugin'); ?></p>
5
+ <h3><?php _e('Manage Exports', 'wp_all_export_plugin'); ?></h3>
6
+ </div>
7
+ </div>
8
+
9
+ <h2></h2> <!-- Do not remove -->
10
+
11
+ <?php if ($this->errors->get_error_codes()): ?>
12
+ <?php $this->error() ?>
13
+ <?php endif ?>
14
+
15
+ <form method="get">
16
+ <input type="hidden" name="page" value="<?php echo esc_attr($this->input->get('page')) ?>" />
17
+ <p class="search-box">
18
+ <label for="search-input" class="screen-reader-text"><?php _e('Search Exports', 'wp_all_export_plugin') ?>:</label>
19
+ <input id="search-input" type="text" name="s" value="<?php echo esc_attr($s) ?>" />
20
+ <input type="submit" class="button" value="<?php _e('Search Exports', 'wp_all_export_plugin') ?>">
21
+ </p>
22
+ </form>
23
+
24
+ <?php
25
+ // define the columns to display, the syntax is 'internal name' => 'display name'
26
+ $columns = array(
27
+ 'id' => __('ID', 'wp_all_export_plugin'),
28
+ 'name' => __('Name', 'wp_all_export_plugin'),
29
+ 'actions' => '',
30
+ 'data' => __('Query', 'wp_all_export_plugin'),
31
+ //'format' => __('Format', 'wp_all_export_plugin'),
32
+ 'summary' => __('Summary', 'wp_all_export_plugin'),
33
+ //'registered_on' => __('Last Export', 'wp_all_export_plugin'),
34
+ 'info' => __('Info & Options', 'wp_all_export_plugin'),
35
+ );
36
+
37
+ if ( ! wp_all_export_is_compatible()) unset($columns['info']);
38
+
39
+ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
40
+
41
+ ?>
42
+
43
+ <form method="post" id="import-list" action="<?php echo remove_query_arg('pmxe_nt') ?>">
44
+
45
+ <input type="hidden" name="action" value="bulk" />
46
+ <?php wp_nonce_field('bulk-exports', '_wpnonce_bulk-exports') ?>
47
+
48
+ <div class="tablenav">
49
+ <div class="alignleft actions">
50
+ <select name="bulk-action">
51
+ <option value="" selected="selected"><?php _e('Bulk Actions', 'wp_all_export_plugin') ?></option>
52
+ <option value="delete"><?php _e('Delete', 'wp_all_export_plugin') ?></option>
53
+ </select>
54
+ <input type="submit" value="<?php esc_attr_e('Apply', 'wp_all_export_plugin') ?>" name="doaction" id="doaction" class="button-secondary action" />
55
+ </div>
56
+
57
+ <?php if ($page_links): ?>
58
+ <div class="tablenav-pages">
59
+ <?php echo $page_links_html = sprintf(
60
+ '<span class="displaying-num">' . __('Displaying %s&#8211;%s of %s', 'wp_all_export_plugin') . '</span>%s',
61
+ number_format_i18n(($pagenum - 1) * $perPage + 1),
62
+ number_format_i18n(min($pagenum * $perPage, $list->total())),
63
+ number_format_i18n($list->total()),
64
+ $page_links
65
+ ) ?>
66
+ </div>
67
+ <?php endif ?>
68
+ </div>
69
+ <div class="clear"></div>
70
+
71
+ <table class="widefat pmxe-admin-exports">
72
+ <thead>
73
+ <tr>
74
+ <th class="manage-column column-cb check-column" scope="col">
75
+ <input type="checkbox" />
76
+ </th>
77
+ <?php
78
+ $col_html = '';
79
+ foreach ($columns as $column_id => $column_display_name) {
80
+ $column_link = "<a href='";
81
+ $order2 = 'ASC';
82
+ if ($order_by == $column_id)
83
+ $order2 = ($order == 'DESC') ? 'ASC' : 'DESC';
84
+
85
+ $column_link .= esc_url(add_query_arg(array('order' => $order2, 'order_by' => $column_id), $this->baseUrl));
86
+ $column_link .= "'>{$column_display_name}</a>";
87
+ $col_html .= '<th scope="col" class="column-' . $column_id . ' ' . ($order_by == $column_id ? $order : '') . '">' . $column_link . '</th>';
88
+ }
89
+ echo $col_html;
90
+ ?>
91
+ </tr>
92
+ </thead>
93
+ <tfoot>
94
+ <tr>
95
+ <th class="manage-column column-cb check-column" scope="col">
96
+ <input type="checkbox" />
97
+ </th>
98
+ <?php echo $col_html; ?>
99
+ </tr>
100
+ </tfoot>
101
+ <tbody id="the-pmxi-admin-import-list" class="list:pmxe-admin-exports">
102
+ <?php if ($list->isEmpty()): ?>
103
+ <tr>
104
+ <td colspan="<?php echo count($columns) + 1 ?>"><?php _e('No previous exports found.', 'wp_all_export_plugin') ?></td>
105
+ </tr>
106
+ <?php else: ?>
107
+ <?php
108
+
109
+ $is_secure_import = PMXE_Plugin::getInstance()->getOption('secure');
110
+
111
+ $class = '';
112
+ ?>
113
+ <?php foreach ($list as $item): ?>
114
+ <?php $class = ('alternate' == $class) ? '' : 'alternate'; ?>
115
+ <tr class="<?php echo $class; ?>" valign="middle">
116
+ <th scope="row" class="check-column">
117
+ <input type="checkbox" id="item_<?php echo $item['id'] ?>" name="items[]" value="<?php echo esc_attr($item['id']) ?>" />
118
+ </th>
119
+ <?php foreach ($columns as $column_id => $column_display_name): ?>
120
+ <?php
121
+ switch ($column_id):
122
+ case 'id':
123
+ ?>
124
+ <th valign="top" scope="row">
125
+ <?php echo $item['id'] ?>
126
+ </th>
127
+ <?php
128
+ break;
129
+ case 'name':
130
+ ?>
131
+ <td>
132
+ <strong><?php echo $item['friendly_name']; ?></strong> <br>
133
+ <div class="row-actions">
134
+ <span class="edit"><a class="edit" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'template'), $this->baseUrl)) ?>"><?php _e('Edit Template', 'wp_all_export_plugin') ?></a></span> |
135
+ <span class="edit"><a class="edit" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'options'), $this->baseUrl)) ?>"><?php _e('Edit Options', 'wp_all_export_plugin') ?></a></span> |
136
+ <?php if ( ! $is_secure_import and $item['attch_id']): ?>
137
+ <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'get_file', '_wpnonce' => wp_create_nonce( '_wpnonce-download_feed' )), $this->baseUrl)) ?>"><?php _e('Download', 'wp_all_export_plugin') ?></a></span> |
138
+ <?php endif; ?>
139
+ <?php if ($is_secure_import and ! empty($item['options']['filepath'])): ?>
140
+ <span class="update"><a class="update" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'get_file', '_wpnonce' => wp_create_nonce( '_wpnonce-download_feed' )), $this->baseUrl)) ?>"><?php _e('Download', 'wp_all_export_plugin') ?></a></span> |
141
+ <?php endif; ?>
142
+ <span class="delete"><a class="delete" href="<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'delete'), $this->baseUrl)) ?>"><?php _e('Delete', 'wp_all_export_plugin') ?></a></span>
143
+ </div>
144
+ </td>
145
+ <?php
146
+ break;
147
+ case 'info':
148
+ ?>
149
+ <td style="min-width: 180px;">
150
+ <a href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'scheduling'), $this->baseUrl)?>"><?php _e('Cron Scheduling', 'wp_all_export_plugin'); ?></a> <br>
151
+ <?php
152
+ $is_re_import_allowed = true;
153
+ if ( ! empty($item['options']['ids']) ){
154
+ $required_fields = array('id' => 'id');
155
+ // re-import products
156
+ if ((in_array('product', $item['options']['cpt']) or $item['options']['export_type'] == 'advanced') and class_exists('WooCommerce') and (empty($item['options']['wp_query_selector']) or $item['options']['wp_query_selector'] == 'wp_query')) {
157
+ $required_fields['woo'] = '_sku';
158
+ $required_fields['cats'] = 'product_type';
159
+ }
160
+ if ((in_array('users', $item['options']['cpt']) or $item['options']['export_type'] == 'advanced') and (!empty($item['options']['wp_query_selector']) and $item['options']['wp_query_selector'] == 'wp_user_query')) {
161
+ $required_fields['user_email'] = 'user_email';
162
+ $required_fields['user_login'] = 'user_login';
163
+ }
164
+ if ($item['options']['export_type'] == 'advanced' and (empty($item['options']['wp_query_selector']) or $item['options']['wp_query_selector'] == 'wp_query')){
165
+ $required_fields['post_type'] = 'post_type';
166
+ }
167
+ $defined_fields = array();
168
+ foreach ($item['options']['ids'] as $ID => $value) {
169
+ foreach ($required_fields as $type => $field) {
170
+ if ($item['options']['cc_type'][$ID] == $type && $item['options']['cc_label'][$ID] == $field){
171
+ $defined_fields[] = $field;
172
+ }
173
+ }
174
+ }
175
+
176
+ foreach ($required_fields as $type => $field) {
177
+ if ( ! in_array($field, $defined_fields) ){
178
+ $is_re_import_allowed = false;
179
+ break;
180
+ }
181
+ }
182
+
183
+ // if ($is_re_import_allowed and wp_all_export_is_compatible() and ! empty($item['options']['import_id'])){
184
+ // $import = new PMXI_Import_Record();
185
+ // $import->getById($item['options']['import_id']);
186
+ // if ($import->isEmpty() or $import->parent_import_id == 0){
187
+ // $item['options']['import_id'] = 0;
188
+ // }
189
+ // }
190
+ }
191
+ ?>
192
+ <?php if ( wp_all_export_is_compatible() and !empty($item['options']['import_id']) and $is_re_import_allowed): ?>
193
+ <a href="<?php echo add_query_arg(array('page' => 'pmxi-admin-import', 'id' => $item['options']['import_id'], 'deligate' => 'wpallexport'), remove_query_arg('page', $this->baseUrl)); ?>"><?php _e("Import with WP All Import", "wp_all_export_plugin"); ?></a>
194
+ <?php endif;?>
195
+ <?php
196
+ if ( wp_all_export_is_compatible() and (empty($item['options']['cpt']) or ! in_array('shop_order', $item['options']['cpt']))){
197
+ $template = new PMXI_Template_Record();
198
+ if ( ! empty($item['options']['template_name'])) {
199
+ $template->getByName($item['options']['template_name']);
200
+ if ( ! $template->isEmpty() ){
201
+ ?>
202
+ <br/>
203
+ <a href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'templates'), $this->baseUrl)?>"><?php _e('Download Import Templates', 'wp_all_export_plugin'); ?></a>
204
+ <?php
205
+ }
206
+ }
207
+ }
208
+ ?>
209
+ </td>
210
+ <?php
211
+ break;
212
+ case 'data':
213
+ ?>
214
+ <td>
215
+ <?php echo (!empty($item['options']['cpt'])) ? '<strong>' . __('Custom Types: ') . '</strong> ' . implode(', ', $item['options']['cpt']) : $item['options']['wp_query']; ?>
216
+ </td>
217
+ <?php
218
+ break;
219
+ case 'format':
220
+ ?>
221
+ <td>
222
+ <strong><?php echo $item['options']['export_to']; ?></strong>
223
+ </td>
224
+ <?php
225
+ break;
226
+ case 'registered_on':
227
+ ?>
228
+ <td>
229
+ <?php if ('0000-00-00 00:00:00' == $item['registered_on']): ?>
230
+ <em>never</em>
231
+ <?php else: ?>
232
+ <?php echo mysql2date(__('Y/m/d g:i a', 'wp_all_export_plugin'), $item['registered_on']) ?>
233
+ <?php endif ?>
234
+ </td>
235
+ <?php
236
+ break;
237
+ case 'summary':
238
+ ?>
239
+ <td>
240
+ <?php
241
+ if ($item['triggered'] and ! $item['processing']){
242
+ _e('triggered with cron', 'wp_all_export_plugin');
243
+ if ($item['last_activity'] != '0000-00-00 00:00:00'){
244
+ $diff = ceil((time() - strtotime($item['last_activity']))/60);
245
+ ?>
246
+ <br>
247
+ <span <?php if ($diff >= 10) echo 'style="color:red;"';?>>
248
+ <?php
249
+ printf(__('last activity %s ago', 'wp_all_export_plugin'), human_time_diff(strtotime($item['last_activity']), time()));
250
+ ?>
251
+ </span>
252
+ <?php
253
+ }
254
+ }
255
+ elseif ($item['processing']){
256
+ _e('currently processing with cron', 'wp_all_export_plugin'); echo '<br/>';
257
+ printf('Records Processed %s', $item['exported']);
258
+ if ($item['last_activity'] != '0000-00-00 00:00:00'){
259
+ $diff = ceil((time() - strtotime($item['last_activity']))/60);
260
+ ?>
261
+ <br>
262
+ <span <?php if ($diff >= 10) echo 'style="color:red;"';?>>
263
+ <?php
264
+ printf(__('last activity %s ago', 'wp_all_export_plugin'), human_time_diff(strtotime($item['last_activity']), time()));
265
+ ?>
266
+ </span>
267
+ <?php
268
+ }
269
+ }
270
+ elseif($item['executing']){
271
+ _e('Export currently in progress', 'wp_all_export_plugin');
272
+ if ($item['last_activity'] != '0000-00-00 00:00:00'){
273
+ $diff = ceil((time() - strtotime($item['last_activity']))/60);
274
+ ?>
275
+ <br>
276
+ <span <?php if ($diff >= 10) echo 'style="color:red;"';?>>
277
+ <?php
278
+ printf(__('last activity %s ago', 'wp_all_export_plugin'), human_time_diff(strtotime($item['last_activity']), time()));
279
+ ?>
280
+ </span>
281
+ <?php
282
+ }
283
+ }
284
+ elseif($item['canceled'] and $item['canceled_on'] != '0000-00-00 00:00:00'){
285
+ printf(__('Export Attempt at %s', 'wp_all_export_plugin'), get_date_from_gmt($item['canceled_on'], "m/d/Y g:i a")); echo '<br/>';
286
+ _e('Export canceled', 'wp_all_export_plugin');
287
+ }
288
+ else{
289
+ printf(__('Last run: %s', 'wp_all_export_plugin'), ($item['registered_on'] == '0000-00-00 00:00:00') ? __('never', 'wp_all_export_plugin') : get_date_from_gmt($item['registered_on'], "m/d/Y g:i a")); echo '<br/>';
290
+ printf(__('%d Records Exported', 'wp_all_export_plugin'), $item['exported']); echo '<br/>';
291
+ printf(__('Format: %s', 'wp_all_export_plugin'), $item['options']['export_to']); echo '<br/>';
292
+ //printf(__('%d records', 'wp_all_export_plugin'), $item['post_count']);
293
+ }
294
+
295
+ if ($item['settings_update_on'] != '0000-00-00 00:00:00' and $item['last_activity'] != '0000-00-00 00:00:00' and strtotime($item['settings_update_on']) > strtotime($item['last_activity'])){
296
+ ?>
297
+ <strong><?php _e('settings edited since last run', 'wp_all_export_plugin'); ?></strong>
298
+ <?php
299
+ }
300
+
301
+ ?>
302
+ </td>
303
+ <?php
304
+ break;
305
+ case 'actions':
306
+ ?>
307
+ <td style="width: 130px;">
308
+ <?php if ( ! $item['processing'] and ! $item['executing'] ): ?>
309
+ <!--h2 style="float:left;"><a class="add-new-h2" href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'edit'), $this->baseUrl); ?>"><?php _e('Edit', 'wp_all_export_plugin'); ?></a></h2-->
310
+ <h2 style="float:left;"><a class="add-new-h2" href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'update'), $this->baseUrl); ?>"><?php _e('Run Export', 'wp_all_export_plugin'); ?></a></h2>
311
+ <?php elseif ($item['processing']) : ?>
312
+ <h2 style="float:left;"><a class="add-new-h2" href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'cancel'), $this->baseUrl); ?>"><?php _e('Cancel Cron', 'wp_all_export_plugin'); ?></a></h2>
313
+ <?php elseif ($item['executing']) : ?>
314
+ <h2 style="float:left;"><a class="add-new-h2" href="<?php echo add_query_arg(array('id' => $item['id'], 'action' => 'cancel'), $this->baseUrl); ?>"><?php _e('Cancel', 'wp_all_export_plugin'); ?></a></h2>
315
+ <?php endif; ?>
316
+ </td>
317
+ <?php
318
+ break;
319
+ default:
320
+ ?>
321
+ <td>
322
+ <?php do_action('pmxe_manage_imports_column', $column_id, $item); ?>
323
+ </td>
324
+ <?php
325
+ break;
326
+ endswitch;
327
+ ?>
328
+ <?php endforeach; ?>
329
+ </tr>
330
+ <?php endforeach; ?>
331
+ <?php endif ?>
332
+ </tbody>
333
+ </table>
334
+
335
+ <div class="tablenav">
336
+ <?php if ($page_links): ?><div class="tablenav-pages"><?php echo $page_links_html ?></div><?php endif ?>
337
+
338
+ <div class="alignleft actions">
339
+ <select name="bulk-action2">
340
+ <option value="" selected="selected"><?php _e('Bulk Actions', 'wp_all_export_plugin') ?></option>
341
+ <?php if ( empty($type) or 'trash' != $type): ?>
342
+ <option value="delete"><?php _e('Delete', 'wp_all_export_plugin') ?></option>
343
+ <?php else: ?>
344
+ <option value="restore"><?php _e('Restore', 'wp_all_export_plugin')?></option>
345
+ <option value="delete"><?php _e('Delete Permanently', 'wp_all_export_plugin')?></option>
346
+ <?php endif ?>
347
+ </select>
348
+ <input type="submit" value="<?php esc_attr_e('Apply', 'wp_all_export_plugin') ?>" name="doaction2" id="doaction2" class="button-secondary action" />
349
+ </div>
350
+ </div>
351
+ <div class="clear"></div>
352
+
353
+ <a href="http://soflyy.com/" target="_blank" class="wpallexport-created-by"><?php _e('Created by', 'wp_all_export_plugin'); ?> <span></span></a>
354
+
355
+ </form>
views/admin/manage/scheduling.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>
2
+ <?php _e('Cron Scheduling', 'wp_all_export_plugin') ?>
3
+ </h2>
4
+
5
+ <div class="wpallexport-free-edition-notice" style="padding: 20px; margin-left: 0px;">
6
+ <a class="upgrade_link" target="_blank" href="http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=wordpress.org&amp;utm_medium=cron&amp;utm_campaign=free+wp+all+export+plugin"><?php _e('Upgrade to the professional edition of WP All Export to enable automated exports.', 'wp_all_export_plugin');?></a>
7
+ </div>
8
+
9
+ <p>
10
+ <?php _e('To schedule an import, you must create two cron jobs in your web hosting control panel. One cron job will be used to run the Trigger script, the other to run the Execution script.', 'wp_all_export_plugin'); ?>
11
+ </p>
12
+
13
+ <p>
14
+ <?php _e('Trigger Script URL', 'wp_all_export_plugin');?><br />
15
+ <small><?php _e('Run the trigger script when you want to update your import. Once per 24 hours is recommended.', 'wp_all_export_plugin'); ?></small><br />
16
+ <input style='width: 700px;' type='text' value='<?php echo home_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=trigger'; ?>' disabled="disabled"/>
17
+ <br /><br />
18
+ <?php _e('Execution Script URL', 'wp_all_export_plugin');?><br />
19
+ <small><?php _e('Run the execution script frequently. Once per two minutes is recommended.','wp_all_export_plugin');?></small><br />
20
+ <input style='width: 700px;' type='text' value='<?php echo home_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=processing'; ?>' disabled="disabled"/><br /><br />
21
+ <?php _e('Export File URL', 'wp_all_export_plugin'); ?><br />
22
+ <input style='width: 700px;' type='text' value='<?php echo $file_path; ?>' disabled="disabled"/><br /><br />
23
+ </p>
24
+
25
+ <p><strong><?php _e('Trigger Script', 'wp_all_export_plugin'); ?></strong></p>
26
+
27
+ <p><?php _e('Every time you want to schedule the import, run the trigger script.', 'wp_all_export_plugin'); ?></p>
28
+
29
+ <p><?php _e('To schedule the import to run once every 24 hours, run the trigger script every 24 hours. Most hosts require you to use “wget” to access a URL. Ask your host for details.', 'wp_all_export_plugin'); ?></p>
30
+
31
+ <p><i><?php _e('Example:', 'wp_all_export_plugin'); ?></i></p>
32
+
33
+ <p>wget -q -O /dev/null "<?php echo home_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=trigger'; ?>"</p>
34
+
35
+ <p><strong><?php _e('Execution Script', 'wp_all_export_plugin'); ?></strong></p>
36
+
37
+ <p><?php _e('The Execution script actually executes the import, once it has been triggered with the Trigger script.', 'wp_all_export_plugin'); ?></p>
38
+
39
+ <p><?php _e('It processes in iteration (only importing a few records each time it runs) to optimize server load. It is recommended you run the execution script every 2 minutes.', 'wp_all_export_plugin'); ?></p>
40
+
41
+ <p><?php _e('It also operates this way in case of unexpected crashes by your web host. If it crashes before the import is finished, the next run of the cron job two minutes later will continue it where it left off, ensuring reliability.', 'wp_all_export_plugin'); ?></p>
42
+
43
+ <p><i><?php _e('Example:', 'wp_all_export_plugin'); ?></i></p>
44
+
45
+ <p>wget -q -O /dev/null "<?php echo home_url() . '/wp-cron.php?export_key=' . $cron_job_key . '&export_id=' . $id . '&action=processing'; ?>"</p>
46
+
47
+ <p><strong><?php _e('Notes', 'wp_all_export_plugin'); ?></strong></p>
48
+
49
+ <p>
50
+ <?php _e('Your web host may require you to use a command other than wget, although wget is most common. In this case, you must asking your web hosting provider for help.', 'wp_all_export_plugin'); ?>
51
+ </p>
52
+
53
+ <p>
54
+ See the <a href='http://www.wpallimport.com/documentation/recurring/cron/'>documentation</a> for more details.
55
+ </p>
56
+
57
+ <a href="http://soflyy.com/" target="_blank" class="wpallexport-created-by"><?php _e('Created by', 'wp_all_export_plugin'); ?> <span></span></a>
views/admin/manage/templates.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>
2
+ <?php _e('Download Import Templates', 'wp_all_export_plugin') ?>
3
+ </h2>
4
+
5
+ <p>
6
+ <?php _e('Download your import templates and use them to import your exported file to a separate WordPress/WP All Import installation.', 'wp_all_export_plugin'); ?>
7
+ </p>
8
+
9
+ <p>
10
+ <?php _e('Install these import templates in your separate WP All Import installation from the All Import -> Settings page by clicking the "Import Templates" button.', 'wp_all_export_plugin'); ?>
11
+ </p>
12
+
13
+ <p>
14
+ <a href='<?php echo esc_url(add_query_arg(array('id' => $item['id'], 'action' => 'get_template', '_wpnonce' => wp_create_nonce( '_wpnonce-download_template' )), $this->baseUrl));?>'>Download</a>
15
+ </p>
16
+
17
+ <img src="<?php echo PMXE_ROOT_URL; ?>/static/img/import-templates.png" width="400px" style="border: 1px solid #aaa;">
18
+
19
+ <a href="http://soflyy.com/" target="_blank" class="wpallexport-created-by"><?php _e('Created by', 'wp_all_export_plugin'); ?> <span></span></a>
views/admin/manage/update.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2><?php _e('Re-run Export', 'pmxe_plugin') ?></h2>
2
+
3
+ <?php if ($this->errors->get_error_codes()): ?>
4
+ <?php $this->error() ?>
5
+ <?php endif ?>
6
+
7
+ <form method="post">
8
+ <p><?php printf(__('Are you sure you want to re-run <strong>%s</strong> export?', 'pmxe_plugin'), $item->friendly_name) ?></p>
9
+
10
+ <p class="submit">
11
+ <?php wp_nonce_field('update-export', '_wpnonce_update-export') ?>
12
+ <input type="hidden" name="is_confirmed" value="1" />
13
+ <input type="submit" class="button-primary ajax-update" value="Export Posts" />
14
+ </p>
15
+
16
+ </form>
views/admin/settings/index.php CHANGED
@@ -10,16 +10,54 @@
10
  <br />
11
 
12
  <form name="settings" method="post" action="<?php echo $this->baseUrl ?>">
13
- <h3><?php _e('Export Settings', 'pmxe_plugin') ?></h3>
14
- <p>
15
- <?php printf(__('%s <label for="session_mode_default">Session Mode (default)</label>', 'pmxe_plugin'), '<input type="radio" name="session_mode" id="session_mode_default" value="default" style="position:relative; top:-2px;" '. (($post['session_mode'] == 'default') ? 'checked="checked"' : '') .'/>') ?> <br>
16
- <?php printf(__('%s <label for="session_mode_files">Session Mode (files)</label>', 'pmxe_plugin'), '<input type="radio" name="session_mode" id="session_mode_files" value="files" style="position:relative; top:-2px;" '. (($post['session_mode'] == 'files') ? 'checked="checked"' : '') .'/>') ?> <br>
17
- <?php printf(__('%s <label for="session_mode_database">Session Mode (database)</label>', 'pmxe_plugin'), '<input type="radio" name="session_mode" id="session_mode_database" value="database" style="position:relative; top:-2px;" '. (($post['session_mode'] == 'database') ? 'checked="checked"' : '') .'/>') ?>
18
- </p>
19
- <p class="submit-buttons">
20
- <?php wp_nonce_field('edit-settings', '_wpnonce_edit-settings') ?>
21
- <input type="hidden" name="is_settings_submitted" value="1" />
22
- <input type="submit" class="button-primary" value="Save Settings" />
23
- </p>
24
-
25
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  <br />
11
 
12
  <form name="settings" method="post" action="<?php echo $this->baseUrl ?>">
13
+
14
+ <h3><?php _e('Cron Exports', 'wp_all_export_plugin') ?></h3>
15
+
16
+ <table class="form-table">
17
+ <tbody>
18
+ <tr>
19
+ <th scope="row"><label><?php _e('Secret Key', 'wp_all_export_plugin'); ?></label></th>
20
+ <td>
21
+ <input type="text" class="regular-text" name="cron_job_key" value="<?php echo esc_attr($post['cron_job_key']); ?>"/>
22
+ <p class="description"><?php _e('Changing this will require you to re-create your existing cron jobs.', 'wp_all_export_plugin'); ?></p>
23
+ </td>
24
+ </tr>
25
+ </tbody>
26
+ </table>
27
+
28
+ <div class="clear"></div>
29
+
30
+ <h3><?php _e('Files', 'wp_all_export_plugin') ?></h3>
31
+
32
+ <table class="form-table">
33
+ <tbody>
34
+ <tr>
35
+ <th scope="row"><label><?php _e('Secure Mode', 'wp_all_export_plugin'); ?></label></th>
36
+ <td>
37
+ <fieldset style="padding:0;">
38
+ <legend class="screen-reader-text"><span><?php _e('Secure Mode', 'wp_all_export_plugin'); ?></span></legend>
39
+ <input type="hidden" name="secure" value="0"/>
40
+ <label for="secure"><input type="checkbox" value="1" id="secure" name="secure" <?php echo (($post['secure']) ? 'checked="checked"' : ''); ?>><?php _e('Randomize folder names', 'wp_all_export_plugin'); ?></label>
41
+ </fieldset>
42
+ <p class="description">
43
+ <?php
44
+ $wp_uploads = wp_upload_dir();
45
+ ?>
46
+ <?php printf(__('Exported files and temporary files will be placed in a folder with a randomized name inside of %s.', 'wp_all_export_plugin'), $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY ); ?>
47
+ </p>
48
+ </td>
49
+ </tr>
50
+ </tbody>
51
+ </table>
52
+
53
+ <div class="clear"></div>
54
+
55
+ <p class="submit-buttons">
56
+ <?php wp_nonce_field('edit-settings', '_wpnonce_edit-settings') ?>
57
+ <input type="hidden" name="is_settings_submitted" value="1" />
58
+ <input type="submit" class="button-primary" value="Save Settings" />
59
+ </p>
60
+
61
+ </form>
62
+
63
+ <a href="http://soflyy.com/" target="_blank" class="wpallexport-created-by"><?php _e('Created by', 'wp_all_export_plugin'); ?> <span></span></a>
views/controller/error.php CHANGED
File without changes
wp-all-export.php ADDED
@@ -0,0 +1,606 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WP All Export
4
+ Plugin URI: http://www.wpallimport.com/export/
5
+ Description: Export any post type to a CSV or XML file. Edit the exported data, and then re-import it later using WP All Import.
6
+ Version: 1.0.0
7
+ Author: Soflyy
8
+ */
9
+
10
+ if( ! defined( 'PMXE_SESSION_COOKIE' ) )
11
+ define( 'PMXE_SESSION_COOKIE', '_pmxe_session' );
12
+
13
+ /**
14
+ * Plugin root dir with forward slashes as directory separator regardless of actuall DIRECTORY_SEPARATOR value
15
+ * @var string
16
+ */
17
+ define('PMXE_ROOT_DIR', str_replace('\\', '/', dirname(__FILE__)));
18
+ /**
19
+ * Plugin root url for referencing static content
20
+ * @var string
21
+ */
22
+ define('PMXE_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
23
+
24
+ if ( class_exists('PMXE_Plugin') and PMXE_EDITION == "paid"){
25
+
26
+ function pmxe_notice(){
27
+
28
+ ?>
29
+ <div class="error">
30
+ <p>
31
+ <?php printf(__('Please de-activate and remove the free version of the WP All Export before activating the paid version.', 'wp_all_export_plugin')); ?>
32
+ </p>
33
+ </div>
34
+ <?php
35
+
36
+ deactivate_plugins( str_replace('\\', '/', dirname(__FILE__)) . '/wp-all-export.php');
37
+
38
+ }
39
+
40
+ add_action('admin_notices', 'pmxe_notice');
41
+
42
+ }
43
+ else {
44
+
45
+ /**
46
+ * Plugin prefix for making names unique (be aware that this variable is used in conjuction with naming convention,
47
+ * i.e. in order to change it one must not only modify this constant but also rename all constants, classes and functions which
48
+ * names composed using this prefix)
49
+ * @var string
50
+ */
51
+ define('PMXE_PREFIX', 'pmxe_');
52
+
53
+ define('PMXE_VERSION', '1.0.0');
54
+
55
+ define('PMXE_EDITION', 'free');
56
+
57
+ /**
58
+ * Plugin root uploads folder name
59
+ * @var string
60
+ */
61
+ define('WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY', 'wpallexport');
62
+ /**
63
+ * Plugin uploads folder name
64
+ * @var string
65
+ */
66
+ define('WP_ALL_EXPORT_UPLOADS_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'uploads');
67
+
68
+ /**
69
+ * Plugin temp folder name
70
+ * @var string
71
+ */
72
+ define('WP_ALL_EXPORT_TEMP_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'temp');
73
+
74
+ /**
75
+ * Plugin temp folder name
76
+ * @var string
77
+ */
78
+ define('WP_ALL_EXPORT_CRON_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'exports');
79
+
80
+ /**
81
+ * Main plugin file, Introduces MVC pattern
82
+ *
83
+ * @singletone
84
+ * @author Pavel Kulbakin <p.kulbakin@gmail.com>
85
+ */
86
+ final class PMXE_Plugin {
87
+ /**
88
+ * Singletone instance
89
+ * @var PMXE_Plugin
90
+ */
91
+ protected static $instance;
92
+
93
+ /**
94
+ * Plugin options
95
+ * @var array
96
+ */
97
+ protected $options = array();
98
+
99
+ /**
100
+ * Plugin root dir
101
+ * @var string
102
+ */
103
+ const ROOT_DIR = PMXE_ROOT_DIR;
104
+ /**
105
+ * Plugin root URL
106
+ * @var string
107
+ */
108
+ const ROOT_URL = PMXE_ROOT_URL;
109
+ /**
110
+ * Prefix used for names of shortcodes, action handlers, filter functions etc.
111
+ * @var string
112
+ */
113
+ const PREFIX = PMXE_PREFIX;
114
+ /**
115
+ * Plugin file path
116
+ * @var string
117
+ */
118
+ const FILE = __FILE__;
119
+ /**
120
+ * Max allowed file size (bytes) to import in default mode
121
+ * @var int
122
+ */
123
+ const LARGE_SIZE = 0; // all files will importing in large import mode
124
+
125
+ /**
126
+ * WP All Import temp folder
127
+ * @var string
128
+ */
129
+ const TEMP_DIRECTORY = WP_ALL_EXPORT_TEMP_DIRECTORY;
130
+ /**
131
+ * WP All Import uploads folder
132
+ * @var string
133
+ */
134
+ const UPLOADS_DIRECTORY = WP_ALL_EXPORT_UPLOADS_DIRECTORY;
135
+ /**
136
+ * WP All Import uploads folder
137
+ * @var string
138
+ */
139
+ const CRON_DIRECTORY = WP_ALL_EXPORT_CRON_DIRECTORY;
140
+
141
+ public static $session = null;
142
+
143
+ /**
144
+ * Return singletone instance
145
+ * @return PMXE_Plugin
146
+ */
147
+ static public function getInstance() {
148
+ if (self::$instance == NULL) {
149
+ self::$instance = new self();
150
+ }
151
+ return self::$instance;
152
+ }
153
+
154
+ static public function getEddName(){
155
+ return 'WP All Export';
156
+ }
157
+
158
+ /**
159
+ * Common logic for requestin plugin info fields
160
+ */
161
+ public function __call($method, $args) {
162
+ if (preg_match('%^get(.+)%i', $method, $mtch)) {
163
+ $info = get_plugin_data(self::FILE);
164
+ if (isset($info[$mtch[1]])) {
165
+ return $info[$mtch[1]];
166
+ }
167
+ }
168
+ throw new Exception("Requested method " . get_class($this) . "::$method doesn't exist.");
169
+ }
170
+
171
+ /**
172
+ * Get path to plagin dir relative to wordpress root
173
+ * @param bool[optional] $noForwardSlash Whether path should be returned withot forwarding slash
174
+ * @return string
175
+ */
176
+ public function getRelativePath($noForwardSlash = false) {
177
+ $wp_root = str_replace('\\', '/', ABSPATH);
178
+ return ($noForwardSlash ? '' : '/') . str_replace($wp_root, '', self::ROOT_DIR);
179
+ }
180
+
181
+ /**
182
+ * Check whether plugin is activated as network one
183
+ * @return bool
184
+ */
185
+ public function isNetwork() {
186
+ if ( !is_multisite() )
187
+ return false;
188
+
189
+ $plugins = get_site_option('active_sitewide_plugins');
190
+ if (isset($plugins[plugin_basename(self::FILE)]))
191
+ return true;
192
+
193
+ return false;
194
+ }
195
+
196
+ /**
197
+ * Check whether permalinks is enabled
198
+ * @return bool
199
+ */
200
+ public function isPermalinks() {
201
+ global $wp_rewrite;
202
+
203
+ return $wp_rewrite->using_permalinks();
204
+ }
205
+
206
+ /**
207
+ * Return prefix for plugin database tables
208
+ * @return string
209
+ */
210
+ public function getTablePrefix() {
211
+ global $wpdb;
212
+
213
+ //return ($this->isNetwork() ? $wpdb->base_prefix : $wpdb->prefix) . self::PREFIX;
214
+ return $wpdb->prefix . self::PREFIX;
215
+ }
216
+
217
+ /**
218
+ * Return prefix for wordpress database tables
219
+ * @return string
220
+ */
221
+ public function getWPPrefix() {
222
+ global $wpdb;
223
+ return ($this->isNetwork()) ? $wpdb->base_prefix : $wpdb->prefix;
224
+ }
225
+
226
+ /**
227
+ * Class constructor containing dispatching logic
228
+ * @param string $rootDir Plugin root dir
229
+ * @param string $pluginFilePath Plugin main file
230
+ */
231
+ protected function __construct() {
232
+
233
+ $this->load_plugin_textdomain();
234
+
235
+ // regirster autoloading method
236
+ if (function_exists('__autoload') and ! in_array('__autoload', spl_autoload_functions())) { // make sure old way of autoloading classes is not broken
237
+ spl_autoload_register('__autoload');
238
+ }
239
+ spl_autoload_register(array($this, '__autoload'));
240
+
241
+ // register helpers
242
+ if (is_dir(self::ROOT_DIR . '/helpers')) foreach (PMXE_Helper::safe_glob(self::ROOT_DIR . '/helpers/*.php', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH) as $filePath) {
243
+ require_once $filePath;
244
+ }
245
+
246
+ // init plugin options
247
+ $option_name = get_class($this) . '_Options';
248
+ $options_default = PMXE_Config::createFromFile(self::ROOT_DIR . '/config/options.php')->toArray();
249
+ $this->options = array_intersect_key(get_option($option_name, array()), $options_default) + $options_default;
250
+ $this->options = array_intersect_key($options_default, array_flip(array('info_api_url'))) + $this->options; // make sure hidden options apply upon plugin reactivation
251
+ if ('' == $this->options['cron_job_key']) $this->options['cron_job_key'] = wp_all_export_url_title(wp_all_export_rand_char(12));
252
+
253
+ update_option($option_name, $this->options);
254
+ $this->options = get_option(get_class($this) . '_Options');
255
+ register_activation_hook(self::FILE, array($this, '__activation'));
256
+
257
+ // register action handlers
258
+ if (is_dir(self::ROOT_DIR . '/actions')) if (is_dir(self::ROOT_DIR . '/actions')) foreach (PMXE_Helper::safe_glob(self::ROOT_DIR . '/actions/*.php', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH) as $filePath) {
259
+ require_once $filePath;
260
+ $function = $actionName = basename($filePath, '.php');
261
+ if (preg_match('%^(.+?)[_-](\d+)$%', $actionName, $m)) {
262
+ $actionName = $m[1];
263
+ $priority = intval($m[2]);
264
+ } else {
265
+ $priority = 10;
266
+ }
267
+ add_action($actionName, self::PREFIX . str_replace('-', '_', $function), $priority, 99); // since we don't know at this point how many parameters each plugin expects, we make sure they will be provided with all of them (it's unlikely any developer will specify more than 99 parameters in a function)
268
+ }
269
+
270
+ // register filter handlers
271
+ if (is_dir(self::ROOT_DIR . '/filters')) foreach (PMXE_Helper::safe_glob(self::ROOT_DIR . '/filters/*.php', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH) as $filePath) {
272
+ require_once $filePath;
273
+ $function = $actionName = basename($filePath, '.php');
274
+ if (preg_match('%^(.+?)[_-](\d+)$%', $actionName, $m)) {
275
+ $actionName = $m[1];
276
+ $priority = intval($m[2]);
277
+ } else {
278
+ $priority = 10;
279
+ }
280
+ add_filter($actionName, self::PREFIX . str_replace('-', '_', $function), $priority, 99); // since we don't know at this point how many parameters each plugin expects, we make sure they will be provided with all of them (it's unlikely any developer will specify more than 99 parameters in a function)
281
+ }
282
+
283
+ // register shortcodes handlers
284
+ if (is_dir(self::ROOT_DIR . '/shortcodes')) foreach (PMXE_Helper::safe_glob(self::ROOT_DIR . '/shortcodes/*.php', PMXE_Helper::GLOB_RECURSE | PMXE_Helper::GLOB_PATH) as $filePath) {
285
+ $tag = strtolower(str_replace('/', '_', preg_replace('%^' . preg_quote(self::ROOT_DIR . '/shortcodes/', '%') . '|\.php$%', '', $filePath)));
286
+ add_shortcode($tag, array($this, 'shortcodeDispatcher'));
287
+ }
288
+
289
+ // register admin page pre-dispatcher
290
+ add_action('admin_init', array($this, '__adminInit'));
291
+ }
292
+
293
+ /**
294
+ * pre-dispatching logic for admin page controllers
295
+ */
296
+ public function __adminInit() {
297
+
298
+ // create history folder
299
+ $uploads = wp_upload_dir();
300
+
301
+ $wpallimportDirs = array( WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY, self::TEMP_DIRECTORY, self::UPLOADS_DIRECTORY, self::CRON_DIRECTORY);
302
+
303
+ foreach ($wpallimportDirs as $destination) {
304
+
305
+ $dir = $uploads['basedir'] . DIRECTORY_SEPARATOR . $destination;
306
+
307
+ if ( !is_dir($dir)) wp_mkdir_p($dir);
308
+
309
+ if ( ! @file_exists($dir . DIRECTORY_SEPARATOR . 'index.php') ) @touch( $dir . DIRECTORY_SEPARATOR . 'index.php' );
310
+
311
+ }
312
+
313
+ if ( ! is_dir($uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY) or ! is_writable($uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY)) {
314
+ die(sprintf(__('Uploads folder %s must be writable', 'wp_all_export_plugin'), $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY));
315
+ }
316
+
317
+ if ( ! is_dir($uploads['basedir'] . DIRECTORY_SEPARATOR . self::UPLOADS_DIRECTORY) or ! is_writable($uploads['basedir'] . DIRECTORY_SEPARATOR . self::UPLOADS_DIRECTORY)) {
318
+ die(sprintf(__('Uploads folder %s must be writable', 'wp_all_export_plugin'), $uploads['basedir'] . DIRECTORY_SEPARATOR . self::UPLOADS_DIRECTORY));
319
+ }
320
+
321
+ self::$session = new PMXE_Handler();
322
+
323
+ $input = new PMXE_Input();
324
+ $page = strtolower($input->getpost('page', ''));
325
+
326
+ if (preg_match('%^' . preg_quote(str_replace('_', '-', self::PREFIX), '%') . '([\w-]+)$%', $page)) {
327
+ //$this->adminDispatcher($page, strtolower($input->getpost('action', 'index')));
328
+
329
+ $action = strtolower($input->getpost('action', 'index'));
330
+
331
+ // capitalize prefix and first letters of class name parts
332
+ if (function_exists('preg_replace_callback')){
333
+ $controllerName = preg_replace_callback('%(^' . preg_quote(self::PREFIX, '%') . '|_).%', array($this, "replace_callback"),str_replace('-', '_', $page));
334
+ }
335
+ else{
336
+ $controllerName = preg_replace('%(^' . preg_quote(self::PREFIX, '%') . '|_).%e', 'strtoupper("$0")', str_replace('-', '_', $page));
337
+ }
338
+ $actionName = str_replace('-', '_', $action);
339
+ if (method_exists($controllerName, $actionName)) {
340
+
341
+ if ( ! get_current_user_id() or ! current_user_can('manage_options')) {
342
+ // This nonce is not valid.
343
+ die( 'Security check' );
344
+
345
+ } else {
346
+
347
+ $this->_admin_current_screen = (object)array(
348
+ 'id' => $controllerName,
349
+ 'base' => $controllerName,
350
+ 'action' => $actionName,
351
+ 'is_ajax' => strpos($_SERVER["HTTP_ACCEPT"], 'json') !== false,
352
+ 'is_network' => is_network_admin(),
353
+ 'is_user' => is_user_admin(),
354
+ );
355
+ add_filter('current_screen', array($this, 'getAdminCurrentScreen'));
356
+ add_filter('admin_body_class', create_function('', 'return "' . 'wpallexport-plugin";'));
357
+
358
+ $controller = new $controllerName();
359
+ if ( ! $controller instanceof PMXE_Controller_Admin) {
360
+ throw new Exception("Administration page `$page` matches to a wrong controller type.");
361
+ }
362
+
363
+ if ($this->_admin_current_screen->is_ajax) { // ajax request
364
+ $controller->$action();
365
+ do_action('wpallexport_action_after');
366
+ die(); // stop processing since we want to output only what controller is randered, nothing in addition
367
+ } elseif ( ! $controller->isInline) {
368
+ @ob_start();
369
+ $controller->$action();
370
+ self::$buffer = @ob_get_clean();
371
+ } else {
372
+ self::$buffer_callback = array($controller, $action);
373
+ }
374
+ }
375
+
376
+ } else { // redirect to dashboard if requested page and/or action don't exist
377
+ wp_redirect(admin_url()); die();
378
+ }
379
+
380
+ }
381
+ }
382
+
383
+ /**
384
+ * Dispatch shorttag: create corresponding controller instance and call its index method
385
+ * @param array $args Shortcode tag attributes
386
+ * @param string $content Shortcode tag content
387
+ * @param string $tag Shortcode tag name which is being dispatched
388
+ * @return string
389
+ */
390
+ public function shortcodeDispatcher($args, $content, $tag) {
391
+
392
+ $controllerName = self::PREFIX . preg_replace('%(^|_).%e', 'strtoupper("$0")', $tag); // capitalize first letters of class name parts and add prefix
393
+ $controller = new $controllerName();
394
+ if ( ! $controller instanceof PMXE_Controller) {
395
+ throw new Exception("Shortcode `$tag` matches to a wrong controller type.");
396
+ }
397
+ ob_start();
398
+ $controller->index($args, $content);
399
+ return ob_get_clean();
400
+ }
401
+
402
+ static $buffer = NULL;
403
+ static $buffer_callback = NULL;
404
+
405
+ /**
406
+ * Dispatch admin page: call corresponding controller based on get parameter `page`
407
+ * The method is called twice: 1st time as handler `parse_header` action and then as admin menu item handler
408
+ * @param string[optional] $page When $page set to empty string ealier buffered content is outputted, otherwise controller is called based on $page value
409
+ */
410
+ public function adminDispatcher($page = '', $action = 'index') {
411
+ if ('' === $page) {
412
+ if ( ! is_null(self::$buffer)) {
413
+ echo '<div class="wrap">';
414
+ echo self::$buffer;
415
+ do_action('wpallexport_action_after');
416
+ echo '</div>';
417
+ } elseif ( ! is_null(self::$buffer_callback)) {
418
+ echo '<div class="wrap">';
419
+ call_user_func(self::$buffer_callback);
420
+ do_action('wpallexport_action_after');
421
+ echo '</div>';
422
+ } else {
423
+ throw new Exception('There is no previousely buffered content to display.');
424
+ }
425
+ }
426
+ }
427
+
428
+ public function replace_callback($matches){
429
+ return strtoupper($matches[0]);
430
+ }
431
+
432
+ protected $_admin_current_screen = NULL;
433
+ public function getAdminCurrentScreen()
434
+ {
435
+ return $this->_admin_current_screen;
436
+ }
437
+
438
+ /**
439
+ * Autoloader
440
+ * It's assumed class name consists of prefix folloed by its name which in turn corresponds to location of source file
441
+ * if `_` symbols replaced by directory path separator. File name consists of prefix folloed by last part in class name (i.e.
442
+ * symbols after last `_` in class name)
443
+ * When class has prefix it's source is looked in `models`, `controllers`, `shortcodes` folders, otherwise it looked in `core` or `library` folder
444
+ *
445
+ * @param string $className
446
+ * @return bool
447
+ */
448
+ public function __autoload($className) {
449
+ $is_prefix = false;
450
+ $filePath = str_replace('_', '/', preg_replace('%^' . preg_quote(self::PREFIX, '%') . '%', '', strtolower($className), 1, $is_prefix)) . '.php';
451
+ if ( ! $is_prefix) { // also check file with original letter case
452
+ $filePathAlt = $className . '.php';
453
+ }
454
+ foreach ($is_prefix ? array('models', 'controllers', 'shortcodes', 'classes') : array('libraries') as $subdir) {
455
+ $path = self::ROOT_DIR . '/' . $subdir . '/' . $filePath;
456
+ if (is_file($path)) {
457
+ require $path;
458
+ return TRUE;
459
+ }
460
+ if ( ! $is_prefix) {
461
+ $pathAlt = self::ROOT_DIR . '/' . $subdir . '/' . $filePathAlt;
462
+ if (is_file($pathAlt)) {
463
+ require $pathAlt;
464
+ return TRUE;
465
+ }
466
+ }
467
+ }
468
+
469
+ return FALSE;
470
+ }
471
+
472
+ /**
473
+ * Get plugin option
474
+ * @param string[optional] $option Parameter to return, all array of options is returned if not set
475
+ * @return mixed
476
+ */
477
+ public function getOption($option = NULL) {
478
+ if (is_null($option)) {
479
+ return $this->options;
480
+ } else if (isset($this->options[$option])) {
481
+ return $this->options[$option];
482
+ } else {
483
+ throw new Exception("Specified option is not defined for the plugin");
484
+ }
485
+ }
486
+ /**
487
+ * Update plugin option value
488
+ * @param string $option Parameter name or array of name => value pairs
489
+ * @param mixed[optional] $value New value for the option, if not set than 1st parameter is supposed to be array of name => value pairs
490
+ * @return array
491
+ */
492
+ public function updateOption($option, $value = NULL) {
493
+ is_null($value) or $option = array($option => $value);
494
+ if (array_diff_key($option, $this->options)) {
495
+ throw new Exception("Specified option is not defined for the plugin");
496
+ }
497
+ $this->options = $option + $this->options;
498
+ update_option(get_class($this) . '_Options', $this->options);
499
+
500
+ return $this->options;
501
+ }
502
+
503
+ /**
504
+ * Plugin activation logic
505
+ */
506
+ public function __activation() {
507
+ // uncaught exception doesn't prevent plugin from being activated, therefore replace it with fatal error so it does
508
+ set_exception_handler(create_function('$e', 'trigger_error($e->getMessage(), E_USER_ERROR);'));
509
+
510
+ // create plugin options
511
+ $option_name = get_class($this) . '_Options';
512
+ $options_default = PMXE_Config::createFromFile(self::ROOT_DIR . '/config/options.php')->toArray();
513
+ $wpai_options = get_option($option_name, false);
514
+ if ( ! $wpai_options ) update_option($option_name, $options_default);
515
+
516
+ // create/update required database tables
517
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
518
+ require self::ROOT_DIR . '/schema.php';
519
+ global $wpdb;
520
+
521
+ if (function_exists('is_multisite') && is_multisite()) {
522
+ // check if it is a network activation - if so, run the activation function for each blog id
523
+ if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) {
524
+ $old_blog = $wpdb->blogid;
525
+ // Get all blog ids
526
+ $blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
527
+ foreach ($blogids as $blog_id) {
528
+ switch_to_blog($blog_id);
529
+ require self::ROOT_DIR . '/schema.php';
530
+ dbDelta($plugin_queries);
531
+ }
532
+ switch_to_blog($old_blog);
533
+ return;
534
+ }
535
+ }
536
+
537
+ dbDelta($plugin_queries);
538
+
539
+ }
540
+
541
+ /**
542
+ * Load Localisation files.
543
+ *
544
+ * Note: the first-loaded translation file overrides any following ones if the same translation is present
545
+ *
546
+ * @access public
547
+ * @return void
548
+ */
549
+ public function load_plugin_textdomain() {
550
+ $locale = apply_filters( 'plugin_locale', get_locale(), 'wp_all_export_plugin' );
551
+
552
+ load_plugin_textdomain( 'wp_all_export_plugin', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" );
553
+ }
554
+
555
+ /**
556
+ * Method returns default import options, main utility of the method is to avoid warnings when new
557
+ * option is introduced but already registered imports don't have it
558
+ */
559
+ public static function get_default_import_options() {
560
+ return array(
561
+ 'cpt' => array(),
562
+ 'whereclause' => '',
563
+ 'joinclause' => '',
564
+ 'filter_rules_hierarhy' => '',
565
+ 'product_matching_mode' => 'strict',
566
+ 'order_item_per_row' => 1,
567
+ 'filepath' => '',
568
+ 'export_type' => 'specific',
569
+ 'wp_query' => '',
570
+ 'wp_query_selector' => 'wp_query',
571
+ 'is_user_export' => false,
572
+ 'export_to' => 'csv',
573
+ 'delimiter' => ',',
574
+ 'encoding' => 'UTF-8',
575
+ 'is_generate_templates' => 1,
576
+ 'is_generate_import' => 1,
577
+ 'import_id' => 0,
578
+ 'template_name' => '',
579
+ 'is_scheduled' => 0,
580
+ 'scheduled_period' => '',
581
+ 'scheduled_email' => '',
582
+ 'cc_label' => array(),
583
+ 'cc_type' => array(),
584
+ 'cc_value' => array(),
585
+ 'cc_name' => array(),
586
+ 'cc_php' => array(),
587
+ 'cc_code' => array(),
588
+ 'cc_sql' => array(),
589
+ 'cc_options' => array(),
590
+ 'friendly_name' => '',
591
+ 'fields' => array('default', 'other', 'cf', 'cats'),
592
+ 'ids' => array(),
593
+ 'rules' => array(),
594
+ 'records_per_iteration' => 50
595
+ );
596
+ }
597
+
598
+ public static function is_ajax(){
599
+ return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') ? true : false ;
600
+ }
601
+
602
+ }
603
+
604
+ PMXE_Plugin::getInstance();
605
+
606
+ }