WooCommerce – Store Exporter - Version 1.8.2

Version Description

  • Added: Order support for Extra Product Options
  • Fixed: Detect corrupted Date Format
  • Added: Detection of corrupted WordPress options at export time
  • Added: Total Sales to Products export
  • Fixed: Advanced Google Product Feed not being included in Products export
  • Added: Custom User meta to Customers export
  • Added: Support for exporting Shipping Classes
  • Changed: Product URL is now External URL
  • Added: Product URL is the absolute URL to the Product
  • Added: Support for custom User fields
  • Fixed: Admin notice not showing for saving custom fields
Download this release

Release Info

Developer visser
Plugin Icon 128x128 WooCommerce – Store Exporter
Version 1.8.2
Comparing to
See all releases

Version 1.8.2

Files changed (60) hide show
  1. common/common.php +95 -0
  2. exporter.php +549 -0
  3. includes/admin.php +639 -0
  4. includes/brands.php +115 -0
  5. includes/categories.php +198 -0
  6. includes/common-dashboard_widgets.php +54 -0
  7. includes/coupons.php +188 -0
  8. includes/customers.php +261 -0
  9. includes/export-csv.php +49 -0
  10. includes/formatting.php +516 -0
  11. includes/functions.php +876 -0
  12. includes/install.php +41 -0
  13. includes/legacy.php +10 -0
  14. includes/orders.php +1255 -0
  15. includes/product_vendors.php +86 -0
  16. includes/products.php +1391 -0
  17. includes/settings.php +319 -0
  18. includes/shipping_classes.php +89 -0
  19. includes/subscriptions.php +118 -0
  20. includes/tags.php +165 -0
  21. includes/users.php +324 -0
  22. js/jquery-ui.js +48 -0
  23. js/jquery.chosen.js +988 -0
  24. js/jquery.csvToTable.js +154 -0
  25. js/ui-datepicker.js +84 -0
  26. languages/woo_ce-en_GB.mo +0 -0
  27. languages/woo_ce-en_GB.po +97 -0
  28. license.txt +281 -0
  29. readme.txt +576 -0
  30. templates/admin/chosen-sprite.png +0 -0
  31. templates/admin/chosen.css +397 -0
  32. templates/admin/export.css +102 -0
  33. templates/admin/export.js +347 -0
  34. templates/admin/images/animated-overlay.gif +0 -0
  35. templates/admin/images/progress.gif +0 -0
  36. templates/admin/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  37. templates/admin/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  38. templates/admin/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  39. templates/admin/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  40. templates/admin/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  41. templates/admin/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  42. templates/admin/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  43. templates/admin/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  44. templates/admin/images/ui-icons_222222_256x240.png +0 -0
  45. templates/admin/images/ui-icons_2e83ff_256x240.png +0 -0
  46. templates/admin/images/ui-icons_454545_256x240.png +0 -0
  47. templates/admin/images/ui-icons_888888_256x240.png +0 -0
  48. templates/admin/images/ui-icons_cd0a0a_256x240.png +0 -0
  49. templates/admin/jquery-csvtable.css +40 -0
  50. templates/admin/jquery-ui-datepicker.css +347 -0
  51. templates/admin/media-csv_file.php +12 -0
  52. templates/admin/media-export_details.php +54 -0
  53. templates/admin/tabs-archive.php +80 -0
  54. templates/admin/tabs-export.php +846 -0
  55. templates/admin/tabs-fields.php +28 -0
  56. templates/admin/tabs-overview.php +125 -0
  57. templates/admin/tabs-settings.php +155 -0
  58. templates/admin/tabs-tools.php +30 -0
  59. templates/admin/tabs.php +13 -0
  60. templates/admin/woocommerce-admin_dashboard_vm-plugins.css +55 -0
common/common.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Filename: common.php
5
+ * Description: common.php loads commonly accessed functions across the Visser Labs suite.
6
+ *
7
+ * Free
8
+ * - woo_get_action
9
+ * - woo_is_wpsc_activated
10
+ * - woo_is_woo_activated
11
+ * - woo_is_jigo_activated
12
+ * - woo_is_exchange_activated
13
+ * - woo_get_woo_version
14
+ *
15
+ */
16
+
17
+ if( is_admin() ) {
18
+
19
+ /* Start of: WordPress Administration */
20
+
21
+ // Load Dashboard widgets
22
+ include_once( WOO_CE_PATH . 'includes/common-dashboard_widgets.php' );
23
+
24
+ /* End of: WordPress Administration */
25
+
26
+ }
27
+
28
+ if( !function_exists( 'woo_get_action' ) ) {
29
+ function woo_get_action( $prefer_get = false ) {
30
+
31
+ if ( isset( $_GET['action'] ) && $prefer_get )
32
+ return sanitize_text_field( $_GET['action'] );
33
+
34
+ if ( isset( $_POST['action'] ) )
35
+ return sanitize_text_field( $_POST['action'] );
36
+
37
+ if ( isset( $_GET['action'] ) )
38
+ return sanitize_text_field( $_GET['action'] );
39
+
40
+ return false;
41
+
42
+ }
43
+ }
44
+
45
+ if( !function_exists( 'woo_is_wpsc_activated' ) ) {
46
+ function woo_is_wpsc_activated() {
47
+
48
+ if( class_exists( 'WP_eCommerce' ) || defined( 'WPSC_VERSION' ) )
49
+ return true;
50
+
51
+ }
52
+ }
53
+
54
+ if( !function_exists( 'woo_is_woo_activated' ) ) {
55
+ function woo_is_woo_activated() {
56
+
57
+ if( class_exists( 'Woocommerce' ) )
58
+ return true;
59
+
60
+ }
61
+ }
62
+
63
+ if( !function_exists( 'woo_is_jigo_activated' ) ) {
64
+ function woo_is_jigo_activated() {
65
+
66
+ if( function_exists( 'jigoshop_init' ) )
67
+ return true;
68
+
69
+ }
70
+ }
71
+
72
+ if( !function_exists( 'woo_is_exchange_activated' ) ) {
73
+ function woo_is_exchange_activated() {
74
+
75
+ if( function_exists( 'IT_Exchange' ) )
76
+ return true;
77
+
78
+ }
79
+ }
80
+
81
+ if( !function_exists( 'woo_get_woo_version' ) ) {
82
+ function woo_get_woo_version() {
83
+
84
+ $version = false;
85
+ if( defined( 'WC_VERSION' ) ) {
86
+ $version = WC_VERSION;
87
+ // Backwards compatibility
88
+ } else if( defined( 'WOOCOMMERCE_VERSION' ) ) {
89
+ $version = WOOCOMMERCE_VERSION;
90
+ }
91
+ return $version;
92
+
93
+ }
94
+ }
95
+ ?>
exporter.php ADDED
@@ -0,0 +1,549 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WooCommerce - Store Exporter
4
+ Plugin URI: http://www.visser.com.au/woocommerce/plugins/exporter/
5
+ Description: Export store details out of WooCommerce into simple formatted files (e.g. CSV, XML, Excel 2007 XLS, etc.).
6
+ Version: 1.8.2
7
+ Author: Visser Labs
8
+ Author URI: http://www.visser.com.au/about/
9
+ License: GPL2
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
+
14
+ define( 'WOO_CE_DIRNAME', basename( dirname( __FILE__ ) ) );
15
+ define( 'WOO_CE_RELPATH', basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
16
+ define( 'WOO_CE_PATH', plugin_dir_path( __FILE__ ) );
17
+ define( 'WOO_CE_PREFIX', 'woo_ce' );
18
+
19
+ // Turn this on to enable additional debugging options at export time
20
+ define( 'WOO_CE_DEBUG', false );
21
+
22
+ // Avoid conflicts if Store Exporter Deluxe is activated
23
+ include_once( WOO_CE_PATH . 'common/common.php' );
24
+ if( defined( 'WOO_CD_PREFIX' ) == false )
25
+ include_once( WOO_CE_PATH . 'includes/functions.php' );
26
+
27
+ function woo_ce_i18n() {
28
+
29
+ load_plugin_textdomain( 'woo_ce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
30
+
31
+ }
32
+ add_action( 'init', 'woo_ce_i18n' );
33
+
34
+ if( is_admin() ) {
35
+
36
+ /* Start of: WordPress Administration */
37
+
38
+ include_once( WOO_CE_PATH . 'includes/install.php' );
39
+ register_activation_hook( __FILE__, 'woo_ce_install' );
40
+
41
+ // Initial scripts and export process
42
+ function woo_ce_admin_init() {
43
+
44
+ global $export, $wp_roles;
45
+
46
+ // Now is the time to de-activate Store Exporter if Store Exporter Deluxe is activated
47
+ if( defined( 'WOO_CD_PREFIX' ) ) {
48
+ include_once( WOO_CE_PATH . 'includes/install.php' );
49
+ woo_ce_deactivate_ce();
50
+ return;
51
+ }
52
+
53
+ // Detect if WooCommerce Subscriptions Exporter is activated
54
+ if( function_exists( 'wc_subs_exporter_admin_init' ) ) {
55
+ $message = sprintf( __( 'We have detected a WooCommerce Plugin that is activated and known to conflict with Store Exporter, please de-activate WooCommerce Subscriptions Exporter to resolve export issues. <a href="%s" target="_blank">Need help?</a>', 'woo_ce' ), $troubleshooting_url );
56
+ woo_cd_admin_notice( $message, 'error', array( 'plugins.php', 'admin.php' ) );
57
+ }
58
+
59
+ // Check that we are on the Store Exporter screen
60
+ $page = ( isset($_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : false );
61
+ if( $page != strtolower( WOO_CE_PREFIX ) )
62
+ return;
63
+
64
+ // Detect other platform versions
65
+ woo_ce_detect_non_woo_install();
66
+
67
+ // Add Store Exporter widgets to Export screen
68
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_category' );
69
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_tag' );
70
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_status' );
71
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_type' );
72
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_stock_status' );
73
+ add_action( 'woo_ce_export_product_options_after_table', 'woo_ce_product_sorting' );
74
+ add_action( 'woo_ce_export_category_options_after_table', 'woo_ce_category_sorting' );
75
+ add_action( 'woo_ce_export_tag_options_after_table', 'woo_ce_tag_sorting' );
76
+ add_action( 'woo_ce_export_user_options_after_table', 'woo_ce_user_sorting' );
77
+ add_action( 'woo_ce_export_shipping_class_options_after_table', 'woo_ce_shipping_class_sorting' );
78
+ add_action( 'woo_ce_export_options', 'woo_ce_products_upsells_formatting' );
79
+ add_action( 'woo_ce_export_options', 'woo_ce_products_crosssells_formatting' );
80
+ add_action( 'woo_ce_export_after_form', 'woo_ce_products_custom_fields' );
81
+ add_action( 'woo_ce_export_after_form', 'woo_ce_users_custom_fields' );
82
+ add_action( 'woo_ce_export_after_form', 'woo_ce_customers_custom_fields' );
83
+
84
+ // Add Store Exporter Deluxe widgets to Export screen
85
+ add_action( 'woo_ce_export_brand_options_before_table', 'woo_ce_brand_sorting' );
86
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_date' );
87
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_status' );
88
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_customer' );
89
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_user_role' );
90
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_coupon' );
91
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_product_category' );
92
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_product_tag' );
93
+ add_action( 'woo_ce_export_order_options_after_table', 'woo_ce_order_sorting' );
94
+ add_action( 'woo_ce_export_customer_options_before_table', 'woo_ce_customers_filter_by_status' );
95
+ add_action( 'woo_ce_export_coupon_options_before_table', 'woo_ce_coupon_sorting' );
96
+ add_action( 'woo_ce_export_options', 'woo_ce_orders_items_formatting' );
97
+ add_action( 'woo_ce_export_options', 'woo_ce_orders_max_order_items' );
98
+ add_action( 'woo_ce_export_options', 'woo_ce_orders_items_types' );
99
+ add_action( 'woo_ce_export_after_form', 'woo_ce_orders_custom_fields' );
100
+ add_action( 'woo_ce_export_options', 'woo_ce_export_options_export_format' );
101
+ add_action( 'woo_ce_export_options', 'woo_ce_export_options_gallery_format' );
102
+
103
+ // Add Store Exporter Deluxe options to Settings screen
104
+ add_action( 'woo_ce_export_settings_top', 'woo_ce_export_settings_quicklinks' );
105
+ add_action( 'woo_ce_export_settings_general', 'woo_ce_export_settings_additional' );
106
+ add_action( 'woo_ce_export_settings_after', 'woo_ce_export_settings_cron' );
107
+
108
+ // Process any pre-import notice confirmations
109
+ $action = woo_get_action();
110
+ switch( $action ) {
111
+
112
+ // Prompt on Export screen when insufficient memory (less than 64M is allocated)
113
+ case 'dismiss_memory_prompt':
114
+ woo_ce_update_option( 'dismiss_memory_prompt', 1 );
115
+ $url = add_query_arg( 'action', null );
116
+ wp_redirect( $url );
117
+ exit();
118
+ break;
119
+
120
+ // Prompt on Export screen when insufficient memory (less than 64M is allocated)
121
+ case 'dismiss_php_legacy':
122
+ woo_ce_update_option( 'dismiss_php_legacy', 1 );
123
+ $url = add_query_arg( 'action', null );
124
+ wp_redirect( $url );
125
+ exit();
126
+ break;
127
+
128
+ // Save skip overview preference
129
+ case 'skip_overview':
130
+ $skip_overview = false;
131
+ if( isset( $_POST['skip_overview'] ) )
132
+ $skip_overview = 1;
133
+ woo_ce_update_option( 'skip_overview', $skip_overview );
134
+
135
+ if( $skip_overview == 1 ) {
136
+ $url = add_query_arg( 'tab', 'export' );
137
+ wp_redirect( $url );
138
+ exit();
139
+ }
140
+ break;
141
+
142
+ // This is where the magic happens
143
+ case 'export':
144
+
145
+ // Set up the basic export options
146
+ $export = new stdClass();
147
+ $export->cron = 0;
148
+ $export->start_time = time();
149
+ $export->idle_memory_start = woo_ce_current_memory_usage();
150
+ $export->delete_file = woo_ce_get_option( 'delete_file', 0 );
151
+ $export->encoding = woo_ce_get_option( 'encoding', get_option( 'blog_charset', 'UTF-8' ) );
152
+ // Reset the Encoding if corrupted
153
+ if( $export->encoding == '' || $export->encoding == false || $export->encoding == 'System default' ) {
154
+ $export->encoding = 'UTF-8';
155
+ woo_ce_update_option( 'encoding', 'UTF-8' );
156
+ }
157
+ $export->delimiter = woo_ce_get_option( 'delimiter', ',' );
158
+ // Reset the Delimiter if corrupted
159
+ if( $export->delimiter == '' || $export->delimiter == false ) {
160
+ $export->delimiter = ',';
161
+ woo_ce_update_option( 'delimiter', ',' );
162
+ }
163
+ $export->category_separator = woo_ce_get_option( 'category_separator', '|' );
164
+ // Reset the Category Separator if corrupted
165
+ if( $export->category_separator == '' || $export->category_separator == false ) {
166
+ $export->category_separator = '|';
167
+ woo_ce_update_option( 'category_separator', '|' );
168
+ }
169
+ $export->bom = woo_ce_get_option( 'bom', 1 );
170
+ $export->escape_formatting = woo_ce_get_option( 'escape_formatting', 'all' );
171
+ // Reset the Escape Formatting if corrupted
172
+ if( $export->escape_formatting == '' || $export->escape_formatting == false ) {
173
+ $export->escape_formatting = 'all';
174
+ woo_ce_update_option( 'escape_formatting', 'all' );
175
+ }
176
+ $export->date_format = woo_ce_get_option( 'date_format', 'd/m/Y' );
177
+ // Reset the Date Format if corrupted
178
+ if( $export->date_format == '1' || $export->date_format == '' || $export->date_format == false ) {
179
+ $export->date_format = 'd/m/Y';
180
+ woo_ce_update_option( 'date_format', 'd/m/Y' );
181
+ }
182
+
183
+ // Save export option changes made on the Export screen
184
+ $export->limit_volume = ( isset( $_POST['limit_volume'] ) ? sanitize_text_field( $_POST['limit_volume'] ) : '' );
185
+ woo_ce_update_option( 'limit_volume', $export->limit_volume );
186
+ if( $export->limit_volume == '' )
187
+ $export->limit_volume = -1;
188
+ $export->offset = ( isset( $_POST['offset'] ) ? sanitize_text_field( $_POST['offset'] ) : '' );
189
+ woo_ce_update_option( 'offset', $export->offset );
190
+ if( $export->offset == '' )
191
+ $export->offset = 0;
192
+
193
+ // Set default values for all export options to be later passed onto the export process
194
+ $export->fields = false;
195
+ $export->fields_order = false;
196
+ $export->export_format = 'csv';
197
+
198
+ // Product sorting
199
+ $export->product_categories = false;
200
+ $export->product_tags = false;
201
+ $export->product_status = false;
202
+ $export->product_type = false;
203
+ $export->product_orderby = false;
204
+ $export->product_order = false;
205
+ $export->upsell_formatting = false;
206
+ $export->crosssell_formatting = false;
207
+
208
+ // Category sorting
209
+ $export->category_orderby = false;
210
+ $export->category_order = false;
211
+
212
+ // Tag sorting
213
+ $export->tag_orderby = false;
214
+ $export->tag_order = false;
215
+
216
+ // User sorting
217
+ $export->user_orderby = false;
218
+ $export->user_order = false;
219
+
220
+ $export->type = ( isset( $_POST['dataset'] ) ? sanitize_text_field( $_POST['dataset'] ) : false );
221
+ if( $export->type )
222
+ woo_ce_update_option( 'last_export', $export->type );
223
+ switch( $export->type ) {
224
+
225
+ case 'product':
226
+ // Set up dataset specific options
227
+ $export->fields = ( isset( $_POST['product_fields'] ) ? array_map( 'sanitize_text_field', $_POST['product_fields'] ) : false );
228
+ $export->fields_order = ( isset( $_POST['product_fields_order'] ) ? array_map( 'absint', $_POST['product_fields_order'] ) : false );
229
+ $export->product_categories = ( isset( $_POST['product_filter_category'] ) ? woo_ce_format_product_filters( array_map( 'absint', $_POST['product_filter_category'] ) ) : false );
230
+ $export->product_tags = ( isset( $_POST['product_filter_tag'] ) ? woo_ce_format_product_filters( array_map( 'absint', $_POST['product_filter_tag'] ) ) : false );
231
+ $export->product_status = ( isset( $_POST['product_filter_status'] ) ? woo_ce_format_product_filters( array_map( 'sanitize_text_field', $_POST['product_filter_status'] ) ) : false );
232
+ $export->product_type = ( isset( $_POST['product_filter_type'] ) ? woo_ce_format_product_filters( array_map( 'sanitize_text_field', $_POST['product_filter_type'] ) ) : false );
233
+ $export->product_orderby = ( isset( $_POST['product_orderby'] ) ? sanitize_text_field( $_POST['product_orderby'] ) : false );
234
+ $export->product_order = ( isset( $_POST['product_order'] ) ? sanitize_text_field( $_POST['product_order'] ) : false );
235
+ $export->upsell_formatting = ( isset( $_POST['product_upsell_formatting'] ) ? absint( $_POST['product_upsell_formatting'] ) : false );
236
+ $export->crosssell_formatting = ( isset( $_POST['product_crosssell_formatting'] ) ? absint( $_POST['product_crosssell_formatting'] ) : false );
237
+
238
+ // Save dataset export specific options
239
+ if( $export->product_orderby <> woo_ce_get_option( 'product_orderby' ) )
240
+ woo_ce_update_option( 'product_orderby', $export->product_orderby );
241
+ if( $export->product_order <> woo_ce_get_option( 'product_order' ) )
242
+ woo_ce_update_option( 'product_order', $export->product_order );
243
+ if( $export->upsell_formatting <> woo_ce_get_option( 'upsell_formatting' ) )
244
+ woo_ce_update_option( 'upsell_formatting', $export->upsell_formatting );
245
+ if( $export->crosssell_formatting <> woo_ce_get_option( 'crosssell_formatting' ) )
246
+ woo_ce_update_option( 'crosssell_formatting', $export->crosssell_formatting );
247
+ break;
248
+
249
+ case 'category':
250
+ // Set up dataset specific options
251
+ $export->fields = ( isset( $_POST['category_fields'] ) ? array_map( 'sanitize_text_field', $_POST['category_fields'] ) : false );
252
+ $export->fields_order = ( isset( $_POST['category_fields_order'] ) ? array_map( 'absint', $_POST['category_fields_order'] ) : false );
253
+ $export->category_orderby = ( isset( $_POST['category_orderby'] ) ? sanitize_text_field( $_POST['category_orderby'] ) : false );
254
+ $export->category_order = ( isset( $_POST['category_order'] ) ? sanitize_text_field( $_POST['category_order'] ) : false );
255
+
256
+ // Save dataset export specific options
257
+ if( $export->category_orderby <> woo_ce_get_option( 'category_orderby' ) )
258
+ woo_ce_update_option( 'category_orderby', $export->category_orderby );
259
+ if( $export->category_order <> woo_ce_get_option( 'category_order' ) )
260
+ woo_ce_update_option( 'category_order', $export->category_order );
261
+ break;
262
+
263
+ case 'tag':
264
+ // Set up dataset specific options
265
+ $export->fields = ( isset( $_POST['tag_fields'] ) ? array_map( 'sanitize_text_field', $_POST['tag_fields'] ) : false );
266
+ $export->fields_order = ( isset( $_POST['tag_fields_order'] ) ? array_map( 'absint', $_POST['tag_fields_order'] ) : false );
267
+ $export->tag_orderby = ( isset( $_POST['tag_orderby'] ) ? sanitize_text_field( $_POST['tag_orderby'] ) : false );
268
+ $export->tag_order = ( isset( $_POST['tag_order'] ) ? sanitize_text_field( $_POST['tag_order'] ) : false );
269
+
270
+ // Save dataset export specific options
271
+ if( $export->tag_orderby <> woo_ce_get_option( 'tag_orderby' ) )
272
+ woo_ce_update_option( 'tag_orderby', $export->tag_orderby );
273
+ if( $export->tag_order <> woo_ce_get_option( 'tag_order' ) )
274
+ woo_ce_update_option( 'tag_order', $export->tag_order );
275
+ break;
276
+
277
+ case 'user':
278
+ // Set up dataset specific options
279
+ $export->fields = array_map( 'sanitize_text_field', $_POST['user_fields'] );
280
+ $export->fields_order = ( isset( $_POST['user_fields_order'] ) ? array_map( 'absint', $_POST['user_fields_order'] ) : false );
281
+ $export->user_orderby = ( isset( $_POST['user_orderby'] ) ? sanitize_text_field( $_POST['user_orderby'] ) : false );
282
+ $export->user_order = ( isset( $_POST['user_order'] ) ? sanitize_text_field( $_POST['user_order'] ) : false );
283
+
284
+ // Save dataset export specific options
285
+ if( $export->user_orderby <> woo_ce_get_option( 'user_orderby' ) )
286
+ woo_ce_update_option( 'user_orderby', $export->user_orderby );
287
+ if( $export->user_order <> woo_ce_get_option( 'user_order' ) )
288
+ woo_ce_update_option( 'user_order', $export->user_order );
289
+ break;
290
+
291
+ }
292
+ if( $export->type ) {
293
+
294
+ $timeout = 600;
295
+ if( isset( $_POST['timeout'] ) ) {
296
+ $timeout = absint( (int)$_POST['timeout'] );
297
+ if( $timeout <> woo_ce_get_option( 'timeout' ) )
298
+ woo_ce_update_option( 'timeout', $timeout );
299
+ }
300
+ if( !ini_get( 'safe_mode' ) )
301
+ @set_time_limit( (int)$timeout );
302
+
303
+ @ini_set( 'memory_limit', WP_MAX_MEMORY_LIMIT );
304
+ @ini_set( 'max_execution_time', (int)$timeout );
305
+
306
+ $export->args = array(
307
+ 'limit_volume' => $export->limit_volume,
308
+ 'offset' => $export->offset,
309
+ 'encoding' => $export->encoding,
310
+ 'date_format' => $export->date_format,
311
+ 'product_categories' => $export->product_categories,
312
+ 'product_tags' => $export->product_tags,
313
+ 'product_status' => $export->product_status,
314
+ 'product_type' => $export->product_type,
315
+ 'product_orderby' => $export->product_orderby,
316
+ 'product_order' => $export->product_order,
317
+ 'category_orderby' => $export->category_orderby,
318
+ 'category_order' => $export->category_order,
319
+ 'tag_orderby' => $export->tag_orderby,
320
+ 'tag_order' => $export->tag_order,
321
+ 'user_orderby' => $export->user_orderby,
322
+ 'user_order' => $export->user_order
323
+ );
324
+ woo_ce_save_fields( $export->type, $export->fields, $export->fields_order );
325
+
326
+ if( $export->export_format == 'csv' ) {
327
+ $export->filename = woo_ce_generate_csv_filename( $export->type );
328
+ }
329
+
330
+ // Print file contents to debug export screen
331
+ if( WOO_CE_DEBUG ) {
332
+
333
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
334
+ woo_ce_export_dataset( $export->type );
335
+ }
336
+ $export->idle_memory_end = woo_ce_current_memory_usage();
337
+ $export->end_time = time();
338
+
339
+ // Print file contents to browser
340
+ } else {
341
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
342
+
343
+ // Generate CSV contents
344
+ $bits = woo_ce_export_dataset( $export->type );
345
+ unset( $export->fields );
346
+ if( !$bits ) {
347
+ $message = __( 'No export entries were found, please try again with different export filters.', 'woo_ce' );
348
+ woo_ce_admin_notice( $message, 'error' );
349
+ return;
350
+ }
351
+ if( $export->delete_file ) {
352
+
353
+ // Print to browser
354
+ if( $export->export_format == 'csv' )
355
+ woo_ce_generate_csv_header( $export->type );
356
+ echo $bits;
357
+ exit();
358
+
359
+ } else {
360
+
361
+ // Save to file and insert to WordPress Media
362
+ if( $export->filename && $bits ) {
363
+ if( $export->export_format == 'csv' )
364
+ $post_ID = woo_ce_save_file_attachment( $export->filename, 'text/csv' );
365
+ $upload = wp_upload_bits( $export->filename, null, $bits );
366
+ if( ( $post_ID == false ) || $upload['error'] ) {
367
+ wp_delete_attachment( $post_ID, true );
368
+ if( isset( $upload['error'] ) )
369
+ wp_redirect( add_query_arg( array( 'failed' => true, 'message' => urlencode( $upload['error'] ) ) ) );
370
+ else
371
+ wp_redirect( add_query_arg( array( 'failed' => true ) ) );
372
+ return;
373
+ }
374
+ $attach_data = wp_generate_attachment_metadata( $post_ID, $upload['file'] );
375
+ wp_update_attachment_metadata( $post_ID, $attach_data );
376
+ update_attached_file( $post_ID, $upload['file'] );
377
+ if( $post_ID ) {
378
+ woo_ce_save_file_guid( $post_ID, $export->type, $upload['url'] );
379
+ woo_ce_save_file_details( $post_ID );
380
+ }
381
+ $export_type = $export->type;
382
+ unset( $export );
383
+
384
+ // The end memory usage and time is collected at the very last opportunity prior to the CSV header being rendered to the screen
385
+ woo_ce_update_file_detail( $post_ID, '_woo_idle_memory_end', woo_ce_current_memory_usage() );
386
+ woo_ce_update_file_detail( $post_ID, '_woo_end_time', time() );
387
+
388
+ // Generate CSV header
389
+ woo_ce_generate_csv_header( $export_type );
390
+ unset( $export_type );
391
+
392
+ // Print file contents to screen
393
+ if( $upload['file'] )
394
+ readfile( $upload['file'] );
395
+ else
396
+ wp_redirect( add_query_arg( 'failed', true ) );
397
+ unset( $upload );
398
+ } else {
399
+ wp_redirect( add_query_arg( 'failed', true ) );
400
+ }
401
+
402
+ }
403
+
404
+ }
405
+ exit();
406
+ }
407
+ }
408
+ break;
409
+
410
+ // Save changes on Settings screen
411
+ case 'save-settings':
412
+ // Sanitize each setting field as needed
413
+ woo_ce_update_option( 'export_filename', strip_tags( (string)$_POST['export_filename'] ) );
414
+ woo_ce_update_option( 'delete_file', sanitize_text_field( (int)$_POST['delete_file'] ) );
415
+ woo_ce_update_option( 'encoding', sanitize_text_field( (string)$_POST['encoding'] ) );
416
+ woo_ce_update_option( 'delimiter', sanitize_text_field( (string)$_POST['delimiter'] ) );
417
+ woo_ce_update_option( 'category_separator', sanitize_text_field( (string)$_POST['category_separator'] ) );
418
+ woo_ce_update_option( 'bom', absint( (int)$_POST['bom'] ) );
419
+ woo_ce_update_option( 'escape_formatting', sanitize_text_field( (string)$_POST['escape_formatting'] ) );
420
+ if( $_POST['date_format'] == 'custom' && !empty( $_POST['date_format_custom'] ) )
421
+ woo_ce_update_option( 'date_format', sanitize_text_field( (string)$_POST['date_format_custom'] ) );
422
+ else
423
+ woo_ce_update_option( 'date_format', sanitize_text_field( (string)$_POST['date_format'] ) );
424
+
425
+ $message = __( 'Changes have been saved.', 'woo_ce' );
426
+ woo_ce_admin_notice( $message );
427
+ break;
428
+
429
+ // Save changes on Field Editor screen
430
+ case 'save-fields':
431
+ $fields = ( isset( $_POST['fields'] ) ? array_filter( $_POST['fields'] ) : array() );
432
+ $types = array_keys( woo_ce_return_export_types() );
433
+ $export_type = ( isset( $_POST['type'] ) ? sanitize_text_field( $_POST['type'] ) : '' );
434
+ if( in_array( $export_type, $types ) ) {
435
+ woo_ce_update_option( $export_type . '_labels', $fields );
436
+ $message = __( 'Changes have been saved.', 'woo_ce' );
437
+ woo_ce_admin_notice( $message );
438
+ } else {
439
+ $message = __( 'Changes could not be saved.', 'woo_ce' );
440
+ woo_ce_admin_notice( $message, 'error' );
441
+ }
442
+ break;
443
+
444
+ }
445
+
446
+ }
447
+ add_action( 'admin_init', 'woo_ce_admin_init', 10 );
448
+
449
+ // HTML templates and form processor for Store Exporter screen
450
+ function woo_ce_html_page() {
451
+
452
+ global $wpdb, $export;
453
+
454
+ $title = apply_filters( 'woo_ce_template_header', __( 'Store Exporter', 'woo_ce' ) );
455
+ woo_ce_template_header( $title );
456
+ woo_ce_support_donate();
457
+ $action = woo_get_action();
458
+ switch( $action ) {
459
+
460
+ case 'export':
461
+ $message = __( 'Chosen WooCommerce details have been exported from your store.', 'woo_ce' );
462
+ woo_ce_admin_notice( $message );
463
+ if( WOO_CE_DEBUG ) {
464
+ $output = '';
465
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
466
+ if( false === ( $export_log = get_transient( WOO_CE_PREFIX . '_debug_log' ) ) ) {
467
+ $export_log = __( 'No export entries were found, please try again with different export filters.', 'woo_ce' );
468
+ } else {
469
+ $export_log = base64_decode( $export_log );
470
+ delete_transient( WOO_CE_PREFIX . '_debug_log' );
471
+ }
472
+ $output = '
473
+ <h3>' . sprintf( __( 'Export Details: %s', 'woo_ce' ), esc_attr( $export->filename ) ) . '</h3>
474
+ <p>' . __( 'This prints the $export global that contains the different export options and filters to help reproduce this on another instance of WordPress. Very useful for debugging blank or unexpected exports.', 'woo_ce' ) . '</p>
475
+ <textarea id="export_log">' . esc_textarea( print_r( $export, true ) ) . '</textarea>
476
+ <hr />';
477
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
478
+ $output .= '
479
+ <script>
480
+ $j(function() {
481
+ $j(\'#export_sheet\').CSVToTable(\'\', { startLine: 0 });
482
+ });
483
+ </script>
484
+ <h3>' . __( 'Export', 'woo_ce' ) . '</h3>
485
+ <p>' . __( 'We use the <a href="http://code.google.com/p/jquerycsvtotable/" target="_blank"><em>CSV to Table plugin</em></a> to see first hand formatting errors or unexpected values within the export file.', 'woo_ce' ) . '</p>
486
+ <div id="export_sheet">' . esc_textarea( $export_log ) . '</div>
487
+ <p class="description">' . __( 'This jQuery plugin can fail with <code>\'Item count (#) does not match header count\'</code> notices which simply mean the number of headers detected does not match the number of cell contents.', 'woo_ce' ) . '</p>
488
+ <hr />';
489
+ }
490
+ $output .= '
491
+ <h3>' . __( 'Export Log', 'woo_ce' ) . '</h3>
492
+ <p>' . __( 'This prints the raw export contents and is helpful when the jQuery plugin above fails due to major formatting errors.', 'woo_ce' ) . '</p>
493
+ <textarea id="export_log" wrap="off">' . esc_textarea( $export_log ) . '</textarea>
494
+ <hr />
495
+ ';
496
+ echo $output;
497
+ }
498
+
499
+ woo_ce_manage_form();
500
+ break;
501
+
502
+ case 'update':
503
+ // Save Custom Product Meta
504
+ if( isset( $_POST['custom_products'] ) ) {
505
+ $custom_products = $_POST['custom_products'];
506
+ $custom_products = explode( "\n", trim( $custom_products ) );
507
+ $size = count( $custom_products );
508
+ if( $size ) {
509
+ for( $i = 0; $i < $size; $i++ )
510
+ $custom_products[$i] = sanitize_text_field( trim( $custom_products[$i] ) );
511
+ woo_ce_update_option( 'custom_products', $custom_products );
512
+ }
513
+ }
514
+
515
+ $message = __( 'Custom Fields saved.', 'woo_ce' );
516
+ woo_ce_admin_notice_html( $message );
517
+ woo_ce_manage_form();
518
+ break;
519
+
520
+ default:
521
+ woo_ce_manage_form();
522
+ break;
523
+
524
+ }
525
+ woo_ce_template_footer();
526
+
527
+ }
528
+
529
+ // HTML template for Export screen
530
+ function woo_ce_manage_form() {
531
+
532
+ $tab = false;
533
+ if( isset( $_GET['tab'] ) ) {
534
+ $tab = sanitize_text_field( $_GET['tab'] );
535
+ // If Skip Overview is set then jump to Export screen
536
+ } else if( woo_ce_get_option( 'skip_overview', false ) ) {
537
+ $tab = 'export';
538
+ }
539
+ $url = add_query_arg( 'page', 'woo_ce' );
540
+ woo_ce_fail_notices();
541
+
542
+ include_once( WOO_CE_PATH . 'templates/admin/tabs.php' );
543
+
544
+ }
545
+
546
+ /* End of: WordPress Administration */
547
+
548
+ }
549
+ ?>
includes/admin.php ADDED
@@ -0,0 +1,639 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Display admin notice on screen load
3
+ function woo_ce_admin_notice( $message = '', $priority = 'updated', $screen = '' ) {
4
+
5
+ if( $priority == false || $priority == '' )
6
+ $priority = 'updated';
7
+ if( $message <> '' ) {
8
+ ob_start();
9
+ woo_ce_admin_notice_html( $message, $priority, $screen );
10
+ $output = ob_get_contents();
11
+ ob_end_clean();
12
+ // Check if an existing notice is already in queue
13
+ $existing_notice = get_transient( WOO_CE_PREFIX . '_notice' );
14
+ if( $existing_notice !== false ) {
15
+ $existing_notice = base64_decode( $existing_notice );
16
+ $output = $existing_notice . $output;
17
+ }
18
+ set_transient( WOO_CE_PREFIX . '_notice', base64_encode( $output ), MINUTE_IN_SECONDS );
19
+ add_action( 'admin_notices', 'woo_ce_admin_notice_print' );
20
+ }
21
+
22
+ }
23
+
24
+ // HTML template for admin notice
25
+ function woo_ce_admin_notice_html( $message = '', $priority = 'updated', $screen = '' ) {
26
+
27
+ // Display admin notice on specific screen
28
+ if( !empty( $screen ) ) {
29
+
30
+ global $pagenow;
31
+
32
+ if( is_array( $screen ) ) {
33
+ if( in_array( $pagenow, $screen ) == false )
34
+ return;
35
+ } else {
36
+ if( $pagenow <> $screen )
37
+ return;
38
+ }
39
+
40
+ } ?>
41
+ <div id="message" class="<?php echo $priority; ?>">
42
+ <p><?php echo $message; ?></p>
43
+ </div>
44
+ <?php
45
+
46
+ }
47
+
48
+ // Grabs the WordPress transient that holds the admin notice and prints it
49
+ function woo_ce_admin_notice_print() {
50
+
51
+ $output = get_transient( WOO_CE_PREFIX . '_notice' );
52
+ if( $output !== false ) {
53
+ delete_transient( WOO_CE_PREFIX . '_notice' );
54
+ $output = base64_decode( $output );
55
+ echo $output;
56
+ }
57
+
58
+ }
59
+
60
+ // HTML template header on Store Exporter screen
61
+ function woo_ce_template_header( $title = '', $icon = 'woocommerce' ) {
62
+
63
+ if( $title )
64
+ $output = $title;
65
+ else
66
+ $output = __( 'Store Export', 'woo_ce' ); ?>
67
+ <div id="woo-ce" class="wrap">
68
+ <div id="icon-<?php echo $icon; ?>" class="icon32 icon32-woocommerce-importer"><br /></div>
69
+ <h2>
70
+ <?php echo $output; ?>
71
+ <a href="<?php echo add_query_arg( array( 'tab' => 'export', 'empty' => null ) ); ?>" class="add-new-h2"><?php _e( 'Add New', 'woo_ce' ); ?></a>
72
+ </h2>
73
+ <?php
74
+
75
+ }
76
+
77
+ // HTML template footer on Store Exporter screen
78
+ function woo_ce_template_footer() { ?>
79
+ </div>
80
+ <!-- .wrap -->
81
+ <?php
82
+
83
+ }
84
+
85
+ // Add Export and Docs links to the Plugins screen
86
+ function woo_ce_add_settings_link( $links, $file ) {
87
+
88
+ // Manually force slug
89
+ $this_plugin = WOO_CE_RELPATH;
90
+
91
+ if( $file == $this_plugin ) {
92
+ $docs_url = 'http://www.visser.com.au/docs/';
93
+ $docs_link = sprintf( '<a href="%s" target="_blank">' . __( 'Docs', 'woo_ce' ) . '</a>', $docs_url );
94
+ $export_link = sprintf( '<a href="%s">' . __( 'Export', 'woo_ce' ) . '</a>', add_query_arg( 'page', 'woo_ce', 'admin.php' ) );
95
+ array_unshift( $links, $docs_link );
96
+ array_unshift( $links, $export_link );
97
+ }
98
+ return $links;
99
+
100
+ }
101
+ add_filter( 'plugin_action_links', 'woo_ce_add_settings_link', 10, 2 );
102
+
103
+ // Add Store Export page to WooCommerce screen IDs
104
+ function woo_ce_wc_screen_ids( $screen_ids = array() ) {
105
+
106
+ $screen_ids[] = 'woocommerce_page_woo_ce';
107
+ return $screen_ids;
108
+
109
+ }
110
+ add_filter( 'woocommerce_screen_ids', 'woo_ce_wc_screen_ids', 10, 1 );
111
+
112
+ // Add Store Export to WordPress Administration menu
113
+ function woo_ce_admin_menu() {
114
+
115
+ $page = add_submenu_page( 'woocommerce', __( 'Store Exporter', 'woo_ce' ), __( 'Store Export', 'woo_ce' ), 'view_woocommerce_reports', 'woo_ce', 'woo_ce_html_page' );
116
+ add_action( 'admin_print_styles-' . $page, 'woo_ce_enqueue_scripts' );
117
+ add_action( 'current_screen', 'woo_ce_add_help_tab' );
118
+
119
+ }
120
+ add_action( 'admin_menu', 'woo_ce_admin_menu', 11 );
121
+
122
+ // Load CSS and jQuery scripts for Store Exporter screen
123
+ function woo_ce_enqueue_scripts( $hook ) {
124
+
125
+ // Simple check that WooCommerce is activated
126
+ if( class_exists( 'WooCommerce' ) ) {
127
+
128
+ global $woocommerce;
129
+
130
+ // Load WooCommerce default Admin styling
131
+ wp_enqueue_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css' );
132
+
133
+ }
134
+
135
+ // Date Picker
136
+ wp_enqueue_script( 'jquery-ui-datepicker' );
137
+ wp_enqueue_style( 'jquery-ui-datepicker', plugins_url( '/templates/admin/jquery-ui-datepicker.css', WOO_CE_RELPATH ) );
138
+
139
+ // Chosen
140
+ wp_enqueue_style( 'jquery-chosen', plugins_url( '/templates/admin/chosen.css', WOO_CE_RELPATH ) );
141
+ wp_enqueue_script( 'jquery-chosen', plugins_url( '/js/jquery.chosen.js', WOO_CE_RELPATH ), array( 'jquery' ) );
142
+
143
+ // Common
144
+ wp_enqueue_style( 'woo_ce_styles', plugins_url( '/templates/admin/export.css', WOO_CE_RELPATH ) );
145
+ wp_enqueue_script( 'woo_ce_scripts', plugins_url( '/templates/admin/export.js', WOO_CE_RELPATH ), array( 'jquery', 'jquery-ui-sortable' ) );
146
+ wp_enqueue_style( 'dashicons' );
147
+
148
+ if( WOO_CE_DEBUG ) {
149
+ wp_enqueue_style( 'jquery-csvToTable', plugins_url( '/templates/admin/jquery-csvtable.css', WOO_CE_RELPATH ) );
150
+ wp_enqueue_script( 'jquery-csvToTable', plugins_url( '/js/jquery.csvToTable.js', WOO_CE_RELPATH ), array( 'jquery' ) );
151
+ }
152
+ wp_enqueue_style( 'woo_vm_styles', plugins_url( '/templates/admin/woocommerce-admin_dashboard_vm-plugins.css', WOO_CE_RELPATH ) );
153
+
154
+ }
155
+
156
+ function woo_ce_add_help_tab() {
157
+
158
+ $screen = get_current_screen();
159
+ if( $screen->id <> 'woocommerce_page_woo_ce' )
160
+ return;
161
+
162
+ $screen->add_help_tab( array(
163
+ 'id' => 'woo_ce',
164
+ 'title' => __( 'Store Exporter', 'woo_ce' ),
165
+ 'content' =>
166
+ '<p>' . __( 'Thank you for using Store Exporter :) Should you need help using this Plugin please read the documentation, if an issue persists get in touch with us on the WordPress.org Support tab for this Plugin.', 'woo_ce' ) . '</p>' .
167
+ '<p><a href="' . 'http://www.visser.com.au/documentation/store-exporter/usage/' . '" target="_blank" class="button button-primary">' . __( 'Documentation', 'woo_ce' ) . '</a> <a href="' . 'http://wordpress.org/support/plugin/woocommerce-exporter' . '" target="_blank" class="button">' . __( 'Forum Support', 'woo_ce' ) . '</a></p>'
168
+ ) );
169
+
170
+ }
171
+
172
+ // HTML active class for the currently selected tab on the Store Exporter screen
173
+ function woo_ce_admin_active_tab( $tab_name = null, $tab = null ) {
174
+
175
+ if( isset( $_GET['tab'] ) && !$tab )
176
+ $tab = $_GET['tab'];
177
+ else if( !isset( $_GET['tab'] ) && woo_ce_get_option( 'skip_overview', false ) )
178
+ $tab = 'export';
179
+ else
180
+ $tab = 'overview';
181
+
182
+ $output = '';
183
+ if( isset( $tab_name ) && $tab_name ) {
184
+ if( $tab_name == $tab )
185
+ $output = ' nav-tab-active';
186
+ }
187
+ echo $output;
188
+
189
+ }
190
+
191
+ // HTML template for each tab on the Store Exporter screen
192
+ function woo_ce_tab_template( $tab = '' ) {
193
+
194
+ if( !$tab )
195
+ $tab = 'overview';
196
+
197
+ // Store Exporter Deluxe
198
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
199
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
200
+
201
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/';
202
+
203
+ switch( $tab ) {
204
+
205
+ case 'overview':
206
+ $skip_overview = woo_ce_get_option( 'skip_overview', false );
207
+ break;
208
+
209
+ case 'export':
210
+ $export_type = sanitize_text_field( ( isset( $_POST['dataset'] ) ? $_POST['dataset'] : woo_ce_get_option( 'last_export', 'product' ) ) );
211
+ $types = array_keys( woo_ce_return_export_types() );
212
+ // Check if the default export type exists
213
+ if( !in_array( $export_type, $types ) )
214
+ $export_type = 'product';
215
+
216
+ $products = woo_ce_return_count( 'product' );
217
+ $categories = woo_ce_return_count( 'category' );
218
+ $tags = woo_ce_return_count( 'tag' );
219
+ $brands = '999';
220
+ $orders = '999';
221
+ $customers = '999';
222
+ $users = woo_ce_return_count( 'user' );
223
+ $coupons = '999';
224
+ $attributes = '999';
225
+ $subscriptions = '999';
226
+ $product_vendors = '999';
227
+ $shipping_classes = '999';
228
+
229
+ if( $product_fields = woo_ce_get_product_fields() ) {
230
+ foreach( $product_fields as $key => $product_field )
231
+ $product_fields[$key]['disabled'] = ( isset( $product_field['disabled'] ) ? $product_field['disabled'] : 0 );
232
+ }
233
+ if( $category_fields = woo_ce_get_category_fields() ) {
234
+ foreach( $category_fields as $key => $category_field )
235
+ $category_fields[$key]['disabled'] = ( isset( $category_field['disabled'] ) ? $category_field['disabled'] : 0 );
236
+ }
237
+ if( $tag_fields = woo_ce_get_tag_fields() ) {
238
+ foreach( $tag_fields as $key => $tag_field )
239
+ $tag_fields[$key]['disabled'] = ( isset( $tag_field['disabled'] ) ? $tag_field['disabled'] : 0 );
240
+ }
241
+ if( $brand_fields = woo_ce_get_brand_fields() ) {
242
+ foreach( $brand_fields as $key => $brand_field )
243
+ $brand_fields[$key]['disabled'] = ( isset( $brand_field['disabled'] ) ? $brand_field['disabled'] : 0 );
244
+ }
245
+ $order_fields = woo_ce_get_order_fields();
246
+ $customer_fields = woo_ce_get_customer_fields();
247
+ if( $user_fields = woo_ce_get_user_fields() ) {
248
+ foreach( $user_fields as $key => $user_field )
249
+ $user_fields[$key]['disabled'] = ( isset( $user_field['disabled'] ) ? $user_field['disabled'] : 0 );
250
+ }
251
+ $coupon_fields = woo_ce_get_coupon_fields();
252
+ $subscription_fields = woo_ce_get_subscription_fields();
253
+ $product_vendor_fields = woo_ce_get_product_vendor_fields();
254
+ $shipping_class_fields = woo_ce_get_shipping_class_fields();
255
+ $attribute_fields = false;
256
+
257
+ // Export modules
258
+ $modules = woo_ce_modules_list();
259
+
260
+ // Export options
261
+ $limit_volume = woo_ce_get_option( 'limit_volume' );
262
+ $offset = woo_ce_get_option( 'offset' );
263
+ break;
264
+
265
+ case 'fields':
266
+ $export_type = ( isset( $_GET['type'] ) ? sanitize_text_field( $_GET['type'] ) : '' );
267
+ $types = array_keys( woo_ce_return_export_types() );
268
+ $fields = array();
269
+ if( in_array( $export_type, $types ) ) {
270
+ if( has_filter( 'woo_ce_' . $export_type . '_fields', 'woo_ce_override_' . $export_type . '_field_labels' ) )
271
+ remove_filter( 'woo_ce_' . $export_type . '_fields', 'woo_ce_override_' . $export_type . '_field_labels', 11 );
272
+ if( function_exists( sprintf( 'woo_ce_get_%s_fields', $export_type ) ) )
273
+ $fields = call_user_func( 'woo_ce_get_' . $export_type . '_fields' );
274
+ $labels = woo_ce_get_option( $export_type . '_labels', array() );
275
+ }
276
+ break;
277
+
278
+ case 'archive':
279
+ if( isset( $_GET['deleted'] ) ) {
280
+ $message = __( 'Archived export has been deleted.', 'woo_ce' );
281
+ woo_ce_admin_notice( $message );
282
+ }
283
+ if( $files = woo_ce_get_archive_files() ) {
284
+ foreach( $files as $key => $file )
285
+ $files[$key] = woo_ce_get_archive_file( $file );
286
+ }
287
+ break;
288
+
289
+ case 'settings':
290
+ $export_filename = woo_ce_get_option( 'export_filename', '' );
291
+ // Default export filename
292
+ if( empty( $export_filename ) )
293
+ $export_filename = 'woo-export_%dataset%-%date%.csv';
294
+ $delete_file = woo_ce_get_option( 'delete_file', 0 );
295
+ $timeout = woo_ce_get_option( 'timeout', 0 );
296
+ $encoding = woo_ce_get_option( 'encoding', 'UTF-8' );
297
+ $bom = woo_ce_get_option( 'bom', 1 );
298
+ $delimiter = woo_ce_get_option( 'delimiter', ',' );
299
+ $category_separator = woo_ce_get_option( 'category_separator', '|' );
300
+ $escape_formatting = woo_ce_get_option( 'escape_formatting', 'all' );
301
+ $date_format = woo_ce_get_option( 'date_format', 'd/m/Y' );
302
+ if( $date_format == 1 || $date_format == '' )
303
+ $date_format = 'd/m/Y';
304
+ $file_encodings = ( function_exists( 'mb_list_encodings' ) ? mb_list_encodings() : false );
305
+ break;
306
+
307
+ case 'tools':
308
+ // Product Importer Deluxe
309
+ $woo_pd_url = 'http://www.visser.com.au/woocommerce/plugins/product-importer-deluxe/';
310
+ $woo_pd_target = ' target="_blank"';
311
+ if( function_exists( 'woo_pd_init' ) ) {
312
+ $woo_pd_url = add_query_arg( array( 'page' => 'woo_pd', 'tab' => null ) );
313
+ $woo_pd_target = false;
314
+ }
315
+
316
+ // Store Toolkit
317
+ $woo_st_url = 'http://www.visser.com.au/woocommerce/plugins/store-toolkit/';
318
+ $woo_st_target = ' target="_blank"';
319
+ if( function_exists( 'woo_st_admin_init' ) ) {
320
+ $woo_st_url = add_query_arg( array( 'page' => 'woo_st', 'tab' => null ) );
321
+ $woo_st_target = false;
322
+ }
323
+ break;
324
+
325
+ }
326
+ if( $tab ) {
327
+ if( file_exists( WOO_CE_PATH . 'templates/admin/tabs-' . $tab . '.php' ) ) {
328
+ include_once( WOO_CE_PATH . 'templates/admin/tabs-' . $tab . '.php' );
329
+ } else {
330
+ $message = sprintf( __( 'We couldn\'t load the export template file <code>%s</code> within <code>%s</code>, this file should be present.', 'woo_ce' ), 'tabs-' . $tab . '.php', WOO_CE_PATH . 'templates/admin/...' );
331
+ woo_ce_admin_notice_html( $message, 'error' );
332
+ ob_start(); ?>
333
+ <p><?php _e( 'You can see this error for one of a few common reasons', 'woo_ce' ); ?>:</p>
334
+ <ul class="ul-disc">
335
+ <li><?php _e( 'WordPress was unable to create this file when the Plugin was installed or updated', 'woo_ce' ); ?></li>
336
+ <li><?php _e( 'The Plugin files have been recently changed and there has been a file conflict', 'woo_ce' ); ?></li>
337
+ <li><?php _e( 'The Plugin file has been locked and cannot be opened by WordPress', 'woo_ce' ); ?></li>
338
+ </ul>
339
+ <p><?php _e( 'Jump onto our website and download a fresh copy of this Plugin as it might be enough to fix this issue. If this persists get in touch with us.', 'woo_ce' ); ?></p>
340
+ <?php
341
+ ob_end_flush();
342
+ }
343
+ }
344
+
345
+ }
346
+
347
+ // List of WordPress Plugins that Product Importer Deluxe integrates with
348
+ function woo_ce_modules_list( $modules = array() ) {
349
+
350
+ $modules[] = array(
351
+ 'name' => 'aioseop',
352
+ 'title' => __( 'All in One SEO Pack', 'woo_ce' ),
353
+ 'description' => __( 'Optimize your WooCommerce Products for Search Engines. Requires Store Toolkit for All in One SEO Pack integration.', 'woo_ce' ),
354
+ 'url' => 'http://wordpress.org/extend/plugins/all-in-one-seo-pack/',
355
+ 'slug' => 'all-in-one-seo-pack',
356
+ 'function' => 'aioseop_activate'
357
+ );
358
+ $modules[] = array(
359
+ 'name' => 'store_toolkit',
360
+ 'title' => __( 'Store Toolkit', 'woo_ce' ),
361
+ 'description' => __( 'Store Toolkit includes a growing set of commonly-used WooCommerce administration tools aimed at web developers and store maintainers.', 'woo_ce' ),
362
+ 'url' => 'http://wordpress.org/extend/plugins/woocommerce-store-toolkit/',
363
+ 'slug' => 'woocommerce-store-toolkit',
364
+ 'function' => 'woo_st_admin_init'
365
+ );
366
+ $modules[] = array(
367
+ 'name' => 'ultimate_seo',
368
+ 'title' => __( 'SEO Ultimate', 'woo_ce' ),
369
+ 'description' => __( 'This all-in-one SEO plugin gives you control over Product details.', 'woo_ce' ),
370
+ 'url' => 'http://wordpress.org/extend/plugins/seo-ultimate/',
371
+ 'slug' => 'seo-ultimate',
372
+ 'function' => 'su_wp_incompat_notice'
373
+ );
374
+ $modules[] = array(
375
+ 'name' => 'gpf',
376
+ 'title' => __( 'Advanced Google Product Feed', 'woo_ce' ),
377
+ 'description' => __( 'Easily configure data to be added to your Google Merchant Centre feed.', 'woo_ce' ),
378
+ 'url' => 'http://www.leewillis.co.uk/wordpress-plugins/',
379
+ 'function' => 'woocommerce_gpf_install'
380
+ );
381
+ $modules[] = array(
382
+ 'name' => 'wpseo',
383
+ 'title' => __( 'WordPress SEO by Yoast', 'woo_ce' ),
384
+ 'description' => __( 'The first true all-in-one SEO solution for WordPress.', 'woo_ce' ),
385
+ 'url' => 'http://yoast.com/wordpress/seo/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wpseoplugin',
386
+ 'slug' => 'wordpress-seo',
387
+ 'function' => 'wpseo_admin_init'
388
+ );
389
+ $modules[] = array(
390
+ 'name' => 'msrp',
391
+ 'title' => __( 'WooCommerce MSRP Pricing', 'woo_ce' ),
392
+ 'description' => __( 'Define and display MSRP prices (Manufacturer\'s suggested retail price) to your customers.', 'woo_ce' ),
393
+ 'url' => 'http://www.woothemes.com/products/msrp-pricing/',
394
+ 'function' => 'woocommerce_msrp_activate'
395
+ );
396
+ $modules[] = array(
397
+ 'name' => 'wc_brands',
398
+ 'title' => __( 'WooCommerce Brands Addon', 'woo_ce' ),
399
+ 'description' => __( 'Create, assign and list brands for products, and allow customers to filter by brand.', 'woo_ce' ),
400
+ 'url' => 'http://www.woothemes.com/products/brands/',
401
+ 'class' => 'WC_Brands'
402
+ );
403
+ $modules[] = array(
404
+ 'name' => 'wc_cog',
405
+ 'title' => __( 'Cost of Goods', 'woo_ce' ),
406
+ 'description' => __( 'Easily track total profit and cost of goods by adding a Cost of Good field to simple and variable products.', 'woo_ce' ),
407
+ 'url' => 'http://www.skyverge.com/product/woocommerce-cost-of-goods-tracking/',
408
+ 'class' => 'WC_COG'
409
+ );
410
+ $modules[] = array(
411
+ 'name' => 'per_product_shipping',
412
+ 'title' => __( 'Per-Product Shipping', 'woo_ce' ),
413
+ 'description' => __( 'Define separate shipping costs per product which are combined at checkout to provide a total shipping cost.', 'woo_ce' ),
414
+ 'url' => 'http://www.woothemes.com/products/per-product-shipping/',
415
+ 'function' => 'woocommerce_per_product_shipping_init'
416
+ );
417
+ $modules[] = array(
418
+ 'name' => 'vendors',
419
+ 'title' => __( 'Product Vendors', 'woo_ce' ),
420
+ 'description' => __( 'Turn your store into a multi-vendor marketplace (such as Etsy or Creative Market).', 'woo_ce' ),
421
+ 'url' => 'http://www.woothemes.com/products/product-vendors/',
422
+ 'class' => 'WooCommerce_Product_Vendors'
423
+ );
424
+ $modules[] = array(
425
+ 'name' => 'acf',
426
+ 'title' => __( 'Advanced Custom Fields', 'woo_ce' ),
427
+ 'description' => __( 'Powerful fields for WordPress developers.', 'woo_ce' ),
428
+ 'url' => 'http://www.advancedcustomfields.com',
429
+ 'class' => 'acf'
430
+ );
431
+ $modules[] = array(
432
+ 'name' => 'product_addons',
433
+ 'title' => __( 'Product Add-ons', 'woo_ce' ),
434
+ 'description' => __( 'Allow your customers to customise your products by adding input boxes, dropdowns or a field set of checkboxes.', 'woo_ce' ),
435
+ 'url' => 'http://www.woothemes.com/products/product-add-ons/',
436
+ 'class' => 'Product_Addon_Admin'
437
+ );
438
+ $modules[] = array(
439
+ 'name' => 'seq',
440
+ 'title' => __( 'WooCommerce Sequential Order Numbers', 'woo_ce' ),
441
+ 'description' => __( 'This plugin extends the WooCommerce e-commerce plugin by setting sequential order numbers for new orders.', 'woo_ce' ),
442
+ 'url' => 'https://wordpress.org/plugins/woocommerce-sequential-order-numbers/',
443
+ 'slug' => 'woocommerce-sequential-order-numbers',
444
+ 'class' => 'WC_Seq_Order_Number'
445
+ );
446
+ $modules[] = array(
447
+ 'name' => 'seq_pro',
448
+ 'title' => __( 'WooCommerce Sequential Order Numbers Pro', 'woo_ce' ),
449
+ 'description' => __( 'Tame your WooCommerce Order Numbers.', 'woo_ce' ),
450
+ 'url' => 'http://www.woothemes.com/products/sequential-order-numbers-pro/',
451
+ 'class' => 'WC_Seq_Order_Number'
452
+ );
453
+ $modules[] = array(
454
+ 'name' => 'print_invoice_delivery_note',
455
+ 'title' => __( 'WooCommerce Print Invoice & Delivery Note', 'woo_ce' ),
456
+ 'description' => __( 'Print invoices and delivery notes for WooCommerce orders.', 'woo_ce' ),
457
+ 'url' => 'http://wordpress.org/plugins/woocommerce-delivery-notes/',
458
+ 'slug' => 'woocommerce-delivery-notes',
459
+ 'class' => 'WooCommerce_Delivery_Notes'
460
+ );
461
+ $modules[] = array(
462
+ 'name' => 'pdf_invoices_packing_slips',
463
+ 'title' => __( 'WooCommerce PDF Invoices & Packing Slips', 'woo_ce' ),
464
+ 'description' => __( 'Create, print & automatically email PDF invoices & packing slips for WooCommerce orders.', 'woo_ce' ),
465
+ 'url' => 'https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/',
466
+ 'slug' => 'woocommerce-pdf-invoices-packing-slips',
467
+ 'class' => 'WooCommerce_PDF_Invoices'
468
+ );
469
+ $modules[] = array(
470
+ 'name' => 'checkout_manager',
471
+ 'title' => __( 'WooCommerce Checkout Manager', 'woo_ce' ),
472
+ 'description' => __( 'Manages WooCommerce Checkout.', 'woo_ce' ),
473
+ 'url' => 'http://wordpress.org/plugins/woocommerce-checkout-manager/',
474
+ 'slug' => 'woocommerce-checkout-manager',
475
+ 'function' => 'wccs_install'
476
+ );
477
+ $modules[] = array(
478
+ 'name' => 'checkout_manager_pro',
479
+ 'title' => __( 'WooCommerce Checkout Manager Pro', 'woo_ce' ),
480
+ 'description' => __( 'Manages the WooCommerce Checkout page and WooCommerce Checkout processes.', 'woo_ce' ),
481
+ 'url' => 'http://www.trottyzone.com/product/woocommerce-checkout-manager-pro',
482
+ 'function' => 'wccs_install'
483
+ );
484
+ $modules[] = array(
485
+ 'name' => 'pgsk',
486
+ 'title' => __( 'Poor Guys Swiss Knife', 'woo_ce' ),
487
+ 'description' => __( 'A Swiss Knife for WooCommerce.', 'woo_ce' ),
488
+ 'url' => 'http://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/',
489
+ 'slug' => 'woocommerce-poor-guys-swiss-knife',
490
+ 'function' => 'wcpgsk_init'
491
+ );
492
+ $modules[] = array(
493
+ 'name' => 'checkout_field_editor',
494
+ 'title' => __( 'Checkout Field Editor', 'woo_ce' ),
495
+ 'description' => __( 'Add, edit and remove fields shown on your WooCommerce checkout page.', 'woo_ce' ),
496
+ 'url' => 'http://www.woothemes.com/products/woocommerce-checkout-field-editor/',
497
+ 'function' => 'woocommerce_init_checkout_field_editor'
498
+ );
499
+ $modules[] = array(
500
+ 'name' => 'checkout_field_manager',
501
+ 'title' => __( 'Checkout Field Manager', 'woo_ce' ),
502
+ 'description' => __( 'Quickly and effortlessly add, remove and re-orders fields in the checkout process.', 'woo_ce' ),
503
+ 'url' => 'http://61extensions.com/shop/woocommerce-checkout-field-manager/',
504
+ 'function' => 'sod_woocommerce_checkout_manager_settings'
505
+ );
506
+ $modules[] = array(
507
+ 'name' => 'checkout_addons',
508
+ 'title' => __( 'WooCommerce Checkout Add-Ons', 'woo_ce' ),
509
+ 'description' => __( 'Add fields at checkout for add-on products and services while optionally setting a cost for each add-on.', 'woo_ce' ),
510
+ 'url' => 'http://www.skyverge.com/product/woocommerce-checkout-add-ons/',
511
+ 'function' => 'init_woocommerce_checkout_add_ons'
512
+ );
513
+ $modules[] = array(
514
+ 'name' => 'local_pickup_plus',
515
+ 'title' => __( 'Local Pickup Plus', 'woo_ce' ),
516
+ 'description' => __( 'Let customers pick up products from specific locations.', 'woo_ce' ),
517
+ 'url' => 'http://www.woothemes.com/products/local-pickup-plus/',
518
+ 'class' => 'WC_Local_Pickup_Plus'
519
+ );
520
+ $modules[] = array(
521
+ 'name' => 'gravity_forms',
522
+ 'title' => __( 'Gravity Forms', 'woo_ce' ),
523
+ 'description' => __( 'Gravity Forms is hands down the best contact form plugin for WordPress powered websites.', 'woo_ce' ),
524
+ 'url' => 'http://woothemes.com/woocommerce',
525
+ 'class' => 'RGForms'
526
+ );
527
+ $modules[] = array(
528
+ 'name' => 'currency_switcher',
529
+ 'title' => __( 'WooCommerce Currency Switcher', 'woo_ce' ),
530
+ 'description' => __( 'Currency Switcher for WooCommerce allows your shop to display prices and accept payments in multiple currencies.', 'woo_ce' ),
531
+ 'url' => 'http://aelia.co/shop/currency-switcher-woocommerce/',
532
+ 'class' => 'WC_Aelia_CurrencySwitcher'
533
+ );
534
+ $modules[] = array(
535
+ 'name' => 'subscriptions',
536
+ 'title' => __( 'WooCommerce Subscriptions', 'woo_ce' ),
537
+ 'description' => __( 'WC Subscriptions makes it easy to create and manage products with recurring payments.', 'woo_ce' ),
538
+ 'url' => 'http://www.woothemes.com/products/woocommerce-subscriptions/',
539
+ 'class' => 'WC_Subscriptions_Manager'
540
+ );
541
+ $modules[] = array(
542
+ 'name' => 'extra_product_options',
543
+ 'title' => __( 'Extra Product Options', 'woo_ce' ),
544
+ 'description' => __( 'Create extra price fields globally or per-Product', 'woo_ce' ),
545
+ 'url' => 'http://codecanyon.net/item/woocommerce-extra-product-options/7908619',
546
+ 'class' => 'TM_Extra_Product_Options'
547
+ );
548
+
549
+ /*
550
+ $modules[] = array(
551
+ 'name' => '',
552
+ 'title' => __( '', 'woo_ce' ),
553
+ 'description' => __( '', 'woo_ce' ),
554
+ 'url' => '',
555
+ 'slug' => '', // Define this if the Plugin is hosted on the WordPress repo
556
+ 'function' => ''
557
+ );
558
+ */
559
+
560
+ $modules = apply_filters( 'woo_ce_modules_addons', $modules );
561
+
562
+ if( !empty( $modules ) ) {
563
+ foreach( $modules as $key => $module ) {
564
+ $modules[$key]['status'] = 'inactive';
565
+ // Check if each module is activated
566
+ if( isset( $module['function'] ) ) {
567
+ if( function_exists( $module['function'] ) )
568
+ $modules[$key]['status'] = 'active';
569
+ } else if( isset( $module['class'] ) ) {
570
+ if( class_exists( $module['class'] ) )
571
+ $modules[$key]['status'] = 'active';
572
+ }
573
+ // Check if the Plugin has a slug and if current user can install Plugins
574
+ if( current_user_can( 'install_plugins' ) && isset( $module['slug'] ) )
575
+ $modules[$key]['url'] = admin_url( sprintf( 'plugin-install.php?tab=search&type=tag&s=%s', $module['slug'] ) );
576
+ }
577
+ }
578
+ return $modules;
579
+
580
+ }
581
+
582
+ function woo_ce_modules_status_class( $status = 'inactive' ) {
583
+
584
+ $output = '';
585
+ switch( $status ) {
586
+
587
+ case 'active':
588
+ $output = 'green';
589
+ break;
590
+
591
+ case 'inactive':
592
+ $output = 'yellow';
593
+ break;
594
+
595
+ }
596
+ echo $output;
597
+
598
+ }
599
+
600
+ function woo_ce_modules_status_label( $status = 'inactive' ) {
601
+
602
+ $output = '';
603
+ switch( $status ) {
604
+
605
+ case 'active':
606
+ $output = __( 'OK', 'woo_ce' );
607
+ break;
608
+
609
+ case 'inactive':
610
+ $output = __( 'Install', 'woo_ce' );
611
+ break;
612
+
613
+ }
614
+ echo $output;
615
+
616
+ }
617
+
618
+ // HTML template for header prompt on Store Exporter screen
619
+ function woo_ce_support_donate() {
620
+
621
+ $output = '';
622
+ $show = true;
623
+ if( function_exists( 'woo_vl_we_love_your_plugins' ) ) {
624
+ if( in_array( WOO_CE_DIRNAME, woo_vl_we_love_your_plugins() ) )
625
+ $show = false;
626
+ }
627
+ if( $show ) {
628
+ $donate_url = 'http://www.visser.com.au/donate/';
629
+ $rate_url = 'http://wordpress.org/support/view/plugin-reviews/' . WOO_CE_DIRNAME;
630
+ $output = '
631
+ <div id="support-donate_rate" class="support-donate_rate">
632
+ <p>' . sprintf( __( '<strong>Like this Plugin?</strong> %s and %s.', 'woo_ce' ), '<a href="' . $donate_url . '" target="_blank">' . __( 'Donate to support this Plugin', 'woo_ce' ) . '</a>', '<a href="' . add_query_arg( array( 'rate' => '5' ), $rate_url ) . '#postform" target="_blank">rate / review us on WordPress.org</a>' ) . '</p>
633
+ </div>
634
+ ';
635
+ }
636
+ echo $output;
637
+
638
+ }
639
+ ?>
includes/brands.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for Coupon Sorting widget on Store Exporter screen
7
+ function woo_ce_brand_sorting() {
8
+
9
+ $orderby = woo_ce_get_option( 'brand_orderby', 'ID' );
10
+ $order = woo_ce_get_option( 'brand_order', 'DESC' );
11
+
12
+ ob_start(); ?>
13
+ <p><label><?php _e( 'Brand Sorting', 'woo_ce' ); ?></label></p>
14
+ <div>
15
+ <select name="brand_orderby" disabled="disabled">
16
+ <option value="id"><?php _e( 'Term ID', 'woo_ce' ); ?></option>
17
+ <option value="name"><?php _e( 'Brand Name', 'woo_ce' ); ?></option>
18
+ </select>
19
+ <select name="brand_order" disabled="disabled">
20
+ <option value="ASC"><?php _e( 'Ascending', 'woo_ce' ); ?></option>
21
+ <option value="DESC"><?php _e( 'Descending', 'woo_ce' ); ?></option>
22
+ </select>
23
+ <p class="description"><?php _e( 'Select the sorting of Brands within the exported file. By default this is set to export Product Brands by Term ID in Desending order.', 'woo_ce' ); ?></p>
24
+ </div>
25
+ <?php
26
+ ob_end_flush();
27
+
28
+ }
29
+
30
+ /* End of: WordPress Administration */
31
+
32
+ }
33
+
34
+ // Returns a list of Brand export columns
35
+ function woo_ce_get_brand_fields( $format = 'full' ) {
36
+
37
+ $export_type = 'brand';
38
+
39
+ $fields = array();
40
+ $fields[] = array(
41
+ 'name' => 'term_id',
42
+ 'label' => __( 'Term ID', 'woo_ce' )
43
+ );
44
+ $fields[] = array(
45
+ 'name' => 'name',
46
+ 'label' => __( 'Brand Name', 'woo_ce' )
47
+ );
48
+ $fields[] = array(
49
+ 'name' => 'slug',
50
+ 'label' => __( 'Brand Slug', 'woo_ce' )
51
+ );
52
+ $fields[] = array(
53
+ 'name' => 'parent_id',
54
+ 'label' => __( 'Parent Term ID', 'woo_ce' )
55
+ );
56
+ $fields[] = array(
57
+ 'name' => 'description',
58
+ 'label' => __( 'Brand Description', 'woo_ce' )
59
+ );
60
+ $fields[] = array(
61
+ 'name' => 'image',
62
+ 'label' => __( 'Brand Image', 'woo_ce' )
63
+ );
64
+
65
+ /*
66
+ $fields[] = array(
67
+ 'name' => '',
68
+ 'label' => __( '', 'woo_ce' )
69
+ );
70
+ */
71
+
72
+ // Allow Plugin/Theme authors to add support for additional columns
73
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
74
+
75
+ switch( $format ) {
76
+
77
+ case 'summary':
78
+ $output = array();
79
+ $size = count( $fields );
80
+ for( $i = 0; $i < $size; $i++ ) {
81
+ if( isset( $fields[$i] ) )
82
+ $output[$fields[$i]['name']] = 'on';
83
+ }
84
+ return $output;
85
+ break;
86
+
87
+ case 'full':
88
+ default:
89
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
90
+ $size = count( $fields );
91
+ for( $i = 0; $i < $size; $i++ )
92
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
93
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
94
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
95
+ return $fields;
96
+ break;
97
+
98
+ }
99
+
100
+ }
101
+
102
+ function woo_ce_override_brand_field_labels( $fields = array() ) {
103
+
104
+ $labels = woo_ce_get_option( 'brand_labels', array() );
105
+ if( !empty( $labels ) ) {
106
+ foreach( $fields as $key => $field ) {
107
+ if( isset( $labels[$field['name']] ) )
108
+ $fields[$key]['label'] = $labels[$field['name']];
109
+ }
110
+ }
111
+ return $fields;
112
+
113
+ }
114
+ add_filter( 'woo_ce_brand_fields', 'woo_ce_override_brand_field_labels', 11 );
115
+ ?>
includes/categories.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for Category Sorting widget on Store Exporter screen
7
+ function woo_ce_category_sorting() {
8
+
9
+ $category_orderby = woo_ce_get_option( 'category_orderby', 'ID' );
10
+ $category_order = woo_ce_get_option( 'category_order', 'DESC' );
11
+
12
+ ob_start(); ?>
13
+ <p><label><?php _e( 'Category Sorting', 'woo_ce' ); ?></label></p>
14
+ <div>
15
+ <select name="category_orderby">
16
+ <option value="id"<?php selected( 'id', $category_orderby ); ?>><?php _e( 'Term ID', 'woo_ce' ); ?></option>
17
+ <option value="name"<?php selected( 'name', $category_orderby ); ?>><?php _e( 'Category Name', 'woo_ce' ); ?></option>
18
+ </select>
19
+ <select name="category_order">
20
+ <option value="ASC"<?php selected( 'ASC', $category_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
21
+ <option value="DESC"<?php selected( 'DESC', $category_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
22
+ </select>
23
+ <p class="description"><?php _e( 'Select the sorting of Categories within the exported file. By default this is set to export Categories by Term ID in Desending order.', 'woo_ce' ); ?></p>
24
+ </div>
25
+ <?php
26
+ ob_end_flush();
27
+
28
+ }
29
+
30
+ /* End of: WordPress Administration */
31
+
32
+ }
33
+
34
+ // Returns a list of Category export columns
35
+ function woo_ce_get_category_fields( $format = 'full' ) {
36
+
37
+ $export_type = 'category';
38
+
39
+ $fields = array();
40
+ $fields[] = array(
41
+ 'name' => 'term_id',
42
+ 'label' => __( 'Term ID', 'woo_ce' )
43
+ );
44
+ $fields[] = array(
45
+ 'name' => 'name',
46
+ 'label' => __( 'Category Name', 'woo_ce' )
47
+ );
48
+ $fields[] = array(
49
+ 'name' => 'slug',
50
+ 'label' => __( 'Category Slug', 'woo_ce' )
51
+ );
52
+ $fields[] = array(
53
+ 'name' => 'parent_id',
54
+ 'label' => __( 'Parent Term ID', 'woo_ce' )
55
+ );
56
+ $fields[] = array(
57
+ 'name' => 'description',
58
+ 'label' => __( 'Category Description', 'woo_ce' )
59
+ );
60
+ $fields[] = array(
61
+ 'name' => 'display_type',
62
+ 'label' => __( 'Display Type', 'woo_ce' )
63
+ );
64
+ $fields[] = array(
65
+ 'name' => 'image',
66
+ 'label' => __( 'Category Image', 'woo_ce' )
67
+ );
68
+
69
+ /*
70
+ $fields[] = array(
71
+ 'name' => '',
72
+ 'label' => __( '', 'woo_ce' )
73
+ );
74
+ */
75
+
76
+ // Allow Plugin/Theme authors to add support for additional columns
77
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
78
+
79
+ if( $remember = woo_ce_get_option( $export_type . '_fields', array() ) ) {
80
+ $remember = maybe_unserialize( $remember );
81
+ $size = count( $fields );
82
+ for( $i = 0; $i < $size; $i++ ) {
83
+ $fields[$i]['disabled'] = ( isset( $fields[$i]['disabled'] ) ? $fields[$i]['disabled'] : 0 );
84
+ $fields[$i]['default'] = 1;
85
+ if( !array_key_exists( $fields[$i]['name'], $remember ) )
86
+ $fields[$i]['default'] = 0;
87
+ }
88
+ }
89
+
90
+ switch( $format ) {
91
+
92
+ case 'summary':
93
+ $output = array();
94
+ $size = count( $fields );
95
+ for( $i = 0; $i < $size; $i++ ) {
96
+ if( isset( $fields[$i] ) )
97
+ $output[$fields[$i]['name']] = 'on';
98
+ }
99
+ return $output;
100
+ break;
101
+
102
+ case 'full':
103
+ default:
104
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
105
+ $size = count( $fields );
106
+ for( $i = 0; $i < $size; $i++ )
107
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
108
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
109
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
110
+ return $fields;
111
+ break;
112
+
113
+ }
114
+
115
+ }
116
+
117
+ function woo_ce_override_category_field_labels( $fields = array() ) {
118
+
119
+ $labels = woo_ce_get_option( 'category_labels', array() );
120
+ if( !empty( $labels ) ) {
121
+ foreach( $fields as $key => $field ) {
122
+ if( isset( $labels[$field['name']] ) )
123
+ $fields[$key]['label'] = $labels[$field['name']];
124
+ }
125
+ }
126
+ return $fields;
127
+
128
+ }
129
+ add_filter( 'woo_ce_category_fields', 'woo_ce_override_category_field_labels', 11 );
130
+
131
+ // Returns the export column header label based on an export column slug
132
+ function woo_ce_get_category_field( $name = null, $format = 'name' ) {
133
+
134
+ $output = '';
135
+ if( $name ) {
136
+ $fields = woo_ce_get_category_fields();
137
+ $size = count( $fields );
138
+ for( $i = 0; $i < $size; $i++ ) {
139
+ if( $fields[$i]['name'] == $name ) {
140
+ switch( $format ) {
141
+
142
+ case 'name':
143
+ $output = $fields[$i]['label'];
144
+ break;
145
+
146
+ case 'full':
147
+ $output = $fields[$i];
148
+ break;
149
+
150
+ }
151
+ $i = $size;
152
+ }
153
+ }
154
+ }
155
+ return $output;
156
+
157
+ }
158
+
159
+ // Returns a list of WooCommerce Product Categories to export process
160
+ function woo_ce_get_product_categories( $args = array() ) {
161
+
162
+ $term_taxonomy = 'product_cat';
163
+ $defaults = array(
164
+ 'orderby' => 'name',
165
+ 'order' => 'ASC',
166
+ 'hide_empty' => 0
167
+ );
168
+ $args = wp_parse_args( $args, $defaults );
169
+ $categories = get_terms( $term_taxonomy, $args );
170
+ if( !empty( $categories ) && is_wp_error( $categories ) == false ) {
171
+ foreach( $categories as $key => $category ) {
172
+ $categories[$key]->parent_name = '';
173
+ if( $categories[$key]->parent_id = $category->parent ) {
174
+ if( $parent_category = get_term( $categories[$key]->parent_id, $term_taxonomy ) ) {
175
+ $categories[$key]->parent_name = $parent_category->name;
176
+ }
177
+ unset( $parent_category );
178
+ } else {
179
+ $categories[$key]->parent_id = '';
180
+ }
181
+ $categories[$key]->image = woo_ce_get_category_thumbnail_url( $category->term_id );
182
+ $categories[$key]->display_type = get_woocommerce_term_meta( $category->term_id, 'display_type', true );
183
+ }
184
+ return $categories;
185
+ }
186
+
187
+ }
188
+
189
+ function woo_ce_get_category_thumbnail_url( $category_id = 0, $size = 'full' ) {
190
+
191
+ if ( $thumbnail_id = get_woocommerce_term_meta( $category_id, 'thumbnail_id', true ) ) {
192
+ $image_attributes = wp_get_attachment_image_src( $thumbnail_id, $size );
193
+ if( is_array( $image_attributes ) )
194
+ return current( $image_attributes );
195
+ }
196
+
197
+ }
198
+ ?>
includes/common-dashboard_widgets.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+
4
+ Filename: common-dashboard_widgets.php
5
+ Description: common-dashboard_widgets.php loads commonly access Dashboard widgets across the Visser Labs suite.
6
+ Version: 1.4
7
+
8
+ */
9
+
10
+ /* Start of: WooCommerce News - by Visser Labs */
11
+
12
+ if( !function_exists( 'woo_vl_dashboard_setup' ) ) {
13
+
14
+ function woo_vl_dashboard_setup() {
15
+
16
+ if( current_user_can( 'manage_options' ) ) {
17
+ wp_add_dashboard_widget( 'woo_vl_news_widget', __( 'Plugin News - by Visser Labs', 'woo_ce' ), 'woo_vl_news_widget' );
18
+ }
19
+
20
+ }
21
+ add_action( 'wp_dashboard_setup', 'woo_vl_dashboard_setup' );
22
+
23
+ function woo_vl_news_widget() {
24
+
25
+ include_once( ABSPATH . WPINC . '/feed.php' );
26
+
27
+ $rss = fetch_feed( 'http://www.visser.com.au/blog/category/woocommerce/feed/' );
28
+ $output = '<div class="rss-widget">';
29
+ if( !is_wp_error( $rss ) ) {
30
+ $maxitems = $rss->get_item_quantity( 5 );
31
+ $rss_items = $rss->get_items( 0, $maxitems );
32
+ $output .= '<ul>';
33
+ foreach ( $rss_items as $item ) :
34
+ $output .= '<li>';
35
+ $output .= '<a href="' . $item->get_permalink() . '" title="' . 'Posted ' . $item->get_date( 'j F Y | g:i a' ) . '" class="rsswidget">' . $item->get_title() . '</a>';
36
+ $output .= '<span class="rss-date">' . $item->get_date( 'j F, Y' ) . '</span>';
37
+ $output .= '<div class="rssSummary">' . $item->get_description() . '</div>';
38
+ $output .= '</li>';
39
+ endforeach;
40
+ $output .= '</ul>';
41
+ } else {
42
+ $message = __( 'Connection failed. Please check your network settings.', 'woo_ce' );
43
+ $output .= '<p>' . $message . '</p>';
44
+ }
45
+ $output .= '</div>';
46
+
47
+ echo $output;
48
+
49
+ }
50
+
51
+ }
52
+
53
+ /* End of: WooCommerce News - by Visser Labs */
54
+ ?>
includes/coupons.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for disabled Coupon Sorting widget on Store Exporter screen
7
+ function woo_ce_coupon_sorting() {
8
+
9
+ ob_start(); ?>
10
+ <p><label><?php _e( 'Coupon Sorting', 'woo_ce' ); ?></label></p>
11
+ <div>
12
+ <select name="coupon_orderby" disabled="disabled">
13
+ <option value="ID"><?php _e( 'Coupon ID', 'woo_ce' ); ?></option>
14
+ <option value="title"><?php _e( 'Coupon Code', 'woo_ce' ); ?></option>
15
+ <option value="date"><?php _e( 'Date Created', 'woo_ce' ); ?></option>
16
+ <option value="modified"><?php _e( 'Date Modified', 'woo_ce' ); ?></option>
17
+ <option value="rand"><?php _e( 'Random', 'woo_ce' ); ?></option>
18
+ </select>
19
+ <select name="coupon_order" disabled="disabled">
20
+ <option value="ASC"><?php _e( 'Ascending', 'woo_ce' ); ?></option>
21
+ <option value="DESC"><?php _e( 'Descending', 'woo_ce' ); ?></option>
22
+ </select>
23
+ <p class="description"><?php _e( 'Select the sorting of Coupons within the exported file. By default this is set to export Coupons by Coupon ID in Desending order.', 'woo_ce' ); ?></p>
24
+ </div>
25
+ <?php
26
+ ob_end_flush();
27
+
28
+ }
29
+
30
+ /* End of: WordPress Administration */
31
+
32
+ }
33
+
34
+ // Returns a list of Coupon export columns
35
+ function woo_ce_get_coupon_fields( $format = 'full' ) {
36
+
37
+ $export_type = 'coupon';
38
+
39
+ $fields = array();
40
+ $fields[] = array(
41
+ 'name' => 'coupon_code',
42
+ 'label' => __( 'Coupon Code', 'woo_ce' )
43
+ );
44
+ $fields[] = array(
45
+ 'name' => 'coupon_description',
46
+ 'label' => __( 'Coupon Description', 'woo_ce' )
47
+ );
48
+ $fields[] = array(
49
+ 'name' => 'discount_type',
50
+ 'label' => __( 'Discount Type', 'woo_ce' )
51
+ );
52
+ $fields[] = array(
53
+ 'name' => 'coupon_amount',
54
+ 'label' => __( 'Coupon Amount', 'woo_ce' )
55
+ );
56
+ $fields[] = array(
57
+ 'name' => 'individual_use',
58
+ 'label' => __( 'Individual Use', 'woo_ce' )
59
+ );
60
+ $fields[] = array(
61
+ 'name' => 'apply_before_tax',
62
+ 'label' => __( 'Apply before tax', 'woo_ce' )
63
+ );
64
+ $fields[] = array(
65
+ 'name' => 'exclude_sale_items',
66
+ 'label' => __( 'Exclude sale items', 'woo_ce' )
67
+ );
68
+ $fields[] = array(
69
+ 'name' => 'minimum_amount',
70
+ 'label' => __( 'Minimum Amount', 'woo_ce' )
71
+ );
72
+ $fields[] = array(
73
+ 'name' => 'product_ids',
74
+ 'label' => __( 'Products', 'woo_ce' )
75
+ );
76
+ $fields[] = array(
77
+ 'name' => 'exclude_product_ids',
78
+ 'label' => __( 'Exclude Products', 'woo_ce' )
79
+ );
80
+ $fields[] = array(
81
+ 'name' => 'product_categories',
82
+ 'label' => __( 'Product Categories', 'woo_ce' )
83
+ );
84
+ $fields[] = array(
85
+ 'name' => 'exclude_product_categories',
86
+ 'label' => __( 'Exclude Product Categories', 'woo_ce' )
87
+ );
88
+ $fields[] = array(
89
+ 'name' => 'customer_email',
90
+ 'label' => __( 'Customer e-mails', 'woo_ce' )
91
+ );
92
+ $fields[] = array(
93
+ 'name' => 'usage_limit',
94
+ 'label' => __( 'Usage Limit', 'woo_ce' )
95
+ );
96
+ $fields[] = array(
97
+ 'name' => 'expiry_date',
98
+ 'label' => __( 'Expiry Date', 'woo_ce' )
99
+ );
100
+
101
+ /*
102
+ $fields[] = array(
103
+ 'name' => '',
104
+ 'label' => __( '', 'woo_ce' )
105
+ );
106
+ */
107
+
108
+ // Allow Plugin/Theme authors to add support for additional columns
109
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
110
+
111
+ switch( $format ) {
112
+
113
+ case 'summary':
114
+ $output = array();
115
+ $size = count( $fields );
116
+ for( $i = 0; $i < $size; $i++ ) {
117
+ if( isset( $fields[$i] ) )
118
+ $output[$fields[$i]['name']] = 'on';
119
+ }
120
+ return $output;
121
+ break;
122
+
123
+ case 'full':
124
+ default:
125
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
126
+ $size = count( $fields );
127
+ for( $i = 0; $i < $size; $i++ )
128
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
129
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
130
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
131
+ return $fields;
132
+ break;
133
+
134
+ }
135
+
136
+ }
137
+
138
+ function woo_ce_override_coupon_field_labels( $fields = array() ) {
139
+
140
+ $labels = woo_ce_get_option( 'coupon_labels', array() );
141
+ if( !empty( $labels ) ) {
142
+ foreach( $fields as $key => $field ) {
143
+ if( isset( $labels[$field['name']] ) )
144
+ $fields[$key]['label'] = $labels[$field['name']];
145
+ }
146
+ }
147
+ return $fields;
148
+
149
+ }
150
+ add_filter( 'woo_ce_coupon_fields', 'woo_ce_override_coupon_field_labels', 11 );
151
+
152
+ // Returns a list of Coupon IDs
153
+ function woo_ce_get_coupons( $args = array() ) {
154
+
155
+ global $export;
156
+
157
+ $limit_volume = -1;
158
+ $offset = 0;
159
+
160
+ if( $args ) {
161
+ $limit_volume = ( isset( $args['limit_volume'] ) ? $args['limit_volume'] : false );
162
+ $offset = ( isset( $args['offset'] ) ? $args['offset'] : false );
163
+ $orderby = ( isset( $args['coupon_orderby'] ) ? $args['coupon_orderby'] : 'ID' );
164
+ $order = ( isset( $args['coupon_order'] ) ? $args['coupon_order'] : 'ASC' );
165
+ }
166
+
167
+ $post_type = 'shop_coupon';
168
+ $args = array(
169
+ 'post_type' => $post_type,
170
+ 'orderby' => $orderby,
171
+ 'order' => $order,
172
+ 'offset' => $offset,
173
+ 'posts_per_page' => $limit_volume,
174
+ 'post_status' => woo_ce_post_statuses(),
175
+ 'fields' => 'ids'
176
+ );
177
+ $coupons = array();
178
+ $coupon_ids = new WP_Query( $args );
179
+ if( $coupon_ids->posts ) {
180
+ foreach( $coupon_ids->posts as $coupon_id )
181
+ $coupons[] = $coupon_id;
182
+ unset( $coupon_ids, $coupon_id );
183
+ }
184
+ return $coupons;
185
+
186
+ }
187
+
188
+ ?>
includes/customers.php ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for disabled Filter Customers by Order Status widget on Store Exporter screen
7
+ function woo_ce_customers_filter_by_status() {
8
+
9
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
10
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
11
+
12
+ $order_statuses = woo_ce_get_order_statuses();
13
+
14
+ ob_start(); ?>
15
+ <p><label><input type="checkbox" id="customers-filters-status" /> <?php _e( 'Filter Customers by Order Status', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
16
+ <div id="export-customers-filters-status" class="separator">
17
+ <ul>
18
+ <?php if( $order_statuses ) { ?>
19
+ <?php foreach( $order_statuses as $order_status ) { ?>
20
+ <li><label><input type="checkbox" name="customer_filter_status[<?php echo $order_status->name; ?>]" value="<?php echo $order_status->name; ?>" disabled="disabled" /> <?php echo ucfirst( $order_status->name ); ?></label></li>
21
+ <?php } ?>
22
+ <?php } else { ?>
23
+ <li><?php _e( 'No Order Status\'s were found.', 'woo_ce' ); ?></li>
24
+ <?php } ?>
25
+ </ul>
26
+ <p class="description"><?php _e( 'Select the Order Status you want to filter exported Customers by. Default is to include all Order Status options.', 'woo_ce' ); ?></p>
27
+ </div>
28
+ <!-- #export-customers-filters-status -->
29
+ <?php
30
+ ob_end_flush();
31
+
32
+ }
33
+
34
+ // HTML template for disabled Custom Customers widget on Store Exporter screen
35
+ function woo_ce_customers_custom_fields() {
36
+
37
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
38
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
39
+
40
+ $custom_customers = '-';
41
+
42
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
43
+
44
+ ob_start(); ?>
45
+ <form method="post" id="export-customers-custom-fields" class="export-options customer-options">
46
+ <div id="poststuff">
47
+
48
+ <div class="postbox" id="export-options customer-options">
49
+ <h3 class="hndle"><?php _e( 'Custom Customer Fields', 'woo_ce' ); ?></h3>
50
+ <div class="inside">
51
+ <p class="description"><?php _e( 'To include additional custom Customer meta in the Export Customers table above fill the Customers text box then click Save Custom Fields.', 'woo_ce' ); ?></p>
52
+ <table class="form-table">
53
+
54
+ <tr>
55
+ <th>
56
+ <label><?php _e( 'Customer meta', 'woo_ce' ); ?></label>
57
+ </th>
58
+ <td>
59
+ <textarea name="custom_customers" rows="5" cols="70" disabled="disabled"><?php echo esc_textarea( $custom_customers ); ?></textarea>
60
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
61
+ <p class="description"><?php _e( 'Include additional custom Customer meta in your export file by adding each custom Customer meta name to a new line above.<br />For example: <code>Customer UA, Customer IP Address</code>', 'woo_ce' ); ?></p>
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ <p class="submit">
67
+ <input type="button" class="button button-disabled" value="<?php _e( 'Save Custom Fields', 'woo_ce' ); ?>" />
68
+ </p>
69
+ <p class="description"><?php printf( __( 'For more information on custom Customer meta consult our <a href="%s" target="_blank">online documentation</a>.', 'woo_ce' ), $troubleshooting_url ); ?></p>
70
+ </div>
71
+ <!-- .inside -->
72
+ </div>
73
+ <!-- .postbox -->
74
+
75
+ </div>
76
+ <!-- #poststuff -->
77
+ <input type="hidden" name="action" value="update" />
78
+ </form>
79
+ <!-- #export-customers-custom-fields -->
80
+ <?php
81
+ ob_end_flush();
82
+
83
+ }
84
+
85
+ /* End of: WordPress Administration */
86
+
87
+ }
88
+
89
+ // Returns a list of Customer export columns
90
+ function woo_ce_get_customer_fields( $format = 'full' ) {
91
+
92
+ $export_type = 'customer';
93
+
94
+ $fields = array();
95
+ $fields[] = array(
96
+ 'name' => 'user_id',
97
+ 'label' => __( 'User ID', 'woo_ce' )
98
+ );
99
+ $fields[] = array(
100
+ 'name' => 'user_name',
101
+ 'label' => __( 'Username', 'woo_ce' )
102
+ );
103
+ $fields[] = array(
104
+ 'name' => 'user_role',
105
+ 'label' => __( 'User Role', 'woo_ce' )
106
+ );
107
+ $fields[] = array(
108
+ 'name' => 'billing_full_name',
109
+ 'label' => __( 'Billing: Full Name', 'woo_ce' )
110
+ );
111
+ $fields[] = array(
112
+ 'name' => 'billing_first_name',
113
+ 'label' => __( 'Billing: First Name', 'woo_ce' )
114
+ );
115
+ $fields[] = array(
116
+ 'name' => 'billing_last_name',
117
+ 'label' => __( 'Billing: Last Name', 'woo_ce' )
118
+ );
119
+ $fields[] = array(
120
+ 'name' => 'billing_company',
121
+ 'label' => __( 'Billing: Company', 'woo_ce' )
122
+ );
123
+ $fields[] = array(
124
+ 'name' => 'billing_address',
125
+ 'label' => __( 'Billing: Street Address', 'woo_ce' )
126
+ );
127
+ $fields[] = array(
128
+ 'name' => 'billing_city',
129
+ 'label' => __( 'Billing: City', 'woo_ce' )
130
+ );
131
+ $fields[] = array(
132
+ 'name' => 'billing_postcode',
133
+ 'label' => __( 'Billing: ZIP Code', 'woo_ce' )
134
+ );
135
+ $fields[] = array(
136
+ 'name' => 'billing_state',
137
+ 'label' => __( 'Billing: State (prefix)', 'woo_ce' )
138
+ );
139
+ $fields[] = array(
140
+ 'name' => 'billing_state_full',
141
+ 'label' => __( 'Billing: State', 'woo_ce' )
142
+ );
143
+ $fields[] = array(
144
+ 'name' => 'billing_country',
145
+ 'label' => __( 'Billing: Country', 'woo_ce' )
146
+ );
147
+ $fields[] = array(
148
+ 'name' => 'billing_phone',
149
+ 'label' => __( 'Billing: Phone Number', 'woo_ce' )
150
+ );
151
+ $fields[] = array(
152
+ 'name' => 'billing_email',
153
+ 'label' => __( 'Billing: E-mail Address', 'woo_ce' )
154
+ );
155
+ $fields[] = array(
156
+ 'name' => 'shipping_full_name',
157
+ 'label' => __( 'Shipping: Full Name', 'woo_ce' )
158
+ );
159
+ $fields[] = array(
160
+ 'name' => 'shipping_first_name',
161
+ 'label' => __( 'Shipping: First Name', 'woo_ce' )
162
+ );
163
+ $fields[] = array(
164
+ 'name' => 'shipping_last_name',
165
+ 'label' => __( 'Shipping: Last Name', 'woo_ce' )
166
+ );
167
+ $fields[] = array(
168
+ 'name' => 'shipping_company',
169
+ 'label' => __( 'Shipping: Company', 'woo_ce' )
170
+ );
171
+ $fields[] = array(
172
+ 'name' => 'shipping_address',
173
+ 'label' => __( 'Shipping: Street Address', 'woo_ce' )
174
+ );
175
+ $fields[] = array(
176
+ 'name' => 'shipping_city',
177
+ 'label' => __( 'Shipping: City', 'woo_ce' )
178
+ );
179
+ $fields[] = array(
180
+ 'name' => 'shipping_postcode',
181
+ 'label' => __( 'Shipping: ZIP Code', 'woo_ce' )
182
+ );
183
+ $fields[] = array(
184
+ 'name' => 'shipping_state',
185
+ 'label' => __( 'Shipping: State (prefix)', 'woo_ce' )
186
+ );
187
+ $fields[] = array(
188
+ 'name' => 'shipping_state_full',
189
+ 'label' => __( 'Shipping: State', 'woo_ce' )
190
+ );
191
+ $fields[] = array(
192
+ 'name' => 'shipping_country',
193
+ 'label' => __( 'Shipping: Country (prefix)', 'woo_ce' )
194
+ );
195
+ $fields[] = array(
196
+ 'name' => 'shipping_country_full',
197
+ 'label' => __( 'Shipping: Country', 'woo_ce' )
198
+ );
199
+ $fields[] = array(
200
+ 'name' => 'total_spent',
201
+ 'label' => __( 'Total Spent', 'woo_ce' )
202
+ );
203
+ $fields[] = array(
204
+ 'name' => 'completed_orders',
205
+ 'label' => __( 'Completed Orders', 'woo_ce' )
206
+ );
207
+ $fields[] = array(
208
+ 'name' => 'total_orders',
209
+ 'label' => __( 'Total Orders', 'woo_ce' )
210
+ );
211
+
212
+ /*
213
+ $fields[] = array(
214
+ 'name' => '',
215
+ 'label' => __( '', 'woo_ce' )
216
+ );
217
+ */
218
+
219
+ // Allow Plugin/Theme authors to add support for additional columns
220
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
221
+
222
+ switch( $format ) {
223
+
224
+ case 'summary':
225
+ $output = array();
226
+ $size = count( $fields );
227
+ for( $i = 0; $i < $size; $i++ ) {
228
+ if( isset( $fields[$i] ) )
229
+ $output[$fields[$i]['name']] = 'on';
230
+ }
231
+ return $output;
232
+ break;
233
+
234
+ case 'full':
235
+ default:
236
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
237
+ $size = count( $fields );
238
+ for( $i = 0; $i < $size; $i++ )
239
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
240
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
241
+ return $fields;
242
+ break;
243
+
244
+ }
245
+
246
+ }
247
+
248
+ function woo_ce_override_customer_field_labels( $fields = array() ) {
249
+
250
+ $labels = woo_ce_get_option( 'customer_labels', array() );
251
+ if( !empty( $labels ) ) {
252
+ foreach( $fields as $key => $field ) {
253
+ if( isset( $labels[$field['name']] ) )
254
+ $fields[$key]['label'] = $labels[$field['name']];
255
+ }
256
+ }
257
+ return $fields;
258
+
259
+ }
260
+ add_filter( 'woo_ce_customer_fields', 'woo_ce_override_customer_field_labels', 11 );
261
+ ?>
includes/export-csv.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Function to generate filename of CSV file based on the Export type
3
+ function woo_ce_generate_csv_filename( $export_type = '' ) {
4
+
5
+ // Get the filename from WordPress options
6
+ $filename = woo_ce_get_option( 'export_filename', 'woo-export_%dataset%-%date%.csv' );
7
+
8
+ // Strip other file extensions if present
9
+ $filename = str_replace( array( 'xml', 'xls' ), 'csv', $filename );
10
+ if( ( strpos( $filename, '.xml' ) !== false ) || ( strpos( $filename, '.xls' ) !== false ) )
11
+ $filename = str_replace( array( '.xml', '.xls' ), '.csv', $filename );
12
+
13
+ // Add file extension if it has been removed
14
+ if( strpos( $filename, '.csv' ) === false )
15
+ $filename .= '.csv';
16
+
17
+ // Populate the available tags
18
+ $date = date( 'Y_m_d' );
19
+ $time = date( 'H_i_s' );
20
+ $store_name = sanitize_title( get_bloginfo( 'name' ) );
21
+
22
+ // Switch out the tags for filled values
23
+ $filename = str_replace( '%dataset%', $export_type, $filename );
24
+ $filename = str_replace( '%date%', $date, $filename );
25
+ $filename = str_replace( '%time%', $time, $filename );
26
+ $filename = str_replace( '%store_name%', $store_name, $filename );
27
+
28
+ // Return the filename
29
+ return $filename;
30
+
31
+ }
32
+
33
+ // File output header for CSV file
34
+ function woo_ce_generate_csv_header( $export_type = '' ) {
35
+
36
+ global $export;
37
+
38
+ if( $filename = woo_ce_generate_csv_filename( $export_type ) ) {
39
+ $mime_type = 'text/csv';
40
+ header( sprintf( 'Content-Encoding: %s', esc_attr( $export->encoding ) ) );
41
+ header( sprintf( 'Content-Type: %s; charset=%s', $mime_type, esc_attr( $export->encoding ) ) );
42
+ header( 'Content-Transfer-Encoding: binary' );
43
+ header( sprintf( 'Content-Disposition: attachment; filename=%s', $filename ) );
44
+ header( 'Pragma: no-cache' );
45
+ header( 'Expires: 0' );
46
+ }
47
+
48
+ }
49
+ ?>
includes/formatting.php ADDED
@@ -0,0 +1,516 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function woo_ce_file_encoding( $content = '' ) {
3
+
4
+ global $export;
5
+
6
+ if( function_exists( 'mb_convert_encoding' ) ) {
7
+ $to_encoding = $export->encoding;
8
+ $from_encoding = 'auto';
9
+ if( !empty( $to_encoding ) )
10
+ $content = mb_convert_encoding( trim( $content ), $to_encoding, $from_encoding );
11
+ if( $to_encoding <> 'UTF-8' )
12
+ $content = utf8_encode( $content );
13
+ }
14
+ return $content;
15
+
16
+ }
17
+
18
+ function woo_ce_display_memory( $memory = 0 ) {
19
+
20
+ $output = '-';
21
+ if( !empty( $output ) )
22
+ $output = sprintf( __( '%s MB', 'woo_ce' ), $memory );
23
+ echo $output;
24
+
25
+ }
26
+
27
+ function woo_ce_display_time_elapsed( $from, $to ) {
28
+
29
+ $output = __( '1 second', 'woo_ce' );
30
+ $time = $to - $from;
31
+ $tokens = array (
32
+ 31536000 => __( 'year', 'woo_ce' ),
33
+ 2592000 => __( 'month', 'woo_ce' ),
34
+ 604800 => __( 'week', 'woo_ce' ),
35
+ 86400 => __( 'day', 'woo_ce' ),
36
+ 3600 => __( 'hour', 'woo_ce' ),
37
+ 60 => __( 'minute', 'woo_ce' ),
38
+ 1 => __( 'second', 'woo_ce' )
39
+ );
40
+ foreach ($tokens as $unit => $text) {
41
+ if ($time < $unit) continue;
42
+ $numberOfUnits = floor($time / $unit);
43
+ $output = $numberOfUnits . ' ' . $text . ( ( $numberOfUnits > 1 ) ? 's' : '' );
44
+ }
45
+ return $output;
46
+
47
+ }
48
+
49
+ // This function escapes all cells in 'Excel' CSV escape formatting of a CSV file, also converts HTML entities to plain-text
50
+ function woo_ce_escape_csv_value( $string = '', $delimiter = ',', $format = 'all' ) {
51
+
52
+ $string = str_replace( '"', '""', $string );
53
+ $string = wp_specialchars_decode( $string );
54
+ $string = str_replace( PHP_EOL, "\r\n", $string );
55
+ switch( $format ) {
56
+
57
+ case 'all':
58
+ $string = '"' . $string . '"';
59
+ break;
60
+
61
+ case 'excel':
62
+ if( strpos( $string, '"' ) !== false or strpos( $string, ',' ) !== false or strpos( $string, "\r" ) !== false or strpos( $string, "\n" ) !== false )
63
+ $string = '"' . $string . '"';
64
+ break;
65
+
66
+ }
67
+ return $string;
68
+
69
+ }
70
+
71
+ function woo_ce_count_object( $object = 0, $exclude_post_types = array() ) {
72
+
73
+ $count = 0;
74
+ if( is_object( $object ) ) {
75
+ if( $exclude_post_types ) {
76
+ $size = count( $exclude_post_types );
77
+ for( $i = 0; $i < $size; $i++ ) {
78
+ if( isset( $object->$exclude_post_types[$i] ) )
79
+ unset( $object->$exclude_post_types[$i] );
80
+ }
81
+ }
82
+ if( !empty( $object ) ) {
83
+ foreach( $object as $key => $item )
84
+ $count = $item + $count;
85
+ }
86
+ } else {
87
+ $count = $object;
88
+ }
89
+ return $count;
90
+
91
+ }
92
+
93
+ function woo_ce_convert_product_ids( $product_ids = null ) {
94
+
95
+ global $export;
96
+
97
+ $output = '';
98
+ if( $product_ids ) {
99
+ if( is_array( $product_ids ) ) {
100
+ $size = count( $product_ids );
101
+ for( $i = 0; $i < $size; $i++ )
102
+ $output .= $product_ids[$i] . $export->category_separator;
103
+ $output = substr( $output, 0, -1 );
104
+ } else if( strstr( $product_ids, ',' ) ) {
105
+ $output = str_replace( ',', $export->category_separator, $product_ids );
106
+ }
107
+ }
108
+ return $output;
109
+
110
+ }
111
+
112
+ function woo_ce_format_visibility( $visibility = '' ) {
113
+
114
+ $output = '';
115
+ if( $visibility ) {
116
+ switch( $visibility ) {
117
+
118
+ case 'visible':
119
+ $output = __( 'Catalog & Search', 'woo_ce' );
120
+ break;
121
+
122
+ case 'catalog':
123
+ $output = __( 'Catalog', 'woo_ce' );
124
+ break;
125
+
126
+ case 'search':
127
+ $output = __( 'Search', 'woo_ce' );
128
+ break;
129
+
130
+ case 'hidden':
131
+ $output = __( 'Hidden', 'woo_ce' );
132
+ break;
133
+
134
+ }
135
+ }
136
+ return $output;
137
+
138
+ }
139
+
140
+ function woo_ce_format_download_type( $download_type = '' ) {
141
+
142
+ $output = __( 'Standard', 'woo_ce' );
143
+ if( $download_type ) {
144
+ switch( $download_type ) {
145
+
146
+ case 'application':
147
+ $output = __( 'Application', 'woo_ce' );
148
+ break;
149
+
150
+ case 'music':
151
+ $output = __( 'Music', 'woo_ce' );
152
+ break;
153
+
154
+ }
155
+ }
156
+ return $output;
157
+
158
+ }
159
+
160
+ function woo_ce_format_product_status( $product_status = '' ) {
161
+
162
+ $output = $product_status;
163
+ switch( $product_status ) {
164
+
165
+ case 'publish':
166
+ $output = __( 'Publish', 'woo_ce' );
167
+ break;
168
+
169
+ case 'draft':
170
+ $output = __( 'Draft', 'woo_ce' );
171
+ break;
172
+
173
+ case 'trash':
174
+ $output = __( 'Trash', 'woo_ce' );
175
+ break;
176
+
177
+ }
178
+ return $output;
179
+
180
+ }
181
+
182
+ function woo_ce_format_comment_status( $comment_status ) {
183
+
184
+ $output = $comment_status;
185
+ switch( $comment_status ) {
186
+
187
+ case 'open':
188
+ $output = __( 'Open', 'woo_ce' );
189
+ break;
190
+
191
+ case 'closed':
192
+ $output = __( 'Closed', 'woo_ce' );
193
+ break;
194
+
195
+ }
196
+ return $output;
197
+
198
+ }
199
+
200
+ function woo_ce_format_gpf_availability( $availability = null ) {
201
+
202
+ $output = '';
203
+ if( $availability ) {
204
+ switch( $availability ) {
205
+
206
+ case 'in stock':
207
+ $output = __( 'In Stock', 'woo_ce' );
208
+ break;
209
+
210
+ case 'available for order':
211
+ $output = __( 'Available For Order', 'woo_ce' );
212
+ break;
213
+
214
+ case 'preorder':
215
+ $output = __( 'Pre-order', 'woo_ce' );
216
+ break;
217
+
218
+ }
219
+ }
220
+ return $output;
221
+
222
+ }
223
+
224
+ function woo_ce_format_gpf_condition( $condition ) {
225
+
226
+ switch( $condition ) {
227
+
228
+ case 'new':
229
+ $output = __( 'New', 'woo_ce' );
230
+ break;
231
+
232
+ case 'refurbished':
233
+ $output = __( 'Refurbished', 'woo_ce' );
234
+ break;
235
+
236
+ case 'used':
237
+ $output = __( 'Used', 'woo_ce' );
238
+ break;
239
+
240
+ }
241
+ return $output;
242
+
243
+ }
244
+
245
+ function woo_ce_format_switch( $input = '', $output_format = 'answer' ) {
246
+
247
+ $input = strtolower( $input );
248
+ switch( $input ) {
249
+
250
+ case '1':
251
+ case 'yes':
252
+ case 'on':
253
+ case 'open':
254
+ case 'active':
255
+ $input = '1';
256
+ break;
257
+
258
+ case '0':
259
+ case 'no':
260
+ case 'off':
261
+ case 'closed':
262
+ case 'inactive':
263
+ default:
264
+ $input = '0';
265
+ break;
266
+
267
+ }
268
+ $output = '';
269
+ switch( $output_format ) {
270
+
271
+ case 'int':
272
+ $output = $input;
273
+ break;
274
+
275
+ case 'answer':
276
+ switch( $input ) {
277
+
278
+ case '1':
279
+ $output = __( 'Yes', 'woo_ce' );
280
+ break;
281
+
282
+ case '0':
283
+ $output = __( 'No', 'woo_ce' );
284
+ break;
285
+
286
+ }
287
+ break;
288
+
289
+ case 'boolean':
290
+ switch( $input ) {
291
+
292
+ case '1':
293
+ $output = 'on';
294
+ break;
295
+
296
+ case '0':
297
+ $output = 'off';
298
+ break;
299
+
300
+ }
301
+ break;
302
+
303
+ }
304
+ return $output;
305
+
306
+ }
307
+
308
+ function woo_ce_format_stock_status( $stock_status = '', $stock = '' ) {
309
+
310
+ $output = '';
311
+ if( empty( $stock_status ) && !empty( $stock ) ) {
312
+ if( $stock )
313
+ $stock_status = 'instock';
314
+ else
315
+ $stock_status = 'outofstock';
316
+ }
317
+ if( $stock_status ) {
318
+ switch( $stock_status ) {
319
+
320
+ case 'instock':
321
+ $output = __( 'In Stock', 'woo_ce' );
322
+ break;
323
+
324
+ case 'outofstock':
325
+ $output = __( 'Out of Stock', 'woo_ce' );
326
+ break;
327
+
328
+ }
329
+ }
330
+ return $output;
331
+
332
+ }
333
+
334
+ function woo_ce_format_tax_status( $tax_status = null ) {
335
+
336
+ $output = '';
337
+ if( $tax_status ) {
338
+ switch( $tax_status ) {
339
+
340
+ case 'taxable':
341
+ $output = __( 'Taxable', 'woo_ce' );
342
+ break;
343
+
344
+ case 'shipping':
345
+ $output = __( 'Shipping Only', 'woo_ce' );
346
+ break;
347
+
348
+ case 'none':
349
+ $output = __( 'None', 'woo_ce' );
350
+ break;
351
+
352
+ }
353
+ }
354
+ return $output;
355
+
356
+ }
357
+
358
+ function woo_ce_format_tax_class( $tax_class = '' ) {
359
+
360
+ global $export;
361
+
362
+ $output = '';
363
+ if( $tax_class ) {
364
+ switch( $tax_class ) {
365
+
366
+ case '*':
367
+ $tax_class = __( 'Standard', 'woo_ce' );
368
+ break;
369
+
370
+ case 'reduced-rate':
371
+ $tax_class = __( 'Reduced Rate', 'woo_ce' );
372
+ break;
373
+
374
+ case 'zero-rate':
375
+ $tax_class = __( 'Zero Rate', 'woo_ce' );
376
+ break;
377
+
378
+ }
379
+ $output = $tax_class;
380
+ }
381
+ return $output;
382
+
383
+ }
384
+
385
+ function woo_ce_format_product_filters( $product_filters = array() ) {
386
+
387
+ $output = array();
388
+ if( !empty( $product_filters ) ) {
389
+ foreach( $product_filters as $product_filter )
390
+ $output[] = $product_filter;
391
+ }
392
+ return $output;
393
+
394
+ }
395
+
396
+ function woo_ce_format_user_role_filters( $user_role_filters = array() ) {
397
+
398
+ $output = array();
399
+ if( !empty( $user_role_filters ) ) {
400
+ foreach( $user_role_filters as $user_role_filter )
401
+ $output[] = $user_role_filter;
402
+ }
403
+ return $output;
404
+
405
+ }
406
+
407
+ function woo_ce_format_user_role_label( $user_role = '' ) {
408
+
409
+ global $wp_roles;
410
+
411
+ $output = $user_role;
412
+ if( $user_role ) {
413
+ $user_roles = woo_ce_get_user_roles();
414
+ if( isset( $user_roles[$user_role] ) )
415
+ $output = ucfirst( $user_roles[$user_role]['name'] );
416
+ unset( $user_roles );
417
+ }
418
+ return $output;
419
+
420
+ }
421
+
422
+ function woo_ce_format_product_type( $type_id = '' ) {
423
+
424
+ $output = $type_id;
425
+ if( $output ) {
426
+ $product_types = apply_filters( 'woo_ce_format_product_types', array(
427
+ 'simple' => __( 'Simple Product', 'woocommerce' ),
428
+ 'downloadable' => __( 'Downloadable', 'woocommerce' ),
429
+ 'grouped' => __( 'Grouped Product', 'woocommerce' ),
430
+ 'virtual' => __( 'Virtual', 'woocommerce' ),
431
+ 'variable' => __( 'Variable', 'woocommerce' ),
432
+ 'external' => __( 'External/Affiliate Product', 'woocommerce' ),
433
+ 'variation' => __( 'Variation', 'woo_ce' )
434
+ ) );
435
+ if( isset( $product_types[$type_id] ) )
436
+ $output = $product_types[$type_id];
437
+ }
438
+ return $output;
439
+
440
+ }
441
+
442
+ function woo_ce_format_price( $price = '' ) {
443
+
444
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
445
+ if( isset( $price ) && $price != '' && function_exists( 'wc_format_localized_price' ) )
446
+ return wc_format_localized_price( $price );
447
+ else
448
+ return $price;
449
+
450
+ }
451
+
452
+ function woo_ce_format_sale_price_dates( $sale_date = '' ) {
453
+
454
+ $output = $sale_date;
455
+ if( $sale_date )
456
+ $output = woo_ce_format_date( date( 'Y-m-d H:i:s', $sale_date ) );
457
+ return $output;
458
+
459
+ }
460
+
461
+ function woo_ce_format_date( $date = '' ) {
462
+
463
+ $output = $date;
464
+ $date_format = woo_ce_get_option( 'date_format', 'd/m/Y' );
465
+ if( !empty( $date ) && $date_format != '' )
466
+ $output = mysql2date( $date_format, $date );
467
+ return $output;
468
+
469
+ }
470
+
471
+ function woo_ce_format_product_category_label( $product_category = '', $parent_category = '' ) {
472
+
473
+ $output = $product_category;
474
+ if( !empty( $parent_category ) )
475
+ $output .= ' &raquo; ' . $parent_category;
476
+ return $output;
477
+
478
+ }
479
+
480
+ if( !function_exists( 'woo_ce_expand_state_name' ) ) {
481
+ function woo_ce_expand_state_name( $country_prefix = '', $state_prefix = '' ) {
482
+
483
+ global $woocommerce;
484
+
485
+ $output = $state_prefix;
486
+ if( $output ) {
487
+ if( isset( $woocommerce->countries ) ) {
488
+ if( $states = $woocommerce->countries->get_states( $country_prefix ) ) {
489
+ if( isset( $states[$state_prefix] ) )
490
+ $output = $states[$state_prefix];
491
+ }
492
+ unset( $states );
493
+ }
494
+ }
495
+ return $output;
496
+
497
+ }
498
+ }
499
+
500
+ if( !function_exists( 'woo_ce_expand_country_name' ) ) {
501
+ function woo_ce_expand_country_name( $country_prefix = '' ) {
502
+
503
+ global $woocommerce;
504
+
505
+ $output = $country_prefix;
506
+ if( $output && method_exists( $woocommerce, 'countries' ) ) {
507
+ $countries = $woocommerce->countries;
508
+ if( isset( $countries[$country_prefix] ) )
509
+ $output = $countries[$country_prefix];
510
+ unset( $countries );
511
+ }
512
+ return $output;
513
+
514
+ }
515
+ }
516
+ ?>
includes/functions.php ADDED
@@ -0,0 +1,876 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ include_once( WOO_CE_PATH . 'includes/products.php' );
3
+ include_once( WOO_CE_PATH . 'includes/categories.php' );
4
+ include_once( WOO_CE_PATH . 'includes/tags.php' );
5
+ include_once( WOO_CE_PATH . 'includes/brands.php' );
6
+ include_once( WOO_CE_PATH . 'includes/orders.php' );
7
+ include_once( WOO_CE_PATH . 'includes/customers.php' );
8
+ include_once( WOO_CE_PATH . 'includes/users.php' );
9
+ include_once( WOO_CE_PATH . 'includes/coupons.php' );
10
+ include_once( WOO_CE_PATH . 'includes/subscriptions.php' );
11
+ include_once( WOO_CE_PATH . 'includes/product_vendors.php' );
12
+ include_once( WOO_CE_PATH . 'includes/shipping_classes.php' );
13
+
14
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
15
+ include_once( WOO_CE_PATH . 'includes/legacy.php' );
16
+ include_once( WOO_CE_PATH . 'includes/formatting.php' );
17
+
18
+ include_once( WOO_CE_PATH . 'includes/export-csv.php' );
19
+
20
+ if( is_admin() ) {
21
+
22
+ /* Start of: WordPress Administration */
23
+
24
+ include_once( WOO_CE_PATH . 'includes/admin.php' );
25
+ include_once( WOO_CE_PATH . 'includes/settings.php' );
26
+
27
+ function woo_ce_detect_non_woo_install() {
28
+
29
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
30
+ if( !woo_is_woo_activated() && ( woo_is_jigo_activated() || woo_is_wpsc_activated() ) ) {
31
+ $message = sprintf( __( 'We have detected another e-Commerce Plugin than WooCommerce activated, please check that you are using Store Exporter Deluxe for the correct platform. <a href="%s" target="_blank">Need help?</a>', 'woo_ce' ), $troubleshooting_url );
32
+ woo_ce_admin_notice( $message, 'error', 'plugins.php' );
33
+ } else if( !woo_is_woo_activated() ) {
34
+ $message = sprintf( __( 'We have been unable to detect the WooCommerce Plugin activated on this WordPress site, please check that you are using Store Exporter Deluxe for the correct platform. <a href="%s" target="_blank">Need help?</a>', 'woo_ce' ), $troubleshooting_url );
35
+ woo_ce_admin_notice( $message, 'error', 'plugins.php' );
36
+ }
37
+ woo_ce_plugin_page_notices();
38
+
39
+ }
40
+
41
+ // Displays a HTML notice when a WordPress or Store Exporter error is encountered
42
+ function woo_ce_fail_notices() {
43
+
44
+ woo_ce_memory_prompt();
45
+
46
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
47
+ if( isset( $_GET['failed'] ) ) {
48
+ $message = '';
49
+ if( isset( $_GET['message'] ) )
50
+ $message = urldecode( $_GET['message'] );
51
+ if( $message )
52
+ $message = sprintf( __( 'A WordPress or server error caused the exporter to fail, the exporter was provided with a reason: <em>%s</em>', 'woo_ce' ), $message ) . ' (<a href="' . $troubleshooting_url . '" target="_blank">' . __( 'Need help?', 'woo_ce' ) . '</a>)';
53
+ else
54
+ $message = __( 'A WordPress or server error caused the exporter to fail, no reason was provided, please get in touch so we can reproduce and resolve this.', 'woo_ce' ) . ' (<a href="' . $troubleshooting_url . '" target="_blank">' . __( 'Need help?', 'woo_ce' ) . '</a>)';
55
+ woo_ce_admin_notice_html( $message, 'error' );
56
+ }
57
+ if( get_transient( WOO_CE_PREFIX . '_running' ) ) {
58
+ $message = __( 'A WordPress or server error caused the exporter to fail with a blank screen, this is either a memory or timeout issue, please get in touch so we can reproduce and resolve this.', 'woo_ce' ) . ' (<a href="' . $troubleshooting_url . '" target="_blank">' . __( 'Need help?', 'woo_ce' ) . '</a>)';
59
+ woo_ce_admin_notice_html( $message, 'error' );
60
+ delete_transient( WOO_CE_PREFIX . '_running' );
61
+ }
62
+
63
+ }
64
+
65
+ function woo_ce_memory_prompt() {
66
+
67
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
68
+
69
+ // Displays a HTML notice where the memory allocated to WordPress falls below 64MB
70
+ $memory_limit = (int)( ini_get( 'memory_limit' ) );
71
+ $minimum_memory_limit = 64;
72
+ if( ( $memory_limit < $minimum_memory_limit ) && !woo_ce_get_option( 'dismiss_memory_prompt', 0 ) ) {
73
+ $dismiss_url = add_query_arg( 'action', 'dismiss_memory_prompt' );
74
+ $message = sprintf( __( 'We recommend setting memory to at least %dMB, your site has only %dMB allocated to it. See: <a href="%s" target="_blank">Increasing memory allocated to PHP</a>', 'woo_ce' ), $minimum_memory_limit, $memory_limit, $troubleshooting_url ) . '<span style="float:right;"><a href="' . $dismiss_url . '">' . __( 'Dismiss', 'woo_ce' ) . '</a></span>';
75
+ woo_ce_admin_notice_html( $message, 'error' );
76
+ }
77
+
78
+ if( version_compare( phpversion(), '5.3', '<' ) && !woo_ce_get_option( 'dismiss_php_legacy', 0 ) ) {
79
+ $dismiss_url = add_query_arg( 'action', 'dismiss_php_legacy' );
80
+ $message = sprintf( __( 'Your PHP version (%s) is not supported and is very much out of date, since 2010 all users are strongly encouraged to upgrade to PHP 5.3+ and above. Contact your hosting provider to make this happen. See: <a href="%s" target="_blank">Migrating from PHP 5.2 to 5.3</a>', 'woo_ce' ), phpversion(), $troubleshooting_url ) . '<span style="float:right;"><a href="' . $dismiss_url . '">' . __( 'Dismiss', 'woo_ce' ) . '</a></span>';
81
+ woo_ce_admin_notice_html( $message, 'error' );
82
+ }
83
+
84
+ }
85
+
86
+ function woo_ce_plugin_page_notices() {
87
+
88
+ global $pagenow;
89
+
90
+ if( $pagenow == 'plugins.php' ) {
91
+ if( woo_is_jigo_activated() || woo_is_wpsc_activated() ) {
92
+ $r_plugins = array(
93
+ 'woocommerce-exporter/exporter.php',
94
+ 'woocommerce-store-exporter/exporter.php'
95
+ );
96
+ $i_plugins = get_plugins();
97
+ foreach( $r_plugins as $path ) {
98
+ if( isset( $i_plugins[$path] ) ) {
99
+ add_action( 'after_plugin_row_' . $path, 'woo_ce_plugin_page_notice', 10, 3 );
100
+ break;
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+
107
+ function woo_ce_plugin_page_notice( $file, $data, $context ) {
108
+
109
+ if( is_plugin_active( $file ) ) { ?>
110
+ <tr class='plugin-update-tr su-plugin-notice'>
111
+ <td colspan='3' class='plugin-update colspanchange'>
112
+ <div class='update-message'>
113
+ <?php printf( __( '%1$s is intended to be used with a WooCommerce store, please check that you are using Store Exporter with the correct e-Commerce platform.', 'woo_ce' ), $data['Name'] ); ?>
114
+ </div>
115
+ </td>
116
+ </tr>
117
+ <?php
118
+ }
119
+
120
+ }
121
+
122
+ // Saves the state of Export fields for next export
123
+ function woo_ce_save_fields( $type = '', $fields = array(), $sorting = array() ) {
124
+
125
+ if( $fields == false )
126
+ $fields = array();
127
+ $types = array_keys( woo_ce_return_export_types() );
128
+ if( in_array( $type, $types ) && !empty( $fields ) ) {
129
+ woo_ce_update_option( $type . '_fields', array_map( 'sanitize_text_field', $fields ) );
130
+ woo_ce_update_option( $type . '_sorting', array_map( 'absint', $sorting ) );
131
+ }
132
+
133
+ }
134
+
135
+ // Returns number of an Export type prior to export, used on Store Exporter screen
136
+ function woo_ce_return_count( $export_type = '', $args = array() ) {
137
+
138
+ global $wpdb;
139
+
140
+ $count_sql = null;
141
+ switch( $export_type ) {
142
+
143
+ case 'product':
144
+ $post_type = array( 'product', 'product_variation' );
145
+ $args = array(
146
+ 'post_type' => $post_type,
147
+ 'posts_per_page' => 1,
148
+ 'fields' => 'ids'
149
+ );
150
+ $query = new WP_Query( $args );
151
+ $count = $query->found_posts;
152
+ break;
153
+
154
+ case 'category':
155
+ $term_taxonomy = 'product_cat';
156
+ $count = wp_count_terms( $term_taxonomy );
157
+ break;
158
+
159
+ case 'tag':
160
+ $term_taxonomy = 'product_tag';
161
+ $count = wp_count_terms( $term_taxonomy );
162
+ break;
163
+
164
+ case 'brand':
165
+ $term_taxonomy = apply_filters( 'woo_ce_return_count_brand', 'product_brand' );
166
+ $count = wp_count_terms( $term_taxonomy );
167
+ break;
168
+
169
+ case 'order':
170
+ $post_type = 'shop_order';
171
+ $args = array(
172
+ 'post_type' => $post_type,
173
+ 'posts_per_page' => 1,
174
+ 'fields' => 'ids'
175
+ );
176
+ $query = new WP_Query( $args );
177
+ $count = $query->found_posts;
178
+ break;
179
+
180
+ case 'customer':
181
+ if( $users = woo_ce_return_count( 'user' ) > 1000 ) {
182
+ $count = sprintf( '~%s+', 1000 );
183
+ } else {
184
+ $post_type = 'shop_order';
185
+ $args = array(
186
+ 'post_type' => $post_type,
187
+ 'posts_per_page' => -1,
188
+ 'fields' => 'ids'
189
+ );
190
+ // Check if this is a WooCommerce 2.2+ instance (new Post Status)
191
+ $woocommerce_version = woo_get_woo_version();
192
+ if( version_compare( $woocommerce_version, '2.2' ) >= 0 ) {
193
+ $args['post_status'] = apply_filters( 'woo_ce_customer_post_status', array( 'wc-pending', 'wc-on-hold', 'wc-processing', 'wc-completed' ) );
194
+ } else {
195
+ $args['post_status'] = apply_filters( 'woo_ce_customer_post_status', woo_ce_post_statuses() );
196
+ $args['tax_query'] = array(
197
+ array(
198
+ 'taxonomy' => 'shop_order_status',
199
+ 'field' => 'slug',
200
+ 'terms' => array( 'pending', 'on-hold', 'processing', 'completed' )
201
+ ),
202
+ );
203
+ }
204
+ $orders = new WP_Query( $args );
205
+ $count = $orders->found_posts;
206
+ if( $count > 100 ) {
207
+ $count = sprintf( '~%s', $count );
208
+ } else {
209
+ $customers = array();
210
+ if ( $orders->have_posts() ) {
211
+ while ( $orders->have_posts() ) {
212
+ $orders->the_post();
213
+ $email = get_post_meta( get_the_ID(), '_billing_email', true );
214
+ if( !in_array( $email, $customers ) ) {
215
+ $customers[get_the_ID()] = $email;
216
+ }
217
+ unset( $email );
218
+ }
219
+ $count = count( $customers );
220
+ }
221
+ wp_reset_postdata();
222
+ }
223
+ }
224
+ /*
225
+ if( false ) {
226
+ $orders = get_posts( $args );
227
+ if( $orders ) {
228
+ $customers = array();
229
+ foreach( $orders as $order ) {
230
+ $order->email = get_post_meta( $order->ID, '_billing_email', true );
231
+ if( empty( $order->email ) ) {
232
+ if( $order->user_id = get_post_meta( $order->ID, '_customer_user', true ) ) {
233
+ $user = get_userdata( $order->user_id );
234
+ if( $user )
235
+ $order->email = $user->user_email;
236
+ unset( $user );
237
+ } else {
238
+ $order->email = '-';
239
+ }
240
+ }
241
+ if( !in_array( $order->email, $customers ) ) {
242
+ $customers[$order->ID] = $order->email;
243
+ $count++;
244
+ }
245
+ }
246
+ unset( $orders, $order );
247
+ }
248
+ }
249
+ */
250
+ break;
251
+
252
+ case 'user':
253
+ if( $users = count_users() )
254
+ $count = $users['total_users'];
255
+ break;
256
+
257
+ case 'coupon':
258
+ $post_type = 'shop_coupon';
259
+ $count = wp_count_posts( $post_type );
260
+ break;
261
+
262
+ case 'subscription':
263
+ $count = 0;
264
+ // Check that WooCommerce Subscriptions exists
265
+ if( class_exists( 'WC_Subscriptions_Manager' ) ) {
266
+ // Check that the get_all_users_subscriptions() function exists
267
+ if( method_exists( 'WC_Subscriptions_Manager', 'get_all_users_subscriptions' ) ) {
268
+ if( $subscriptions = WC_Subscriptions_Manager::get_all_users_subscriptions() ) {
269
+ foreach( $subscriptions as $key => $user_subscription ) {
270
+ if( !empty( $user_subscription ) ) {
271
+ foreach( $user_subscription as $subscription )
272
+ $count++;
273
+ }
274
+ }
275
+ unset( $subscriptions, $subscription, $user_subscription );
276
+ }
277
+ }
278
+ }
279
+ break;
280
+
281
+ case 'product_vendor':
282
+ $term_taxonomy = 'shop_vendor';
283
+ $count = wp_count_terms( $term_taxonomy );
284
+ break;
285
+
286
+ case 'shipping_class':
287
+ $term_taxonomy = 'product_shipping_class';
288
+ $count = wp_count_terms( $term_taxonomy );
289
+ break;
290
+
291
+ case 'attribute':
292
+ $attributes = ( function_exists( 'wc_get_attribute_taxonomies' ) ? wc_get_attribute_taxonomies() : array() );
293
+ $count = count( $attributes );
294
+ break;
295
+
296
+ }
297
+ if( isset( $count ) || $count_sql ) {
298
+ if( isset( $count ) ) {
299
+ if( is_object( $count ) ) {
300
+ $count = (array)$count;
301
+ $count = (int)array_sum( $count );
302
+ }
303
+ return $count;
304
+ } else {
305
+ if( $count_sql )
306
+ $count = $wpdb->get_var( $count_sql );
307
+ else
308
+ $count = 0;
309
+ }
310
+ return $count;
311
+ } else {
312
+ return 0;
313
+ }
314
+
315
+ }
316
+
317
+ // In-line display of export file and export details when viewed via WordPress Media screen
318
+ function woo_ce_read_csv_file( $post = null ) {
319
+
320
+ if( !$post ) {
321
+ if( isset( $_GET['post'] ) )
322
+ $post = get_post( $_GET['post'] );
323
+ }
324
+
325
+ if( $post->post_type != 'attachment' )
326
+ return false;
327
+
328
+ if( !in_array( $post->post_mime_type, array( 'text/csv', 'xml/application', 'application/vnd.ms-excel' ) ) )
329
+ return false;
330
+
331
+ $filename = $post->post_name;
332
+ $filepath = get_attached_file( $post->ID );
333
+ $contents = __( 'No export entries were found, please try again with different export filters.', 'woo_ce' );
334
+ if( file_exists( $filepath ) ) {
335
+ $handle = fopen( $filepath, "r" );
336
+ $contents = stream_get_contents( $handle );
337
+ fclose( $handle );
338
+ } else {
339
+ // This resets the _wp_attached_file Post meta key to the correct value
340
+ update_attached_file( $post->ID, $post->guid );
341
+ // Try grabbing the file contents again
342
+ $filepath = get_attached_file( $post->ID );
343
+ if( file_exists( $filepath ) ) {
344
+ $handle = fopen( $filepath, "r" );
345
+ $contents = stream_get_contents( $handle );
346
+ fclose( $handle );
347
+ }
348
+ }
349
+ if( !empty( $contents ) )
350
+ include_once( WOO_CE_PATH . 'templates/admin/media-csv_file.php' );
351
+
352
+ $export_type = get_post_meta( $post->ID, '_woo_export_type', true );
353
+ $columns = get_post_meta( $post->ID, '_woo_columns', true );
354
+ $rows = get_post_meta( $post->ID, '_woo_rows', true );
355
+ $start_time = get_post_meta( $post->ID, '_woo_start_time', true );
356
+ $end_time = get_post_meta( $post->ID, '_woo_end_time', true );
357
+ $idle_memory_start = get_post_meta( $post->ID, '_woo_idle_memory_start', true );
358
+ $data_memory_start = get_post_meta( $post->ID, '_woo_data_memory_start', true );
359
+ $data_memory_end = get_post_meta( $post->ID, '_woo_data_memory_end', true );
360
+ $idle_memory_end = get_post_meta( $post->ID, '_woo_idle_memory_end', true );
361
+
362
+ include_once( WOO_CE_PATH . 'templates/admin/media-export_details.php' );
363
+
364
+ }
365
+ add_action( 'edit_form_after_editor', 'woo_ce_read_csv_file' );
366
+
367
+ // Returns label of Export type slug used on Store Exporter screen
368
+ function woo_ce_export_type_label( $export_type = '', $echo = false ) {
369
+
370
+ $output = '';
371
+ if( !empty( $export_type ) ) {
372
+ $export_types = woo_ce_return_export_types();
373
+ if( array_key_exists( $export_type, $export_types ) )
374
+ $output = $export_types[$export_type];
375
+ }
376
+ if( $echo )
377
+ echo $output;
378
+ else
379
+ return $output;
380
+
381
+ }
382
+
383
+ function woo_ce_export_options_export_format() {
384
+
385
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
386
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
387
+
388
+ ob_start(); ?>
389
+ <tr>
390
+ <th>
391
+ <label><?php _e( 'Export format', 'woo_ce' ); ?></label>
392
+ </th>
393
+ <td>
394
+ <label><input type="radio" name="export_format" value="csv"<?php checked( 'csv', 'csv' ); ?> /> <?php _e( 'CSV', 'woo_ce' ); ?> <span class="description"><?php _e( '(Comma separated values)', 'woo_ce' ); ?></span></label><br />
395
+ <label><input type="radio" name="export_format" value="xml" disabled="disabled" /> <?php _e( 'XML', 'woo_ce' ); ?> <span class="description"><?php _e( '(EXtensible Markup Language)', 'woo_ce' ); ?> <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label><br />
396
+ <label><input type="radio" name="export_format" value="xls" disabled="disabled" /> <?php _e( 'Excel (XLS)', 'woo_ce' ); ?> <span class="description"><?php _e( '(Microsoft Excel 2007)', 'woo_ce' ); ?> <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
397
+ <p class="description"><?php _e( 'Adjust the export format to generate different export file formats.', 'woo_ce' ); ?></p>
398
+ </td>
399
+ </tr>
400
+ <?php
401
+ ob_end_flush();
402
+
403
+ }
404
+
405
+ function woo_ce_export_options_gallery_format() {
406
+
407
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
408
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
409
+
410
+ ob_start(); ?>
411
+ <tr class="export-options product-options">
412
+ <th><label for=""><?php _e( 'Product gallery formatting', 'woo_ce' ); ?></label></th>
413
+ <td>
414
+ <label><input type="radio" name="product_gallery_formatting" value="0"<?php checked( 0, 0 ); ?> />&nbsp;<?php _e( 'Export Product Gallery as Post ID', 'woo_ce' ); ?></label><br />
415
+ <label><input type="radio" name="product_gallery_formatting" value="1" disabled="disabled" />&nbsp;<?php _e( 'Export Product Gallery as Image URL', 'woo_ce' ); ?> <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
416
+ <p class="description"><?php _e( 'Choose the product gallery formatting that is accepted by your WooCommerce import Plugin (e.g. Product Importer Deluxe, Product Import Suite, etc.).', 'woo_ce' ); ?></p>
417
+ </td>
418
+ </tr>
419
+ <?php
420
+ ob_end_flush();
421
+
422
+ }
423
+
424
+ // Returns a list of archived exports
425
+ function woo_ce_get_archive_files() {
426
+
427
+ $post_type = 'attachment';
428
+ $meta_key = '_woo_export_type';
429
+ $args = array(
430
+ 'post_type' => $post_type,
431
+ 'post_mime_type' => array( 'text/csv', 'xml/application', 'application/vnd.ms-excel' ),
432
+ 'meta_key' => $meta_key,
433
+ 'meta_value' => null,
434
+ 'posts_per_page' => -1
435
+ );
436
+ if( isset( $_GET['filter'] ) ) {
437
+ $filter = $_GET['filter'];
438
+ if( !empty( $filter ) )
439
+ $args['meta_value'] = $filter;
440
+ }
441
+ $files = get_posts( $args );
442
+ return $files;
443
+
444
+ }
445
+
446
+ // Returns an archived export with additional details
447
+ function woo_ce_get_archive_file( $file = '' ) {
448
+
449
+ $wp_upload_dir = wp_upload_dir();
450
+ $file->export_type = get_post_meta( $file->ID, '_woo_export_type', true );
451
+ $file->export_type_label = woo_ce_export_type_label( $file->export_type );
452
+ if( empty( $file->export_type ) )
453
+ $file->export_type = __( 'Unassigned', 'woo_ce' );
454
+ if( empty( $file->guid ) )
455
+ $file->guid = $wp_upload_dir['url'] . '/' . basename( $file->post_title );
456
+ $file->post_mime_type = get_post_mime_type( $file->ID );
457
+ if( !$file->post_mime_type )
458
+ $file->post_mime_type = __( 'N/A', 'woo_ce' );
459
+ $file->media_icon = wp_get_attachment_image( $file->ID, array( 80, 60 ), true );
460
+ if( $author_name = get_user_by( 'id', $file->post_author ) )
461
+ $file->post_author_name = $author_name->display_name;
462
+ $t_time = strtotime( $file->post_date, current_time( 'timestamp' ) );
463
+ $time = get_post_time( 'G', true, $file->ID, false );
464
+ if( ( abs( $t_diff = time() - $time ) ) < 86400 )
465
+ $file->post_date = sprintf( __( '%s ago', 'woo_ce' ), human_time_diff( $time ) );
466
+ else
467
+ $file->post_date = mysql2date( 'Y/m/d', $file->post_date );
468
+ unset( $author_name, $t_time, $time );
469
+ return $file;
470
+
471
+ }
472
+
473
+ // HTML template for displaying the current export type filter on the Archives screen
474
+ function woo_ce_archives_quicklink_current( $current = '' ) {
475
+
476
+ $output = '';
477
+ if( isset( $_GET['filter'] ) ) {
478
+ $filter = $_GET['filter'];
479
+ if( $filter == $current )
480
+ $output = ' class="current"';
481
+ } else if( $current == 'all' ) {
482
+ $output = ' class="current"';
483
+ }
484
+ echo $output;
485
+
486
+ }
487
+
488
+ // HTML template for displaying the number of each export type filter on the Archives screen
489
+ function woo_ce_archives_quicklink_count( $type = '' ) {
490
+
491
+ $output = '0';
492
+ $post_type = 'attachment';
493
+ $meta_key = '_woo_export_type';
494
+ $args = array(
495
+ 'post_type' => $post_type,
496
+ 'meta_key' => $meta_key,
497
+ 'meta_value' => null,
498
+ 'numberposts' => -1
499
+ );
500
+ if( $type )
501
+ $args['meta_value'] = $type;
502
+ if( $posts = get_posts( $args ) )
503
+ $output = count( $posts );
504
+ echo $output;
505
+
506
+ }
507
+
508
+ /* End of: WordPress Administration */
509
+
510
+ }
511
+
512
+ // Export process for CSV file
513
+ function woo_ce_export_dataset( $export_type = null, &$output = null ) {
514
+
515
+ global $export;
516
+
517
+ $separator = $export->delimiter;
518
+ $export->columns = array();
519
+ $export->total_rows = 0;
520
+ $export->total_columns = 0;
521
+ set_transient( WOO_CE_PREFIX . '_running', time(), woo_ce_get_option( 'timeout', MINUTE_IN_SECONDS ) );
522
+
523
+ switch( $export_type ) {
524
+
525
+ // Products
526
+ case 'product':
527
+ $fields = woo_ce_get_product_fields( 'summary' );
528
+ if( $export->fields = array_intersect_assoc( (array)$export->fields, $fields ) ) {
529
+ foreach( $export->fields as $key => $field )
530
+ $export->columns[] = woo_ce_get_product_field( $key );
531
+ }
532
+ $export->data_memory_start = woo_ce_current_memory_usage();
533
+ if( $products = woo_ce_get_products( $export->args ) ) {
534
+ $export->total_rows = count( $products );
535
+ $export->total_columns = $size = count( $export->columns );
536
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
537
+ for( $i = 0; $i < $size; $i++ ) {
538
+ if( $i == ( $size - 1 ) )
539
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
540
+ else
541
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
542
+ }
543
+ }
544
+ $weight_unit = get_option( 'woocommerce_weight_unit' );
545
+ $dimension_unit = get_option( 'woocommerce_dimension_unit' );
546
+ $height_unit = $dimension_unit;
547
+ $width_unit = $dimension_unit;
548
+ $length_unit = $dimension_unit;
549
+ if( !empty( $export->fields ) ) {
550
+ foreach( $products as $product ) {
551
+
552
+ $product = woo_ce_get_product_data( $product, $export->args );
553
+ foreach( $export->fields as $key => $field ) {
554
+ if( isset( $product->$key ) ) {
555
+ if( is_array( $field ) ) {
556
+ foreach( $field as $array_key => $array_value ) {
557
+ if( !is_array( $array_value ) ) {
558
+ if( in_array( $export->export_format, array( 'csv' ) ) )
559
+ $output .= woo_ce_escape_csv_value( $array_value, $export->delimiter, $export->escape_formatting );
560
+ }
561
+ }
562
+ } else {
563
+ if( in_array( $export->export_format, array( 'csv' ) ) )
564
+ $output .= woo_ce_escape_csv_value( $product->$key, $export->delimiter, $export->escape_formatting );
565
+ }
566
+ }
567
+ if( in_array( $export->export_format, array( 'csv' ) ) )
568
+ $output .= $separator;
569
+ }
570
+
571
+ if( in_array( $export->export_format, array( 'csv' ) ) )
572
+ $output = substr( $output, 0, -1 ) . "\n";
573
+ }
574
+ }
575
+ unset( $products, $product );
576
+ }
577
+ $export->data_memory_end = woo_ce_current_memory_usage();
578
+ break;
579
+
580
+ // Categories
581
+ case 'category':
582
+ $fields = woo_ce_get_category_fields( 'summary' );
583
+ if( $export->fields = array_intersect_assoc( (array)$export->fields, $fields ) ) {
584
+ foreach( $export->fields as $key => $field )
585
+ $export->columns[] = woo_ce_get_category_field( $key );
586
+ }
587
+ $export->data_memory_start = woo_ce_current_memory_usage();
588
+ $category_args = array(
589
+ 'orderby' => ( isset( $export->args['category_orderby'] ) ? $export->args['category_orderby'] : 'ID' ),
590
+ 'order' => ( isset( $export->args['category_order'] ) ? $export->args['category_order'] : 'ASC' ),
591
+ );
592
+ if( $categories = woo_ce_get_product_categories( $category_args ) ) {
593
+ $export->total_rows = count( $categories );
594
+ $export->total_columns = $size = count( $export->columns );
595
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
596
+ for( $i = 0; $i < $size; $i++ ) {
597
+ if( $i == ( $size - 1 ) )
598
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
599
+ else
600
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
601
+ }
602
+ }
603
+ if( !empty( $export->fields ) ) {
604
+ foreach( $categories as $category ) {
605
+
606
+ foreach( $export->fields as $key => $field ) {
607
+ if( isset( $category->$key ) ) {
608
+ if( in_array( $export->export_format, array( 'csv' ) ) )
609
+ $output .= woo_ce_escape_csv_value( $category->$key, $export->delimiter, $export->escape_formatting );
610
+ }
611
+ if( in_array( $export->export_format, array( 'csv' ) ) )
612
+ $output .= $separator;
613
+ }
614
+ if( in_array( $export->export_format, array( 'csv' ) ) )
615
+ $output = substr( $output, 0, -1 ) . "\n";
616
+ }
617
+ }
618
+ unset( $categories, $category );
619
+ }
620
+ $export->data_memory_end = woo_ce_current_memory_usage();
621
+ break;
622
+
623
+ // Tags
624
+ case 'tag':
625
+ $fields = woo_ce_get_tag_fields( 'summary' );
626
+ if( $export->fields = array_intersect_assoc( (array)$export->fields, $fields ) ) {
627
+ foreach( $export->fields as $key => $field )
628
+ $export->columns[] = woo_ce_get_tag_field( $key );
629
+ }
630
+ $export->data_memory_start = woo_ce_current_memory_usage();
631
+ $tag_args = array(
632
+ 'orderby' => ( isset( $export->args['tag_orderby'] ) ? $export->args['tag_orderby'] : 'ID' ),
633
+ 'order' => ( isset( $export->args['tag_order'] ) ? $export->args['tag_order'] : 'ASC' ),
634
+ );
635
+ if( $tags = woo_ce_get_product_tags( $tag_args ) ) {
636
+ $export->total_rows = count( $tags );
637
+ $export->total_columns = $size = count( $export->columns );
638
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
639
+ for( $i = 0; $i < $size; $i++ ) {
640
+ if( $i == ( $size - 1 ) )
641
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
642
+ else
643
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
644
+ }
645
+ }
646
+ if( !empty( $export->fields ) ) {
647
+ foreach( $tags as $tag ) {
648
+
649
+ foreach( $export->fields as $key => $field ) {
650
+ if( isset( $tag->$key ) ) {
651
+ if( in_array( $export->export_format, array( 'csv' ) ) )
652
+ $output .= woo_ce_escape_csv_value( $tag->$key, $export->delimiter, $export->escape_formatting );
653
+ }
654
+ if( in_array( $export->export_format, array( 'csv' ) ) )
655
+ $output .= $separator;
656
+ }
657
+ if( in_array( $export->export_format, array( 'csv' ) ) )
658
+ $output = substr( $output, 0, -1 ) . "\n";
659
+ }
660
+ }
661
+ unset( $tags, $tag );
662
+ }
663
+ $export->data_memory_end = woo_ce_current_memory_usage();
664
+ break;
665
+
666
+ // Users
667
+ case 'user':
668
+ $fields = woo_ce_get_user_fields( 'summary' );
669
+ if( $export->fields = array_intersect_assoc( (array)$export->fields, $fields ) ) {
670
+ foreach( $export->fields as $key => $field )
671
+ $export->columns[] = woo_ce_get_user_field( $key );
672
+ }
673
+ $export->data_memory_start = woo_ce_current_memory_usage();
674
+ if( $users = woo_ce_get_users( $export->args ) ) {
675
+ $export->total_columns = $size = count( $export->columns );
676
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
677
+ $i = 0;
678
+ foreach( $export->columns as $column ) {
679
+ if( $i == ( $size - 1 ) )
680
+ $output .= woo_ce_escape_csv_value( $column, $export->delimiter, $export->escape_formatting ) . "\n";
681
+ else
682
+ $output .= woo_ce_escape_csv_value( $column, $export->delimiter, $export->escape_formatting ) . $separator;
683
+ $i++;
684
+ }
685
+ }
686
+ if( !empty( $export->fields ) ) {
687
+ foreach( $users as $user ) {
688
+
689
+ $user = woo_ce_get_user_data( $user, $export->args );
690
+
691
+ foreach( $export->fields as $key => $field ) {
692
+ if( isset( $user->$key ) ) {
693
+ if( in_array( $export->export_format, array( 'csv' ) ) )
694
+ $output .= woo_ce_escape_csv_value( $user->$key, $export->delimiter, $export->escape_formatting );
695
+ }
696
+ if( in_array( $export->export_format, array( 'csv' ) ) )
697
+ $output .= $separator;
698
+ }
699
+ if( in_array( $export->export_format, array( 'csv' ) ) )
700
+ $output = substr( $output, 0, -1 ) . "\n";
701
+
702
+ }
703
+ }
704
+ unset( $users, $user );
705
+ }
706
+ $export->data_memory_end = woo_ce_current_memory_usage();
707
+ break;
708
+
709
+ }
710
+ // Export completed successfully
711
+ delete_transient( WOO_CE_PREFIX . '_running' );
712
+ // Check that the export file is populated, export columns have been assigned and rows counted
713
+ if( $output && $export->total_rows && $export->total_columns ) {
714
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
715
+ $output = woo_ce_file_encoding( $output );
716
+ if( $export->export_format == 'csv' && $export->bom && ( WOO_CE_DEBUG == false ) )
717
+ $output = "\xEF\xBB\xBF" . $output;
718
+ }
719
+ if( WOO_CE_DEBUG && !$export->cron )
720
+ set_transient( WOO_CE_PREFIX . '_debug_log', base64_encode( $output ), woo_ce_get_option( 'timeout', MINUTE_IN_SECONDS ) );
721
+ else
722
+ return $output;
723
+ }
724
+
725
+ }
726
+
727
+ // List of Export types used on Store Exporter screen
728
+ function woo_ce_return_export_types() {
729
+
730
+ $types = array();
731
+ $types['product'] = __( 'Products', 'woo_ce' );
732
+ $types['category'] = __( 'Categories', 'woo_ce' );
733
+ $types['tag'] = __( 'Tags', 'woo_ce' );
734
+ $types['user'] = __( 'Users', 'woo_ce' );
735
+ $types = apply_filters( 'woo_ce_types', $types );
736
+ return $types;
737
+
738
+ }
739
+
740
+ // Returns the Post object of the export file saved as an attachment to the WordPress Media library
741
+ function woo_ce_save_file_attachment( $filename = '', $post_mime_type = 'text/csv' ) {
742
+
743
+ if( !empty( $filename ) ) {
744
+ $post_type = 'woo-export';
745
+ $args = array(
746
+ 'post_title' => $filename,
747
+ 'post_type' => $post_type,
748
+ 'post_mime_type' => $post_mime_type
749
+ );
750
+ $post_ID = wp_insert_attachment( $args, $filename );
751
+ if( is_wp_error( $post_ID ) )
752
+ error_log( sprintf( '[store-exporter-deluxe] save_file_attachment() - $s: %s', $filename, $result->get_error_message() ) );
753
+ else
754
+ return $post_ID;
755
+ }
756
+
757
+ }
758
+
759
+ // Updates the GUID of the export file attachment to match the correct file URL
760
+ function woo_ce_save_file_guid( $post_ID, $export_type, $upload_url = '' ) {
761
+
762
+ add_post_meta( $post_ID, '_woo_export_type', $export_type );
763
+ if( !empty( $upload_url ) ) {
764
+ $args = array(
765
+ 'ID' => $post_ID,
766
+ 'guid' => $upload_url
767
+ );
768
+ wp_update_post( $args );
769
+ }
770
+
771
+ }
772
+
773
+ // Save critical export details against the archived export
774
+ function woo_ce_save_file_details( $post_ID ) {
775
+
776
+ global $export;
777
+
778
+ add_post_meta( $post_ID, '_woo_start_time', $export->start_time );
779
+ add_post_meta( $post_ID, '_woo_idle_memory_start', $export->idle_memory_start );
780
+ add_post_meta( $post_ID, '_woo_columns', $export->total_columns );
781
+ add_post_meta( $post_ID, '_woo_rows', $export->total_rows );
782
+ add_post_meta( $post_ID, '_woo_data_memory_start', $export->data_memory_start );
783
+ add_post_meta( $post_ID, '_woo_data_memory_end', $export->data_memory_end );
784
+
785
+ }
786
+
787
+ // Update detail of existing archived export
788
+ function woo_ce_update_file_detail( $post_ID, $detail, $value ) {
789
+
790
+ if( strstr( $detail, '_woo_' ) !== false )
791
+ update_post_meta( $post_ID, $detail, $value );
792
+
793
+ }
794
+
795
+ // Returns a list of allowed Export type statuses, can be overridden on a per-Export type basis
796
+ function woo_ce_post_statuses( $extra_status = array(), $override = false ) {
797
+
798
+ $output = array(
799
+ 'publish',
800
+ 'pending',
801
+ 'draft',
802
+ 'future',
803
+ 'private',
804
+ 'trash'
805
+ );
806
+ if( $override ) {
807
+ $output = $extra_status;
808
+ } else {
809
+ if( $extra_status )
810
+ $output = array_merge( $output, $extra_status );
811
+ }
812
+ return $output;
813
+
814
+ }
815
+
816
+ function woo_ce_add_missing_mime_type( $mime_types = array() ) {
817
+
818
+ // Add CSV mime type if it has been removed
819
+ if( !isset( $mime_types['csv'] ) )
820
+ $mime_types['csv'] = 'text/csv';
821
+ return $mime_types;
822
+
823
+ }
824
+ add_filter( 'upload_mimes', 'woo_ce_add_missing_mime_type', 10, 1 );
825
+
826
+ if( !function_exists( 'woo_ce_sort_fields' ) ) {
827
+ function woo_ce_sort_fields( $key ) {
828
+
829
+ return $key;
830
+
831
+ }
832
+ }
833
+
834
+
835
+ // Add Store Export to filter types on the WordPress Media screen
836
+ function woo_ce_add_post_mime_type( $post_mime_types = array() ) {
837
+
838
+ $post_mime_types['text/csv'] = array( __( 'Store Exports (CSV)', 'woo_ce' ), __( 'Manage Store Exports (CSV)', 'woo_ce' ), _n_noop( 'Store Export - CSV <span class="count">(%s)</span>', 'Store Exports - CSV <span class="count">(%s)</span>' ) );
839
+ return $post_mime_types;
840
+
841
+ }
842
+ add_filter( 'post_mime_types', 'woo_ce_add_post_mime_type' );
843
+
844
+ function woo_ce_current_memory_usage() {
845
+
846
+ $output = '';
847
+ if( function_exists( 'memory_get_usage' ) )
848
+ $output = round( memory_get_usage( true ) / 1024 / 1024, 2 );
849
+ return $output;
850
+
851
+ }
852
+
853
+ function woo_ce_get_option( $option = null, $default = false, $allow_empty = false ) {
854
+
855
+ $output = '';
856
+ if( isset( $option ) ) {
857
+ $separator = '_';
858
+ $output = get_option( WOO_CE_PREFIX . $separator . $option, $default );
859
+ if( $allow_empty == false && $output != 0 && ( $output == false || $output == '' ) )
860
+ $output = $default;
861
+ }
862
+ return $output;
863
+
864
+ }
865
+
866
+ function woo_ce_update_option( $option = null, $value = null ) {
867
+
868
+ $output = false;
869
+ if( isset( $option ) && isset( $value ) ) {
870
+ $separator = '_';
871
+ $output = update_option( WOO_CE_PREFIX . $separator . $option, $value );
872
+ }
873
+ return $output;
874
+
875
+ }
876
+ ?>
includes/install.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // De-activate Store Exporter to limit conflicts
3
+ function woo_ce_deactivate_ce() {
4
+
5
+ $plugins = array(
6
+ 'woocommerce-exporter/exporter.php',
7
+ 'woocommerce-store-exporter/exporter.php'
8
+ );
9
+ deactivate_plugins( $plugins, true );
10
+
11
+ }
12
+
13
+ function woo_ce_install() {
14
+
15
+ woo_ce_create_options();
16
+
17
+ }
18
+
19
+ // Trigger the creation of Admin options for this Plugin
20
+ function woo_ce_create_options() {
21
+
22
+ $prefix = 'woo_ce';
23
+ if( !get_option( $prefix . '_export_filename' ) )
24
+ add_option( $prefix . '_export_filename', 'export_%dataset%-%date%-%time%.csv' );
25
+ if( !get_option( $prefix . '_delete_file' ) )
26
+ add_option( $prefix . '_delete_file', 0 );
27
+ if( !get_option( $prefix . '_delimiter' ) )
28
+ add_option( $prefix . '_delimiter', ',' );
29
+ if( !get_option( $prefix . '_category_separator' ) )
30
+ add_option( $prefix . '_category_separator', '|' );
31
+ if( !get_option( $prefix . '_bom' ) )
32
+ add_option( $prefix . '_bom', 1 );
33
+ if( !get_option( $prefix . '_encoding' ) )
34
+ add_option( $prefix . '_encoding', get_option( 'blog_charset', 'UTF-8' ) );
35
+ if( !get_option( $prefix . '_escape_formatting' ) )
36
+ add_option( $prefix . '_escape_formatting', 'all' );
37
+ if( !get_option( $prefix . '_date_format' ) )
38
+ add_option( $prefix . '_date_format', 1 );
39
+
40
+ }
41
+ ?>
includes/legacy.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Makes use of closure/anonymous functions available in PHP 5.3+
3
+ function woo_ce_sort_fields( $key ) {
4
+
5
+ return function( $a, $b ) use ( $key ) {
6
+ return strnatcmp( $a[$key], $b[$key] );
7
+ };
8
+
9
+ }
10
+ ?>
includes/orders.php ADDED
@@ -0,0 +1,1255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for disabled Filter Orders by Date widget on Store Exporter screen
7
+ function woo_ce_orders_filter_by_date() {
8
+
9
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
10
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
11
+
12
+ $current_month = date( 'F' );
13
+ $last_month = date( 'F', mktime( 0, 0, 0, date( 'n' )-1, 1, date( 'Y' ) ) );
14
+ $order_dates_from = '-';
15
+ $order_dates_to = '-';
16
+
17
+ ob_start(); ?>
18
+ <p><label><input type="checkbox" id="orders-filters-date" /> <?php _e( 'Filter Orders by Order Date', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
19
+ <div id="export-orders-filters-date" class="separator">
20
+ <ul>
21
+ <li>
22
+ <label><input type="radio" name="order_dates_filter" value="current_month" disabled="disabled" /> <?php _e( 'Current month', 'woo_ce' ); ?> (<?php echo $current_month; ?>)</label>
23
+ </li>
24
+ <li>
25
+ <label><input type="radio" name="order_dates_filter" value="last_month" disabled="disabled" /> <?php _e( 'Last month', 'woo_ce' ); ?> (<?php echo $last_month; ?>)</label>
26
+ </li>
27
+ <li>
28
+ <label><input type="radio" name="order_dates_filter" value="last_quarter" disabled="disabled" /> <?php _e( 'Last quarter', 'woo_ce' ); ?> (Nov. - Jan.)</label>
29
+ </li>
30
+ <li>
31
+ <label><input type="radio" name="order_dates_filter" value="manual" disabled="disabled" /> <?php _e( 'Manual', 'woo_ce' ); ?></label>
32
+ <div style="margin-top:0.2em;">
33
+ <input type="text" size="10" maxlength="10" id="order_dates_from" name="order_dates_from" value="<?php echo esc_attr( $order_dates_from ); ?>" class="text" disabled="disabled" /> to <input type="text" size="10" maxlength="10" id="order_dates_to" name="order_dates_to" value="<?php echo esc_attr( $order_dates_to ); ?>" class="text" disabled="disabled" />
34
+ <p class="description"><?php _e( 'Filter the dates of Orders to be included in the export. Default is the date of the first order to today.', 'woo_ce' ); ?></p>
35
+ </div>
36
+ </li>
37
+ </ul>
38
+ </div>
39
+ <!-- #export-orders-filters-date -->
40
+ <?php
41
+ ob_end_flush();
42
+
43
+ }
44
+
45
+ // HTML template for disabled Filter Orders by Customer widget on Store Exporter screen
46
+ function woo_ce_orders_filter_by_customer() {
47
+
48
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
49
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
50
+
51
+ ob_start(); ?>
52
+ <p><label><input type="checkbox" id="orders-filters-customer" /> <?php _e( 'Filter Orders by Customer', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
53
+ <div id="export-orders-filters-customer" class="separator">
54
+ <select id="order_customer" name="order_customer" disabled="disabled">
55
+ <option value=""><?php _e( 'Show all customers', 'woo_ce' ); ?></option>
56
+ </select>
57
+ <p class="description"><?php _e( 'Filter Orders by Customer (unique e-mail address) to be included in the export. Default is to include all Orders.', 'woo_ce' ); ?></p>
58
+ </div>
59
+ <!-- #export-orders-filters-customer -->
60
+ <?php
61
+ ob_end_flush();
62
+
63
+ }
64
+
65
+ // HTML template for disabled Filter Orders by User Role widget on Store Exporter screen
66
+ function woo_ce_orders_filter_by_user_role() {
67
+
68
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
69
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
70
+
71
+ $user_roles = woo_ce_get_user_roles();
72
+
73
+ ob_start(); ?>
74
+ <p><label><input type="checkbox" id="orders-filters-user_role" /> <?php _e( 'Filter Orders by User Role', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
75
+ <div id="export-orders-filters-user_role" class="separator">
76
+ <ul>
77
+ <?php if( $user_roles ) { ?>
78
+ <?php foreach( $user_roles as $key => $user_role ) { ?>
79
+ <li><label><input type="checkbox" name="order_filter_user_role[<?php echo $key; ?>]" value="<?php echo $key; ?>" disabled="disabled" /> <?php echo ucfirst( $user_role['name'] ); ?></label></li>
80
+ <?php } ?>
81
+ <?php } else { ?>
82
+ <li><?php _e( 'No User Roles were found.', 'woo_ce' ); ?></li>
83
+ <?php } ?>
84
+ </ul>
85
+ <p class="description"><?php _e( 'Select the User Roles you want to filter exported Orders by. Default is to include all User Role options.', 'woo_ce' ); ?></p>
86
+ </div>
87
+ <!-- #export-orders-filters-user_role -->
88
+ <?php
89
+ ob_end_flush();
90
+
91
+ }
92
+
93
+ // HTML template for disabled Filter Orders by Coupon Code widget on Store Exporter screen
94
+ function woo_ce_orders_filter_by_coupon() {
95
+
96
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
97
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
98
+
99
+ $args = array(
100
+ 'coupon_orderby' => 'ID',
101
+ 'coupon_order' => 'DESC'
102
+ );
103
+ $coupons = woo_ce_get_coupons( $args );
104
+
105
+ ob_start(); ?>
106
+ <p><label><input type="checkbox" id="orders-filters-coupon" /> <?php _e( 'Filter Orders by Coupon Code', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
107
+ <div id="export-orders-filters-coupon" class="separator">
108
+ <ul>
109
+ <?php foreach( $coupons as $key => $coupon ) { ?>
110
+ <li><label><input type="checkbox" name="order_filter_coupon[<?php echo $key; ?>]" disabled="disabled" /> <?php echo get_the_title( $coupon ); ?></label></li>
111
+ <?php } ?>
112
+ </ul>
113
+ <p class="description"><?php _e( 'Select the Coupon Codes you want to filter exported Orders by. Default is to include all Orders with and without assigned Coupon Codes.', 'woo_ce' ); ?></p>
114
+ </div>
115
+ <!-- #export-orders-filters-coupon -->
116
+ <?php
117
+ ob_end_flush();
118
+
119
+ }
120
+
121
+ // HTML template for disabled Order Items Formatting on Store Exporter screen
122
+ function woo_ce_orders_items_formatting() {
123
+
124
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
125
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
126
+
127
+ ob_start(); ?>
128
+ <tr class="export-options order-options">
129
+ <th><label for="order_items"><?php _e( 'Order items formatting', 'woo_ce' ); ?></label></th>
130
+ <td>
131
+ <ul>
132
+ <li>
133
+ <label><input type="radio" name="order_items" value="combined" disabled="disabled" />&nbsp;<?php _e( 'Place Order Items within a grouped single Order row', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
134
+ <p class="description"><?php _e( 'For example: <code>Order Items: SKU</code> cell might contain <code>SPECK-IPHONE|INCASE-NANO|-</code> for 3 Order items within an Order', 'woo_ce' ); ?></p>
135
+ </li>
136
+ <li>
137
+ <label><input type="radio" name="order_items" value="unique" disabled="disabled" />&nbsp;<?php _e( 'Place Order Items on individual cells within a single Order row', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
138
+ <p class="description"><?php _e( 'For example: <code>Order Items: SKU</code> would become <code>Order Item #1: SKU</code> with <codeSPECK-IPHONE</code> for the first Order item within an Order', 'woo_ce' ); ?></p>
139
+ </li>
140
+ <li>
141
+ <label><input type="radio" name="order_items" value="individual" disabled="disabled" />&nbsp;<?php _e( 'Place each Order Item within their own Order row', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
142
+ <p class="description"><?php _e( 'For example: An Order with 3 Order items will display a single Order item on each row', 'woo_ce' ); ?></p>
143
+ </li>
144
+ </ul>
145
+ <p class="description"><?php _e( 'Choose how you would like Order Items to be presented within Orders.', 'woo_ce' ); ?></p>
146
+ </td>
147
+ </tr>
148
+ <?php
149
+ ob_end_flush();
150
+
151
+ }
152
+
153
+ // HTML template for disabled Max Order Items widget on Store Exporter screen
154
+ function woo_ce_orders_max_order_items() {
155
+
156
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
157
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
158
+
159
+ $max_size = 10;
160
+
161
+ ob_start(); ?>
162
+ <tr id="max_order_items_option" class="export-options order-options">
163
+ <th>
164
+ <label for="max_order_items"><?php _e( 'Max unique Order items', 'woo_ce' ); ?>: </label>
165
+ </th>
166
+ <td>
167
+ <input type="text" id="max_order_items" name="max_order_items" size="3" class="text" value="<?php echo esc_attr( $max_size ); ?>" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
168
+ <p class="description"><?php _e( 'Manage the number of Order Item colums displayed when the \'Place Order Items on individual cells within a single Order row\' Order items formatting option is selected.', 'woo_ce' ); ?></p>
169
+ </td>
170
+ </tr>
171
+ <?php
172
+ ob_end_flush();
173
+
174
+ }
175
+
176
+ // HTML template for disabled Order Items Types on Store Exporter screen
177
+ function woo_ce_orders_items_types() {
178
+
179
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
180
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
181
+
182
+ $types = woo_ce_get_order_items_types();
183
+ $order_items_types = woo_ce_get_option( 'order_items_types', array() );
184
+
185
+ ob_start(); ?>
186
+ <tr class="export-options order-options">
187
+ <th><label><?php _e( 'Order items types', 'woo_ce' ); ?></label></th>
188
+ <td>
189
+ <ul>
190
+ <?php foreach( $types as $key => $type ) { ?>
191
+ <li><label><input type="checkbox" name="order_filter_order_item_types[<?php echo $key; ?>]" value="<?php echo $key; ?>" disabled="disabled" /> <?php echo ucfirst( $type ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
192
+ <?php } ?>
193
+ </ul>
194
+ <p class="description"><?php _e( 'Choose what Order Item types are included within the Orders export. Default is to include all Order Item types.', 'woo_ce' ); ?></p>
195
+ </td>
196
+ </tr>
197
+ <?php
198
+ ob_end_flush();
199
+
200
+ }
201
+
202
+ // HTML template for disabled Filter Orders by Order Status widget on Store Exporter screen
203
+ function woo_ce_orders_filter_by_status() {
204
+
205
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
206
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
207
+
208
+ $order_statuses = woo_ce_get_order_statuses();
209
+
210
+ ob_start(); ?>
211
+ <p><label><input type="checkbox" id="orders-filters-status" /> <?php _e( 'Filter Orders by Order Status', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
212
+ <div id="export-orders-filters-status" class="separator">
213
+ <ul>
214
+ <?php if( $order_statuses ) { ?>
215
+ <?php foreach( $order_statuses as $order_status ) { ?>
216
+ <li>
217
+ <label><input type="checkbox" name="order_filter_status[<?php echo $order_status->slug; ?>]" value="<?php echo $order_status->slug; ?>" disabled="disabled" /> <?php echo ucfirst( $order_status->name ); ?></label>
218
+ <span class="description">(<?php echo $order_status->count; ?>)</span>
219
+ </li>
220
+ <?php } ?>
221
+ <?php } else { ?>
222
+ <li><?php _e( 'No Order Status\'s were found.', 'woo_ce' ); ?></li>
223
+ <?php } ?>
224
+ </ul>
225
+ <p class="description"><?php _e( 'Select the Order Status you want to filter exported Orders by. Default is to include all Order Status options.', 'woo_ce' ); ?></p>
226
+ </div>
227
+ <!-- #export-orders-filters-status -->
228
+ <?php
229
+ ob_end_flush();
230
+
231
+ }
232
+
233
+ // HTML template for disabled Filter Orders by Product Category widget on Store Exporter screen
234
+ function woo_ce_orders_filter_by_product_category() {
235
+
236
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
237
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
238
+
239
+ $args = array(
240
+ 'hide_empty' => 1
241
+ );
242
+ $product_categories = woo_ce_get_product_categories( $args );
243
+
244
+ ob_start(); ?>
245
+ <p><label><input type="checkbox" id="orders-filters-category" /> <?php _e( 'Filter Orders by Product Category', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
246
+ <div id="export-orders-filters-category" class="separator">
247
+ <ul>
248
+ <?php if( $product_categories ) { ?>
249
+ <?php foreach( $product_categories as $product_category ) { ?>
250
+ <li>
251
+ <label><input type="checkbox" name="order_filter_category[<?php echo $product_category->name; ?>]" value="<?php echo $product_category->term_id; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_category->term_id ); ?>" disabled="disabled" /> <?php echo woo_ce_format_product_category_label( $product_category->name, $product_category->parent_name ); ?></label>
252
+ </li>
253
+ <?php } ?>
254
+ <?php } else { ?>
255
+ <li><?php _e( 'No Product Categories were found.', 'woo_ce' ); ?></li>
256
+ <?php } ?>
257
+ </ul>
258
+ <p class="description"><?php _e( 'Select the Product Categories you want to filter exported Orders by. Default is to include all Product Categories.', 'woo_ce' ); ?></p>
259
+ </div>
260
+ <!-- #export-orders-filters-category -->
261
+ <?php
262
+ ob_end_flush();
263
+
264
+ }
265
+
266
+ // HTML template for disabled Filter Orders by Product Tag widget on Store Exporter screen
267
+ function woo_ce_orders_filter_by_product_tag() {
268
+
269
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
270
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
271
+
272
+ $args = array(
273
+ 'hide_empty' => 1
274
+ );
275
+ $product_tags = woo_ce_get_product_tags( $args );
276
+
277
+ ob_start(); ?>
278
+ <p><label><input type="checkbox" id="orders-filters-tag" /> <?php _e( 'Filter Orders by Product Tag', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
279
+ <div id="export-orders-filters-tag" class="separator">
280
+ <ul>
281
+ <?php if( $product_tags ) { ?>
282
+ <?php foreach( $product_tags as $product_tag ) { ?>
283
+ <li>
284
+ <label><input type="checkbox" name="order_filter_tag[<?php echo $product_tag->name; ?>]" value="<?php echo $product_tag->name; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_tag->term_id ); ?>" disabled="disabled" /> <?php echo $product_tag->name; ?></label>
285
+ <span class="description">(<?php echo $product_tag->count; ?>)</span>
286
+ </li>
287
+ <?php } ?>
288
+ <?php } else { ?>
289
+ <li><?php _e( 'No Product Tags have been found.', 'woo_ce' ); ?></li>
290
+ <?php } ?>
291
+ </ul>
292
+ <p class="description"><?php _e( 'Select the Product Tags you want to filter exported Orders by. Default is to include all Product Tags.', 'woo_ce' ); ?></p>
293
+ </div>
294
+ <!-- #export-orders-filters-tag -->
295
+ <?php
296
+ ob_end_flush();
297
+
298
+ }
299
+
300
+ // HTML template for disabled Order Sorting widget on Store Exporter screen
301
+ function woo_ce_order_sorting() {
302
+
303
+ ob_start(); ?>
304
+ <p><label><?php _e( 'Order Sorting', 'woo_ce' ); ?></label></p>
305
+ <div>
306
+ <select name="order_orderby" disabled="disabled">
307
+ <option value="ID"><?php _e( 'Order ID', 'woo_ce' ); ?></option>
308
+ <option value="title"><?php _e( 'Order Name', 'woo_ce' ); ?></option>
309
+ <option value="date"><?php _e( 'Date Created', 'woo_ce' ); ?></option>
310
+ <option value="modified"><?php _e( 'Date Modified', 'woo_ce' ); ?></option>
311
+ <option value="rand"><?php _e( 'Random', 'woo_ce' ); ?></option>
312
+ </select>
313
+ <select name="order_order" disabled="disabled">
314
+ <option value="ASC"><?php _e( 'Ascending', 'woo_ce' ); ?></option>
315
+ <option value="DESC"><?php _e( 'Descending', 'woo_ce' ); ?></option>
316
+ </select>
317
+ <p class="description"><?php _e( 'Select the sorting of Orders within the exported file. By default this is set to export Orders by Order ID in Desending order.', 'woo_ce' ); ?></p>
318
+ </div>
319
+ <?php
320
+ ob_end_flush();
321
+
322
+ }
323
+
324
+ // HTML template for disabled Custom Orders widget on Store Exporter screen
325
+ function woo_ce_orders_custom_fields() {
326
+
327
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
328
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
329
+
330
+ $custom_orders = '-';
331
+ $custom_order_items = '-';
332
+
333
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
334
+
335
+ ob_start(); ?>
336
+ <form method="post" id="export-orders-custom-fields" class="export-options order-options">
337
+ <div id="poststuff">
338
+
339
+ <div class="postbox" id="export-options">
340
+ <h3 class="hndle"><?php _e( 'Custom Order Fields', 'woo_ce' ); ?></h3>
341
+ <div class="inside">
342
+ <p class="description"><?php _e( 'To include additional custom Order and Order Item meta in the Export Orders table above fill the Orders and Order Items text box then click Save Custom Fields.', 'woo_ce' ); ?></p>
343
+ <table class="form-table">
344
+
345
+ <tr>
346
+ <th>
347
+ <label><?php _e( 'Order meta', 'woo_ce' ); ?></label>
348
+ </th>
349
+ <td>
350
+ <textarea name="custom_orders" rows="5" cols="70" disabled="disabled"><?php echo esc_textarea( $custom_orders ); ?></textarea>
351
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
352
+ <p class="description"><?php _e( 'Include additional custom Order meta in your export file by adding each custom Order meta name to a new line above.<br />For example: <code>Customer UA, Customer IP Address</code>', 'woo_ce' ); ?></p>
353
+ </td>
354
+ </tr>
355
+
356
+ <tr>
357
+ <th>
358
+ <label><?php _e( 'Order Item meta', 'woo_ce' ); ?></label>
359
+ </th>
360
+ <td>
361
+ <textarea name="custom_order_items" rows="5" cols="70" disabled="disabled"><?php echo esc_textarea( $custom_order_items ); ?></textarea>
362
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
363
+ <p class="description"><?php _e( 'Include additional custom Order Item meta in your export file by adding each custom Order Item meta name to a new line above.<br />For example: <code>Personalized Message</code>.', 'woo_ce' ); ?></p>
364
+ </td>
365
+ </tr>
366
+
367
+ </table>
368
+ <p class="submit">
369
+ <input type="button" class="button button-disabled" value="<?php _e( 'Save Custom Fields', 'woo_ce' ); ?>" />
370
+ </p>
371
+ <p class="description"><?php printf( __( 'For more information on custom Order and Order Item meta consult our <a href="%s" target="_blank">online documentation</a>.', 'woo_ce' ), $troubleshooting_url ); ?></p>
372
+ </div>
373
+ <!-- .inside -->
374
+ </div>
375
+ <!-- .postbox -->
376
+
377
+ </div>
378
+ <!-- #poststuff -->
379
+ <input type="hidden" name="action" value="update" />
380
+ </form>
381
+ <!-- #export-orders-custom-fields -->
382
+ <?php
383
+ ob_end_flush();
384
+
385
+ }
386
+
387
+ /* End of: WordPress Administration */
388
+
389
+ }
390
+
391
+ // Returns a list of Order export columns
392
+ function woo_ce_get_order_fields( $format = 'full' ) {
393
+
394
+ $export_type = 'order';
395
+
396
+ $fields = array();
397
+ $fields[] = array(
398
+ 'name' => 'purchase_id',
399
+ 'label' => __( 'Purchase ID', 'woo_ce' )
400
+ );
401
+ $fields[] = array(
402
+ 'name' => 'purchase_total',
403
+ 'label' => __( 'Order Total', 'woo_ce' )
404
+ );
405
+ $fields[] = array(
406
+ 'name' => 'purchase_subtotal',
407
+ 'label' => __( 'Order Subtotal', 'woo_ce' )
408
+ );
409
+ $fields[] = array(
410
+ 'name' => 'order_discount',
411
+ 'label' => __( 'Order Discount', 'woo_ce' )
412
+ );
413
+ $fields[] = array(
414
+ 'name' => 'coupon_code',
415
+ 'label' => __( 'Coupon Code', 'woo_ce' )
416
+ );
417
+ /*
418
+ $fields[] = array(
419
+ 'name' => 'order_incl_tax',
420
+ 'label' => __( 'Order Incl. Tax', 'woo_ce' )
421
+ );
422
+ */
423
+ $fields[] = array(
424
+ 'name' => 'order_excl_tax',
425
+ 'label' => __( 'Order Excl. Tax', 'woo_ce' )
426
+ );
427
+ /*
428
+ $fields[] = array(
429
+ 'name' => 'order_tax_rate',
430
+ 'label' => __( 'Order Tax Rate', 'woo_ce' )
431
+ );
432
+ */
433
+ $fields[] = array(
434
+ 'name' => 'order_sales_tax',
435
+ 'label' => __( 'Sales Tax Total', 'woo_ce' )
436
+ );
437
+ $fields[] = array(
438
+ 'name' => 'order_shipping_tax',
439
+ 'label' => __( 'Shipping Tax Total', 'woo_ce' )
440
+ );
441
+ $fields[] = array(
442
+ 'name' => 'payment_gateway_id',
443
+ 'label' => __( 'Payment Gateway ID', 'woo_ce' )
444
+ );
445
+ $fields[] = array(
446
+ 'name' => 'payment_gateway',
447
+ 'label' => __( 'Payment Gateway', 'woo_ce' )
448
+ );
449
+ $fields[] = array(
450
+ 'name' => 'shipping_method_id',
451
+ 'label' => __( 'Shipping Method ID', 'woo_ce' )
452
+ );
453
+ $fields[] = array(
454
+ 'name' => 'shipping_method',
455
+ 'label' => __( 'Shipping Method', 'woo_ce' )
456
+ );
457
+ $fields[] = array(
458
+ 'name' => 'shipping_cost',
459
+ 'label' => __( 'Shipping Cost', 'woo_ce' )
460
+ );
461
+ $fields[] = array(
462
+ 'name' => 'shipping_weight',
463
+ 'label' => __( 'Shipping Weight', 'woo_ce' )
464
+ );
465
+ $fields[] = array(
466
+ 'name' => 'payment_status',
467
+ 'label' => __( 'Order Status', 'woo_ce' )
468
+ );
469
+ $fields[] = array(
470
+ 'name' => 'post_status',
471
+ 'label' => __( 'Post Status', 'woo_ce' )
472
+ );
473
+ $fields[] = array(
474
+ 'name' => 'order_key',
475
+ 'label' => __( 'Order Key', 'woo_ce' )
476
+ );
477
+ $fields[] = array(
478
+ 'name' => 'purchase_date',
479
+ 'label' => __( 'Purchase Date', 'woo_ce' )
480
+ );
481
+ $fields[] = array(
482
+ 'name' => 'purchase_time',
483
+ 'label' => __( 'Purchase Time', 'woo_ce' )
484
+ );
485
+ $fields[] = array(
486
+ 'name' => 'customer_message',
487
+ 'label' => __( 'Customer Message', 'woo_ce' )
488
+ );
489
+ $fields[] = array(
490
+ 'name' => 'customer_note',
491
+ 'label' => __( 'Customer Note', 'woo_ce' )
492
+ );
493
+ $fields[] = array(
494
+ 'name' => 'order_notes',
495
+ 'label' => __( 'Order Notes', 'woo_ce' )
496
+ );
497
+ $fields[] = array(
498
+ 'name' => 'user_id',
499
+ 'label' => __( 'User ID', 'woo_ce' )
500
+ );
501
+ $fields[] = array(
502
+ 'name' => 'user_name',
503
+ 'label' => __( 'Username', 'woo_ce' )
504
+ );
505
+ $fields[] = array(
506
+ 'name' => 'user_role',
507
+ 'label' => __( 'User Role', 'woo_ce' )
508
+ );
509
+ $fields[] = array(
510
+ 'name' => 'ip_address',
511
+ 'label' => __( 'Checkout IP Address', 'woo_ce' )
512
+ );
513
+ $fields[] = array(
514
+ 'name' => 'browser_agent',
515
+ 'label' => __( 'Checkout Browser Agent', 'woo_ce' )
516
+ );
517
+ $fields[] = array(
518
+ 'name' => 'billing_full_name',
519
+ 'label' => __( 'Billing: Full Name', 'woo_ce' )
520
+ );
521
+ $fields[] = array(
522
+ 'name' => 'billing_first_name',
523
+ 'label' => __( 'Billing: First Name', 'woo_ce' )
524
+ );
525
+ $fields[] = array(
526
+ 'name' => 'billing_last_name',
527
+ 'label' => __( 'Billing: Last Name', 'woo_ce' )
528
+ );
529
+ $fields[] = array(
530
+ 'name' => 'billing_company',
531
+ 'label' => __( 'Billing: Company', 'woo_ce' )
532
+ );
533
+ $fields[] = array(
534
+ 'name' => 'billing_address',
535
+ 'label' => __( 'Billing: Street Address (Full)', 'woo_ce' )
536
+ );
537
+ $fields[] = array(
538
+ 'name' => 'billing_address_1',
539
+ 'label' => __( 'Billing: Street Address 1', 'woo_ce' )
540
+ );
541
+ $fields[] = array(
542
+ 'name' => 'billing_address_2',
543
+ 'label' => __( 'Billing: Street Address 2', 'woo_ce' )
544
+ );
545
+ $fields[] = array(
546
+ 'name' => 'billing_city',
547
+ 'label' => __( 'Billing: City', 'woo_ce' )
548
+ );
549
+ $fields[] = array(
550
+ 'name' => 'billing_postcode',
551
+ 'label' => __( 'Billing: ZIP Code', 'woo_ce' )
552
+ );
553
+ $fields[] = array(
554
+ 'name' => 'billing_state',
555
+ 'label' => __( 'Billing: State (prefix)', 'woo_ce' )
556
+ );
557
+ $fields[] = array(
558
+ 'name' => 'billing_state_full',
559
+ 'label' => __( 'Billing: State', 'woo_ce' )
560
+ );
561
+ $fields[] = array(
562
+ 'name' => 'billing_country',
563
+ 'label' => __( 'Billing: Country (prefix)', 'woo_ce' )
564
+ );
565
+ $fields[] = array(
566
+ 'name' => 'billing_country_full',
567
+ 'label' => __( 'Billing: Country', 'woo_ce' )
568
+ );
569
+ $fields[] = array(
570
+ 'name' => 'billing_phone',
571
+ 'label' => __( 'Billing: Phone Number', 'woo_ce' )
572
+ );
573
+ $fields[] = array(
574
+ 'name' => 'billing_email',
575
+ 'label' => __( 'Billing: E-mail Address', 'woo_ce' )
576
+ );
577
+ $fields[] = array(
578
+ 'name' => 'shipping_full_name',
579
+ 'label' => __( 'Shipping: Full Name', 'woo_ce' )
580
+ );
581
+ $fields[] = array(
582
+ 'name' => 'shipping_first_name',
583
+ 'label' => __( 'Shipping: First Name', 'woo_ce' )
584
+ );
585
+ $fields[] = array(
586
+ 'name' => 'shipping_last_name',
587
+ 'label' => __( 'Shipping: Last Name', 'woo_ce' )
588
+ );
589
+ $fields[] = array(
590
+ 'name' => 'shipping_company',
591
+ 'label' => __( 'Shipping: Company', 'woo_ce' )
592
+ );
593
+ $fields[] = array(
594
+ 'name' => 'shipping_address',
595
+ 'label' => __( 'Shipping: Street Address (Full)', 'woo_ce' )
596
+ );
597
+ $fields[] = array(
598
+ 'name' => 'shipping_address_1',
599
+ 'label' => __( 'Shipping: Street Address 1', 'woo_ce' )
600
+ );
601
+ $fields[] = array(
602
+ 'name' => 'shipping_address_2',
603
+ 'label' => __( 'Shipping: Street Address 2', 'woo_ce' )
604
+ );
605
+ $fields[] = array(
606
+ 'name' => 'shipping_city',
607
+ 'label' => __( 'Shipping: City', 'woo_ce' )
608
+ );
609
+ $fields[] = array(
610
+ 'name' => 'shipping_postcode',
611
+ 'label' => __( 'Shipping: ZIP Code', 'woo_ce' )
612
+ );
613
+ $fields[] = array(
614
+ 'name' => 'shipping_state',
615
+ 'label' => __( 'Shipping: State (prefix)', 'woo_ce' )
616
+ );
617
+ $fields[] = array(
618
+ 'name' => 'shipping_state_full',
619
+ 'label' => __( 'Shipping: State', 'woo_ce' )
620
+ );
621
+ $fields[] = array(
622
+ 'name' => 'shipping_country',
623
+ 'label' => __( 'Shipping: Country (prefix)', 'woo_ce' )
624
+ );
625
+ $fields[] = array(
626
+ 'name' => 'shipping_country_full',
627
+ 'label' => __( 'Shipping: Country', 'woo_ce' )
628
+ );
629
+ $fields[] = array(
630
+ 'name' => 'order_items_product_id',
631
+ 'label' => __( 'Order Items: Product ID', 'woo_ce' )
632
+ );
633
+ $fields[] = array(
634
+ 'name' => 'order_items_variation_id',
635
+ 'label' => __( 'Order Items: Variation ID', 'woo_ce' )
636
+ );
637
+ $fields[] = array(
638
+ 'name' => 'order_items_sku',
639
+ 'label' => __( 'Order Items: SKU', 'woo_ce' )
640
+ );
641
+ $fields[] = array(
642
+ 'name' => 'order_items_name',
643
+ 'label' => __( 'Order Items: Product Name', 'woo_ce' )
644
+ );
645
+ $fields[] = array(
646
+ 'name' => 'order_items_variation',
647
+ 'label' => __( 'Order Items: Product Variation', 'woo_ce' )
648
+ );
649
+ $fields[] = array(
650
+ 'name' => 'order_items_description',
651
+ 'label' => __( 'Order Items: Product Description', 'woo_ce' )
652
+ );
653
+ $fields[] = array(
654
+ 'name' => 'order_items_excerpt',
655
+ 'label' => __( 'Order Items: Product Excerpt', 'woo_ce' )
656
+ );
657
+ $fields[] = array(
658
+ 'name' => 'order_items_tax_class',
659
+ 'label' => __( 'Order Items: Tax Class', 'woo_ce' )
660
+ );
661
+ $fields[] = array(
662
+ 'name' => 'order_items_quantity',
663
+ 'label' => __( 'Order Items: Quantity', 'woo_ce' )
664
+ );
665
+ $fields[] = array(
666
+ 'name' => 'order_items_total',
667
+ 'label' => __( 'Order Items: Total', 'woo_ce' )
668
+ );
669
+ $fields[] = array(
670
+ 'name' => 'order_items_subtotal',
671
+ 'label' => __( 'Order Items: Subtotal', 'woo_ce' )
672
+ );
673
+ $fields[] = array(
674
+ 'name' => 'order_items_tax',
675
+ 'label' => __( 'Order Items: Tax', 'woo_ce' )
676
+ );
677
+ $fields[] = array(
678
+ 'name' => 'order_items_tax_subtotal',
679
+ 'label' => __( 'Order Items: Tax Subtotal', 'woo_ce' )
680
+ );
681
+ $fields[] = array(
682
+ 'name' => 'order_items_type',
683
+ 'label' => __( 'Order Items: Type', 'woo_ce' )
684
+ );
685
+ $fields[] = array(
686
+ 'name' => 'order_items_category',
687
+ 'label' => __( 'Order Items: Category', 'woo_ce' )
688
+ );
689
+ $fields[] = array(
690
+ 'name' => 'order_items_tag',
691
+ 'label' => __( 'Order Items: Tag', 'woo_ce' )
692
+ );
693
+ $fields[] = array(
694
+ 'name' => 'order_items_total_sales',
695
+ 'label' => __( 'Order Items: Total Sales', 'woo_ce' )
696
+ );
697
+ $fields[] = array(
698
+ 'name' => 'order_items_weight',
699
+ 'label' => __( 'Order Items: Weight', 'woo_ce' )
700
+ );
701
+ $fields[] = array(
702
+ 'name' => 'order_items_total_weight',
703
+ 'label' => __( 'Order Items: Total Weight', 'woo_ce' )
704
+ );
705
+ $fields[] = array(
706
+ 'name' => 'order_items_stock',
707
+ 'label' => __( 'Order Items: Stock', 'woo_ce' )
708
+ );
709
+
710
+ /*
711
+ $fields[] = array(
712
+ 'name' => '',
713
+ 'label' => __( '', 'woo_ce' )
714
+ );
715
+ */
716
+
717
+ // Allow Plugin/Theme authors to add support for additional columns
718
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
719
+
720
+ switch( $format ) {
721
+
722
+ case 'summary':
723
+ $output = array();
724
+ $size = count( $fields );
725
+ for( $i = 0; $i < $size; $i++ ) {
726
+ if( isset( $fields[$i] ) )
727
+ $output[$fields[$i]['name']] = 'on';
728
+ }
729
+ return $output;
730
+ break;
731
+
732
+ case 'full':
733
+ default:
734
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
735
+ $size = count( $fields );
736
+ for( $i = 0; $i < $size; $i++ )
737
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
738
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
739
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
740
+ return $fields;
741
+ break;
742
+
743
+ }
744
+
745
+ }
746
+
747
+ function woo_ce_override_order_field_labels( $fields = array() ) {
748
+
749
+ $labels = woo_ce_get_option( 'order_labels', array() );
750
+ if( !empty( $labels ) ) {
751
+ foreach( $fields as $key => $field ) {
752
+ if( isset( $labels[$field['name']] ) )
753
+ $fields[$key]['label'] = $labels[$field['name']];
754
+ }
755
+ }
756
+ return $fields;
757
+
758
+ }
759
+ add_filter( 'woo_ce_order_fields', 'woo_ce_override_order_field_labels', 11 );
760
+
761
+ // Adds custom Order and Order Item columns to the Order fields list
762
+ function woo_ce_extend_order_fields( $fields = array() ) {
763
+
764
+ // Product Addons - http://www.woothemes.com/
765
+ if( class_exists( 'Product_Addon_Admin' ) || class_exists( 'Product_Addon_Display' ) ) {
766
+ $product_addons = woo_ce_get_product_addons();
767
+ if( !empty( $product_addons ) ) {
768
+ foreach( $product_addons as $product_addon ) {
769
+ if( !empty( $product_addon ) ) {
770
+ $fields[] = array(
771
+ 'name' => sprintf( 'order_items_product_addon_%s', $product_addon->post_name ),
772
+ 'label' => sprintf( __( 'Order Items: %s', 'woo_ce' ), ucfirst( $product_addon->post_title ) )
773
+ );
774
+ }
775
+ }
776
+ }
777
+ unset( $product_addons, $product_addon );
778
+ }
779
+
780
+ // WooCommerce Sequential Order Numbers - http://www.skyverge.com/blog/woocommerce-sequential-order-numbers/
781
+ // Sequential Order Numbers Pro - http://www.woothemes.com/products/sequential-order-numbers-pro/
782
+ if( class_exists( 'WC_Seq_Order_Number' ) || class_exists( 'WC_Seq_Order_Number_Pro' ) ) {
783
+ $fields[] = array(
784
+ 'name' => 'order_number',
785
+ 'label' => __( 'Order Number', 'woo_ce' )
786
+ );
787
+ }
788
+
789
+ // WooCommerce Print Invoice & Delivery Note - https://wordpress.org/plugins/woocommerce-delivery-notes/
790
+ if( class_exists( 'WooCommerce_Delivery_Notes' ) ) {
791
+ $fields[] = array(
792
+ 'name' => 'invoice_number',
793
+ 'label' => __( 'Invoice Number', 'woo_ce' )
794
+ );
795
+ $fields[] = array(
796
+ 'name' => 'invoice_date',
797
+ 'label' => __( 'Invoice Date', 'woo_ce' )
798
+ );
799
+ }
800
+
801
+ // WooCommerce PDF Invoices & Packing Slips - http://www.wpovernight.com
802
+ if( class_exists( 'WooCommerce_PDF_Invoices' ) ) {
803
+ $fields[] = array(
804
+ 'name' => 'pdf_invoice_number',
805
+ 'label' => __( 'PDF Invoice Number', 'woo_ce' )
806
+ );
807
+ $fields[] = array(
808
+ 'name' => 'pdf_invoice_date',
809
+ 'label' => __( 'PDF Invoice Date', 'woo_ce' )
810
+ );
811
+ }
812
+
813
+ // WooCommerce Checkout Manager - http://wordpress.org/plugins/woocommerce-checkout-manager/
814
+ // WooCommerce Checkout Manager Pro - http://www.trottyzone.com/product/woocommerce-checkout-manager-pro
815
+ if( function_exists( 'wccs_install' ) ) {
816
+ $options = get_option( 'wccs_settings' );
817
+ if( isset( $options['buttons'] ) ) {
818
+ $buttons = $options['buttons'];
819
+ if( !empty( $buttons ) ) {
820
+ foreach( $buttons as $button ) {
821
+ $fields[] = array(
822
+ 'name' => $button['label'],
823
+ 'label' => ucfirst( $button['label'] )
824
+ );
825
+ }
826
+ unset( $buttons, $button );
827
+ }
828
+ }
829
+ unset( $options );
830
+ }
831
+
832
+ // Poor Guys Swiss Knife - http://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/
833
+ if( function_exists( 'wcpgsk_init' ) ) {
834
+ $options = get_option( 'wcpgsk_settings' );
835
+ $billing_fields = ( isset( $options['woofields']['billing'] ) ? $options['woofields']['billing'] : array() );
836
+ $shipping_fields = ( isset( $options['woofields']['shipping'] ) ? $options['woofields']['shipping'] : array() );
837
+
838
+ // Custom billing fields
839
+ if( !empty( $billing_fields ) ) {
840
+ foreach( $billing_fields as $key => $billing_field ) {
841
+ $fields[] = array(
842
+ 'name' => $key,
843
+ 'label' => $options['woofields']['label_' . $key]
844
+ );
845
+ }
846
+ unset( $billing_fields, $billing_field );
847
+ }
848
+
849
+ // Custom shipping fields
850
+ if( !empty( $shipping_fields ) ) {
851
+ foreach( $shipping_fields as $key => $shipping_field ) {
852
+ $fields[] = array(
853
+ 'name' => $key,
854
+ 'label' => $options['woofields']['label_' . $key]
855
+ );
856
+ }
857
+ unset( $shipping_fields, $shipping_field );
858
+ }
859
+
860
+ unset( $options );
861
+ }
862
+
863
+ // Checkout Field Editor - http://woothemes.com/woocommerce/
864
+ if( function_exists( 'woocommerce_init_checkout_field_editor' ) ) {
865
+ $billing_fields = get_option( 'wc_fields_billing', array() );
866
+ $shipping_fields = get_option( 'wc_fields_shipping', array() );
867
+ $custom_fields = get_option( 'wc_fields_additional', array() );
868
+
869
+ // Custom billing fields
870
+ if( !empty( $billing_fields ) ) {
871
+ foreach( $billing_fields as $key => $billing_field ) {
872
+ // Only add non-default Checkout fields to export columns list
873
+ if( $billing_field['custom'] == 1 ) {
874
+ $fields[] = array(
875
+ 'name' => sprintf( 'wc_billing_%s', $key ),
876
+ 'label' => sprintf( __( 'Billing: %s', 'woo_ce' ), ucfirst( $billing_field['label'] ) )
877
+ );
878
+ }
879
+ }
880
+ }
881
+ unset( $billing_fields, $billing_field );
882
+
883
+ // Custom shipping fields
884
+ if( !empty( $shipping_fields ) ) {
885
+ foreach( $shipping_fields as $key => $shipping_field ) {
886
+ // Only add non-default Checkout fields to export columns list
887
+ if( $shipping_field['custom'] == 1 ) {
888
+ $fields[] = array(
889
+ 'name' => sprintf( 'wc_shipping_%s', $key ),
890
+ 'label' => sprintf( __( 'Shipping: %s', 'woo_ce' ), ucfirst( $shipping_field['label'] ) )
891
+ );
892
+ }
893
+ }
894
+ }
895
+ unset( $shipping_fields, $shipping_field );
896
+
897
+ // Custom fields
898
+ if( !empty( $custom_fields ) ) {
899
+ foreach( $custom_fields as $key => $custom_field ) {
900
+ // Only add non-default Checkout fields to export columns list
901
+ if( $billing_field['custom'] == 1 ) {
902
+ $fields[] = array(
903
+ 'name' => sprintf( 'wc_additional_%s', $key ),
904
+ 'label' => sprintf( __( 'Additional: %s', 'woo_ce' ), ucfirst( $custom_field['label'] ) )
905
+ );
906
+ }
907
+ }
908
+ }
909
+ unset( $custom_fields, $custom_field );
910
+ }
911
+
912
+ // Checkout Field Manager - http://61extensions.com
913
+ if( function_exists( 'sod_woocommerce_checkout_manager_settings' ) ) {
914
+ $billing_fields = get_option( 'woocommerce_checkout_billing_fields', array() );
915
+ $shipping_fields = get_option( 'woocommerce_checkout_shipping_fields', array() );
916
+ $custom_fields = get_option( 'woocommerce_checkout_additional_fields', array() );
917
+
918
+ // Custom billing fields
919
+ if( !empty( $billing_fields ) ) {
920
+ foreach( $billing_fields as $key => $billing_field ) {
921
+ // Only add non-default Checkout fields to export columns list
922
+ if( strtolower( $billing_field['default_field'] ) != 'on' ) {
923
+ $fields[] = array(
924
+ 'name' => sprintf( 'sod_billing_%s', $billing_field['name'] ),
925
+ 'label' => sprintf( __( 'Billing: %s', 'woo_ce' ), ucfirst( $billing_field['label'] ) )
926
+ );
927
+ }
928
+ }
929
+ }
930
+ unset( $billing_fields, $billing_field );
931
+
932
+ // Custom shipping fields
933
+ if( !empty( $shipping_fields ) ) {
934
+ foreach( $shipping_fields as $key => $shipping_field ) {
935
+ // Only add non-default Checkout fields to export columns list
936
+ if( strtolower( $shipping_field['default_field'] ) != 'on' ) {
937
+ $fields[] = array(
938
+ 'name' => sprintf( 'sod_shipping_%s', $shipping_field['name'] ),
939
+ 'label' => sprintf( __( 'Shipping: %s', 'woo_ce' ), ucfirst( $shipping_field['label'] ) )
940
+ );
941
+ }
942
+ }
943
+ }
944
+ unset( $shipping_fields, $shipping_field );
945
+
946
+ // Custom fields
947
+ if( !empty( $custom_fields ) ) {
948
+ foreach( $custom_fields as $key => $custom_field ) {
949
+ // Only add non-default Checkout fields to export columns list
950
+ if( strtolower( $custom_field['default_field'] ) != 'on' ) {
951
+ $fields[] = array(
952
+ 'name' => sprintf( 'sod_additional_%s', $custom_field['name'] ),
953
+ 'label' => sprintf( __( 'Additional: %s', 'woo_ce' ), ucfirst( $custom_field['label'] ) )
954
+ );
955
+ }
956
+ }
957
+ }
958
+ unset( $custom_fields, $custom_field );
959
+ }
960
+
961
+ // WooCommerce Checkout Add-Ons - http://www.skyverge.com/product/woocommerce-checkout-add-ons/
962
+ if( function_exists( 'init_woocommerce_checkout_add_ons' ) ) {
963
+ $fields[] = array(
964
+ 'name' => 'order_items_checkout_addon_id',
965
+ 'label' => __( 'Order Items: Checkout Add-ons ID', 'woo_ce' )
966
+ );
967
+ $fields[] = array(
968
+ 'name' => 'order_items_checkout_addon_label',
969
+ 'label' => __( 'Order Items: Checkout Add-ons Label', 'woo_ce' )
970
+ );
971
+ $fields[] = array(
972
+ 'name' => 'order_items_checkout_addon_value',
973
+ 'label' => __( 'Order Items: Checkout Add-ons Value', 'woo_ce' )
974
+ );
975
+ }
976
+
977
+ // WooCommerce Brands Addon - http://woothemes.com/woocommerce/
978
+ if( class_exists( 'WC_Brands' ) ) {
979
+ $fields[] = array(
980
+ 'name' => 'order_items_brand',
981
+ 'label' => __( 'Order Items: Brand', 'woo_ce' )
982
+ );
983
+ }
984
+
985
+ // Product Vendors - http://www.woothemes.com/products/product-vendors/
986
+ if( class_exists( 'WooCommerce_Product_Vendors' ) ) {
987
+ $fields[] = array(
988
+ 'name' => 'order_items_vendor',
989
+ 'label' => __( 'Order Items: Product Vendor', 'woo_ce' )
990
+ );
991
+ }
992
+
993
+ // Cost of Goods - http://www.skyverge.com/product/woocommerce-cost-of-goods-tracking/
994
+ if( class_exists( 'WC_COG' ) ) {
995
+ $fields[] = array(
996
+ 'name' => 'total_cost_of_goods',
997
+ 'label' => __( 'Total Cost of Goods', 'woo_ce' )
998
+ );
999
+ $fields[] = array(
1000
+ 'name' => 'order_items_cost_of_goods',
1001
+ 'label' => __( 'Order Items: Cost of Goods', 'woo_ce' )
1002
+ );
1003
+ }
1004
+
1005
+ // Local Pickup Plus - http://www.woothemes.com/products/local-pickup-plus/
1006
+ if( class_exists( 'WC_Local_Pickup_Plus' ) ) {
1007
+ $fields[] = array(
1008
+ 'name' => 'order_items_pickup_location',
1009
+ 'label' => __( 'Order Items: Pickup Location', 'woo_ce' )
1010
+ );
1011
+ }
1012
+
1013
+ // Gravity Forms - http://woothemes.com/woocommerce
1014
+ if( class_exists( 'RGForms' ) && class_exists( 'woocommerce_gravityforms' ) ) {
1015
+ // Check if there are any Products linked to Gravity Forms
1016
+ if( $gf_fields = woo_ce_get_gravity_form_fields() ) {
1017
+ $fields[] = array(
1018
+ 'name' => 'order_items_gf_form_id',
1019
+ 'label' => __( 'Order Items: Gravity Form ID', 'woo_ce' )
1020
+ );
1021
+ $fields[] = array(
1022
+ 'name' => 'order_items_gf_form_label',
1023
+ 'label' => __( 'Order Items: Gravity Form Label', 'woo_ce' )
1024
+ );
1025
+ foreach( $gf_fields as $key => $gf_field ) {
1026
+ $fields[] = array(
1027
+ 'name' => sprintf( 'order_items_gf_%d_%s', $gf_field['formId'], $gf_field['id'] ),
1028
+ 'label' => sprintf( __( 'Order Items: [%s #%s] %s', 'woo_ce' ), $gf_field['formTitle'], $gf_field['formId'], ucfirst( $gf_field['label'] ) )
1029
+ );
1030
+ }
1031
+ }
1032
+ }
1033
+
1034
+ // WooCommerce Currency Switcher - http://dev.pathtoenlightenment.net/shop
1035
+ if( class_exists( 'WC_Aelia_CurrencySwitcher' ) ) {
1036
+ $fields[] = array(
1037
+ 'name' => 'order_currency',
1038
+ 'label' => __( 'Order Currency', 'woo_ce' )
1039
+ );
1040
+ }
1041
+
1042
+ // WooCommerce TM Extra Product Options - http://codecanyon.net/item/woocommerce-extra-product-options/7908619
1043
+ if( class_exists( 'TM_Extra_Product_Options' ) ) {
1044
+ if( $tm_fields = woo_ce_get_extra_product_option_fields() ) {
1045
+ foreach( $tm_fields as $tm_field ) {
1046
+ $fields[] = array(
1047
+ 'name' => sprintf( 'order_items_tm_%s', sanitize_key( $tm_field['name'] ) ),
1048
+ 'label' => sprintf( __( 'Order Items: %s', 'woo_ce' ), $tm_field['name'] )
1049
+ );
1050
+ }
1051
+ }
1052
+ }
1053
+
1054
+ // Custom Order fields
1055
+ $custom_orders = woo_ce_get_option( 'custom_orders', '' );
1056
+ if( !empty( $custom_orders ) ) {
1057
+ foreach( $custom_orders as $custom_order ) {
1058
+ if( !empty( $custom_order ) ) {
1059
+ $fields[] = array(
1060
+ 'name' => $custom_order,
1061
+ 'label' => ucfirst( $custom_order )
1062
+ );
1063
+ }
1064
+ }
1065
+ unset( $custom_orders, $custom_order );
1066
+ }
1067
+
1068
+ // Custom Order Items fields
1069
+ $custom_order_items = woo_ce_get_option( 'custom_order_items', '' );
1070
+ if( !empty( $custom_order_items ) ) {
1071
+ foreach( $custom_order_items as $custom_order_item ) {
1072
+ if( !empty( $custom_order_item ) ) {
1073
+ $fields[] = array(
1074
+ 'name' => sprintf( 'order_items_%s', $custom_order_item ),
1075
+ 'label' => sprintf( __( 'Order Items: %s', 'woo_ce' ), $custom_order_item )
1076
+ );
1077
+ }
1078
+ }
1079
+ }
1080
+
1081
+ // Custom Product fields
1082
+ $custom_product_fields = woo_ce_get_option( 'custom_products', '' );
1083
+ if( !empty( $custom_product_fields ) ) {
1084
+ foreach( $custom_product_fields as $custom_product_field ) {
1085
+ if( !empty( $custom_product_field ) ) {
1086
+ $fields[] = array(
1087
+ 'name' => sprintf( 'order_items_%s', $custom_product_field ),
1088
+ 'label' => sprintf( __( 'Order Items: %s', 'woo_ce' ), $custom_product_field )
1089
+ );
1090
+ }
1091
+ }
1092
+ }
1093
+
1094
+ return $fields;
1095
+
1096
+ }
1097
+ add_filter( 'woo_ce_order_fields', 'woo_ce_extend_order_fields' );
1098
+
1099
+ function woo_ce_get_gravity_forms_products() {
1100
+
1101
+ global $wpdb;
1102
+
1103
+ $meta_key = '_gravity_form_data';
1104
+ $post_ids_sql = $wpdb->prepare( "SELECT `post_id`, `meta_value` FROM `$wpdb->postmeta` WHERE `meta_key` = %s GROUP BY `meta_value`", $meta_key );
1105
+ return $wpdb->get_results( $post_ids_sql );
1106
+
1107
+ }
1108
+
1109
+ function woo_ce_get_gravity_form_fields() {
1110
+
1111
+ if( $gf_products = woo_ce_get_gravity_forms_products() ) {
1112
+ $fields = array();
1113
+ foreach( $gf_products as $gf_product ) {
1114
+ if( $gf_product_data = maybe_unserialize( get_post_meta( $gf_product->post_id, '_gravity_form_data', true ) ) ) {
1115
+ // Check the class and method for Gravity Forms exists
1116
+ if( class_exists( 'RGFormsModel' ) && method_exists( 'RGFormsModel', 'get_form_meta' ) ) {
1117
+ // Check the form exists
1118
+ $gf_form_meta = RGFormsModel::get_form_meta( $gf_product_data['id'] );
1119
+ if( !empty( $gf_form_meta ) ) {
1120
+ // Check that the form has fields assigned to it
1121
+ if( !empty( $gf_form_meta['fields'] ) ) {
1122
+ foreach( $gf_form_meta['fields'] as $gf_form_field ) {
1123
+ // Check for duplicate Gravity Form fields
1124
+ $gf_form_field['formTitle'] = $gf_form_meta['title'];
1125
+ $fields[] = $gf_form_field;
1126
+ }
1127
+ }
1128
+ }
1129
+ }
1130
+ }
1131
+ }
1132
+ return $fields;
1133
+ }
1134
+
1135
+ }
1136
+
1137
+ function woo_ce_get_extra_product_option_fields() {
1138
+
1139
+ global $wpdb;
1140
+
1141
+ $meta_key = '_tmcartepo_data';
1142
+ $tm_fields_sql = $wpdb->prepare( "SELECT order_itemmeta.`meta_value` FROM `" . $wpdb->prefix . "woocommerce_order_items` as order_items, `" . $wpdb->prefix . "woocommerce_order_itemmeta` as order_itemmeta WHERE order_items.`order_item_id` = order_itemmeta.`order_item_id` AND order_items.`order_item_type` = 'line_item' AND order_itemmeta.`meta_key` = %s", $meta_key );
1143
+ $tm_fields = $wpdb->get_col( $tm_fields_sql );
1144
+ if( !empty( $tm_fields ) ) {
1145
+ $fields = array();
1146
+ foreach( $tm_fields as $tm_field ) {
1147
+ $tm_field = maybe_unserialize( $tm_field );
1148
+ $size = count( $tm_field );
1149
+ for( $i = 0; $i < $size; $i++ ) {
1150
+ if( !array_key_exists( sanitize_key( $tm_field[$i]['name'] ), $fields ) )
1151
+ $fields[sanitize_key( $tm_field[$i]['name'] )] = $tm_field[$i];
1152
+ }
1153
+ }
1154
+ }
1155
+ return $fields;
1156
+
1157
+ }
1158
+
1159
+ function woo_ce_format_order_date( $date ) {
1160
+
1161
+ $output = $date;
1162
+ if( $date )
1163
+ $output = str_replace( '/', '-', $date );
1164
+ return $output;
1165
+
1166
+ }
1167
+
1168
+ // Returns a list of WooCommerce Order statuses
1169
+ function woo_ce_get_order_statuses() {
1170
+
1171
+ $terms = false;
1172
+ // Check if this is a WooCommerce 2.2+ instance (new Post Status)
1173
+ $woocommerce_version = woo_get_woo_version();
1174
+ if( version_compare( $woocommerce_version, '2.2' ) >= 0 ) {
1175
+ // Convert Order Status array into our magic sauce
1176
+ $order_statuses = ( function_exists( 'wc_get_order_statuses' ) ? wc_get_order_statuses() : false );
1177
+ if( !empty( $order_statuses ) ) {
1178
+ $terms = array();
1179
+ $post_type = 'shop_order';
1180
+ $posts_count = wp_count_posts( $post_type );
1181
+ foreach( $order_statuses as $key => $order_status ) {
1182
+ $terms[] = (object)array(
1183
+ 'name' => $order_status,
1184
+ 'slug' => $key,
1185
+ 'count' => ( isset( $posts_count->$key ) ? $posts_count->$key : 0 )
1186
+ );
1187
+ }
1188
+ }
1189
+ } else {
1190
+ $args = array(
1191
+ 'hide_empty' => false
1192
+ );
1193
+ $terms = get_terms( 'shop_order_status', $args );
1194
+ if( empty( $terms ) || ( is_wp_error( $terms ) == true ) )
1195
+ $terms = false;
1196
+ }
1197
+ return $terms;
1198
+
1199
+ }
1200
+
1201
+ function woo_ce_get_order_items_types() {
1202
+
1203
+ $types = array(
1204
+ 'line_item' => __( 'Line Item', 'woo_ce' ),
1205
+ 'coupon' => __( 'Coupon', 'woo_ce' ),
1206
+ 'fee' => __( 'Fee', 'woo_ce' ),
1207
+ 'tax' => __( 'Tax', 'woo_ce' ),
1208
+ 'shipping' => __( 'Shipping', 'woo_ce' )
1209
+ );
1210
+ $types = apply_filters( 'woo_ce_order_item_types', $types );
1211
+ return $types;
1212
+
1213
+ }
1214
+
1215
+ // Returns list of Product Addon columns
1216
+ function woo_ce_get_product_addons() {
1217
+
1218
+ $output = array();
1219
+
1220
+ // Product Addons - http://www.woothemes.com/
1221
+ if( class_exists( 'Product_Addon_Admin' ) || class_exists( 'Product_Addon_Display' ) ) {
1222
+ $post_type = 'global_product_addon';
1223
+ $args = array(
1224
+ 'post_type' => $post_type,
1225
+ 'numberposts' => -1
1226
+ );
1227
+ if( $product_addons = get_posts( $args ) ) {
1228
+ foreach( $product_addons as $product_addon ) {
1229
+ if( $meta = maybe_unserialize( get_post_meta( $product_addon->ID, '_product_addons', true ) ) ) {
1230
+ $size = count( $meta );
1231
+ for( $i = 0; $i < $size; $i++ ) {
1232
+ $output[] = (object)array(
1233
+ 'post_name' => $meta[$i]['name'],
1234
+ 'post_title' => $meta[$i]['name']
1235
+ );
1236
+ }
1237
+ }
1238
+ }
1239
+ }
1240
+ }
1241
+
1242
+ // Custom Order Items
1243
+ if( $custom_order_items = woo_ce_get_option( 'custom_order_items', '' ) ) {
1244
+ foreach( $custom_order_items as $custom_order_item ) {
1245
+ $output[] = (object)array(
1246
+ 'post_name' => $custom_order_item,
1247
+ 'post_title' => $custom_order_item
1248
+ );
1249
+ }
1250
+ }
1251
+
1252
+ return $output;
1253
+
1254
+ }
1255
+ ?>
includes/product_vendors.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function woo_ce_get_product_vendor_fields( $format = 'full' ) {
3
+
4
+ $export_type = 'product_vendor';
5
+
6
+ $fields = array();
7
+ $fields[] = array(
8
+ 'name' => 'title',
9
+ 'label' => __( 'Name', 'woo_ce' )
10
+ );
11
+ $fields[] = array(
12
+ 'name' => 'slug',
13
+ 'label' => __( 'Slug', 'woo_ce' )
14
+ );
15
+ $fields[] = array(
16
+ 'name' => 'description',
17
+ 'label' => __( 'Description', 'woo_ce' )
18
+ );
19
+ $fields[] = array(
20
+ 'name' => 'commission',
21
+ 'label' => __( 'Commission', 'woo_ce' )
22
+ );
23
+ $fields[] = array(
24
+ 'name' => 'paypal_email',
25
+ 'label' => __( 'PayPal E-mail Address', 'woo_ce' )
26
+ );
27
+ $fields[] = array(
28
+ 'name' => 'user_name',
29
+ 'label' => __( 'Vendor Username', 'woo_ce' )
30
+ );
31
+ $fields[] = array(
32
+ 'name' => 'user_id',
33
+ 'label' => __( 'Vendor User ID', 'woo_ce' )
34
+ );
35
+
36
+ /*
37
+ $fields[] = array(
38
+ 'name' => '',
39
+ 'label' => __( '', 'woo_ce' )
40
+ );
41
+ */
42
+
43
+ // Allow Plugin/Theme authors to add support for additional columns
44
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
45
+
46
+ switch( $format ) {
47
+
48
+ case 'summary':
49
+ $output = array();
50
+ $size = count( $fields );
51
+ for( $i = 0; $i < $size; $i++ ) {
52
+ if( isset( $fields[$i] ) )
53
+ $output[$fields[$i]['name']] = 'on';
54
+ }
55
+ return $output;
56
+ break;
57
+
58
+ case 'full':
59
+ default:
60
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
61
+ $size = count( $fields );
62
+ for( $i = 0; $i < $size; $i++ )
63
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
64
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
65
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
66
+ return $fields;
67
+ break;
68
+
69
+ }
70
+
71
+ }
72
+
73
+ function woo_ce_override_product_vendor_field_labels( $fields = array() ) {
74
+
75
+ $labels = woo_ce_get_option( 'product_vendor_labels', array() );
76
+ if( !empty( $labels ) ) {
77
+ foreach( $fields as $key => $field ) {
78
+ if( isset( $labels[$field['name']] ) )
79
+ $fields[$key]['label'] = $labels[$field['name']];
80
+ }
81
+ }
82
+ return $fields;
83
+
84
+ }
85
+ add_filter( 'woo_ce_product_vendor_fields', 'woo_ce_override_product_vendor_field_labels', 11 );
86
+ ?>
includes/products.php ADDED
@@ -0,0 +1,1391 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for Filter Products by Product Category widget on Store Exporter screen
7
+ function woo_ce_products_filter_by_product_category() {
8
+
9
+ $args = array(
10
+ 'hide_empty' => 1
11
+ );
12
+ $product_categories = woo_ce_get_product_categories( $args );
13
+
14
+ ob_start(); ?>
15
+ <p><label><input type="checkbox" id="products-filters-categories" /> <?php _e( 'Filter Products by Product Categories', 'woo_ce' ); ?></label></p>
16
+ <div id="export-products-filters-categories" class="separator">
17
+ <?php if( $product_categories ) { ?>
18
+ <ul>
19
+ <?php foreach( $product_categories as $product_category ) { ?>
20
+ <li>
21
+ <label><input type="checkbox" name="product_filter_category[<?php echo $product_category->term_id; ?>]" value="<?php echo $product_category->term_id; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_category->term_id ); ?>"<?php disabled( $product_category->count, 0 ); ?> /> <?php echo woo_ce_format_product_category_label( $product_category->name, $product_category->parent_name ); ?></label>
22
+ <span class="description">(<?php echo $product_category->count; ?>)</span>
23
+ </li>
24
+ <?php } ?>
25
+ </ul>
26
+ <p class="description"><?php _e( 'Select the Product Categories you want to filter exported Products by. Default is to include all Product Categories.', 'woo_ce' ); ?></p>
27
+ <?php } else { ?>
28
+ <p><?php _e( 'No Product Categories were found.', 'woo_ce' ); ?></p>
29
+ <?php } ?>
30
+ </div>
31
+ <!-- #export-products-filters-categories -->
32
+ <?php
33
+ ob_end_flush();
34
+
35
+ }
36
+
37
+ // HTML template for Filter Products by Product Tag widget on Store Exporter screen
38
+ function woo_ce_products_filter_by_product_tag() {
39
+
40
+ $args = array(
41
+ 'hide_empty' => 1
42
+ );
43
+ $product_tags = woo_ce_get_product_tags( $args );
44
+
45
+ ob_start(); ?>
46
+ <p><label><input type="checkbox" id="products-filters-tags" /> <?php _e( 'Filter Products by Product Tags', 'woo_ce' ); ?></label></p>
47
+ <div id="export-products-filters-tags" class="separator">
48
+ <?php if( $product_tags ) { ?>
49
+ <ul>
50
+ <?php foreach( $product_tags as $product_tag ) { ?>
51
+ <li>
52
+ <label><input type="checkbox" name="product_filter_tag[<?php echo $product_tag->term_id; ?>]" value="<?php echo $product_tag->term_id; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_tag->term_id ); ?>"<?php disabled( $product_tag->count, 0 ); ?> /> <?php echo $product_tag->name; ?></label>
53
+ <span class="description">(<?php echo $product_tag->count; ?>)</span>
54
+ </li>
55
+ <?php } ?>
56
+ </ul>
57
+ <p class="description"><?php _e( 'Select the Product Tags you want to filter exported Products by. Default is to include all Product Tags.', 'woo_ce' ); ?></p>
58
+ <?php } else { ?>
59
+ <p><?php _e( 'No Product Tags were found.', 'woo_ce' ); ?></p>
60
+ <?php } ?>
61
+ </div>
62
+ <!-- #export-products-filters-tags -->
63
+ <?php
64
+ ob_end_flush();
65
+
66
+ }
67
+
68
+ // HTML template for Filter Products by Product Status widget on Store Exporter screen
69
+ function woo_ce_products_filter_by_product_status() {
70
+
71
+ $product_statuses = get_post_statuses();
72
+ if( !isset( $product_statuses['trash'] ) )
73
+ $product_statuses['trash'] = __( 'Trash', 'woo_ce' );
74
+
75
+ ob_start(); ?>
76
+ <p><label><input type="checkbox" id="products-filters-status" /> <?php _e( 'Filter Products by Product Status', 'woo_ce' ); ?></label></p>
77
+ <div id="export-products-filters-status" class="separator">
78
+ <ul>
79
+ <?php foreach( $product_statuses as $key => $product_status ) { ?>
80
+ <li><label><input type="checkbox" name="product_filter_status[<?php echo $key; ?>]" value="<?php echo $key; ?>" /> <?php echo $product_status; ?></label></li>
81
+ <?php } ?>
82
+ </ul>
83
+ <p class="description"><?php _e( 'Select the Product Status options you want to filter exported Products by. Default is to include all Product Status options.', 'woo_ce' ); ?></p>
84
+ </div>
85
+ <!-- #export-products-filters-status -->
86
+ <?php
87
+ ob_end_flush();
88
+
89
+ }
90
+
91
+ // HTML template for Filter Products by Product Type widget on Store Exporter screen
92
+ function woo_ce_products_filter_by_product_type() {
93
+
94
+ $product_types = woo_ce_get_product_types();
95
+
96
+ ob_start(); ?>
97
+ <p><label><input type="checkbox" id="products-filters-type" /> <?php _e( 'Filter Products by Product Type', 'woo_ce' ); ?></label></p>
98
+ <div id="export-products-filters-type" class="separator">
99
+ <ul>
100
+ <?php if( $product_types ) { ?>
101
+ <?php foreach( $product_types as $key => $product_type ) { ?>
102
+ <li><label><input type="checkbox" name="product_filter_type[<?php echo $key; ?>]" value="<?php echo $key; ?>" /> <?php echo woo_ce_format_product_type( $product_type['name'] ); ?> (<?php echo $product_type['count']; ?>)</label></li>
103
+ <?php } ?>
104
+ <?php } ?>
105
+ </ul>
106
+ <p class="description"><?php _e( 'Select the Product Type\'s you want to filter exported Products by. Default is to include all Product Types and Variations.', 'woo_ce' ); ?></p>
107
+ </div>
108
+ <!-- #export-products-filters-type -->
109
+ <?php
110
+ ob_end_flush();
111
+
112
+ }
113
+
114
+ // HTML template for Filter Products by Product Type widget on Store Exporter screen
115
+ function woo_ce_products_filter_by_stock_status() {
116
+
117
+ // Store Exporter Deluxe
118
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
119
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
120
+
121
+ ob_start(); ?>
122
+ <p><label><input type="checkbox" id="products-filters-stock" /> <?php _e( 'Filter Products by Stock Status', 'woo_ce' ); ?></label></p>
123
+ <div id="export-products-filters-stock" class="separator">
124
+ <ul>
125
+ <li value=""><label><input type="radio" name="product_filter_stock" value="" checked="checked" /><?php _e( 'Include both', 'woo_ce' ); ?></label></li>
126
+ <li value="instock"><label><input type="radio" name="product_filter_stock" value="instock" disabled="disabled" /><?php _e( 'In stock', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
127
+ <li value="outofstock"><label><input type="radio" name="product_filter_stock" value="outofstock" disabled="disabled" /><?php _e( 'Out of stock', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
128
+ </ul>
129
+ </div>
130
+ <!-- #export-products-filters-stock -->
131
+ <?php
132
+ ob_end_flush();
133
+
134
+ }
135
+
136
+ // HTML template for Product Sorting widget on Store Exporter screen
137
+ function woo_ce_product_sorting() {
138
+
139
+ $product_orderby = woo_ce_get_option( 'product_orderby', 'ID' );
140
+ $product_order = woo_ce_get_option( 'product_order', 'DESC' );
141
+
142
+ ob_start(); ?>
143
+ <p><label><?php _e( 'Product Sorting', 'woo_ce' ); ?></label></p>
144
+ <div>
145
+ <select name="product_orderby">
146
+ <option value="ID"<?php selected( 'ID', $product_orderby ); ?>><?php _e( 'Product ID', 'woo_ce' ); ?></option>
147
+ <option value="title"<?php selected( 'title', $product_orderby ); ?>><?php _e( 'Product Name', 'woo_ce' ); ?></option>
148
+ <option value="date"<?php selected( 'date', $product_orderby ); ?>><?php _e( 'Date Created', 'woo_ce' ); ?></option>
149
+ <option value="modified"<?php selected( 'modified', $product_orderby ); ?>><?php _e( 'Date Modified', 'woo_ce' ); ?></option>
150
+ <option value="rand"<?php selected( 'rand', $product_orderby ); ?>><?php _e( 'Random', 'woo_ce' ); ?></option>
151
+ <option value="menu_order"<?php selected( 'menu_order', $product_orderby ); ?>><?php _e( 'Sort Order', 'woo_ce' ); ?></option>
152
+ </select>
153
+ <select name="product_order">
154
+ <option value="ASC"<?php selected( 'ASC', $product_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
155
+ <option value="DESC"<?php selected( 'DESC', $product_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
156
+ </select>
157
+ <p class="description"><?php _e( 'Select the sorting of Products within the exported file. By default this is set to export Products by Product ID in Desending order.', 'woo_ce' ); ?></p>
158
+ </div>
159
+ <?php
160
+ ob_end_flush();
161
+
162
+ }
163
+
164
+ // HTML template for Up-sells formatting on Store Exporter screen
165
+ function woo_ce_products_upsells_formatting() {
166
+
167
+ $upsell_formatting = woo_ce_get_option( 'upsell_formatting', 1 );
168
+
169
+ ob_start(); ?>
170
+ <tr class="export-options product-options">
171
+ <th><label for=""><?php _e( 'Up-sells formatting', 'woo_ce' ); ?></label></th>
172
+ <td>
173
+ <label><input type="radio" name="product_upsell_formatting" value="0"<?php checked( $upsell_formatting, 0 ); ?> />&nbsp;<?php _e( 'Export Up-Sells as Product ID', 'woo_ce' ); ?></label><br />
174
+ <label><input type="radio" name="product_upsell_formatting" value="1"<?php checked( $upsell_formatting, 1 ); ?> />&nbsp;<?php _e( 'Export Up-Sells as Product SKU', 'woo_ce' ); ?></label>
175
+ <p class="description"><?php _e( 'Choose the up-sell formatting that is accepted by your WooCommerce import Plugin (e.g. Product Importer Deluxe, Product Import Suite, etc.).', 'woo_ce' ); ?></p>
176
+ </td>
177
+ </tr>
178
+
179
+ <?php
180
+ ob_end_flush();
181
+
182
+ }
183
+
184
+ // HTML template for Cross-sells formatting on Store Exporter screen
185
+ function woo_ce_products_crosssells_formatting() {
186
+
187
+ $crosssell_formatting = woo_ce_get_option( 'crosssell_formatting', 1 );
188
+
189
+ ob_start(); ?>
190
+ <tr class="export-options product-options">
191
+ <th><label for=""><?php _e( 'Cross-sells formatting', 'woo_ce' ); ?></label></th>
192
+ <td>
193
+ <label><input type="radio" name="product_crosssell_formatting" value="0"<?php checked( $crosssell_formatting, 0 ); ?> />&nbsp;<?php _e( 'Export Cross-Sells as Product ID', 'woo_ce' ); ?></label><br />
194
+ <label><input type="radio" name="product_crosssell_formatting" value="1"<?php checked( $crosssell_formatting, 1 ); ?> />&nbsp;<?php _e( 'Export Cross-Sells as Product SKU', 'woo_ce' ); ?></label>
195
+ <p class="description"><?php _e( 'Choose the cross-sell formatting that is accepted by your WooCommerce import Plugin (e.g. Product Importer Deluxe, Product Import Suite, etc.).', 'woo_ce' ); ?></p>
196
+ </td>
197
+ </tr>
198
+
199
+ <?php
200
+ ob_end_flush();
201
+
202
+ }
203
+
204
+ // HTML template for Custom Products widget on Store Exporter screen
205
+ function woo_ce_products_custom_fields() {
206
+
207
+ if( $custom_products = woo_ce_get_option( 'custom_products', '' ) )
208
+ $custom_products = implode( "\n", $custom_products );
209
+
210
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
211
+
212
+ ob_start(); ?>
213
+ <form method="post" id="export-products-custom-fields" class="export-options product-options">
214
+ <div id="poststuff">
215
+
216
+ <div class="postbox" id="export-options product-options">
217
+ <h3 class="hndle"><?php _e( 'Custom Product Fields', 'woo_ce' ); ?></h3>
218
+ <div class="inside">
219
+ <p class="description"><?php _e( 'To include additional custom Product meta in the Export Products table above fill the Products text box then click Save Custom Fields.', 'woo_ce' ); ?></p>
220
+ <table class="form-table">
221
+
222
+ <tr>
223
+ <th>
224
+ <label><?php _e( 'Product meta', 'woo_ce' ); ?></label>
225
+ </th>
226
+ <td>
227
+ <textarea name="custom_products" rows="5" cols="70"><?php echo esc_textarea( $custom_products ); ?></textarea>
228
+ <p class="description"><?php _e( 'Include additional custom Product meta in your export file by adding each custom Product meta name to a new line above.<br />For example: <code>Customer UA, Customer IP Address</code>', 'woo_ce' ); ?></p>
229
+ </td>
230
+ </tr>
231
+
232
+ </table>
233
+ <p class="submit">
234
+ <input type="submit" value="<?php _e( 'Save Custom Fields', 'woo_ce' ); ?>" class="button-primary" />
235
+ </p>
236
+ <p class="description"><?php printf( __( 'For more information on custom Product meta consult our <a href="%s" target="_blank">online documentation</a>.', 'woo_ce' ), $troubleshooting_url ); ?></p>
237
+ </div>
238
+ <!-- .inside -->
239
+ </div>
240
+ <!-- .postbox -->
241
+
242
+ </div>
243
+ <!-- #poststuff -->
244
+ <input type="hidden" name="action" value="update" />
245
+ </form>
246
+ <!-- #export-products-custom-fields -->
247
+ <?php
248
+ ob_end_flush();
249
+
250
+ }
251
+
252
+ /* End of: WordPress Administration */
253
+
254
+ }
255
+
256
+ // Returns a list of WooCommerce Product IDs to export process
257
+ function woo_ce_get_products( $args = array() ) {
258
+
259
+ $limit_volume = -1;
260
+ $offset = 0;
261
+ $product_categories = false;
262
+ $product_tags = false;
263
+ $product_status = false;
264
+ $product_type = false;
265
+ $orderby = 'ID';
266
+ $order = 'ASC';
267
+ if( $args ) {
268
+ $limit_volume = $args['limit_volume'];
269
+ $offset = $args['offset'];
270
+ if( !empty( $args['product_categories'] ) )
271
+ $product_categories = $args['product_categories'];
272
+ if( !empty( $args['product_tags'] ) )
273
+ $product_tags = $args['product_tags'];
274
+ if( !empty( $args['product_status'] ) )
275
+ $product_status = $args['product_status'];
276
+ if( !empty( $args['product_type'] ) )
277
+ $product_type = $args['product_type'];
278
+ if( isset( $args['product_orderby'] ) )
279
+ $orderby = $args['product_orderby'];
280
+ if( isset( $args['product_order'] ) )
281
+ $order = $args['product_order'];
282
+ }
283
+ $post_type = array( 'product', 'product_variation' );
284
+ $args = array(
285
+ 'post_type' => $post_type,
286
+ 'orderby' => $orderby,
287
+ 'order' => $order,
288
+ 'offset' => $offset,
289
+ 'posts_per_page' => $limit_volume,
290
+ 'post_status' => woo_ce_post_statuses(),
291
+ 'fields' => 'ids'
292
+ );
293
+ if( $product_categories ) {
294
+ $term_taxonomy = 'product_cat';
295
+ $args['tax_query'] = array(
296
+ array(
297
+ 'taxonomy' => $term_taxonomy,
298
+ 'field' => 'id',
299
+ 'terms' => $product_categories
300
+ )
301
+ );
302
+ }
303
+ if( $product_tags ) {
304
+ $term_taxonomy = 'product_tag';
305
+ $args['tax_query'] = array(
306
+ array(
307
+ 'taxonomy' => $term_taxonomy,
308
+ 'field' => 'id',
309
+ 'terms' => $product_tags
310
+ )
311
+ );
312
+ }
313
+ if( $product_status )
314
+ $args['post_status'] = woo_ce_post_statuses( $product_status, true );
315
+ if( $product_type ) {
316
+ if( in_array( 'variation', $product_type ) ) {
317
+ $args['post_type'] = 'product_variation';
318
+ } else {
319
+ $args['tax_query'] = array(
320
+ array(
321
+ 'taxonomy' => 'product_type',
322
+ 'field' => 'slug',
323
+ 'terms' => $product_type
324
+ )
325
+ );
326
+ }
327
+ }
328
+ $products = array();
329
+ $product_ids = new WP_Query( $args );
330
+ if( $product_ids->posts ) {
331
+ foreach( $product_ids->posts as $product_id ) {
332
+ $product = get_post( $product_id );
333
+ // Filter out variations that don't have a Parent Product that exists
334
+ if( $product->post_type == 'product_variation' ) {
335
+ // Check if Parent exists
336
+ if( $product->post_parent ) {
337
+ if( !get_post( $product->post_parent ) ) {
338
+ unset( $product_id, $product );
339
+ continue;
340
+ }
341
+ }
342
+ }
343
+ if( isset( $product_id ) )
344
+ $products[] = $product_id;
345
+ }
346
+ unset( $product_ids, $product_id );
347
+ }
348
+ return $products;
349
+
350
+ }
351
+
352
+ function woo_ce_get_product_data( $product_id = 0, $args = array() ) {
353
+
354
+ // Get Product defaults
355
+ $weight_unit = get_option( 'woocommerce_weight_unit' );
356
+ $dimension_unit = get_option( 'woocommerce_dimension_unit' );
357
+ $height_unit = $dimension_unit;
358
+ $width_unit = $dimension_unit;
359
+ $length_unit = $dimension_unit;
360
+
361
+ $product = get_post( $product_id );
362
+ $product->parent_id = '';
363
+ $product->parent_sku = '';
364
+ if( $product->post_type == 'product_variation' ) {
365
+ // Assign Parent ID for Variants then check if Parent exists
366
+ if( $product->parent_id = $product->post_parent )
367
+ $product->parent_sku = get_post_meta( $product->post_parent, '_sku', true );
368
+ else
369
+ $product->parent_id = '';
370
+ }
371
+ $product->product_id = $product->ID;
372
+ $product->sku = get_post_meta( $product->ID, '_sku', true );
373
+ $product->name = get_the_title( $product->ID );
374
+ $product->permalink = get_permalink( $product->ID );
375
+ $product->product_url = get_permalink( $product->ID );
376
+ $product->slug = $product->post_name;
377
+ $product->description = $product->post_content;
378
+ $product->excerpt = $product->post_excerpt;
379
+ $product->regular_price = get_post_meta( $product->ID, '_regular_price', true );
380
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
381
+ if( isset( $product->regular_price ) && $product->regular_price != '' && function_exists( 'wc_format_localized_price' ) )
382
+ $product->regular_price = wc_format_localized_price( $product->regular_price );
383
+ $product->price = get_post_meta( $product->ID, '_price', true );
384
+ if( $product->regular_price != '' && ( $product->regular_price <> $product->price ) )
385
+ $product->price = $product->regular_price;
386
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
387
+ if( isset( $product->price ) && $product->price != '' && function_exists( 'wc_format_localized_price' ) )
388
+ $product->price = wc_format_localized_price( $product->price );
389
+ $product->sale_price = get_post_meta( $product->ID, '_sale_price', true );
390
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
391
+ if( isset( $product->sale_price ) && $product->sale_price != '' && function_exists( 'wc_format_localized_price' ) )
392
+ $product->sale_price = wc_format_localized_price( $product->sale_price );
393
+ $product->sale_price_dates_from = woo_ce_format_sale_price_dates( get_post_meta( $product->ID, '_sale_price_dates_from', true ) );
394
+ $product->sale_price_dates_to = woo_ce_format_sale_price_dates( get_post_meta( $product->ID, '_sale_price_dates_to', true ) );
395
+ $product->post_date = woo_ce_format_date( $product->post_date );
396
+ $product->post_modified = woo_ce_format_date( $product->post_modified );
397
+ $product->type = woo_ce_get_product_assoc_type( $product->ID );
398
+ if( $product->post_type == 'product_variation' )
399
+ $product->type = __( 'Variation', 'woo_ce' );
400
+ $product->visibility = woo_ce_format_visibility( get_post_meta( $product->ID, '_visibility', true ) );
401
+ $product->featured = woo_ce_format_switch( get_post_meta( $product->ID, '_featured', true ) );
402
+ $product->virtual = woo_ce_format_switch( get_post_meta( $product->ID, '_virtual', true ) );
403
+ $product->downloadable = woo_ce_format_switch( get_post_meta( $product->ID, '_downloadable', true ) );
404
+ $product->weight = get_post_meta( $product->ID, '_weight', true );
405
+ $product->weight_unit = ( $product->weight != '' ? $weight_unit : '' );
406
+ $product->height = get_post_meta( $product->ID, '_height', true );
407
+ $product->height_unit = ( $product->height != '' ? $height_unit : '' );
408
+ $product->width = get_post_meta( $product->ID, '_width', true );
409
+ $product->width_unit = ( $product->width != '' ? $width_unit : '' );
410
+ $product->length = get_post_meta( $product->ID, '_length', true );
411
+ $product->length_unit = ( $product->length != '' ? $length_unit : '' );
412
+ $product->category = woo_ce_get_product_assoc_categories( $product->ID, $product->parent_id );
413
+ $product->tag = woo_ce_get_product_assoc_tags( $product->ID );
414
+ $product->manage_stock = woo_ce_format_switch( get_post_meta( $product->ID, '_manage_stock', true ) );
415
+ $product->allow_backorders = woo_ce_format_switch( get_post_meta( $product->ID, '_backorders', true ) );
416
+ $product->sold_individually = woo_ce_format_switch( get_post_meta( $product->ID, '_sold_individually', true ) );
417
+ $product->upsell_ids = woo_ce_get_product_assoc_upsell_ids( $product->ID );
418
+ $product->crosssell_ids = woo_ce_get_product_assoc_crosssell_ids( $product->ID );
419
+ $product->quantity = get_post_meta( $product->ID, '_stock', true );
420
+ $product->stock_status = woo_ce_format_stock_status( get_post_meta( $product->ID, '_stock_status', true ), $product->quantity );
421
+ $product->image = woo_ce_get_product_assoc_featured_image( $product->ID );
422
+ $product->tax_status = woo_ce_format_tax_status( get_post_meta( $product->ID, '_tax_status', true ) );
423
+ $product->tax_class = woo_ce_format_tax_class( get_post_meta( $product->ID, '_tax_class', true ) );
424
+ $product->external_url = get_post_meta( $product->ID, '_product_url', true );
425
+ $product->button_text = get_post_meta( $product->ID, '_button_text', true );
426
+ $product->file_download = woo_ce_get_product_assoc_file_downloads( $product->ID );
427
+ $product->download_limit = get_post_meta( $product->ID, '_download_limit', true );
428
+ $product->download_expiry = get_post_meta( $product->ID, '_download_expiry', true );
429
+ $product->download_type = woo_ce_format_download_type( get_post_meta( $product->ID, '_download_type', true ) );
430
+ $product->purchase_note = get_post_meta( $product->ID, '_purchase_note', true );
431
+ $product->product_status = woo_ce_format_product_status( $product->post_status );
432
+ $product->enable_reviews = woo_ce_format_comment_status( $product->comment_status );
433
+ $product->menu_order = $product->menu_order;
434
+
435
+ // Attributes
436
+ if( $attributes = woo_ce_get_product_attributes() ) {
437
+ if( $product->post_type == 'product_variation' ) {
438
+ foreach( $attributes as $attribute ) {
439
+ $attribute_value = get_post_meta( $product->ID, sprintf( 'attribute_pa_%s', $attribute->attribute_name ), true );
440
+ if( !empty( $attribute_value ) ) {
441
+ $term_id = term_exists( $attribute_value, sprintf( 'pa_%s', $attribute->attribute_name ) );
442
+ if( $term_id !== 0 && $term_id !== null && !is_wp_error( $term_id ) ) {
443
+ $term = get_term( $term_id['term_id'], sprintf( 'pa_%s', $attribute->attribute_name ) );
444
+ $attribute_value = $term->name;
445
+ unset( $term );
446
+ }
447
+ unset( $term_id );
448
+ }
449
+ $product->{'attribute_' . $attribute->attribute_name} = $attribute_value;
450
+ unset( $attribute_value );
451
+ }
452
+ } else {
453
+ $product->attributes = maybe_unserialize( get_post_meta( $product->ID, '_product_attributes', true ) );
454
+ if( !empty( $product->attributes ) ) {
455
+ // Check for taxonomy-based attributes
456
+ foreach( $attributes as $attribute ) {
457
+ if( isset( $product->attributes['pa_' . $attribute->attribute_name] ) )
458
+ $product->{'attribute_' . $attribute->attribute_name} = woo_ce_get_product_assoc_attributes( $product->ID, $product->attributes['pa_' . $attribute->attribute_name], 'product' );
459
+ else
460
+ $product->{'attribute_' . $attribute->attribute_name} = woo_ce_get_product_assoc_attributes( $product->ID, $attribute, 'global' );
461
+ }
462
+ // Check for per-Product attributes (custom)
463
+ foreach( $product->attributes as $key => $attribute ) {
464
+ if( $attribute['is_taxonomy'] == 0 ) {
465
+ if( !isset( $product->{'attribute_' . $key} ) )
466
+ $product->{'attribute_' . $key} = $attribute['value'];
467
+ }
468
+ }
469
+ }
470
+ }
471
+ }
472
+
473
+ // Advanced Google Product Feed - http://plugins.leewillis.co.uk/downloads/wp-e-commerce-product-feeds/
474
+ if( function_exists( 'woocommerce_gpf_install' ) ) {
475
+ $product->gpf_data = get_post_meta( $product->ID, '_woocommerce_gpf_data', true );
476
+ $product->gpf_availability = ( isset( $product->gpf_data['availability'] ) ? woo_ce_format_gpf_availability( $product->gpf_data['availability'] ) : '' );
477
+ $product->gpf_condition = ( isset( $product->gpf_data['condition'] ) ? woo_ce_format_gpf_condition( $product->gpf_data['condition'] ) : '' );
478
+ $product->gpf_brand = ( isset( $product->gpf_data['brand'] ) ? $product->gpf_data['brand'] : '' );
479
+ $product->gpf_product_type = ( isset( $product->gpf_data['product_type'] ) ? $product->gpf_data['product_type'] : '' );
480
+ $product->gpf_google_product_category = ( isset( $product->gpf_data['google_product_category'] ) ? $product->gpf_data['google_product_category'] : '' );
481
+ $product->gpf_gtin = ( isset( $product->gpf_data['gtin'] ) ? $product->gpf_data['gtin'] : '' );
482
+ $product->gpf_mpn = ( isset( $product->gpf_data['mpn'] ) ? $product->gpf_data['mpn'] : '' );
483
+ $product->gpf_gender = ( isset( $product->gpf_data['gender'] ) ? $product->gpf_data['gender'] : '' );
484
+ $product->gpf_age_group = ( isset( $product->gpf_data['age_group'] ) ? $product->gpf_data['age_group'] : '' );
485
+ $product->gpf_color = ( isset( $product->gpf_data['color'] ) ? $product->gpf_data['color'] : '' );
486
+ $product->gpf_size = ( isset( $product->gpf_data['size'] ) ? $product->gpf_data['size'] : '' );
487
+ }
488
+
489
+ // All in One SEO Pack - http://wordpress.org/extend/plugins/all-in-one-seo-pack/
490
+ if( function_exists( 'aioseop_activate' ) ) {
491
+ $product->aioseop_keywords = get_post_meta( $product->ID, '_aioseop_keywords', true );
492
+ $product->aioseop_description = get_post_meta( $product->ID, '_aioseop_description', true );
493
+ $product->aioseop_title = get_post_meta( $product->ID, '_aioseop_title', true );
494
+ $product->aioseop_titleatr = get_post_meta( $product->ID, '_aioseop_titleatr', true );
495
+ $product->aioseop_menulabel = get_post_meta( $product->ID, '_aioseop_menulabel', true );
496
+ }
497
+
498
+ // WordPress SEO - http://wordpress.org/plugins/wordpress-seo/
499
+ if( function_exists( 'wpseo_admin_init' ) ) {
500
+ $product->wpseo_focuskw = get_post_meta( $product->ID, '_yoast_wpseo_focuskw', true );
501
+ $product->wpseo_metadesc = get_post_meta( $product->ID, '_yoast_wpseo_metadesc', true );
502
+ $product->wpseo_title = get_post_meta( $product->ID, '_yoast_wpseo_title', true );
503
+ $product->wpseo_googleplus_description = get_post_meta( $product->ID, '_yoast_wpseo_google-plus-description', true );
504
+ $product->wpseo_opengraph_description = get_post_meta( $product->ID, '_yoast_wpseo_opengraph-description', true );
505
+ }
506
+
507
+ // Ultimate SEO - http://wordpress.org/plugins/seo-ultimate/
508
+ if( function_exists( 'su_wp_incompat_notice' ) ) {
509
+ $product->useo_meta_title = get_post_meta( $product->ID, '_su_title', true );
510
+ $product->useo_meta_description = get_post_meta( $product->ID, '_su_description', true );
511
+ $product->useo_meta_keywords = get_post_meta( $product->ID, '_su_keywords', true );
512
+ $product->useo_social_title = get_post_meta( $product->ID, '_su_og_title', true );
513
+ $product->useo_social_description = get_post_meta( $product->ID, '_su_og_description', true );
514
+ $product->useo_meta_noindex = get_post_meta( $product->ID, '_su_meta_robots_noindex', true );
515
+ $product->useo_meta_noautolinks = get_post_meta( $product->ID, '_su_disable_autolinks', true );
516
+ }
517
+
518
+ // WooCommerce MSRP Pricing - http://woothemes.com/woocommerce/
519
+ if( function_exists( 'woocommerce_msrp_activate' ) ) {
520
+ $product->msrp = get_post_meta( $product->ID, '_msrp_price', true );
521
+ if( $product->msrp == false && $product->post_type == 'product_variation' )
522
+ $product->msrp = get_post_meta( $product->ID, '_msrp', true );
523
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
524
+ if( isset( $product->msrp ) && $product->msrp != '' && function_exists( 'wc_format_localized_price' ) )
525
+ $product->msrp = wc_format_localized_price( $product->msrp );
526
+ }
527
+
528
+ // Allow Plugin/Theme authors to add support for additional Product columns
529
+ return apply_filters( 'woo_ce_product_item', $product, $product->ID );
530
+
531
+ }
532
+
533
+ // Returns Product Categories associated to a specific Product
534
+ function woo_ce_get_product_assoc_categories( $product_id = 0, $parent_id = 0 ) {
535
+
536
+ global $export;
537
+
538
+ $output = '';
539
+ $term_taxonomy = 'product_cat';
540
+ // Return Product Categories of Parent if this is a Variation
541
+ if( $parent_id )
542
+ $product_id = $parent_id;
543
+ if( $product_id )
544
+ $categories = wp_get_object_terms( $product_id, $term_taxonomy );
545
+ if( !empty( $categories ) && is_wp_error( $categories ) == false ) {
546
+ $size = count( $categories );
547
+ for( $i = 0; $i < $size; $i++ ) {
548
+ if( $categories[$i]->parent == '0' ) {
549
+ $output .= $categories[$i]->name . $export->category_separator;
550
+ } else {
551
+ // Check if Parent -> Child
552
+ $parent_category = get_term( $categories[$i]->parent, $term_taxonomy );
553
+ // Check if Parent -> Child -> Subchild
554
+ if( $parent_category->parent == '0' ) {
555
+ $output .= $parent_category->name . '>' . $categories[$i]->name . $export->category_separator;
556
+ $output = str_replace( $parent_category->name . $export->category_separator, '', $output );
557
+ } else {
558
+ $root_category = get_term( $parent_category->parent, $term_taxonomy );
559
+ $output .= $root_category->name . '>' . $parent_category->name . '>' . $categories[$i]->name . $export->category_separator;
560
+ $output = str_replace( array(
561
+ $root_category->name . '>' . $parent_category->name . $export->category_separator,
562
+ $parent_category->name . $export->category_separator
563
+ ), '', $output );
564
+ }
565
+ unset( $root_category, $parent_category );
566
+ }
567
+ }
568
+ $output = substr( $output, 0, -1 );
569
+ } else {
570
+ $output .= __( 'Uncategorized', 'woo_ce' );
571
+ }
572
+ return $output;
573
+
574
+ }
575
+
576
+ // Returns Product Tags associated to a specific Product
577
+ function woo_ce_get_product_assoc_tags( $product_id = 0 ) {
578
+
579
+ global $export;
580
+
581
+ $output = '';
582
+ $term_taxonomy = 'product_tag';
583
+ $tags = wp_get_object_terms( $product_id, $term_taxonomy );
584
+ if( !empty( $tags ) && is_wp_error( $tags ) == false ) {
585
+ $size = count( $tags );
586
+ for( $i = 0; $i < $size; $i++ ) {
587
+ if( $tag = get_term( $tags[$i]->term_id, $term_taxonomy ) )
588
+ $output .= $tag->name . $export->category_separator;
589
+ }
590
+ $output = substr( $output, 0, -1 );
591
+ }
592
+ return $output;
593
+
594
+ }
595
+
596
+ // Returns the Featured Image associated to a specific Product
597
+ function woo_ce_get_product_assoc_featured_image( $product_id = 0 ) {
598
+
599
+ $output = '';
600
+ if( $product_id ) {
601
+ if( $thumbnail_id = get_post_meta( $product_id, '_thumbnail_id', true ) )
602
+ $output = wp_get_attachment_url( $thumbnail_id );
603
+ }
604
+ return $output;
605
+
606
+ }
607
+
608
+ // Returns the Product Type of a specific Product
609
+ function woo_ce_get_product_assoc_type( $product_id = 0 ) {
610
+
611
+ global $export;
612
+
613
+ $output = '';
614
+ $term_taxonomy = 'product_type';
615
+ $types = wp_get_object_terms( $product_id, $term_taxonomy );
616
+ if( empty( $types ) )
617
+ $types = array( get_term_by( 'name', 'simple', $term_taxonomy ) );
618
+ if( $types ) {
619
+ $size = count( $types );
620
+ for( $i = 0; $i < $size; $i++ ) {
621
+ $type = get_term( $types[$i]->term_id, $term_taxonomy );
622
+ $output .= woo_ce_format_product_type( $type->name ) . $export->category_separator;
623
+ }
624
+ $output = substr( $output, 0, -1 );
625
+ }
626
+ return $output;
627
+
628
+ }
629
+
630
+ // Returns the Up-Sell associated to a specific Product
631
+ function woo_ce_get_product_assoc_upsell_ids( $product_id = 0 ) {
632
+
633
+ global $export;
634
+
635
+ $output = '';
636
+ if( $product_id ) {
637
+ $upsell_ids = get_post_meta( $product_id, '_upsell_ids', true );
638
+ // Convert Product ID to Product SKU as per Up-Sells Formatting
639
+ if( $export->upsell_formatting == 1 && !empty( $upsell_ids ) ) {
640
+ $size = count( $upsell_ids );
641
+ for( $i = 0; $i < $size; $i++ ) {
642
+ $upsell_ids[$i] = get_post_meta( $upsell_ids[$i], '_sku', true );
643
+ if( empty( $upsell_ids[$i] ) )
644
+ unset( $upsell_ids[$i] );
645
+ }
646
+ // 'reindex' array
647
+ $upsell_ids = array_values( $upsell_ids );
648
+ }
649
+ $output = woo_ce_convert_product_ids( $upsell_ids );
650
+ }
651
+ return $output;
652
+
653
+ }
654
+
655
+ // Returns the Cross-Sell associated to a specific Product
656
+ function woo_ce_get_product_assoc_crosssell_ids( $product_id = 0 ) {
657
+
658
+ global $export;
659
+
660
+ $output = '';
661
+ if( $product_id ) {
662
+ $crosssell_ids = get_post_meta( $product_id, '_crosssell_ids', true );
663
+ // Convert Product ID to Product SKU as per Cross-Sells Formatting
664
+ if( $export->crosssell_formatting == 1 && !empty( $crosssell_ids ) ) {
665
+ $size = count( $crosssell_ids );
666
+ for( $i = 0; $i < $size; $i++ ) {
667
+ $crosssell_ids[$i] = get_post_meta( $crosssell_ids[$i], '_sku', true );
668
+ // Remove Cross-Sell if SKU is empty
669
+ if( empty( $crosssell_ids[$i] ) )
670
+ unset( $crosssell_ids[$i] );
671
+ }
672
+ // 'reindex' array
673
+ $crosssell_ids = array_values( $crosssell_ids );
674
+ }
675
+ $output = woo_ce_convert_product_ids( $crosssell_ids );
676
+ }
677
+ return $output;
678
+
679
+ }
680
+
681
+ // Returns Product Attributes associated to a specific Product
682
+ function woo_ce_get_product_assoc_attributes( $product_id = 0, $attribute = array(), $type = 'product' ) {
683
+
684
+ global $export;
685
+
686
+ $output = '';
687
+ if( $product_id ) {
688
+ $terms = array();
689
+ if( $type == 'product' ) {
690
+ if( $attribute['is_taxonomy'] == 1 )
691
+ $term_taxonomy = $attribute['name'];
692
+ } else if( $type == 'global' ) {
693
+ $term_taxonomy = 'pa_' . $attribute->attribute_name;
694
+ }
695
+ $terms = wp_get_object_terms( $product_id, $term_taxonomy );
696
+ if( !empty( $terms ) && is_wp_error( $terms ) == false ) {
697
+ $size = count( $terms );
698
+ for( $i = 0; $i < $size; $i++ )
699
+ $output .= $terms[$i]->name . $export->category_separator;
700
+ unset( $terms );
701
+ }
702
+ $output = substr( $output, 0, -1 );
703
+ }
704
+ return $output;
705
+
706
+ }
707
+
708
+ // Returns File Downloads associated to a specific Product
709
+ function woo_ce_get_product_assoc_file_downloads( $product_id = 0 ) {
710
+
711
+ global $export;
712
+
713
+ $output = '';
714
+ if( $product_id ) {
715
+ if( version_compare( WOOCOMMERCE_VERSION, '2.0', '>=' ) ) {
716
+ // If WooCommerce 2.0+ is installed then use new _downloadable_files Post meta key
717
+ if( $file_downloads = maybe_unserialize( get_post_meta( $product_id, '_downloadable_files', true ) ) ) {
718
+ foreach( $file_downloads as $file_download )
719
+ $output .= $file_download['file'] . $export->category_separator;
720
+ unset( $file_download, $file_downloads );
721
+ }
722
+ $output = substr( $output, 0, -1 );
723
+ } else {
724
+ // If WooCommerce -2.0 is installed then use legacy _file_paths Post meta key
725
+ if( $file_downloads = maybe_unserialize( get_post_meta( $product_id, '_file_paths', true ) ) ) {
726
+ foreach( $file_downloads as $file_download )
727
+ $output .= $file_download . $export->category_separator;
728
+ unset( $file_download, $file_downloads );
729
+ }
730
+ $output = substr( $output, 0, -1 );
731
+ }
732
+ }
733
+ return $output;
734
+
735
+ }
736
+
737
+ // Returns a list of Product export columns
738
+ function woo_ce_get_product_fields( $format = 'full' ) {
739
+
740
+ $export_type = 'product';
741
+
742
+ $fields = array();
743
+ $fields[] = array(
744
+ 'name' => 'parent_id',
745
+ 'label' => __( 'Parent ID', 'woo_ce' )
746
+ );
747
+ $fields[] = array(
748
+ 'name' => 'parent_sku',
749
+ 'label' => __( 'Parent SKU', 'woo_ce' )
750
+ );
751
+ $fields[] = array(
752
+ 'name' => 'product_id',
753
+ 'label' => __( 'Product ID', 'woo_ce' )
754
+ );
755
+ $fields[] = array(
756
+ 'name' => 'sku',
757
+ 'label' => __( 'Product SKU', 'woo_ce' )
758
+ );
759
+ $fields[] = array(
760
+ 'name' => 'name',
761
+ 'label' => __( 'Product Name', 'woo_ce' )
762
+ );
763
+ $fields[] = array(
764
+ 'name' => 'slug',
765
+ 'label' => __( 'Slug', 'woo_ce' )
766
+ );
767
+ $fields[] = array(
768
+ 'name' => 'permalink',
769
+ 'label' => __( 'Permalink', 'woo_ce' )
770
+ );
771
+ $fields[] = array(
772
+ 'name' => 'product_url',
773
+ 'label' => __( 'Product URL', 'woo_ce' )
774
+ );
775
+ $fields[] = array(
776
+ 'name' => 'description',
777
+ 'label' => __( 'Description', 'woo_ce' )
778
+ );
779
+ $fields[] = array(
780
+ 'name' => 'excerpt',
781
+ 'label' => __( 'Excerpt', 'woo_ce' )
782
+ );
783
+ $fields[] = array(
784
+ 'name' => 'post_date',
785
+ 'label' => __( 'Product Published', 'woo_ce' )
786
+ );
787
+ $fields[] = array(
788
+ 'name' => 'post_modified',
789
+ 'label' => __( 'Product Modified', 'woo_ce' )
790
+ );
791
+ $fields[] = array(
792
+ 'name' => 'type',
793
+ 'label' => __( 'Type', 'woo_ce' )
794
+ );
795
+ $fields[] = array(
796
+ 'name' => 'visibility',
797
+ 'label' => __( 'Visibility', 'woo_ce' )
798
+ );
799
+ $fields[] = array(
800
+ 'name' => 'featured',
801
+ 'label' => __( 'Featured', 'woo_ce' )
802
+ );
803
+ $fields[] = array(
804
+ 'name' => 'virtual',
805
+ 'label' => __( 'Virtual', 'woo_ce' )
806
+ );
807
+ $fields[] = array(
808
+ 'name' => 'downloadable',
809
+ 'label' => __( 'Downloadable', 'woo_ce' )
810
+ );
811
+ $fields[] = array(
812
+ 'name' => 'price',
813
+ 'label' => __( 'Price', 'woo_ce' )
814
+ );
815
+ $fields[] = array(
816
+ 'name' => 'sale_price',
817
+ 'label' => __( 'Sale Price', 'woo_ce' )
818
+ );
819
+ $fields[] = array(
820
+ 'name' => 'sale_price_dates_from',
821
+ 'label' => __( 'Sale Price Dates From', 'woo_ce' )
822
+ );
823
+ $fields[] = array(
824
+ 'name' => 'sale_price_dates_to',
825
+ 'label' => __( 'Sale Price Dates To', 'woo_ce' )
826
+ );
827
+ $fields[] = array(
828
+ 'name' => 'weight',
829
+ 'label' => __( 'Weight', 'woo_ce' )
830
+ );
831
+ $fields[] = array(
832
+ 'name' => 'weight_unit',
833
+ 'label' => __( 'Weight Unit', 'woo_ce' )
834
+ );
835
+ $fields[] = array(
836
+ 'name' => 'height',
837
+ 'label' => __( 'Height', 'woo_ce' )
838
+ );
839
+ $fields[] = array(
840
+ 'name' => 'height_unit',
841
+ 'label' => __( 'Height Unit', 'woo_ce' )
842
+ );
843
+ $fields[] = array(
844
+ 'name' => 'width',
845
+ 'label' => __( 'Width', 'woo_ce' )
846
+ );
847
+ $fields[] = array(
848
+ 'name' => 'width_unit',
849
+ 'label' => __( 'Width Unit', 'woo_ce' )
850
+ );
851
+ $fields[] = array(
852
+ 'name' => 'length',
853
+ 'label' => __( 'Length', 'woo_ce' )
854
+ );
855
+ $fields[] = array(
856
+ 'name' => 'length_unit',
857
+ 'label' => __( 'Length Unit', 'woo_ce' )
858
+ );
859
+ $fields[] = array(
860
+ 'name' => 'category',
861
+ 'label' => __( 'Category', 'woo_ce' )
862
+ );
863
+ $fields[] = array(
864
+ 'name' => 'tag',
865
+ 'label' => __( 'Tag', 'woo_ce' )
866
+ );
867
+ $fields[] = array(
868
+ 'name' => 'image',
869
+ 'label' => __( 'Featured Image', 'woo_ce' )
870
+ );
871
+ $fields[] = array(
872
+ 'name' => 'product_gallery',
873
+ 'label' => __( 'Product Gallery', 'woo_ce' ),
874
+ 'disabled' => 1
875
+ );
876
+ $fields[] = array(
877
+ 'name' => 'tax_status',
878
+ 'label' => __( 'Tax Status', 'woo_ce' )
879
+ );
880
+ $fields[] = array(
881
+ 'name' => 'tax_class',
882
+ 'label' => __( 'Tax Class', 'woo_ce' )
883
+ );
884
+ $fields[] = array(
885
+ 'name' => 'file_download',
886
+ 'label' => __( 'File Download', 'woo_ce' )
887
+ );
888
+ $fields[] = array(
889
+ 'name' => 'download_limit',
890
+ 'label' => __( 'Download Limit', 'woo_ce' )
891
+ );
892
+ $fields[] = array(
893
+ 'name' => 'download_expiry',
894
+ 'label' => __( 'Download Expiry', 'woo_ce' )
895
+ );
896
+ $fields[] = array(
897
+ 'name' => 'download_type',
898
+ 'label' => __( 'Download Type', 'woo_ce' )
899
+ );
900
+ $fields[] = array(
901
+ 'name' => 'manage_stock',
902
+ 'label' => __( 'Manage Stock', 'woo_ce' )
903
+ );
904
+ $fields[] = array(
905
+ 'name' => 'quantity',
906
+ 'label' => __( 'Quantity', 'woo_ce' )
907
+ );
908
+ $fields[] = array(
909
+ 'name' => 'stock_status',
910
+ 'label' => __( 'Stock Status', 'woo_ce' )
911
+ );
912
+ $fields[] = array(
913
+ 'name' => 'allow_backorders',
914
+ 'label' => __( 'Allow Backorders', 'woo_ce' )
915
+ );
916
+ $fields[] = array(
917
+ 'name' => 'sold_individually',
918
+ 'label' => __( 'Sold Individually', 'woo_ce' )
919
+ );
920
+ $fields[] = array(
921
+ 'name' => 'total_sales',
922
+ 'label' => __( 'Total Sales', 'woo_ce' ),
923
+ 'disabled' => 1
924
+ );
925
+ $fields[] = array(
926
+ 'name' => 'upsell_ids',
927
+ 'label' => __( 'Up-Sells', 'woo_ce' )
928
+ );
929
+ $fields[] = array(
930
+ 'name' => 'crosssell_ids',
931
+ 'label' => __( 'Cross-Sells', 'woo_ce' )
932
+ );
933
+ $fields[] = array(
934
+ 'name' => 'external_url',
935
+ 'label' => __( 'External URL', 'woo_ce' )
936
+ );
937
+ $fields[] = array(
938
+ 'name' => 'button_text',
939
+ 'label' => __( 'Button Text', 'woo_ce' )
940
+ );
941
+ $fields[] = array(
942
+ 'name' => 'purchase_note',
943
+ 'label' => __( 'Purchase Note', 'woo_ce' )
944
+ );
945
+ $fields[] = array(
946
+ 'name' => 'product_status',
947
+ 'label' => __( 'Product Status', 'woo_ce' )
948
+ );
949
+ $fields[] = array(
950
+ 'name' => 'enable_reviews',
951
+ 'label' => __( 'Enable Reviews', 'woo_ce' )
952
+ );
953
+ $fields[] = array(
954
+ 'name' => 'menu_order',
955
+ 'label' => __( 'Sort Order', 'woo_ce' )
956
+ );
957
+
958
+ /*
959
+ $fields[] = array(
960
+ 'name' => '',
961
+ 'label' => __( '', 'woo_ce' )
962
+ );
963
+ */
964
+
965
+ // Allow Plugin/Theme authors to add support for additional columns
966
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
967
+
968
+ if( $remember = woo_ce_get_option( $export_type . '_fields', array() ) ) {
969
+ $remember = maybe_unserialize( $remember );
970
+ $size = count( $fields );
971
+ for( $i = 0; $i < $size; $i++ ) {
972
+ $fields[$i]['disabled'] = ( isset( $fields[$i]['disabled'] ) ? $fields[$i]['disabled'] : 0 );
973
+ $fields[$i]['default'] = 1;
974
+ if( !array_key_exists( $fields[$i]['name'], $remember ) )
975
+ $fields[$i]['default'] = 0;
976
+ }
977
+ }
978
+
979
+ switch( $format ) {
980
+
981
+ case 'summary':
982
+ $output = array();
983
+ $size = count( $fields );
984
+ for( $i = 0; $i < $size; $i++ ) {
985
+ if( isset( $fields[$i] ) )
986
+ $output[$fields[$i]['name']] = 'on';
987
+ }
988
+ return $output;
989
+ break;
990
+
991
+ case 'full':
992
+ default:
993
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
994
+ $size = count( $fields );
995
+ for( $i = 0; $i < $size; $i++ )
996
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
997
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
998
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
999
+ return $fields;
1000
+ break;
1001
+
1002
+ }
1003
+
1004
+ }
1005
+
1006
+ function woo_ce_override_product_field_labels( $fields = array() ) {
1007
+
1008
+ $labels = woo_ce_get_option( 'product_labels', array() );
1009
+ if( !empty( $labels ) ) {
1010
+ foreach( $fields as $key => $field ) {
1011
+ if( isset( $labels[$field['name']] ) )
1012
+ $fields[$key]['label'] = $labels[$field['name']];
1013
+ }
1014
+ }
1015
+ return $fields;
1016
+
1017
+ }
1018
+ add_filter( 'woo_ce_product_fields', 'woo_ce_override_product_field_labels', 11 );
1019
+
1020
+ function woo_ce_extend_product_fields( $fields ) {
1021
+
1022
+ // Attributes
1023
+ if( $attributes = woo_ce_get_product_attributes() ) {
1024
+ foreach( $attributes as $attribute ) {
1025
+ if( empty( $attribute->attribute_label ) )
1026
+ $attribute->attribute_label = $attribute->attribute_name;
1027
+ $fields[] = array(
1028
+ 'name' => sprintf( 'attribute_%s', $attribute->attribute_name ),
1029
+ 'label' => sprintf( __( 'Attribute: %s', 'woo_ce' ), ucwords( $attribute->attribute_label ) )
1030
+ );
1031
+ }
1032
+ }
1033
+
1034
+ // Advanced Google Product Feed - http://www.leewillis.co.uk/wordpress-plugins/
1035
+ if( function_exists( 'woocommerce_gpf_install' ) ) {
1036
+ $fields[] = array(
1037
+ 'name' => 'gpf_availability',
1038
+ 'label' => __( 'Advanced Google Product Feed - Availability', 'woo_ce' )
1039
+ );
1040
+ $fields[] = array(
1041
+ 'name' => 'gpf_condition',
1042
+ 'label' => __( 'Advanced Google Product Feed - Condition', 'woo_ce' )
1043
+ );
1044
+ $fields[] = array(
1045
+ 'name' => 'gpf_brand',
1046
+ 'label' => __( 'Advanced Google Product Feed - Brand', 'woo_ce' )
1047
+ );
1048
+ $fields[] = array(
1049
+ 'name' => 'gpf_productype',
1050
+ 'label' => __( 'Advanced Google Product Feed - Product Type', 'woo_ce' )
1051
+ );
1052
+ $fields[] = array(
1053
+ 'name' => 'gpf_google_product_category',
1054
+ 'label' => __( 'Advanced Google Product Feed - Google Product Category', 'woo_ce' )
1055
+ );
1056
+ $fields[] = array(
1057
+ 'name' => 'gpf_gtin',
1058
+ 'label' => __( 'Advanced Google Product Feed - Global Trade Item Number (GTIN)', 'woo_ce' )
1059
+ );
1060
+ $fields[] = array(
1061
+ 'name' => 'gpf_mpn',
1062
+ 'label' => __( 'Advanced Google Product Feed - Manufacturer Part Number (MPN)', 'woo_ce' )
1063
+ );
1064
+ $fields[] = array(
1065
+ 'name' => 'gpf_gender',
1066
+ 'label' => __( 'Advanced Google Product Feed - Gender', 'woo_ce' )
1067
+ );
1068
+ $fields[] = array(
1069
+ 'name' => 'gpf_agegroup',
1070
+ 'label' => __( 'Advanced Google Product Feed - Age Group', 'woo_ce' )
1071
+ );
1072
+ $fields[] = array(
1073
+ 'name' => 'gpf_colour',
1074
+ 'label' => __( 'Advanced Google Product Feed - Colour', 'woo_ce' )
1075
+ );
1076
+ $fields[] = array(
1077
+ 'name' => 'gpf_size',
1078
+ 'label' => __( 'Advanced Google Product Feed - Size', 'woo_ce' )
1079
+ );
1080
+ }
1081
+
1082
+ // All in One SEO Pack - http://wordpress.org/extend/plugins/all-in-one-seo-pack/
1083
+ if( function_exists( 'aioseop_activate' ) ) {
1084
+ $fields[] = array(
1085
+ 'name' => 'aioseop_keywords',
1086
+ 'label' => __( 'All in One SEO - Keywords', 'woo_ce' )
1087
+ );
1088
+ $fields[] = array(
1089
+ 'name' => 'aioseop_description',
1090
+ 'label' => __( 'All in One SEO - Description', 'woo_ce' )
1091
+ );
1092
+ $fields[] = array(
1093
+ 'name' => 'aioseop_title',
1094
+ 'label' => __( 'All in One SEO - Title', 'woo_ce' )
1095
+ );
1096
+ $fields[] = array(
1097
+ 'name' => 'aioseop_title_attributes',
1098
+ 'label' => __( 'All in One SEO - Title Attributes', 'woo_ce' )
1099
+ );
1100
+ $fields[] = array(
1101
+ 'name' => 'aioseop_menu_label',
1102
+ 'label' => __( 'All in One SEO - Menu Label', 'woo_ce' )
1103
+ );
1104
+ }
1105
+
1106
+ // WordPress SEO - http://wordpress.org/plugins/wordpress-seo/
1107
+ if( function_exists( 'wpseo_admin_init' ) ) {
1108
+ $fields[] = array(
1109
+ 'name' => 'wpseo_focuskw',
1110
+ 'label' => __( 'WordPress SEO - Focus Keyword', 'woo_ce' )
1111
+ );
1112
+ $fields[] = array(
1113
+ 'name' => 'wpseo_metadesc',
1114
+ 'label' => __( 'WordPress SEO - Meta Description', 'woo_ce' )
1115
+ );
1116
+ $fields[] = array(
1117
+ 'name' => 'wpseo_title',
1118
+ 'label' => __( 'WordPress SEO - SEO Title', 'woo_ce' )
1119
+ );
1120
+ $fields[] = array(
1121
+ 'name' => 'wpseo_googleplus_description',
1122
+ 'label' => __( 'WordPress SEO - Google+ Description', 'woo_ce' )
1123
+ );
1124
+ $fields[] = array(
1125
+ 'name' => 'wpseo_opengraph_description',
1126
+ 'label' => __( 'WordPress SEO - Facebook Description', 'woo_ce' )
1127
+ );
1128
+ }
1129
+
1130
+ // Ultimate SEO - http://wordpress.org/plugins/seo-ultimate/
1131
+ if( function_exists( 'su_wp_incompat_notice' ) ) {
1132
+ $fields[] = array(
1133
+ 'name' => 'useo_meta_title',
1134
+ 'label' => __( 'Ultimate SEO - Title Tag', 'woo_ce' )
1135
+ );
1136
+ $fields[] = array(
1137
+ 'name' => 'useo_meta_description',
1138
+ 'label' => __( 'Ultimate SEO - Meta Description', 'woo_ce' )
1139
+ );
1140
+ $fields[] = array(
1141
+ 'name' => 'useo_meta_keywords',
1142
+ 'label' => __( 'Ultimate SEO - Meta Keywords', 'woo_ce' )
1143
+ );
1144
+ $fields[] = array(
1145
+ 'name' => 'useo_social_title',
1146
+ 'label' => __( 'Ultimate SEO - Social Title', 'woo_ce' )
1147
+ );
1148
+ $fields[] = array(
1149
+ 'name' => 'useo_social_description',
1150
+ 'label' => __( 'Ultimate SEO - Social Description', 'woo_ce' )
1151
+ );
1152
+ $fields[] = array(
1153
+ 'name' => 'useo_meta_noindex',
1154
+ 'label' => __( 'Ultimate SEO - NoIndex', 'woo_ce' )
1155
+ );
1156
+ $fields[] = array(
1157
+ 'name' => 'useo_meta_noautolinks',
1158
+ 'label' => __( 'Ultimate SEO - Disable Autolinks', 'woo_ce' )
1159
+ );
1160
+ }
1161
+
1162
+ // WooCommerce MSRP Pricing - http://woothemes.com/woocommerce/
1163
+ if( function_exists( 'woocommerce_msrp_activate' ) ) {
1164
+ $fields[] = array(
1165
+ 'name' => 'msrp',
1166
+ 'label' => __( 'Manufacturer Suggested Retail Price (MSRP)', 'woo_ce' ),
1167
+ 'disabled' => 1
1168
+ );
1169
+ }
1170
+
1171
+ // WooCommerce Brands Addon - http://woothemes.com/woocommerce/
1172
+ if( class_exists( 'WC_Brands' ) ) {
1173
+ $fields[] = array(
1174
+ 'name' => 'brands',
1175
+ 'label' => __( 'Brands', 'woo_ce' ),
1176
+ 'disabled' => 1
1177
+ );
1178
+ }
1179
+
1180
+ // Cost of Goods - http://www.skyverge.com/product/woocommerce-cost-of-goods-tracking/
1181
+ if( class_exists( 'WC_COG' ) ) {
1182
+ $fields[] = array(
1183
+ 'name' => 'cost_of_goods',
1184
+ 'label' => __( 'Cost of Goods', 'woo_ce' ),
1185
+ 'disabled' => 1
1186
+ );
1187
+ }
1188
+
1189
+ // Per-Product Shipping - http://www.woothemes.com/products/per-product-shipping/
1190
+ if( function_exists( 'woocommerce_per_product_shipping_init' ) ) {
1191
+ $fields[] = array(
1192
+ 'name' => 'per_product_shipping',
1193
+ 'label' => __( 'Per-Product Shipping', 'woo_ce' ),
1194
+ 'disabled' => 1
1195
+ );
1196
+ }
1197
+
1198
+ // Product Vendors - http://www.woothemes.com/products/product-vendors/
1199
+ if( class_exists( 'WooCommerce_Product_Vendors' ) ) {
1200
+ $fields[] = array(
1201
+ 'name' => 'vendors',
1202
+ 'label' => __( 'Product Vendors', 'woo_ce' ),
1203
+ 'disabled' => 1
1204
+ );
1205
+ $fields[] = array(
1206
+ 'name' => 'vendor_ids',
1207
+ 'label' => __( 'Product Vendor ID\'s', 'woo_ce' ),
1208
+ 'disabled' => 1
1209
+ );
1210
+ $fields[] = array(
1211
+ 'name' => 'vendor_commission',
1212
+ 'label' => __( 'Vendor Commission', 'woo_ce' ),
1213
+ 'disabled' => 1
1214
+ );
1215
+ }
1216
+
1217
+ // Advanced Custom Fields - http://www.advancedcustomfields.com
1218
+ if( class_exists( 'acf' ) ) {
1219
+ if( $custom_fields = woo_ce_get_acf_product_fields() ) {
1220
+ foreach( $custom_fields as $custom_field ) {
1221
+ $fields[] = array(
1222
+ 'name' => $custom_field['name'],
1223
+ 'label' => $custom_field['label'],
1224
+ 'disabled' => 1
1225
+ );
1226
+ }
1227
+ unset( $custom_fields, $custom_field );
1228
+ }
1229
+ }
1230
+
1231
+ // Custom Product meta
1232
+ $custom_products = woo_ce_get_option( 'custom_products', '' );
1233
+ if( !empty( $custom_products ) ) {
1234
+ foreach( $custom_products as $custom_product ) {
1235
+ if( !empty( $custom_product ) ) {
1236
+ $fields[] = array(
1237
+ 'name' => $custom_product,
1238
+ 'label' => $custom_product
1239
+ );
1240
+ }
1241
+ }
1242
+ unset( $custom_products, $custom_product );
1243
+ }
1244
+
1245
+ return $fields;
1246
+
1247
+ }
1248
+ add_filter( 'woo_ce_product_fields', 'woo_ce_extend_product_fields' );
1249
+
1250
+ // Returns the export column header label based on an export column slug
1251
+ function woo_ce_get_product_field( $name = null, $format = 'name' ) {
1252
+
1253
+ $output = '';
1254
+ if( $name ) {
1255
+ $fields = woo_ce_get_product_fields();
1256
+ $size = count( $fields );
1257
+ for( $i = 0; $i < $size; $i++ ) {
1258
+ if( $fields[$i]['name'] == $name ) {
1259
+ switch( $format ) {
1260
+
1261
+ case 'name':
1262
+ $output = $fields[$i]['label'];
1263
+ break;
1264
+
1265
+ case 'full':
1266
+ $output = $fields[$i];
1267
+ break;
1268
+
1269
+ }
1270
+ $i = $size;
1271
+ }
1272
+ }
1273
+ }
1274
+ return $output;
1275
+
1276
+ }
1277
+
1278
+ // Returns a list of WooCommerce Product Types to export process
1279
+ function woo_ce_get_product_types() {
1280
+
1281
+ $term_taxonomy = 'product_type';
1282
+ $args = array(
1283
+ 'hide_empty' => 0
1284
+ );
1285
+ $types = get_terms( $term_taxonomy, $args );
1286
+ if( !empty( $types ) && is_wp_error( $types ) == false ) {
1287
+ $size = count( $types );
1288
+ for( $i = 0; $i < $size; $i++ ) {
1289
+ $output[$types[$i]->slug] = array(
1290
+ 'name' => $types[$i]->name,
1291
+ 'count' => $types[$i]->count
1292
+ );
1293
+ }
1294
+ $output['variation'] = array(
1295
+ 'name' => __( 'variation', 'woo_ce' ),
1296
+ 'count' => woo_ce_get_product_type_variation_count()
1297
+ );
1298
+ asort( $output );
1299
+ return $output;
1300
+ }
1301
+
1302
+ }
1303
+
1304
+ function woo_ce_get_product_type_variation_count() {
1305
+
1306
+ $post_type = 'product_variation';
1307
+ $args = array(
1308
+ 'post_type' => $post_type,
1309
+ 'posts_per_page' => 1
1310
+ );
1311
+ $query = new WP_Query( $args );
1312
+ $size = $query->found_posts;
1313
+ return $size;
1314
+
1315
+ }
1316
+
1317
+ // Returns a list of WooCommerce Product Attributes to export process
1318
+ function woo_ce_get_product_attributes() {
1319
+
1320
+ global $wpdb;
1321
+
1322
+ $output = array();
1323
+ $attributes_sql = "SELECT * FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies";
1324
+ $attributes = $wpdb->get_results( $attributes_sql );
1325
+ $wpdb->flush();
1326
+ if( !empty( $attributes ) )
1327
+ $output = $attributes;
1328
+ unset( $attributes );
1329
+ return $output;
1330
+
1331
+ }
1332
+
1333
+ function woo_ce_get_acf_product_fields() {
1334
+
1335
+ global $wpdb;
1336
+
1337
+ $post_type = 'acf';
1338
+ $args = array(
1339
+ 'post_type' => $post_type,
1340
+ 'numberposts' => -1
1341
+ );
1342
+ if( $field_groups = get_posts( $args ) ) {
1343
+ $fields = array();
1344
+ $post_types = array( 'product', 'product_variation' );
1345
+ foreach( $field_groups as $field_group ) {
1346
+ $has_fields = false;
1347
+ if( $rules = get_post_meta( $field_group->ID, 'rule' ) ) {
1348
+ $size = count( $rules );
1349
+ for( $i = 0; $i < $size; $i++ ) {
1350
+ if( ( $rules[$i]['param'] == 'post_type' ) && ( $rules[$i]['operator'] == '==' ) && ( in_array( $rules[$i]['value'], $post_types ) ) ) {
1351
+ $has_fields = true;
1352
+ $i = $size;
1353
+ }
1354
+ }
1355
+ }
1356
+ unset( $rules );
1357
+ if( $has_fields ) {
1358
+ $custom_fields_sql = "SELECT `meta_value` FROM `" . $wpdb->postmeta . "` WHERE `post_id` = " . (int)$field_group->ID . " AND `meta_key` LIKE 'field_%'";
1359
+ if( $custom_fields = $wpdb->get_col( $custom_fields_sql ) ) {
1360
+ foreach( $custom_fields as $custom_field ) {
1361
+ $custom_field = maybe_unserialize( $custom_field );
1362
+ $fields[] = array(
1363
+ 'name' => $custom_field['name'],
1364
+ 'label' => $custom_field['label']
1365
+ );
1366
+ }
1367
+ }
1368
+ unset( $custom_fields, $custom_field );
1369
+ }
1370
+ }
1371
+ return $fields;
1372
+ }
1373
+
1374
+ }
1375
+
1376
+ function woo_ce_extend_product_item( $product, $product_id ) {
1377
+
1378
+ $custom_products = woo_ce_get_option( 'custom_products', '' );
1379
+ if( !empty( $custom_products ) ) {
1380
+ foreach( $custom_products as $custom_product ) {
1381
+ // Check that the custom Product name is filled and it hasn't previously been set
1382
+ if( !empty( $custom_product ) && !isset( $product->{$custom_product} ) )
1383
+ $product->{$custom_product} = get_post_meta( $product->ID, $custom_product, true );
1384
+ }
1385
+ }
1386
+
1387
+ return $product;
1388
+
1389
+ }
1390
+ add_filter( 'woo_ce_product_item', 'woo_ce_extend_product_item', 10, 2 );
1391
+ ?>
includes/settings.php ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function woo_ce_export_settings_quicklinks() {
3
+
4
+ ob_start(); ?>
5
+ <li>| <a href="#xml-settings"><?php _e( 'XML Settings', 'woo_ce' ); ?></a> |</li>
6
+ <li><a href="#scheduled-exports"><?php _e( 'Scheduled Exports', 'woo_ce' ); ?></a> |</li>
7
+ <li><a href="#cron-exports"><?php _e( 'CRON Exports', 'woo_ce' ); ?></a></li>
8
+ <?php
9
+ ob_end_flush();
10
+
11
+ }
12
+
13
+ function woo_ce_export_settings_additional() {
14
+
15
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
16
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
17
+
18
+ $email_to = get_option( 'admin_email', '' );
19
+ $email_subject = __( '[%store_name%] Export: %export_type% (%export_filename%)', 'woo_ce' );
20
+ $post_to = 'http://www.domain.com/sample-form/';
21
+ ob_start(); ?>
22
+ <tr>
23
+ <th>
24
+ <label for="email_to"><?php _e( 'Default e-mail recipient', 'woo_ce' ); ?></label>
25
+ </th>
26
+ <td>
27
+ <input name="email_to" type="text" id="email_to" value="<?php echo esc_attr( $email_to ); ?>" class="regular-text code" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
28
+ <p class="description"><?php _e( 'Set the default recipient of scheduled export e-mails, can be overriden via CRON using the <code>to</code> argument. Default is the WordPress Blog administrator e-mail address.', 'woo_ce' ); ?></p>
29
+ </td>
30
+ </tr>
31
+ <tr>
32
+ <th>
33
+ <label for="email_to"><?php _e( 'Default e-mail subject', 'woo_ce' ); ?></label>
34
+ </th>
35
+ <td>
36
+ <input name="email_to" type="text" id="email_subject" value="<?php echo esc_attr( $email_subject ); ?>" class="large-text code" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
37
+ <p class="description"><?php _e( 'Set the default subject of scheduled export e-mails, can be overriden via CRON using the <code>subject</code> argument. Tags can be used: <code>%store_name%</code>, <code>%export_type%</code>, <code>%export_filename%</code>.', 'woo_ce' ); ?></p>
38
+ </td>
39
+ </tr>
40
+ <tr>
41
+ <th>
42
+ <label for="post_to"><?php _e( 'Default remote POST URL', 'woo_ce' ); ?></label>
43
+ </th>
44
+ <td>
45
+ <input name="post_to" type="text" id="post_to" value="<?php echo esc_url( $post_to ); ?>" class="full-text code" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
46
+ <p class="description"><?php _e( 'Set the default remote POST address for scheduled exports, can be overriden via CRON using the <code>to</code> argument. Default is empty.', 'woo_ce' ); ?></p>
47
+ </td>
48
+ </tr>
49
+ <?php
50
+ ob_end_flush();
51
+
52
+ }
53
+
54
+ // Returns the disabled HTML template for the Enable CRON and Secret Export Key options for the Settings screen
55
+ function woo_ce_export_settings_cron() {
56
+
57
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
58
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
59
+
60
+ // Scheduled exports
61
+ // Override to enable the Export Type to include all export types
62
+ $export_types = array(
63
+ 'product' => __( 'Products', 'woo_ce' ),
64
+ 'category' => __( 'Categories', 'woo_ce' ),
65
+ 'tag' => __( 'Tags', 'woo_ce' ),
66
+ 'brand' => __( 'Brands', 'woo_ce' ),
67
+ 'order' => __( 'Orders', 'woo_ce' ),
68
+ 'customer' => __( 'Customers', 'woo_ce' ),
69
+ 'user' => __( 'Users', 'woo_ce' ),
70
+ 'coupon' => __( 'Coupons', 'woo_ce' ),
71
+ 'subscription' => __( 'Subscriptions', 'woo_ce' ),
72
+ 'product_vendor' => __( 'Product Vendors', 'woo_ce' ),
73
+ 'shipping_class' => __( 'Shipping Classes', 'woo_ce' )
74
+ );
75
+ $order_statuses = woo_ce_get_order_statuses();
76
+ $product_types = woo_ce_get_product_types();
77
+ $auto_interval = 1440;
78
+ $auto_format = 'csv';
79
+ $ftp_method_host = 'ftp.domain.com';
80
+ $ftp_method_user = 'export';
81
+ $ftp_method_pass = '';
82
+ $ftp_method_port = '';
83
+ $ftp_method_path = 'wp-content/uploads/export/';
84
+ $ftp_method_passive = 'auto';
85
+ $ftp_method_timeout = '';
86
+ $scheduled_fields = 'all';
87
+
88
+ // CRON exports
89
+ $secret_key = '-';
90
+ $cron_fields = 'all';
91
+
92
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
93
+ ob_start(); ?>
94
+ <tr id="xml-settings">
95
+ <td colspan="2" style="padding:0;">
96
+ <hr />
97
+ <h3><?php _e( 'XML Settings', 'woo_ce' ); ?></h3>
98
+ </td>
99
+ </tr>
100
+ <tr>
101
+ <th>
102
+ <label><?php _e( 'Attribute display', 'woo_ce' ); ?></label>
103
+ </th>
104
+ <td>
105
+ <ul>
106
+ <li><label><input type="checkbox" name="xml_attribute_url" value="1" disabled="disabled" /> <?php _e( 'Site Address', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
107
+ <li><label><input type="checkbox" name="xml_attribute_title" value="1" disabled="disabled" /> <?php _e( 'Site Title', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
108
+ <li><label><input type="checkbox" name="xml_attribute_date" value="1" disabled="disabled" /> <?php _e( 'Export Date', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
109
+ <li><label><input type="checkbox" name="xml_attribute_time" value="1" disabled="disabled" /> <?php _e( 'Export Time', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
110
+ <li><label><input type="checkbox" name="xml_attribute_export" value="1" disabled="disabled" /> <?php _e( 'Export Type', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
111
+ <li><label><input type="checkbox" name="xml_attribute_orderby" value="1" disabled="disabled" /> <?php _e( 'Export Order By', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
112
+ <li><label><input type="checkbox" name="xml_attribute_order" value="1" disabled="disabled" /> <?php _e( 'Export Order', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
113
+ <li><label><input type="checkbox" name="xml_attribute_limit" value="1" disabled="disabled" /> <?php _e( 'Limit Volume', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
114
+ <li><label><input type="checkbox" name="xml_attribute_offset" value="1" disabled="disabled" /> <?php _e( 'Volume Offset', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
115
+ </ul>
116
+ <p class="description"><?php _e( 'Control the visibility of different attributes in the XML export.', 'woo_ce' ); ?></p>
117
+ </td>
118
+ </tr>
119
+
120
+ <tr id="scheduled-exports">
121
+ <td colspan="2" style="padding:0;">
122
+ <hr />
123
+ <h3><div class="dashicons dashicons-calendar"></div>&nbsp;<?php _e( 'Scheduled Exports', 'woo_ce' ); ?></h3>
124
+ <p class="description"><?php _e( 'Configure Store Exporter Deluxe to automatically generate exports.', 'woo_ce' ); ?></p>
125
+ </td>
126
+ </tr>
127
+ <tr>
128
+ <th>
129
+ <label for="enable_auto"><?php _e( 'Enable scheduled exports', 'woo_ce' ); ?></label>
130
+ </th>
131
+ <td>
132
+ <select id="enable_auto" name="enable_auto">
133
+ <option value="1" disabled="disabled"><?php _e( 'Yes', 'woo_ce' ); ?></option>
134
+ <option value="0" selected="selected"><?php _e( 'No', 'woo_ce' ); ?></option>
135
+ </select>
136
+ <p class="description"><?php _e( 'Enabling Scheduled Exports will trigger automated exports at the interval specified under Once every (minutes).', 'woo_ce' ); ?></p>
137
+ </td>
138
+ </tr>
139
+ <tr>
140
+ <th>
141
+ <label for="auto_type"><?php _e( 'Export type', 'woo_ce' ); ?></label>
142
+ </th>
143
+ <td>
144
+ <select id="auto_type" name="auto_type">
145
+ <?php if( $export_types ) { ?>
146
+ <?php foreach( $export_types as $key => $export_type ) { ?>
147
+ <option value="<?php echo $key; ?>"><?php echo $export_type; ?></option>
148
+ <?php } ?>
149
+ <?php } else { ?>
150
+ <option value=""><?php _e( 'No export types were found.', 'woo_ce' ); ?></option>
151
+ <?php } ?>
152
+ </select>
153
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
154
+ <p class="description"><?php _e( 'Select the data type you want to export.', 'woo_ce' ); ?></p>
155
+ </td>
156
+ </tr>
157
+ <tr class="auto_type_options">
158
+ <th>
159
+ <label><?php _e( 'Export filters', 'woo_ce' ); ?></label>
160
+ </th>
161
+ <td>
162
+ <ul>
163
+ <li class="export-options product-options">
164
+ <label><?php _e( 'Product Type', 'woo_ce' ); ?></label>
165
+ <?php if( $product_types ) { ?>
166
+ <ul style="margin-top:0.2em;">
167
+ <?php foreach( $product_types as $key => $product_type ) { ?>
168
+ <li><label><input type="checkbox" name="product_filter_type[<?php echo $key; ?>]" value="<?php echo $key; ?>" disabled="disabled" /> <?php echo woo_ce_format_product_type( $product_type['name'] ); ?> (<?php echo $product_type['count']; ?>)<span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
169
+ <?php } ?>
170
+ </ul>
171
+ <?php } ?>
172
+ <p class="description"><?php _e( 'Select the Product Type\'s you want to filter exported Products by. Default is to include all Product Types and Variations.', 'woo_ce' ); ?></p>
173
+ </li>
174
+ <li class="export-options category-options tag-options brand-options customer-options user-options coupon-options subscription-options product_vendor-options">
175
+ <p><?php _e( 'No export filter options are available for this export type.', 'woo_ce' ); ?></p>
176
+ </li>
177
+ <li class="export-options order-options">
178
+ <label><?php _e( 'Order Status', 'woo_ce' ); ?></label>
179
+ <select name="order_filter_status">
180
+ <option value="" selected="selected"><?php _e( 'All', 'woo_ce' ); ?></option>
181
+ <?php if( $order_statuses ) { ?>
182
+ <?php foreach( $order_statuses as $order_status ) { ?>
183
+ <option value="<?php echo $order_status->name; ?>" disabled="disabled"><?php echo ucfirst( $order_status->name ); ?></option>
184
+ <?php } ?>
185
+ <?php } ?>
186
+ </select>
187
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
188
+ <p class="description"><?php _e( 'Select the Order Status you want to filter exported Orders by. Default is to include all Order Status options.', 'woo_ce' ); ?></p>
189
+ </li>
190
+ <li class="export-options order-options">
191
+ <label><?php _e( 'Order Date', 'woo_ce' ); ?></label>
192
+ <input type="text" size="10" maxlength="10" class="text" disabled="disabled"> to <input type="text" size="10" maxlength="10" class="text" disabled="disabled"><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
193
+ <p class="description"><?php _e( 'Filter the dates of Orders to be included in the export. Default is empty.', 'woo_ce' ); ?></p>
194
+ </li>
195
+ </ul>
196
+ </td>
197
+ </tr>
198
+ <tr>
199
+ <th>
200
+ <label for="auto_interval"><?php _e( 'Once every (minutes)', 'woo_ce' ); ?></label>
201
+ </th>
202
+ <td>
203
+ <input name="auto_interval" type="text" id="auto_interval" value="<?php echo esc_attr( $auto_interval ); ?>" size="4" maxlength="4" class="text" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
204
+ <p class="description"><?php _e( 'Choose how often Store Exporter Deluxe generates new exports. Default is every 1440 minutes (once every 24 hours).', 'woo_ce' ); ?></p>
205
+ </td>
206
+ </tr>
207
+ <tr>
208
+ <th>
209
+ <label><?php _e( 'Export format', 'woo_ce' ); ?></label>
210
+ </th>
211
+ <td>
212
+ <ul style="margin-top:0.2em;">
213
+ <li><label><input type="radio" name="auto_format" value="csv"<?php checked( $auto_format, 'csv' ); ?> disabled="disabled" /> <?php _e( 'CSV', 'woo_ce' ); ?> <span class="description"><?php _e( '(Comma separated values)', 'woo_ce' ); ?></span><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
214
+ <li><label><input type="radio" name="auto_format" value="xml"<?php checked( $auto_format, 'xml' ); ?> disabled="disabled" /> <?php _e( 'XML', 'woo_ce' ); ?> <span class="description"><?php _e( '(EXtensible Markup Language)', 'woo_ce' ); ?></span><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
215
+ <li><label><input type="radio" name="auto_format" value="xls"<?php checked( $auto_format, 'xls' ); ?> disabled="disabled" /> <?php _e( 'Excel (XLS)', 'woo_ce' ); ?> <span class="description"><?php _e( '(Microsoft Excel 2007)', 'woo_ce' ); ?></span><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
216
+ </ul>
217
+ <p class="description"><?php _e( 'Adjust the export format to generate different export file formats. Default is CSV.', 'woo_ce' ); ?></p>
218
+ </td>
219
+ </tr>
220
+ <tr>
221
+ <th>
222
+ <label for="auto_method"><?php _e( 'Export method', 'woo_ce' ); ?></label>
223
+ </th>
224
+ <td>
225
+ <select id="auto_method" name="auto_method">
226
+ <option value="archive"><?php _e( 'Archive to WordPress Media', 'woo_ce' ); ?></option>
227
+ <option value="email"><?php _e( 'Send as e-mail', 'woo_ce' ); ?></option>
228
+ <option value="post"><?php _e( 'POST to remote URL', 'woo_ce' ); ?></option>
229
+ <option value="ftp"><?php _e( 'Upload to remote FTP', 'woo_ce' ); ?></option>
230
+ </select>
231
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
232
+ <p class="description"><?php _e( 'Choose what Store Exporter Deluxe does with the generated export. Default is to archive the export to the WordPress Media for archival purposes.', 'woo_ce' ); ?></p>
233
+ </td>
234
+ </tr>
235
+ <tr class="auto_method_options">
236
+ <th>
237
+ <label><?php _e( 'Export method options', 'woo_ce' ); ?></label>
238
+ </th>
239
+ <td>
240
+ <ul>
241
+ <li class="export-options ftp-options">
242
+ <label for="ftp_method_host"><?php _e( 'Host', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_host" name="ftp_method_host" size="15" class="regular-text code" value="<?php echo sanitize_text_field( $ftp_method_host ); ?>" disabled="disabled" /><br />
243
+ <label for="ftp_method_user"><?php _e( 'Username', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_user" name="ftp_method_user" size="15" class="regular-text code" value="<?php echo sanitize_text_field( $ftp_method_user ); ?>" disabled="disabled" /><br />
244
+ <label for="ftp_method_pass"><?php _e( 'Password', 'woo_ce' ); ?>:</label> <input type="password" id="ftp_method_pass" name="ftp_method_pass" size="15" class="regular-text code" value="" disabled="disabled" /><?php if( !empty( $ftp_method_pass ) ) { echo ' ' . __( '(password is saved)', 'woo_ce' ); } ?><br />
245
+ <label for="ftp_method_port"><?php _e( 'Port', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_port" name="ftp_method_port" size="5" class="short-text code" value="<?php echo sanitize_text_field( $ftp_method_port ); ?>" maxlength="5" disabled="disabled" /><br />
246
+ <label for="ftp_method_file_path"><?php _e( 'File path', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_file_path" name="ftp_method_path" size="25" class="regular-text code" value="<?php echo sanitize_text_field( $ftp_method_path ); ?>" disabled="disabled" /><br />
247
+ <label for="ftp_method_passive"><?php _e( 'Transfer mode', 'woo_ce' ); ?>:</label>
248
+ <select id="ftp_method_passive" name="ftp_method_passive">
249
+ <option value="auto" selected="selected"><?php _e( 'Auto', 'woo_ce' ); ?></option>
250
+ <option value="active" disabled="disabled"><?php _e( 'Active', 'woo_ce' ); ?></option>
251
+ <option value="passive" disabled="disabled"><?php _e( 'Passive', 'woo_ce' ); ?></option>
252
+ </select><br />
253
+ <label for="ftp_method_timeout"><?php _e( 'Timeout', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_timeout" name="ftp_method_timeout" size="5" class="short-text code" value="<?php echo sanitize_text_field( $ftp_method_timeout ); ?>" /><br />
254
+ <p class="description"><?php _e( 'Enter the FTP host, login details and path of where to save the export file, do not provide the filename, the export filename can be set on General Settings above. For file path example: <code>wp-content/uploads/exports/</code>', 'woo_ce' ); ?></p>
255
+ </li>
256
+ <li class="export-options archive-options email-options post-options">
257
+ <p><?php _e( 'No export method options are available for this export method.', 'woo_ce' ); ?></p>
258
+ </li>
259
+ </ul>
260
+ </td>
261
+ </tr>
262
+ <tr>
263
+ <th>
264
+ <label for="scheduled_fields"><?php _e( 'Export Fields', 'woo_ce' ); ?></label>
265
+ </th>
266
+ <td>
267
+ <ul style="margin-top:0.2em;">
268
+ <li><label><input type="radio" id="scheduled_fields" name="scheduled_fields" value="all"<?php checked( $scheduled_fields, 'all' ); ?> /> <?php _e( 'Include all Export Fields for the requested Export Type', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
269
+ <li><label><input type="radio" name="scheduled_fields" value="saved"<?php checked( $scheduled_fields, 'saved' ); ?> disabled="disabled" /> <?php _e( 'Use the saved Export Fields preference set on the Export screen for the requested Export Type', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
270
+ </ul>
271
+ <p class="description"><?php _e( 'Control whether all known export fields are included or only checked fields from the Export Fields section on the Export screen for each Export Type. Default is to include all export fields.', 'woo_ce' ); ?></p>
272
+ </td>
273
+ </tr>
274
+
275
+ <tr id="cron-exports">
276
+ <td colspan="2" style="padding:0;">
277
+ <hr />
278
+ <h3><div class="dashicons dashicons-clock"></div>&nbsp;<?php _e( 'CRON Exports', 'woo_ce' ); ?></h3>
279
+ <p class="description"><?php printf( __( 'Store Exporter Deluxe supports exporting via a command line request. For sample CRON requests and supported arguments consult our <a href="%s" target="_blank">online documentation</a>.', 'woo_ce' ), $troubleshooting_url ); ?></p>
280
+ </td>
281
+ </tr>
282
+ <tr>
283
+ <th>
284
+ <label for="enable_cron"><?php _e( 'Enable CRON', 'woo_ce' ); ?></label>
285
+ </th>
286
+ <td>
287
+ <select id="enable_cron" name="enable_cron">
288
+ <option value="1" disabled="disabled"><?php _e( 'Yes', 'woo_ce' ); ?></option>
289
+ <option value="0" selected="selected"><?php _e( 'No', 'woo_ce' ); ?></option>
290
+ </select>
291
+ <p class="description"><?php _e( 'Enabling CRON allows developers to schedule automated exports and connect with Store Exporter Deluxe remotely.', 'woo_ce' ); ?></p>
292
+ </td>
293
+ </tr>
294
+ <tr>
295
+ <th>
296
+ <label for="secret_key"><?php _e( 'Export secret key', 'woo_ce' ); ?></label>
297
+ </th>
298
+ <td>
299
+ <input name="secret_key" type="text" id="secret_key" value="<?php echo esc_attr( $secret_key ); ?>" class="large-text code" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
300
+ <p class="description"><?php _e( 'This secret key (can be left empty to allow unrestricted access) limits access to authorised developers who provide a matching key when working with Store Exporter Deluxe.', 'woo_ce' ); ?></p>
301
+ </td>
302
+ </tr>
303
+ <tr>
304
+ <th>
305
+ <label for="cron_fields"><?php _e( 'Export Fields', 'woo_ce' ); ?></label>
306
+ </th>
307
+ <td>
308
+ <ul style="margin-top:0.2em;">
309
+ <li><label><input type="radio" id="cron_fields" name="cron_fields" value="all"<?php checked( $cron_fields, 'all' ); ?> /> <?php _e( 'Include all Export Fields for the requested Export Type', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
310
+ <li><label><input type="radio" name="cron_fields" value="saved"<?php checked( $cron_fields, 'saved' ); ?> disabled="disabled" /> <?php _e( 'Use the saved Export Fields preference set on the Export screen for the requested Export Type', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
311
+ </ul>
312
+ <p class="description"><?php _e( 'Control whether all known export fields are included or only checked fields from the Export Fields section on the Export screen for each Export Type. Default is to include all export fields.', 'woo_ce' ); ?></p>
313
+ </td>
314
+ </tr>
315
+ <?php
316
+ ob_end_flush();
317
+
318
+ }
319
+ ?>
includes/shipping_classes.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for disabled Shipping Class Sorting widget on Store Exporter screen
7
+ function woo_ce_shipping_class_sorting() {
8
+
9
+ $shipping_class_orderby = 'ID';
10
+ $shipping_class_order = 'DESC';
11
+
12
+ ob_start(); ?>
13
+ <p><label><?php _e( 'Shipping Class Sorting', 'woo_ce' ); ?></label></p>
14
+ <div>
15
+ <select name="shipping_class_orderby" disabled="disabled">
16
+ <option value="id"<?php selected( 'id', $shipping_class_orderby ); ?>><?php _e( 'Term ID', 'woo_ce' ); ?></option>
17
+ <option value="name"<?php selected( 'name', $shipping_class_orderby ); ?>><?php _e( 'Shipping Class Name', 'woo_ce' ); ?></option>
18
+ </select>
19
+ <select name="shipping_class_order" disabled="disabled">
20
+ <option value="ASC"<?php selected( 'ASC', $shipping_class_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
21
+ <option value="DESC"<?php selected( 'DESC', $shipping_class_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
22
+ </select>
23
+ <p class="description"><?php _e( 'Select the sorting of Shipping Classes within the exported file. By default this is set to export Shipping Classes by Term ID in Desending order.', 'woo_ce' ); ?></p>
24
+ </div>
25
+ <?php
26
+ ob_end_flush();
27
+
28
+ }
29
+
30
+ /* End of: WordPress Administration */
31
+
32
+ }
33
+
34
+ // Returns a list of Shipping Classes export columns
35
+ function woo_ce_get_shipping_class_fields( $format = 'full' ) {
36
+
37
+ $export_type = 'shipping_class';
38
+
39
+ $fields = array();
40
+ $fields[] = array(
41
+ 'name' => 'term_id',
42
+ 'label' => __( 'Term ID', 'woo_ce' )
43
+ );
44
+ $fields[] = array(
45
+ 'name' => 'name',
46
+ 'label' => __( 'Shipping Class Name', 'woo_ce' )
47
+ );
48
+ $fields[] = array(
49
+ 'name' => 'slug',
50
+ 'label' => __( 'Shipping Class Slug', 'woo_ce' )
51
+ );
52
+ $fields[] = array(
53
+ 'name' => 'description',
54
+ 'label' => __( 'Shipping Class Description', 'woo_ce' )
55
+ );
56
+
57
+ /*
58
+ $fields[] = array(
59
+ 'name' => '',
60
+ 'label' => __( '', 'woo_ce' )
61
+ );
62
+ */
63
+
64
+ // Allow Plugin/Theme authors to add support for additional columns
65
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
66
+
67
+ switch( $format ) {
68
+
69
+ case 'summary':
70
+ $output = array();
71
+ $size = count( $fields );
72
+ for( $i = 0; $i < $size; $i++ ) {
73
+ if( isset( $fields[$i] ) )
74
+ $output[$fields[$i]['name']] = 'on';
75
+ }
76
+ return $output;
77
+ break;
78
+
79
+ case 'full':
80
+ default:
81
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
82
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
83
+ return $fields;
84
+ break;
85
+
86
+ }
87
+
88
+ }
89
+ ?>
includes/subscriptions.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function woo_ce_get_subscription_fields( $format = 'full' ) {
3
+
4
+ $export_type = 'subscription';
5
+
6
+ $fields = array();
7
+ $fields[] = array(
8
+ 'name' => 'key',
9
+ 'label' => __( 'Subscription Key', 'woo_ce' )
10
+ );
11
+ $fields[] = array(
12
+ 'name' => 'status',
13
+ 'label' => __( 'Subscription Status', 'woo_ce' )
14
+ );
15
+ $fields[] = array(
16
+ 'name' => 'name',
17
+ 'label' => __( 'Subscription Name', 'woo_ce' )
18
+ );
19
+ $fields[] = array(
20
+ 'name' => 'user',
21
+ 'label' => __( 'User', 'woo_ce' )
22
+ );
23
+ $fields[] = array(
24
+ 'name' => 'user_id',
25
+ 'label' => __( 'User ID', 'woo_ce' )
26
+ );
27
+ $fields[] = array(
28
+ 'name' => 'email',
29
+ 'label' => __( 'E-mail Address', 'woo_ce' )
30
+ );
31
+ $fields[] = array(
32
+ 'name' => 'order_id',
33
+ 'label' => __( 'Order ID', 'woo_ce' )
34
+ );
35
+ $fields[] = array(
36
+ 'name' => 'order_status',
37
+ 'label' => __( 'Order Status', 'woo_ce' )
38
+ );
39
+ $fields[] = array(
40
+ 'name' => 'post_status',
41
+ 'label' => __( 'Post Status', 'woo_ce' )
42
+ );
43
+ $fields[] = array(
44
+ 'name' => 'start_date',
45
+ 'label' => __( 'Start Date', 'woo_ce' )
46
+ );
47
+ $fields[] = array(
48
+ 'name' => 'expiration',
49
+ 'label' => __( 'Expiration', 'woo_ce' )
50
+ );
51
+ $fields[] = array(
52
+ 'name' => 'end_date',
53
+ 'label' => __( 'End Date', 'woo_ce' )
54
+ );
55
+ $fields[] = array(
56
+ 'name' => 'trial_end_date',
57
+ 'label' => __( 'Trial End Date', 'woo_ce' )
58
+ );
59
+ $fields[] = array(
60
+ 'name' => 'last_payment',
61
+ 'label' => __( 'Last Payment', 'woo_ce' )
62
+ );
63
+ $fields[] = array(
64
+ 'name' => 'next_payment',
65
+ 'label' => __( 'Next Payment', 'woo_ce' )
66
+ );
67
+ $fields[] = array(
68
+ 'name' => 'renewals',
69
+ 'label' => __( 'Renewals', 'woo_ce' )
70
+ );
71
+ $fields[] = array(
72
+ 'name' => 'product_id',
73
+ 'label' => __( 'Product ID', 'woo_ce' )
74
+ );
75
+ $fields[] = array(
76
+ 'name' => 'product_sku',
77
+ 'label' => __( 'Product SKU', 'woo_ce' )
78
+ );
79
+ $fields[] = array(
80
+ 'name' => 'variation_id',
81
+ 'label' => __( 'Variation ID', 'woo_ce' )
82
+ );
83
+ $fields[] = array(
84
+ 'name' => 'coupon',
85
+ 'label' => __( 'Coupon Code', 'woo_ce' )
86
+ );
87
+ /*
88
+ $fields[] = array(
89
+ 'name' => '',
90
+ 'label' => __( '', 'woo_ce' )
91
+ );
92
+ */
93
+
94
+ // Allow Plugin/Theme authors to add support for additional columns
95
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
96
+
97
+ switch( $format ) {
98
+
99
+ case 'summary':
100
+ $output = array();
101
+ $size = count( $fields );
102
+ for( $i = 0; $i < $size; $i++ ) {
103
+ if( isset( $fields[$i] ) )
104
+ $output[$fields[$i]['name']] = 'on';
105
+ }
106
+ return $output;
107
+ break;
108
+
109
+ case 'full':
110
+ default:
111
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
112
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
113
+ return $fields;
114
+ break;
115
+
116
+ }
117
+
118
+ }
includes/tags.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for Tag Sorting widget on Store Exporter screen
7
+ function woo_ce_tag_sorting() {
8
+
9
+ $tag_orderby = woo_ce_get_option( 'tag_orderby', 'ID' );
10
+ $tag_order = woo_ce_get_option( 'tag_order', 'DESC' );
11
+
12
+ ob_start(); ?>
13
+ <p><label><?php _e( 'Product Tag Sorting', 'woo_ce' ); ?></label></p>
14
+ <div>
15
+ <select name="tag_orderby">
16
+ <option value="id"<?php selected( 'id', $tag_orderby ); ?>><?php _e( 'Term ID', 'woo_ce' ); ?></option>
17
+ <option value="name"<?php selected( 'name', $tag_orderby ); ?>><?php _e( 'Tag Name', 'woo_ce' ); ?></option>
18
+ </select>
19
+ <select name="tag_order">
20
+ <option value="ASC"<?php selected( 'ASC', $tag_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
21
+ <option value="DESC"<?php selected( 'DESC', $tag_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
22
+ </select>
23
+ <p class="description"><?php _e( 'Select the sorting of Product Tags within the exported file. By default this is set to export Product Tags by Term ID in Desending order.', 'woo_ce' ); ?></p>
24
+ </div>
25
+ <?php
26
+ ob_end_flush();
27
+
28
+ }
29
+
30
+ /* End of: WordPress Administration */
31
+
32
+ }
33
+
34
+ // Returns a list of WooCommerce Product Tags to export process
35
+ function woo_ce_get_product_tags( $args = array() ) {
36
+
37
+ $term_taxonomy = 'product_tag';
38
+ $defaults = array(
39
+ 'orderby' => 'name',
40
+ 'order' => 'ASC',
41
+ 'hide_empty' => 0
42
+ );
43
+ $args = wp_parse_args( $args, $defaults );
44
+ $tags = get_terms( $term_taxonomy, $args );
45
+ if( !empty( $tags ) && is_wp_error( $tags ) == false ) {
46
+ $size = count( $tags );
47
+ for( $i = 0; $i < $size; $i++ ) {
48
+ $tags[$i]->disabled = 0;
49
+ if( $tags[$i]->count == 0 )
50
+ $tags[$i]->disabled = 1;
51
+ }
52
+ return $tags;
53
+ }
54
+
55
+ }
56
+
57
+ // Returns a list of Product Tag export columns
58
+ function woo_ce_get_tag_fields( $format = 'full' ) {
59
+
60
+ $export_type = 'tag';
61
+
62
+ $fields = array();
63
+ $fields[] = array(
64
+ 'name' => 'term_id',
65
+ 'label' => __( 'Term ID', 'woo_ce' )
66
+ );
67
+ $fields[] = array(
68
+ 'name' => 'name',
69
+ 'label' => __( 'Tag Name', 'woo_ce' )
70
+ );
71
+ $fields[] = array(
72
+ 'name' => 'slug',
73
+ 'label' => __( 'Tag Slug', 'woo_ce' )
74
+ );
75
+
76
+ /*
77
+ $fields[] = array(
78
+ 'name' => '',
79
+ 'label' => __( '', 'woo_ce' )
80
+ );
81
+ */
82
+
83
+ // Allow Plugin/Theme authors to add support for additional columns
84
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
85
+
86
+ if( $remember = woo_ce_get_option( $export_type . '_fields', array() ) ) {
87
+ $remember = maybe_unserialize( $remember );
88
+ $size = count( $fields );
89
+ for( $i = 0; $i < $size; $i++ ) {
90
+ $fields[$i]['disabled'] = ( isset( $fields[$i]['disabled'] ) ? $fields[$i]['disabled'] : 0 );
91
+ $fields[$i]['default'] = 1;
92
+ if( !array_key_exists( $fields[$i]['name'], $remember ) )
93
+ $fields[$i]['default'] = 0;
94
+ }
95
+ }
96
+
97
+ switch( $format ) {
98
+
99
+ case 'summary':
100
+ $output = array();
101
+ $size = count( $fields );
102
+ for( $i = 0; $i < $size; $i++ ) {
103
+ if( isset( $fields[$i] ) )
104
+ $output[$fields[$i]['name']] = 'on';
105
+ }
106
+ return $output;
107
+ break;
108
+
109
+ case 'full':
110
+ default:
111
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
112
+ $size = count( $fields );
113
+ for( $i = 0; $i < $size; $i++ )
114
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
115
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
116
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
117
+ return $fields;
118
+ break;
119
+
120
+ }
121
+
122
+ }
123
+
124
+ function woo_ce_override_tag_field_labels( $fields = array() ) {
125
+
126
+ $labels = woo_ce_get_option( 'tag_labels', array() );
127
+ if( !empty( $labels ) ) {
128
+ foreach( $fields as $key => $field ) {
129
+ if( isset( $labels[$field['name']] ) )
130
+ $fields[$key]['label'] = $labels[$field['name']];
131
+ }
132
+ }
133
+ return $fields;
134
+
135
+ }
136
+ add_filter( 'woo_ce_tag_fields', 'woo_ce_override_tag_field_labels', 11 );
137
+
138
+ // Returns the export column header label based on an export column slug
139
+ function woo_ce_get_tag_field( $name = null, $format = 'name' ) {
140
+
141
+ $output = '';
142
+ if( $name ) {
143
+ $fields = woo_ce_get_tag_fields();
144
+ $size = count( $fields );
145
+ for( $i = 0; $i < $size; $i++ ) {
146
+ if( $fields[$i]['name'] == $name ) {
147
+ switch( $format ) {
148
+
149
+ case 'name':
150
+ $output = $fields[$i]['label'];
151
+ break;
152
+
153
+ case 'full':
154
+ $output = $fields[$i];
155
+ break;
156
+
157
+ }
158
+ $i = $size;
159
+ }
160
+ }
161
+ }
162
+ return $output;
163
+
164
+ }
165
+ ?>
includes/users.php ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for User Sorting widget on Store Exporter screen
7
+ function woo_ce_user_sorting() {
8
+
9
+ $orderby = woo_ce_get_option( 'user_orderby', 'ID' );
10
+ $order = woo_ce_get_option( 'user_order', 'ASC' );
11
+
12
+ ob_start(); ?>
13
+ <p><label><?php _e( 'User Sorting', 'woo_ce' ); ?></label></p>
14
+ <div>
15
+ <select name="user_orderby">
16
+ <option value="ID"<?php selected( 'ID', $orderby ); ?>><?php _e( 'User ID', 'woo_ce' ); ?></option>
17
+ <option value="display_name"<?php selected( 'display_name', $orderby ); ?>><?php _e( 'Display Name', 'woo_ce' ); ?></option>
18
+ <option value="user_name"<?php selected( 'user_name', $orderby ); ?>><?php _e( 'Name', 'woo_ce' ); ?></option>
19
+ <option value="user_login"<?php selected( 'user_login', $orderby ); ?>><?php _e( 'Username', 'woo_ce' ); ?></option>
20
+ <option value="nicename"<?php selected( 'nicename', $orderby ); ?>><?php _e( 'Nickname', 'woo_ce' ); ?></option>
21
+ <option value="email"<?php selected( 'email', $orderby ); ?>><?php _e( 'E-mail', 'woo_ce' ); ?></option>
22
+ <option value="url"<?php selected( 'url', $orderby ); ?>><?php _e( 'Website', 'woo_ce' ); ?></option>
23
+ <option value="registered"<?php selected( 'registered', $orderby ); ?>><?php _e( 'Date Registered', 'woo_ce' ); ?></option>
24
+ <option value="rand"<?php selected( 'rand', $orderby ); ?>><?php _e( 'Random', 'woo_ce' ); ?></option>
25
+ </select>
26
+ <select name="user_order">
27
+ <option value="ASC"<?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
28
+ <option value="DESC"<?php selected( 'DESC', $order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
29
+ </select>
30
+ <p class="description"><?php _e( 'Select the sorting of Users within the exported file. By default this is set to export User by User ID in Desending order.', 'woo_ce' ); ?></p>
31
+ </div>
32
+ <?php
33
+ ob_end_flush();
34
+
35
+ }
36
+
37
+ // HTML template for disabled Custom Users widget on Store Exporter screen
38
+ function woo_ce_users_custom_fields() {
39
+
40
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
41
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
42
+
43
+ $custom_users = ' - ';
44
+
45
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
46
+
47
+ ob_start(); ?>
48
+ <form method="post" id="export-users-custom-fields" class="export-options user-options">
49
+ <div id="poststuff">
50
+
51
+ <div class="postbox" id="export-options user-options">
52
+ <h3 class="hndle"><?php _e( 'Custom User Fields', 'woo_ce' ); ?></h3>
53
+ <div class="inside">
54
+ <p class="description"><?php _e( 'To include additional custom User meta in the Export Users table above fill the Users text box then click Save Custom Fields.', 'woo_ce' ); ?></p>
55
+ <table class="form-table">
56
+
57
+ <tr>
58
+ <th>
59
+ <label><?php _e( 'User meta', 'woo_ce' ); ?></label>
60
+ </th>
61
+ <td>
62
+ <textarea name="custom_users" rows="5" cols="70"><?php echo esc_textarea( $custom_users ); ?></textarea>
63
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
64
+ <p class="description"><?php _e( 'Include additional custom User meta in your export file by adding each custom User meta name to a new line above.<br />For example: <code>Customer UA, Customer IP Address</code>', 'woo_ce' ); ?></p>
65
+ </td>
66
+ </tr>
67
+
68
+ </table>
69
+ <p class="submit">
70
+ <input type="button" class="button button-disabled" value="<?php _e( 'Save Custom Fields', 'woo_ce' ); ?>" />
71
+ </p>
72
+ <p class="description"><?php printf( __( 'For more information on custom User meta consult our <a href="%s" target="_blank">online documentation</a>.', 'woo_ce' ), $troubleshooting_url ); ?></p>
73
+ </div>
74
+ <!-- .inside -->
75
+ </div>
76
+ <!-- .postbox -->
77
+
78
+ </div>
79
+ <!-- #poststuff -->
80
+ <input type="hidden" name="action" value="update" />
81
+ </form>
82
+ <!-- #export-users-custom-fields -->
83
+ <?php
84
+ ob_end_flush();
85
+
86
+ }
87
+
88
+ /* End of: WordPress Administration */
89
+
90
+ }
91
+
92
+ // Returns a list of User export columns
93
+ function woo_ce_get_user_fields( $format = 'full' ) {
94
+
95
+ $export_type = 'user';
96
+
97
+ $fields = array();
98
+ $fields[] = array(
99
+ 'name' => 'user_id',
100
+ 'label' => __( 'User ID', 'woo_ce' )
101
+ );
102
+ $fields[] = array(
103
+ 'name' => 'user_name',
104
+ 'label' => __( 'Username', 'woo_ce' )
105
+ );
106
+ $fields[] = array(
107
+ 'name' => 'user_role',
108
+ 'label' => __( 'User Role', 'woo_ce' )
109
+ );
110
+ $fields[] = array(
111
+ 'name' => 'first_name',
112
+ 'label' => __( 'First Name', 'woo_ce' )
113
+ );
114
+ $fields[] = array(
115
+ 'name' => 'last_name',
116
+ 'label' => __( 'Last Name', 'woo_ce' )
117
+ );
118
+ $fields[] = array(
119
+ 'name' => 'full_name',
120
+ 'label' => __( 'Full Name', 'woo_ce' )
121
+ );
122
+ $fields[] = array(
123
+ 'name' => 'nick_name',
124
+ 'label' => __( 'Nickname', 'woo_ce' )
125
+ );
126
+ $fields[] = array(
127
+ 'name' => 'email',
128
+ 'label' => __( 'E-mail', 'woo_ce' )
129
+ );
130
+ $fields[] = array(
131
+ 'name' => 'url',
132
+ 'label' => __( 'Website', 'woo_ce' )
133
+ );
134
+ $fields[] = array(
135
+ 'name' => 'date_registered',
136
+ 'label' => __( 'Date Registered', 'woo_ce' )
137
+ );
138
+
139
+ /*
140
+ $fields[] = array(
141
+ 'name' => '',
142
+ 'label' => __( '', 'woo_ce' )
143
+ );
144
+ */
145
+
146
+ // Allow Plugin/Theme authors to add support for additional columns
147
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
148
+
149
+ if( $remember = woo_ce_get_option( $export_type . '_fields', array() ) ) {
150
+ $remember = maybe_unserialize( $remember );
151
+ $size = count( $fields );
152
+ for( $i = 0; $i < $size; $i++ ) {
153
+ $fields[$i]['disabled'] = ( isset( $fields[$i]['disabled'] ) ? $fields[$i]['disabled'] : 0 );
154
+ $fields[$i]['default'] = 1;
155
+ if( !array_key_exists( $fields[$i]['name'], $remember ) )
156
+ $fields[$i]['default'] = 0;
157
+ }
158
+ }
159
+
160
+ switch( $format ) {
161
+
162
+ case 'summary':
163
+ $output = array();
164
+ $size = count( $fields );
165
+ for( $i = 0; $i < $size; $i++ ) {
166
+ if( isset( $fields[$i] ) )
167
+ $output[$fields[$i]['name']] = 'on';
168
+ }
169
+ return $output;
170
+ break;
171
+
172
+ case 'full':
173
+ default:
174
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
175
+ $size = count( $fields );
176
+ for( $i = 0; $i < $size; $i++ )
177
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
178
+ if( version_compare( phpversion(), '5.3' ) >= 0 )
179
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
180
+ return $fields;
181
+ break;
182
+
183
+ }
184
+
185
+ }
186
+
187
+ function woo_ce_override_user_field_labels( $fields = array() ) {
188
+
189
+ $labels = woo_ce_get_option( 'user_labels', array() );
190
+ if( !empty( $labels ) ) {
191
+ foreach( $fields as $key => $field ) {
192
+ if( isset( $labels[$field['name']] ) )
193
+ $fields[$key]['label'] = $labels[$field['name']];
194
+ }
195
+ }
196
+ return $fields;
197
+
198
+ }
199
+ add_filter( 'woo_ce_user_fields', 'woo_ce_override_user_field_labels', 11 );
200
+
201
+ // Returns the export column header label based on an export column slug
202
+ function woo_ce_get_user_field( $name = null, $format = 'name' ) {
203
+
204
+ $output = '';
205
+ if( $name ) {
206
+ $fields = woo_ce_get_user_fields();
207
+ $size = count( $fields );
208
+ for( $i = 0; $i < $size; $i++ ) {
209
+ if( $fields[$i]['name'] == $name ) {
210
+ switch( $format ) {
211
+
212
+ case 'name':
213
+ $output = $fields[$i]['label'];
214
+ break;
215
+
216
+ case 'full':
217
+ $output = $fields[$i];
218
+ break;
219
+
220
+ }
221
+ $i = $size;
222
+ }
223
+ }
224
+ }
225
+ return $output;
226
+
227
+ }
228
+
229
+ // Adds custom User columns to the User fields list
230
+ function woo_ce_extend_user_fields( $fields = array() ) {
231
+
232
+ if( class_exists( 'WC_Admin_Profile' ) ) {
233
+ $admin_profile = new WC_Admin_Profile();
234
+ if( method_exists( 'WC_Admin_Profile', 'get_customer_meta_fields' ) ) {
235
+ $show_fields = $admin_profile->get_customer_meta_fields();
236
+ foreach( $show_fields as $fieldset ) {
237
+ foreach( $fieldset['fields'] as $key => $field ) {
238
+ $fields[] = array(
239
+ 'name' => $key,
240
+ 'label' => sprintf( '%s: %s', $fieldset['title'], esc_html( $field['label'] ) ),
241
+ 'disabled' => 1
242
+ );
243
+ }
244
+ }
245
+ unset( $show_fields, $fieldset, $field );
246
+ }
247
+ }
248
+ return $fields;
249
+
250
+ }
251
+ add_filter( 'woo_ce_user_fields', 'woo_ce_extend_user_fields' );
252
+
253
+ // Returns a list of User IDs
254
+ function woo_ce_get_users( $args = array() ) {
255
+
256
+ global $export;
257
+
258
+ $limit_volume = 0;
259
+ $offset = 0;
260
+ $orderby = 'login';
261
+ $order = 'ASC';
262
+
263
+ if( $args ) {
264
+ $limit_volume = ( isset( $args['limit_volume'] ) ? $args['limit_volume'] : 0 );
265
+ if( $limit_volume == -1 )
266
+ $limit_volume = 0;
267
+ $offset = ( isset( $args['offset'] ) ? $args['offset'] : 0 );
268
+ $orderby = ( isset( $args['user_orderby'] ) ? $args['user_orderby'] : 'login' );
269
+ $order = ( isset( $args['user_order'] ) ? $args['user_order'] : 'ASC' );
270
+ }
271
+ $args = array(
272
+ 'offset' => $offset,
273
+ 'number' => $limit_volume,
274
+ 'order' => $order,
275
+ 'offset' => $offset,
276
+ 'fields' => 'ids'
277
+ );
278
+ if( $user_ids = new WP_User_Query( $args ) ) {
279
+ $users = array();
280
+ $export->total_rows = $user_ids->total_users;
281
+ foreach( $user_ids->results as $user_id )
282
+ $users[] = $user_id;
283
+ return $users;
284
+ }
285
+
286
+ }
287
+
288
+ function woo_ce_get_user_data( $user_id = 0, $args = array() ) {
289
+
290
+ $defaults = array();
291
+ $args = wp_parse_args( $args, $defaults );
292
+
293
+ // Get User details
294
+ $user_data = get_userdata( $user_id );
295
+
296
+ $user = new stdClass;
297
+ if( $user_data !== false ) {
298
+ $user->ID = $user_data->ID;
299
+ $user->user_id = $user_data->ID;
300
+ $user->user_name = $user_data->user_login;
301
+ $user->user_role = $user_data->roles[0];
302
+ $user->first_name = $user_data->first_name;
303
+ $user->last_name = $user_data->last_name;
304
+ $user->full_name = sprintf( '%s %s', $user->first_name, $user->last_name );
305
+ $user->nick_name = $user_data->user_nicename;
306
+ $user->email = $user_data->user_email;
307
+ $user->url = $user_data->user_url;
308
+ $user->date_registered = $user_data->user_registered;
309
+ }
310
+ return apply_filters( 'woo_ce_user', $user );
311
+
312
+ }
313
+
314
+ // Returns a list of WordPress User Roles
315
+ function woo_ce_get_user_roles() {
316
+
317
+ global $wp_roles;
318
+
319
+ $user_roles = $wp_roles->roles;
320
+ return $user_roles;
321
+
322
+ }
323
+
324
+ ?>
js/jquery-ui.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI 1.8.16
3
+ */
4
+ (function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16",
5
+ keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=
6
+ this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,
7
+ "overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":
8
+ "mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,
9
+ outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,
10
+ "tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&
11
+ a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&
12
+ c.ui.isOverAxis(b,e,i)}})}})(jQuery);
13
+ ;
14
+
15
+ (function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=
16
+ function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):
17
+ d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=
18
+ b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
19
+ "-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
20
+ c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
21
+ ;
22
+
23
+ (function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
24
+ this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
25
+ this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
26
+ !(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
27
+ false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
28
+ ;
29
+
30
+ (function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
31
+ this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
32
+ this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
33
+ g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length?
34
+ (h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i-
35
+ m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
36
+ return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false;
37
+ this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b=
38
+ this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b=
39
+ this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);
40
+ c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c<f))c=f;if(c!==this.values(b)){f=this.values();f[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:f});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c});
41
+ a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=
42
+ this._trimAlignValue(a);this._refreshValue();this._change(null,0)}else return this._value()},values:function(a,b){var c,f,e;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):
43
+ this.value();else return this._values()},_setOption:function(a,b){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
44
+ this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a];
45
+ return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=
46
+ this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e-
47
+ g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"},
48
+ b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery);
js/jquery.chosen.js ADDED
@@ -0,0 +1,988 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Chosen, a Select Box Enhancer for jQuery and Protoype
2
+ // by Patrick Filler for Harvest, http://getharvest.com
3
+ //
4
+ // Version 0.9.8
5
+ // Full source at https://github.com/harvesthq/chosen
6
+ // Copyright (c) 2011 Harvest http://getharvest.com
7
+
8
+ // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
+ // This file is generated by `cake build`, do not edit it by hand.
10
+ (function() {
11
+ var SelectParser;
12
+
13
+ SelectParser = (function() {
14
+
15
+ function SelectParser() {
16
+ this.options_index = 0;
17
+ this.parsed = [];
18
+ }
19
+
20
+ SelectParser.prototype.add_node = function(child) {
21
+ if (child.nodeName === "OPTGROUP") {
22
+ return this.add_group(child);
23
+ } else {
24
+ return this.add_option(child);
25
+ }
26
+ };
27
+
28
+ SelectParser.prototype.add_group = function(group) {
29
+ var group_position, option, _i, _len, _ref, _results;
30
+ group_position = this.parsed.length;
31
+ this.parsed.push({
32
+ array_index: group_position,
33
+ group: true,
34
+ label: group.label,
35
+ children: 0,
36
+ disabled: group.disabled
37
+ });
38
+ _ref = group.childNodes;
39
+ _results = [];
40
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
41
+ option = _ref[_i];
42
+ _results.push(this.add_option(option, group_position, group.disabled));
43
+ }
44
+ return _results;
45
+ };
46
+
47
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
48
+ if (option.nodeName === "OPTION") {
49
+ if (option.text !== "") {
50
+ if (group_position != null) this.parsed[group_position].children += 1;
51
+ this.parsed.push({
52
+ array_index: this.parsed.length,
53
+ options_index: this.options_index,
54
+ value: option.value,
55
+ text: option.text,
56
+ html: option.innerHTML,
57
+ selected: option.selected,
58
+ disabled: group_disabled === true ? group_disabled : option.disabled,
59
+ group_array_index: group_position,
60
+ classes: option.className,
61
+ style: option.style.cssText
62
+ });
63
+ } else {
64
+ this.parsed.push({
65
+ array_index: this.parsed.length,
66
+ options_index: this.options_index,
67
+ empty: true
68
+ });
69
+ }
70
+ return this.options_index += 1;
71
+ }
72
+ };
73
+
74
+ return SelectParser;
75
+
76
+ })();
77
+
78
+ SelectParser.select_to_array = function(select) {
79
+ var child, parser, _i, _len, _ref;
80
+ parser = new SelectParser();
81
+ _ref = select.childNodes;
82
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
83
+ child = _ref[_i];
84
+ parser.add_node(child);
85
+ }
86
+ return parser.parsed;
87
+ };
88
+
89
+ this.SelectParser = SelectParser;
90
+
91
+ }).call(this);
92
+
93
+ /*
94
+ Chosen source: generate output using 'cake build'
95
+ Copyright (c) 2011 by Harvest
96
+ */
97
+
98
+ (function() {
99
+ var AbstractChosen, root;
100
+
101
+ root = this;
102
+
103
+ AbstractChosen = (function() {
104
+
105
+ function AbstractChosen(form_field, options) {
106
+ this.form_field = form_field;
107
+ this.options = options != null ? options : {};
108
+ this.set_default_values();
109
+ this.is_multiple = this.form_field.multiple;
110
+ this.set_default_text();
111
+ this.setup();
112
+ this.set_up_html();
113
+ this.register_observers();
114
+ this.finish_setup();
115
+ }
116
+
117
+ AbstractChosen.prototype.set_default_values = function() {
118
+ var _this = this;
119
+ this.click_test_action = function(evt) {
120
+ return _this.test_active_click(evt);
121
+ };
122
+ this.activate_action = function(evt) {
123
+ return _this.activate_field(evt);
124
+ };
125
+ this.active_field = false;
126
+ this.mouse_on_container = false;
127
+ this.results_showing = false;
128
+ this.result_highlighted = null;
129
+ this.result_single_selected = null;
130
+ 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;
131
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
132
+ this.search_contains = this.options.search_contains || false;
133
+ this.choices = 0;
134
+ return this.max_selected_options = this.options.max_selected_options || Infinity;
135
+ };
136
+
137
+ AbstractChosen.prototype.set_default_text = function() {
138
+ if (this.form_field.getAttribute("data-placeholder")) {
139
+ this.default_text = this.form_field.getAttribute("data-placeholder");
140
+ } else if (this.is_multiple) {
141
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || "Select Some Options";
142
+ } else {
143
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || "Select an Option";
144
+ }
145
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
146
+ };
147
+
148
+ AbstractChosen.prototype.mouse_enter = function() {
149
+ return this.mouse_on_container = true;
150
+ };
151
+
152
+ AbstractChosen.prototype.mouse_leave = function() {
153
+ return this.mouse_on_container = false;
154
+ };
155
+
156
+ AbstractChosen.prototype.input_focus = function(evt) {
157
+ var _this = this;
158
+ if (!this.active_field) {
159
+ return setTimeout((function() {
160
+ return _this.container_mousedown();
161
+ }), 50);
162
+ }
163
+ };
164
+
165
+ AbstractChosen.prototype.input_blur = function(evt) {
166
+ var _this = this;
167
+ if (!this.mouse_on_container) {
168
+ this.active_field = false;
169
+ return setTimeout((function() {
170
+ return _this.blur_test();
171
+ }), 100);
172
+ }
173
+ };
174
+
175
+ AbstractChosen.prototype.result_add_option = function(option) {
176
+ var classes, style;
177
+ if (!option.disabled) {
178
+ option.dom_id = this.container_id + "_o_" + option.array_index;
179
+ classes = option.selected && this.is_multiple ? [] : ["active-result"];
180
+ if (option.selected) classes.push("result-selected");
181
+ if (option.group_array_index != null) classes.push("group-option");
182
+ if (option.classes !== "") classes.push(option.classes);
183
+ style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
184
+ return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
185
+ } else {
186
+ return "";
187
+ }
188
+ };
189
+
190
+ AbstractChosen.prototype.results_update_field = function() {
191
+ this.results_reset();
192
+ this.result_clear_highlight();
193
+ this.result_single_selected = null;
194
+ return this.results_build();
195
+ };
196
+
197
+ AbstractChosen.prototype.results_toggle = function() {
198
+ if (this.results_showing) {
199
+ return this.results_hide();
200
+ } else {
201
+ return this.results_show();
202
+ }
203
+ };
204
+
205
+ AbstractChosen.prototype.results_search = function(evt) {
206
+ if (this.results_showing) {
207
+ return this.winnow_results();
208
+ } else {
209
+ return this.results_show();
210
+ }
211
+ };
212
+
213
+ AbstractChosen.prototype.keyup_checker = function(evt) {
214
+ var stroke, _ref;
215
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
216
+ this.search_field_scale();
217
+ switch (stroke) {
218
+ case 8:
219
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
220
+ return this.keydown_backstroke();
221
+ } else if (!this.pending_backstroke) {
222
+ this.result_clear_highlight();
223
+ return this.results_search();
224
+ }
225
+ break;
226
+ case 13:
227
+ evt.preventDefault();
228
+ if (this.results_showing) return this.result_select(evt);
229
+ break;
230
+ case 27:
231
+ if (this.results_showing) this.results_hide();
232
+ return true;
233
+ case 9:
234
+ case 38:
235
+ case 40:
236
+ case 16:
237
+ case 91:
238
+ case 17:
239
+ break;
240
+ default:
241
+ return this.results_search();
242
+ }
243
+ };
244
+
245
+ AbstractChosen.prototype.generate_field_id = function() {
246
+ var new_id;
247
+ new_id = this.generate_random_id();
248
+ this.form_field.id = new_id;
249
+ return new_id;
250
+ };
251
+
252
+ AbstractChosen.prototype.generate_random_char = function() {
253
+ var chars, newchar, rand;
254
+ chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
255
+ rand = Math.floor(Math.random() * chars.length);
256
+ return newchar = chars.substring(rand, rand + 1);
257
+ };
258
+
259
+ return AbstractChosen;
260
+
261
+ })();
262
+
263
+ root.AbstractChosen = AbstractChosen;
264
+
265
+ }).call(this);
266
+
267
+ /*
268
+ Chosen source: generate output using 'cake build'
269
+ Copyright (c) 2011 by Harvest
270
+ */
271
+
272
+ (function() {
273
+ var $, Chosen, get_side_border_padding, root,
274
+ __hasProp = Object.prototype.hasOwnProperty,
275
+ __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; };
276
+
277
+ root = this;
278
+
279
+ $ = jQuery;
280
+
281
+ $.fn.extend({
282
+ chosen: function(options) {
283
+ if ($.browser.msie && ($.browser.version === "6.0" || $.browser.version === "7.0")) {
284
+ return this;
285
+ }
286
+ return this.each(function(input_field) {
287
+ var $this;
288
+ $this = $(this);
289
+ if (!$this.hasClass("chzn-done")) {
290
+ return $this.data('chosen', new Chosen(this, options));
291
+ }
292
+ });
293
+ }
294
+ });
295
+
296
+ Chosen = (function(_super) {
297
+
298
+ __extends(Chosen, _super);
299
+
300
+ function Chosen() {
301
+ Chosen.__super__.constructor.apply(this, arguments);
302
+ }
303
+
304
+ Chosen.prototype.setup = function() {
305
+ this.form_field_jq = $(this.form_field);
306
+ return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
307
+ };
308
+
309
+ Chosen.prototype.finish_setup = function() {
310
+ return this.form_field_jq.addClass("chzn-done");
311
+ };
312
+
313
+ Chosen.prototype.set_up_html = function() {
314
+ var container_div, dd_top, dd_width, sf_width;
315
+ this.container_id = this.form_field.id.length ? this.form_field.id.replace(/[^\w]/g, '_') : this.generate_field_id();
316
+ this.container_id += "_chzn";
317
+ this.f_width = this.form_field_jq.outerWidth();
318
+ container_div = $("<div />", {
319
+ id: this.container_id,
320
+ "class": "chzn-container" + (this.is_rtl ? ' chzn-rtl' : ''),
321
+ style: 'width: ' + this.f_width + 'px;'
322
+ });
323
+ if (this.is_multiple) {
324
+ container_div.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
325
+ } else {
326
+ container_div.html('<a href="javascript:void(0)" class="chzn-single chzn-default"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
327
+ }
328
+ this.form_field_jq.hide().after(container_div);
329
+ this.container = $('#' + this.container_id);
330
+ this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
331
+ this.dropdown = this.container.find('div.chzn-drop').first();
332
+ dd_top = this.container.height();
333
+ dd_width = this.f_width - get_side_border_padding(this.dropdown);
334
+ this.dropdown.css({
335
+ "width": dd_width + "px",
336
+ "top": dd_top + "px"
337
+ });
338
+ this.search_field = this.container.find('input').first();
339
+ this.search_results = this.container.find('ul.chzn-results').first();
340
+ this.search_field_scale();
341
+ this.search_no_results = this.container.find('li.no-results').first();
342
+ if (this.is_multiple) {
343
+ this.search_choices = this.container.find('ul.chzn-choices').first();
344
+ this.search_container = this.container.find('li.search-field').first();
345
+ } else {
346
+ this.search_container = this.container.find('div.chzn-search').first();
347
+ this.selected_item = this.container.find('.chzn-single').first();
348
+ sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
349
+ this.search_field.css({
350
+ "width": sf_width + "px"
351
+ });
352
+ }
353
+ this.results_build();
354
+ this.set_tab_index();
355
+ return this.form_field_jq.trigger("liszt:ready", {
356
+ chosen: this
357
+ });
358
+ };
359
+
360
+ Chosen.prototype.register_observers = function() {
361
+ var _this = this;
362
+ this.container.mousedown(function(evt) {
363
+ return _this.container_mousedown(evt);
364
+ });
365
+ this.container.mouseup(function(evt) {
366
+ return _this.container_mouseup(evt);
367
+ });
368
+ this.container.mouseenter(function(evt) {
369
+ return _this.mouse_enter(evt);
370
+ });
371
+ this.container.mouseleave(function(evt) {
372
+ return _this.mouse_leave(evt);
373
+ });
374
+ this.search_results.mouseup(function(evt) {
375
+ return _this.search_results_mouseup(evt);
376
+ });
377
+ this.search_results.mouseover(function(evt) {
378
+ return _this.search_results_mouseover(evt);
379
+ });
380
+ this.search_results.mouseout(function(evt) {
381
+ return _this.search_results_mouseout(evt);
382
+ });
383
+ this.form_field_jq.bind("liszt:updated", function(evt) {
384
+ return _this.results_update_field(evt);
385
+ });
386
+ this.search_field.blur(function(evt) {
387
+ return _this.input_blur(evt);
388
+ });
389
+ this.search_field.keyup(function(evt) {
390
+ return _this.keyup_checker(evt);
391
+ });
392
+ this.search_field.keydown(function(evt) {
393
+ return _this.keydown_checker(evt);
394
+ });
395
+ if (this.is_multiple) {
396
+ this.search_choices.click(function(evt) {
397
+ return _this.choices_click(evt);
398
+ });
399
+ return this.search_field.focus(function(evt) {
400
+ return _this.input_focus(evt);
401
+ });
402
+ } else {
403
+ return this.container.click(function(evt) {
404
+ return evt.preventDefault();
405
+ });
406
+ }
407
+ };
408
+
409
+ Chosen.prototype.search_field_disabled = function() {
410
+ this.is_disabled = this.form_field_jq[0].disabled;
411
+ if (this.is_disabled) {
412
+ this.container.addClass('chzn-disabled');
413
+ this.search_field[0].disabled = true;
414
+ if (!this.is_multiple) {
415
+ this.selected_item.unbind("focus", this.activate_action);
416
+ }
417
+ return this.close_field();
418
+ } else {
419
+ this.container.removeClass('chzn-disabled');
420
+ this.search_field[0].disabled = false;
421
+ if (!this.is_multiple) {
422
+ return this.selected_item.bind("focus", this.activate_action);
423
+ }
424
+ }
425
+ };
426
+
427
+ Chosen.prototype.container_mousedown = function(evt) {
428
+ var target_closelink;
429
+ if (!this.is_disabled) {
430
+ target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
431
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
432
+ evt.stopPropagation();
433
+ }
434
+ if (!this.pending_destroy_click && !target_closelink) {
435
+ if (!this.active_field) {
436
+ if (this.is_multiple) this.search_field.val("");
437
+ $(document).click(this.click_test_action);
438
+ this.results_show();
439
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
440
+ evt.preventDefault();
441
+ this.results_toggle();
442
+ }
443
+ return this.activate_field();
444
+ } else {
445
+ return this.pending_destroy_click = false;
446
+ }
447
+ }
448
+ };
449
+
450
+ Chosen.prototype.container_mouseup = function(evt) {
451
+ if (evt.target.nodeName === "ABBR") return this.results_reset(evt);
452
+ };
453
+
454
+ Chosen.prototype.blur_test = function(evt) {
455
+ if (!this.active_field && this.container.hasClass("chzn-container-active")) {
456
+ return this.close_field();
457
+ }
458
+ };
459
+
460
+ Chosen.prototype.close_field = function() {
461
+ $(document).unbind("click", this.click_test_action);
462
+ if (!this.is_multiple) {
463
+ this.selected_item.attr("tabindex", this.search_field.attr("tabindex"));
464
+ this.search_field.attr("tabindex", -1);
465
+ }
466
+ this.active_field = false;
467
+ this.results_hide();
468
+ this.container.removeClass("chzn-container-active");
469
+ this.winnow_results_clear();
470
+ this.clear_backstroke();
471
+ this.show_search_field_default();
472
+ return this.search_field_scale();
473
+ };
474
+
475
+ Chosen.prototype.activate_field = function() {
476
+ if (!this.is_multiple && !this.active_field) {
477
+ this.search_field.attr("tabindex", this.selected_item.attr("tabindex"));
478
+ this.selected_item.attr("tabindex", -1);
479
+ }
480
+ this.container.addClass("chzn-container-active");
481
+ this.active_field = true;
482
+ this.search_field.val(this.search_field.val());
483
+ return this.search_field.focus();
484
+ };
485
+
486
+ Chosen.prototype.test_active_click = function(evt) {
487
+ if ($(evt.target).parents('#' + this.container_id).length) {
488
+ return this.active_field = true;
489
+ } else {
490
+ return this.close_field();
491
+ }
492
+ };
493
+
494
+ Chosen.prototype.results_build = function() {
495
+ var content, data, _i, _len, _ref;
496
+ this.parsing = true;
497
+ this.results_data = root.SelectParser.select_to_array(this.form_field);
498
+ if (this.is_multiple && this.choices > 0) {
499
+ this.search_choices.find("li.search-choice").remove();
500
+ this.choices = 0;
501
+ } else if (!this.is_multiple) {
502
+ this.selected_item.find("span").text(this.default_text);
503
+ if (this.form_field.options.length <= this.disable_search_threshold) {
504
+ this.container.addClass("chzn-container-single-nosearch");
505
+ } else {
506
+ this.container.removeClass("chzn-container-single-nosearch");
507
+ }
508
+ }
509
+ content = '';
510
+ _ref = this.results_data;
511
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
512
+ data = _ref[_i];
513
+ if (data.group) {
514
+ content += this.result_add_group(data);
515
+ } else if (!data.empty) {
516
+ content += this.result_add_option(data);
517
+ if (data.selected && this.is_multiple) {
518
+ this.choice_build(data);
519
+ } else if (data.selected && !this.is_multiple) {
520
+ this.selected_item.removeClass("chzn-default").find("span").text(data.text);
521
+ if (this.allow_single_deselect) this.single_deselect_control_build();
522
+ }
523
+ }
524
+ }
525
+ this.search_field_disabled();
526
+ this.show_search_field_default();
527
+ this.search_field_scale();
528
+ this.search_results.html(content);
529
+ return this.parsing = false;
530
+ };
531
+
532
+ Chosen.prototype.result_add_group = function(group) {
533
+ if (!group.disabled) {
534
+ group.dom_id = this.container_id + "_g_" + group.array_index;
535
+ return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
536
+ } else {
537
+ return "";
538
+ }
539
+ };
540
+
541
+ Chosen.prototype.result_do_highlight = function(el) {
542
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
543
+ if (el.length) {
544
+ this.result_clear_highlight();
545
+ this.result_highlight = el;
546
+ this.result_highlight.addClass("highlighted");
547
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
548
+ visible_top = this.search_results.scrollTop();
549
+ visible_bottom = maxHeight + visible_top;
550
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
551
+ high_bottom = high_top + this.result_highlight.outerHeight();
552
+ if (high_bottom >= visible_bottom) {
553
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
554
+ } else if (high_top < visible_top) {
555
+ return this.search_results.scrollTop(high_top);
556
+ }
557
+ }
558
+ };
559
+
560
+ Chosen.prototype.result_clear_highlight = function() {
561
+ if (this.result_highlight) this.result_highlight.removeClass("highlighted");
562
+ return this.result_highlight = null;
563
+ };
564
+
565
+ Chosen.prototype.results_show = function() {
566
+ var dd_top;
567
+ if (!this.is_multiple) {
568
+ this.selected_item.addClass("chzn-single-with-drop");
569
+ if (this.result_single_selected) {
570
+ this.result_do_highlight(this.result_single_selected);
571
+ }
572
+ } else if (this.max_selected_options <= this.choices) {
573
+ this.form_field_jq.trigger("liszt:maxselected", {
574
+ chosen: this
575
+ });
576
+ return false;
577
+ }
578
+ dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
579
+ this.form_field_jq.trigger("liszt:showing_dropdown", {
580
+ chosen: this
581
+ });
582
+ this.dropdown.css({
583
+ "top": dd_top + "px",
584
+ "left": 0
585
+ });
586
+ this.results_showing = true;
587
+ this.search_field.focus();
588
+ this.search_field.val(this.search_field.val());
589
+ return this.winnow_results();
590
+ };
591
+
592
+ Chosen.prototype.results_hide = function() {
593
+ if (!this.is_multiple) {
594
+ this.selected_item.removeClass("chzn-single-with-drop");
595
+ }
596
+ this.result_clear_highlight();
597
+ this.form_field_jq.trigger("liszt:hiding_dropdown", {
598
+ chosen: this
599
+ });
600
+ this.dropdown.css({
601
+ "left": "-9000px"
602
+ });
603
+ return this.results_showing = false;
604
+ };
605
+
606
+ Chosen.prototype.set_tab_index = function(el) {
607
+ var ti;
608
+ if (this.form_field_jq.attr("tabindex")) {
609
+ ti = this.form_field_jq.attr("tabindex");
610
+ this.form_field_jq.attr("tabindex", -1);
611
+ if (this.is_multiple) {
612
+ return this.search_field.attr("tabindex", ti);
613
+ } else {
614
+ this.selected_item.attr("tabindex", ti);
615
+ return this.search_field.attr("tabindex", -1);
616
+ }
617
+ }
618
+ };
619
+
620
+ Chosen.prototype.show_search_field_default = function() {
621
+ if (this.is_multiple && this.choices < 1 && !this.active_field) {
622
+ this.search_field.val(this.default_text);
623
+ return this.search_field.addClass("default");
624
+ } else {
625
+ this.search_field.val("");
626
+ return this.search_field.removeClass("default");
627
+ }
628
+ };
629
+
630
+ Chosen.prototype.search_results_mouseup = function(evt) {
631
+ var target;
632
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
633
+ if (target.length) {
634
+ this.result_highlight = target;
635
+ return this.result_select(evt);
636
+ }
637
+ };
638
+
639
+ Chosen.prototype.search_results_mouseover = function(evt) {
640
+ var target;
641
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
642
+ if (target) return this.result_do_highlight(target);
643
+ };
644
+
645
+ Chosen.prototype.search_results_mouseout = function(evt) {
646
+ if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
647
+ return this.result_clear_highlight();
648
+ }
649
+ };
650
+
651
+ Chosen.prototype.choices_click = function(evt) {
652
+ evt.preventDefault();
653
+ if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
654
+ return this.results_show();
655
+ }
656
+ };
657
+
658
+ Chosen.prototype.choice_build = function(item) {
659
+ var choice_id, link,
660
+ _this = this;
661
+ if (this.is_multiple && this.max_selected_options <= this.choices) {
662
+ this.form_field_jq.trigger("liszt:maxselected", {
663
+ chosen: this
664
+ });
665
+ return false;
666
+ }
667
+ choice_id = this.container_id + "_c_" + item.array_index;
668
+ this.choices += 1;
669
+ this.search_container.before('<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>');
670
+ link = $('#' + choice_id).find("a").first();
671
+ return link.click(function(evt) {
672
+ return _this.choice_destroy_link_click(evt);
673
+ });
674
+ };
675
+
676
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
677
+ evt.preventDefault();
678
+ if (!this.is_disabled) {
679
+ this.pending_destroy_click = true;
680
+ return this.choice_destroy($(evt.target));
681
+ } else {
682
+ return evt.stopPropagation;
683
+ }
684
+ };
685
+
686
+ Chosen.prototype.choice_destroy = function(link) {
687
+ this.choices -= 1;
688
+ this.show_search_field_default();
689
+ if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
690
+ this.results_hide();
691
+ }
692
+ this.result_deselect(link.attr("rel"));
693
+ return link.parents('li').first().remove();
694
+ };
695
+
696
+ Chosen.prototype.results_reset = function() {
697
+ this.form_field.options[0].selected = true;
698
+ this.selected_item.find("span").text(this.default_text);
699
+ if (!this.is_multiple) this.selected_item.addClass("chzn-default");
700
+ this.show_search_field_default();
701
+ this.selected_item.find("abbr").remove();
702
+ this.form_field_jq.trigger("change");
703
+ if (this.active_field) return this.results_hide();
704
+ };
705
+
706
+ Chosen.prototype.result_select = function(evt) {
707
+ var high, high_id, item, position;
708
+ if (this.result_highlight) {
709
+ high = this.result_highlight;
710
+ high_id = high.attr("id");
711
+ this.result_clear_highlight();
712
+ if (this.is_multiple) {
713
+ this.result_deactivate(high);
714
+ } else {
715
+ this.search_results.find(".result-selected").removeClass("result-selected");
716
+ this.result_single_selected = high;
717
+ this.selected_item.removeClass("chzn-default");
718
+ }
719
+ high.addClass("result-selected");
720
+ position = high_id.substr(high_id.lastIndexOf("_") + 1);
721
+ item = this.results_data[position];
722
+ item.selected = true;
723
+ this.form_field.options[item.options_index].selected = true;
724
+ if (this.is_multiple) {
725
+ this.choice_build(item);
726
+ } else {
727
+ this.selected_item.find("span").first().text(item.text);
728
+ if (this.allow_single_deselect) this.single_deselect_control_build();
729
+ }
730
+ if (!(evt.metaKey && this.is_multiple)) this.results_hide();
731
+ this.search_field.val("");
732
+ this.form_field_jq.trigger("change", {
733
+ 'selected': this.form_field.options[item.options_index].value
734
+ });
735
+ return this.search_field_scale();
736
+ }
737
+ };
738
+
739
+ Chosen.prototype.result_activate = function(el) {
740
+ return el.addClass("active-result");
741
+ };
742
+
743
+ Chosen.prototype.result_deactivate = function(el) {
744
+ return el.removeClass("active-result");
745
+ };
746
+
747
+ Chosen.prototype.result_deselect = function(pos) {
748
+ var result, result_data;
749
+ result_data = this.results_data[pos];
750
+ result_data.selected = false;
751
+ this.form_field.options[result_data.options_index].selected = false;
752
+ result = $("#" + this.container_id + "_o_" + pos);
753
+ result.removeClass("result-selected").addClass("active-result").show();
754
+ this.result_clear_highlight();
755
+ this.winnow_results();
756
+ this.form_field_jq.trigger("change", {
757
+ deselected: this.form_field.options[result_data.options_index].value
758
+ });
759
+ return this.search_field_scale();
760
+ };
761
+
762
+ Chosen.prototype.single_deselect_control_build = function() {
763
+ if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
764
+ return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
765
+ }
766
+ };
767
+
768
+ Chosen.prototype.winnow_results = function() {
769
+ var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref;
770
+ this.no_results_clear();
771
+ results = 0;
772
+ searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
773
+ regexAnchor = this.search_contains ? "" : "^";
774
+ regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
775
+ zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
776
+ _ref = this.results_data;
777
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
778
+ option = _ref[_i];
779
+ if (!option.disabled && !option.empty) {
780
+ if (option.group) {
781
+ $('#' + option.dom_id).css('display', 'none');
782
+ } else if (!(this.is_multiple && option.selected)) {
783
+ found = false;
784
+ result_id = option.dom_id;
785
+ result = $("#" + result_id);
786
+ if (regex.test(option.html)) {
787
+ found = true;
788
+ results += 1;
789
+ } else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) {
790
+ parts = option.html.replace(/\[|\]/g, "").split(" ");
791
+ if (parts.length) {
792
+ for (_j = 0, _len2 = parts.length; _j < _len2; _j++) {
793
+ part = parts[_j];
794
+ if (regex.test(part)) {
795
+ found = true;
796
+ results += 1;
797
+ }
798
+ }
799
+ }
800
+ }
801
+ if (found) {
802
+ if (searchText.length) {
803
+ startpos = option.html.search(zregex);
804
+ text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
805
+ text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
806
+ } else {
807
+ text = option.html;
808
+ }
809
+ result.html(text);
810
+ this.result_activate(result);
811
+ if (option.group_array_index != null) {
812
+ $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
813
+ }
814
+ } else {
815
+ if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
816
+ this.result_clear_highlight();
817
+ }
818
+ this.result_deactivate(result);
819
+ }
820
+ }
821
+ }
822
+ }
823
+ if (results < 1 && searchText.length) {
824
+ return this.no_results(searchText);
825
+ } else {
826
+ return this.winnow_results_set_highlight();
827
+ }
828
+ };
829
+
830
+ Chosen.prototype.winnow_results_clear = function() {
831
+ var li, lis, _i, _len, _results;
832
+ this.search_field.val("");
833
+ lis = this.search_results.find("li");
834
+ _results = [];
835
+ for (_i = 0, _len = lis.length; _i < _len; _i++) {
836
+ li = lis[_i];
837
+ li = $(li);
838
+ if (li.hasClass("group-result")) {
839
+ _results.push(li.css('display', 'auto'));
840
+ } else if (!this.is_multiple || !li.hasClass("result-selected")) {
841
+ _results.push(this.result_activate(li));
842
+ } else {
843
+ _results.push(void 0);
844
+ }
845
+ }
846
+ return _results;
847
+ };
848
+
849
+ Chosen.prototype.winnow_results_set_highlight = function() {
850
+ var do_high, selected_results;
851
+ if (!this.result_highlight) {
852
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
853
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
854
+ if (do_high != null) return this.result_do_highlight(do_high);
855
+ }
856
+ };
857
+
858
+ Chosen.prototype.no_results = function(terms) {
859
+ var no_results_html;
860
+ no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
861
+ no_results_html.find("span").first().html(terms);
862
+ return this.search_results.append(no_results_html);
863
+ };
864
+
865
+ Chosen.prototype.no_results_clear = function() {
866
+ return this.search_results.find(".no-results").remove();
867
+ };
868
+
869
+ Chosen.prototype.keydown_arrow = function() {
870
+ var first_active, next_sib;
871
+ if (!this.result_highlight) {
872
+ first_active = this.search_results.find("li.active-result").first();
873
+ if (first_active) this.result_do_highlight($(first_active));
874
+ } else if (this.results_showing) {
875
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
876
+ if (next_sib) this.result_do_highlight(next_sib);
877
+ }
878
+ if (!this.results_showing) return this.results_show();
879
+ };
880
+
881
+ Chosen.prototype.keyup_arrow = function() {
882
+ var prev_sibs;
883
+ if (!this.results_showing && !this.is_multiple) {
884
+ return this.results_show();
885
+ } else if (this.result_highlight) {
886
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
887
+ if (prev_sibs.length) {
888
+ return this.result_do_highlight(prev_sibs.first());
889
+ } else {
890
+ if (this.choices > 0) this.results_hide();
891
+ return this.result_clear_highlight();
892
+ }
893
+ }
894
+ };
895
+
896
+ Chosen.prototype.keydown_backstroke = function() {
897
+ if (this.pending_backstroke) {
898
+ this.choice_destroy(this.pending_backstroke.find("a").first());
899
+ return this.clear_backstroke();
900
+ } else {
901
+ this.pending_backstroke = this.search_container.siblings("li.search-choice").last();
902
+ return this.pending_backstroke.addClass("search-choice-focus");
903
+ }
904
+ };
905
+
906
+ Chosen.prototype.clear_backstroke = function() {
907
+ if (this.pending_backstroke) {
908
+ this.pending_backstroke.removeClass("search-choice-focus");
909
+ }
910
+ return this.pending_backstroke = null;
911
+ };
912
+
913
+ Chosen.prototype.keydown_checker = function(evt) {
914
+ var stroke, _ref;
915
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
916
+ this.search_field_scale();
917
+ if (stroke !== 8 && this.pending_backstroke) this.clear_backstroke();
918
+ switch (stroke) {
919
+ case 8:
920
+ this.backstroke_length = this.search_field.val().length;
921
+ break;
922
+ case 9:
923
+ if (this.results_showing && !this.is_multiple) this.result_select(evt);
924
+ this.mouse_on_container = false;
925
+ break;
926
+ case 13:
927
+ evt.preventDefault();
928
+ break;
929
+ case 38:
930
+ evt.preventDefault();
931
+ this.keyup_arrow();
932
+ break;
933
+ case 40:
934
+ this.keydown_arrow();
935
+ break;
936
+ }
937
+ };
938
+
939
+ Chosen.prototype.search_field_scale = function() {
940
+ var dd_top, div, h, style, style_block, styles, w, _i, _len;
941
+ if (this.is_multiple) {
942
+ h = 0;
943
+ w = 0;
944
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
945
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
946
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
947
+ style = styles[_i];
948
+ style_block += style + ":" + this.search_field.css(style) + ";";
949
+ }
950
+ div = $('<div />', {
951
+ 'style': style_block
952
+ });
953
+ div.text(this.search_field.val());
954
+ $('body').append(div);
955
+ w = div.width() + 25;
956
+ div.remove();
957
+ if (w > this.f_width - 10) w = this.f_width - 10;
958
+ this.search_field.css({
959
+ 'width': w + 'px'
960
+ });
961
+ dd_top = this.container.height();
962
+ return this.dropdown.css({
963
+ "top": dd_top + "px"
964
+ });
965
+ }
966
+ };
967
+
968
+ Chosen.prototype.generate_random_id = function() {
969
+ var string;
970
+ string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
971
+ while ($("#" + string).length > 0) {
972
+ string += this.generate_random_char();
973
+ }
974
+ return string;
975
+ };
976
+
977
+ return Chosen;
978
+
979
+ })(AbstractChosen);
980
+
981
+ get_side_border_padding = function(elmt) {
982
+ var side_border_padding;
983
+ return side_border_padding = elmt.outerWidth() - elmt.width();
984
+ };
985
+
986
+ root.get_side_border_padding = get_side_border_padding;
987
+
988
+ }).call(this);
js/jquery.csvToTable.js ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * CSV to Table plugin
3
+ * http://code.google.com/p/jquerycsvtotable/
4
+ *
5
+ * Copyright (c) 2010 Steve Sobel
6
+ * http://honestbleeps.com/
7
+ *
8
+ * v0.9 - 2010-06-22 - First release.
9
+ *
10
+ * Example implementation:
11
+ * $('#divID').CSVToTable('test.csv');
12
+ *
13
+ * The above line would load 'test.csv' via AJAX and render a table. If
14
+ * headers are not specified, the plugin assumes the first line of the CSV
15
+ * file contains the header names.
16
+ *
17
+ * Configurable options:
18
+ * separator - separator to use when parsing CSV/TSV data
19
+ * - value will almost always be "," or "\t" (comma or tab)
20
+ * - if not specified, default value is ","
21
+ * headers - an array of headers for the CSV data
22
+ * - if not specified, plugin assumes that the first line of the CSV
23
+ * file contains the header names.
24
+ * - Example: headers: ['Album Title', 'Artist Name', 'Price ($USD)']
25
+ * tableClass - class name to apply to the <table> tag rendered by the plugin.
26
+ * theadClass - class name to apply to the <thead> tag rendered by the plugin.
27
+ * thClass - class name to apply to the <th> tag rendered by the plugin.
28
+ * tbodyClass - class name to apply to the <tbody> tag rendered by the plugin.
29
+ * trClass - class name to apply to the <tr> tag rendered by the plugin.
30
+ * tdClass - class name to apply to the <td> tag rendered by the plugin.
31
+ * loadingImage - path to an image to display while CSV/TSV data is loading
32
+ * loadingText - text to display while CSV/TSV is loading
33
+ * - if not specified, default value is "Loading CSV data..."
34
+ *
35
+ *
36
+ * Upon completion, the plugin triggers a "loadComplete" event so that you
37
+ * may perform other manipulation on the table after it has loaded. A
38
+ * common use of this would be to use the jQuery tablesorter plugin, found
39
+ * at http://tablesorter.com/
40
+ *
41
+ * An example of such a call would be as follows, assuming you have loaded
42
+ * the tablesorter plugin.
43
+ *
44
+ * $('#CSVTable').CSVToTable('test.csv',
45
+ * {
46
+ * loadingImage: 'images/loading.gif',
47
+ * startLine: 1,
48
+ * headers: ['Album Title', 'Artist Name', 'Price ($USD)']
49
+ * }
50
+ * ).bind("loadComplete",function() {
51
+ * $('#CSVTable').find('TABLE').tablesorter();
52
+ * });;
53
+
54
+ *
55
+ */
56
+
57
+
58
+ (function($){
59
+
60
+ /**
61
+ *
62
+ * CSV Parser credit goes to Brian Huisman, from his blog entry entitled "CSV String to Array in JavaScript":
63
+ * http://www.greywyvern.com/?post=258
64
+ *
65
+ */
66
+ String.prototype.splitCSV = function(sep) {
67
+ for (var thisCSV = this.split(sep = sep || ","), x = thisCSV.length - 1, tl; x >= 0; x--) {
68
+ if (thisCSV[x].replace(/"\s+$/, '"').charAt(thisCSV[x].length - 1) == '"') {
69
+ if ((tl = thisCSV[x].replace(/^\s+"/, '"')).length > 1 && tl.charAt(0) == '"') {
70
+ thisCSV[x] = thisCSV[x].replace(/^\s*"|"\s*$/g, '').replace(/""/g, '"');
71
+ } else if (x) {
72
+ thisCSV.splice(x - 1, 2, [thisCSV[x - 1], thisCSV[x]].join(sep));
73
+ } else thisCSV = thisCSV.shift().split(sep).concat(thisCSV);
74
+ } else thisCSV[x].replace(/""/g, '"');
75
+ } return thisCSV;
76
+ };
77
+
78
+ $.fn.CSVToTable = function(csvFile, options) {
79
+ var defaults = {
80
+ tableClass: "CSVTable",
81
+ theadClass: "",
82
+ thClass: "",
83
+ tbodyClass: "",
84
+ trClass: "",
85
+ tdClass: "",
86
+ loadingImage: "",
87
+ loadingText: "Loading CSV data...",
88
+ separator: ",",
89
+ startLine: 0
90
+ };
91
+ var options = $.extend(defaults, options);
92
+ return this.each(function() {
93
+ var obj = $(this);
94
+ var error = '';
95
+ var csv = obj.html(); // this is the string containing the CSV data
96
+ var data = csv;
97
+ (options.loadingImage) ? loading = '<div style="text-align: center"><img alt="' + options.loadingText + '" src="' + options.loadingImage + '" /><br>' + options.loadingText + '</div>' : loading = options.loadingText;
98
+ obj.html(loading);
99
+ var tableHTML = '<table class="' + options.tableClass + '">';
100
+ var lines = data.replace('\r','').split('\n');
101
+ var printedLines = 0;
102
+ var headerCount = 0;
103
+ var headers = new Array();
104
+ $.each(lines, function(lineCount, line) {
105
+ if ((lineCount == 0) && (typeof(options.headers) != 'undefined')) {
106
+ headers = options.headers;
107
+ headerCount = headers.length;
108
+ tableHTML += '<thead class="' + options.theadClass + '"><tr class="' + options.trClass + '">';
109
+ $.each(headers, function(headerCount, header) {
110
+ tableHTML += '<th class="' + options.thClass + '">' + header + '</th>';
111
+ });
112
+ tableHTML += '</tr></thead><tbody class="' + options.tbodyClass + '">';
113
+ }
114
+ if ((lineCount == options.startLine) && (typeof(options.headers) == 'undefined')) {
115
+ headers = line.splitCSV(options.separator);
116
+ headerCount = headers.length;
117
+ tableHTML += '<thead class="' + options.theadClass + '"><tr class="' + options.trClass + '">';
118
+ $.each(headers, function(headerCount, header) {
119
+ tableHTML += '<th class="' + options.thClass + '">' + header + '</th>';
120
+ });
121
+ tableHTML += '</tr></thead><tbody class="' + options.tbodyClass + '">';
122
+ } else if (lineCount >= options.startLine) {
123
+ var items = line.splitCSV(options.separator);
124
+ if (items.length > 1) {
125
+ printedLines++;
126
+ if (items.length != headerCount) {
127
+ error += 'error on line ' + lineCount + ': Item count (' + items.length + ') does not match header count (' + headerCount + ') \n';
128
+ }
129
+ (printedLines % 2) ? oddOrEven = 'odd' : oddOrEven = 'even';
130
+ tableHTML += '<tr class="' + options.trClass + ' ' + oddOrEven + '">';
131
+ $.each(items, function(itemCount, item) {
132
+ tableHTML += '<td class="' + options.tdClass + '">' + item + '</td>';
133
+ });
134
+ tableHTML += '</tr>';
135
+ }
136
+ }
137
+ });
138
+ tableHTML += '</tbody></table>';
139
+ if (error) {
140
+ obj.html(error);
141
+ } else {
142
+ obj.fadeOut(500, function() {
143
+ obj.html(tableHTML)
144
+ }).fadeIn(function() {
145
+ // trigger loadComplete
146
+ setTimeout(function() {
147
+ obj.trigger("loadComplete");
148
+ },0);
149
+ });
150
+ }
151
+ });
152
+ };
153
+
154
+ })(jQuery);
js/ui-datepicker.js ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Datepicker 1.8.16
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Datepicker
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ */
13
+ (function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
14
+ "ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
15
+ "Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
16
+ minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout",
17
+ function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
18
+ b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},
19
+ setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,
20
+ "\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
21
+ function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c==
22
+ "focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():
23
+ d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,
24
+ b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=
25
+ 1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/
26
+ 2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=
27
+ d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=
28
+ a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,
29
+ "datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==
30
+ a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?
31
+ d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);
32
+ this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");
33
+ b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]);if(a=d.datepicker._get(b,"onSelect")){c=d.datepicker._formatDate(b);a.apply(b.input?b.input[0]:null,[c,b])}else d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,
34
+ a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=
35
+ a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,
36
+ "stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);
37
+ return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",
38
+ a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value=
39
+ "";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);
40
+ c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=
41
+ true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});
42
+ a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&
43
+ !a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),
44
+ h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=
45
+ this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);
46
+ this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
47
+ _checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):
48
+ 0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"?
49
+ "Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);
50
+ this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");
51
+ if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?
52
+ b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1<a.length&&a.charAt(A+1)==p)&&A++;return p},m=function(p){var D=
53
+ o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s=
54
+ function(){if(b.charAt(q)!=a.charAt(A))throw"Unexpected literal at position "+q;q++},q=0,A=0;A<a.length;A++)if(k)if(a.charAt(A)=="'"&&!o("'"))k=false;else s();else switch(a.charAt(A)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+
55
+ 1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",
56
+ COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:
57
+ null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-
58
+ (new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=
59
+ 0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);
60
+ var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;
61
+ i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=
62
+ Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>
63
+ 12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&
64
+ a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?
65
+ new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));
66
+ n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,
67
+ g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&
68
+ a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+B+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
69
+ B+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O=
70
+ "";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&
71
+ x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,
72
+ z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==
73
+ P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+B+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span class="ui-state-default">'+
74
+ r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
75
+ "");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&
76
+ (!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,
77
+ e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+
78
+ (c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input?
79
+ a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,
80
+ e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,
81
+ "dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this;
82
+ if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a==
83
+ "string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery);
84
+ ;
languages/woo_ce-en_GB.mo ADDED
Binary file
languages/woo_ce-en_GB.po ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: woocommerce-exporter\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-01-29 18:32+1000\n"
6
+ "PO-Revision-Date: 2012-01-29 18:32+1000\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: Visser Labs\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SearchPath-0: ..\n"
15
+
16
+ #: ../exporter.php:26
17
+ msgid "WooCommerce Exporter"
18
+ msgstr ""
19
+
20
+ #: ../exporter.php:27
21
+ #: ../includes/functions.php:9
22
+ msgid "Store Export"
23
+ msgstr ""
24
+
25
+ #: ../exporter.php:69
26
+ msgid "Chosen WooCommerce details have been exported from your store."
27
+ msgstr ""
28
+
29
+ #: ../exporter.php:99
30
+ msgid "Export to CSV"
31
+ msgstr ""
32
+
33
+ #: ../exporter.php:103
34
+ msgid "Export WooCommerce Details"
35
+ msgstr ""
36
+
37
+ #: ../exporter.php:109
38
+ msgid "Products"
39
+ msgstr ""
40
+
41
+ #: ../exporter.php:122
42
+ msgid "Import Options"
43
+ msgstr ""
44
+
45
+ #: ../exporter.php:129
46
+ msgid "Script timeout"
47
+ msgstr ""
48
+
49
+ #: ../exporter.php:131
50
+ #: ../exporter.php:132
51
+ msgid "minutes"
52
+ msgstr ""
53
+
54
+ #: ../exporter.php:133
55
+ msgid "hour"
56
+ msgstr ""
57
+
58
+ #: ../exporter.php:134
59
+ msgid "Unlimited"
60
+ msgstr ""
61
+
62
+ #: ../exporter.php:136
63
+ msgid "Script timeout defines how long WooCommerce Exporter is 'allowed' to process your CSV file, once the time limit is reached the export process halts."
64
+ msgstr ""
65
+
66
+ #: ../exporter.php:146
67
+ msgid "Export"
68
+ msgstr ""
69
+
70
+ #: ../exporter.php:152
71
+ msgid "Chosen WooCommerce details are being exported, this process can take awhile. Time for a beer?"
72
+ msgstr ""
73
+
74
+ #: ../exporter.php:154
75
+ msgid "Return to <a href=\""
76
+ msgstr ""
77
+
78
+ #: ../includes/common-dashboard_widgets.php:8
79
+ msgid "Plugin News - by Visser Labs"
80
+ msgstr ""
81
+
82
+ #: ../includes/common-dashboard_widgets.php:32
83
+ msgid "Connection failed. Please check your network settings."
84
+ msgstr ""
85
+
86
+ #: ../includes/common-update.php:49
87
+ msgid "An Unexpected HTTP Error occurred during the API request.</p> <p><a href=\"?\" onclick=\"document.location.reload(); return false;\">Try again</a>"
88
+ msgstr ""
89
+
90
+ #: ../includes/common-update.php:53
91
+ msgid "An unknown error occurred"
92
+ msgstr ""
93
+
94
+ #: ../includes/functions.php:9
95
+ msgid "WP e-Commerce Exporter"
96
+ msgstr ""
97
+
license.txt ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
6
+
7
+ Everyone is permitted to copy and distribute verbatim copies
8
+ of this license document, but changing it is not allowed.
9
+
10
+ Preamble
11
+
12
+ The licenses for most software are designed to take away your
13
+ freedom to share and change it. By contrast, the GNU General Public
14
+ License is intended to guarantee your freedom to share and change free
15
+ software--to make sure the software is free for all its users. This
16
+ General Public License applies to most of the Free Software
17
+ Foundation's software and to any other program whose authors commit to
18
+ using it. (Some other Free Software Foundation software is covered by
19
+ the GNU Library General Public License instead.) You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ this service if you wish), that you receive source code or can get it
26
+ if you want it, that you can change the software or use pieces of it
27
+ in new free programs; and that you know you can do these things.
28
+
29
+ To protect your rights, we need to make restrictions that forbid
30
+ anyone to deny you these rights or to ask you to surrender the rights.
31
+ These restrictions translate to certain responsibilities for you if you
32
+ distribute copies of the software, or if you modify it.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must give the recipients all the rights that
36
+ you have. You must make sure that they, too, receive or can get the
37
+ source code. And you must show them these terms so they know their
38
+ rights.
39
+
40
+ We protect your rights with two steps: (1) copyright the software, and
41
+ (2) offer you this license which gives you legal permission to copy,
42
+ distribute and/or modify the software.
43
+
44
+ Also, for each author's protection and ours, we want to make certain
45
+ that everyone understands that there is no warranty for this free
46
+ software. If the software is modified by someone else and passed on, we
47
+ want its recipients to know that what they have is not the original, so
48
+ that any problems introduced by others will not reflect on the original
49
+ authors' reputations.
50
+
51
+ Finally, any free program is threatened constantly by software
52
+ patents. We wish to avoid the danger that redistributors of a free
53
+ program will individually obtain patent licenses, in effect making the
54
+ program proprietary. To prevent this, we have made it clear that any
55
+ patent must be licensed for everyone's free use or not licensed at all.
56
+
57
+ The precise terms and conditions for copying, distribution and
58
+ modification follow.
59
+
60
+ GNU GENERAL PUBLIC LICENSE
61
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
62
+
63
+ 0. This License applies to any program or other work which contains
64
+ a notice placed by the copyright holder saying it may be distributed
65
+ under the terms of this General Public License. The "Program", below,
66
+ refers to any such program or work, and a "work based on the Program"
67
+ means either the Program or any derivative work under copyright law:
68
+ that is to say, a work containing the Program or a portion of it,
69
+ either verbatim or with modifications and/or translated into another
70
+ language. (Hereinafter, translation is included without limitation in
71
+ the term "modification".) Each licensee is addressed as "you".
72
+
73
+ Activities other than copying, distribution and modification are not
74
+ covered by this License; they are outside its scope. The act of
75
+ running the Program is not restricted, and the output from the Program
76
+ is covered only if its contents constitute a work based on the
77
+ Program (independent of having been made by running the Program).
78
+ Whether that is true depends on what the Program does.
79
+
80
+ 1. You may copy and distribute verbatim copies of the Program's
81
+ source code as you receive it, in any medium, provided that you
82
+ conspicuously and appropriately publish on each copy an appropriate
83
+ copyright notice and disclaimer of warranty; keep intact all the
84
+ notices that refer to this License and to the absence of any warranty;
85
+ and give any other recipients of the Program a copy of this License
86
+ along with the Program.
87
+
88
+ You may charge a fee for the physical act of transferring a copy, and
89
+ you may at your option offer warranty protection in exchange for a fee.
90
+
91
+ 2. You may modify your copy or copies of the Program or any portion
92
+ of it, thus forming a work based on the Program, and copy and
93
+ distribute such modifications or work under the terms of Section 1
94
+ above, provided that you also meet all of these conditions:
95
+
96
+ a) You must cause the modified files to carry prominent notices
97
+ stating that you changed the files and the date of any change.
98
+
99
+ b) You must cause any work that you distribute or publish, that in
100
+ whole or in part contains or is derived from the Program or any
101
+ part thereof, to be licensed as a whole at no charge to all third
102
+ parties under the terms of this License.
103
+
104
+ c) If the modified program normally reads commands interactively
105
+ when run, you must cause it, when started running for such
106
+ interactive use in the most ordinary way, to print or display an
107
+ announcement including an appropriate copyright notice and a
108
+ notice that there is no warranty (or else, saying that you provide
109
+ a warranty) and that users may redistribute the program under
110
+ these conditions, and telling the user how to view a copy of this
111
+ License. (Exception: if the Program itself is interactive but
112
+ does not normally print such an announcement, your work based on
113
+ the Program is not required to print an announcement.)
114
+
115
+ These requirements apply to the modified work as a whole. If
116
+ identifiable sections of that work are not derived from the Program,
117
+ and can be reasonably considered independent and separate works in
118
+ themselves, then this License, and its terms, do not apply to those
119
+ sections when you distribute them as separate works. But when you
120
+ distribute the same sections as part of a whole which is a work based
121
+ on the Program, the distribution of the whole must be on the terms of
122
+ this License, whose permissions for other licensees extend to the
123
+ entire whole, and thus to each and every part regardless of who wrote it.
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
readme.txt ADDED
@@ -0,0 +1,576 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WooCommerce - Store Exporter ===
2
+
3
+ Contributors: visser
4
+ Donate link: http://www.visser.com.au/#donations
5
+ Tags: e-commerce, woocommerce, shop, cart, ecommerce, export, csv, xml, xls, excel, customers, products, sales, orders, coupons, users, attributes, subscriptions
6
+ Requires at least: 2.9.2
7
+ Tested up to: 4.0
8
+ Stable tag: 1.8.2
9
+
10
+ == Description ==
11
+
12
+ Export store details out of WooCommerce into simple formatted files (e.g. CSV, XML, Excel 2007 XLS, etc.).
13
+
14
+ Features include:
15
+
16
+ * Export Products (*)
17
+ * Export Products by Product Category
18
+ * Export Products by Product Status
19
+ * Export Products by Type including Variations
20
+ * Export Categories
21
+ * Export Tags
22
+ * Export Brands (*)
23
+ * Export Orders (*)
24
+ * Export Orders by Order Status (*)
25
+ * Export Orders by Order Date (*)
26
+ * Export Orders by Customers (*)
27
+ * Export Orders by Coupon Code (*)
28
+ * Export Customers (*)
29
+ * Export Customers by Order Status (*)
30
+ * Export Users
31
+ * Export Coupons (*)
32
+ * Export Subscriptions (*)
33
+ * Export Product Vendors (*)
34
+ * Export Shipping Classes (*)
35
+ * Export Attributes (*)
36
+ * Toggle and save export fields
37
+ * Field label editor (*)
38
+ * Works with WordPress Multisite
39
+ * Export to CSV file
40
+ * Export to XML file (*)
41
+ * Export to Excel 2007 (XLS) file (*)
42
+ * Export to WordPress Media
43
+ * Export to e-mail addresses (*)
44
+ * Export to remote POST (*)
45
+ * Export to remote FTP (*)
46
+ * Supports external CRON commands (*)
47
+ * Supports scheduled exports (*)
48
+
49
+ (*) Requires the Pro upgrade to enable additional store export functionality.
50
+
51
+ Just a few of the features unlocked in the Pro upgrade of Product Importer include:
52
+
53
+ - Compatibility with Product Importer Deluxe
54
+ - Export All in One SEO Pack
55
+ - Export Advanced Google Product Feed
56
+ - Export Product Addons
57
+ - Export Sequential Order Number Pro
58
+ - Export Checkout Manager
59
+ - Export Checkout Manager Pro
60
+ - Export Checkout Field Editor
61
+ - Export Cost of Goods
62
+ - Export Per-Product Shipping
63
+ - Export Print Invoice & Delivery Note
64
+ - Export Local Pickups Plus
65
+ - Export WooCommerce Subscriptions
66
+ - Export Checkout Field Manager
67
+ - Export Currency Switcher
68
+ - Export WooCommerce PDF Invoices & Packing Slips
69
+ - Export WooCommerce Checkout Add-ons
70
+ - Export Product Vendors
71
+
72
+ ... and more free and Premium extensions for WooCommerce.
73
+
74
+ For more information visit: http://www.visser.com.au/woocommerce/
75
+
76
+ == Installation ==
77
+
78
+ 1. Upload the folder 'woocommerce-exporter' to the '/wp-content/plugins/' directory
79
+ 2. Activate 'WooCommerce - Store Exporter' through the 'Plugins' menu in WordPress
80
+
81
+ See Usage section before for instructions on how to generate export files.
82
+
83
+ == Usage ==
84
+
85
+ 1. Open WooCommerce > Store Export from the WordPress Administration
86
+ 2. Select the Export tab on the Store Exporter screen
87
+ 3. Select which export type and WooCommerce details you would like to export
88
+ 4. Click Export
89
+ 5. Download archived copies of previous exports from the Archives tab
90
+
91
+ Done!
92
+
93
+ == Support ==
94
+
95
+ If you have any problems, questions or suggestions please join the members discussion on our WooCommerce dedicated forum.
96
+
97
+ http://www.visser.com.au/woocommerce/forums/
98
+
99
+ == Screenshots ==
100
+
101
+ 1. The overview screen for Store Exporter.
102
+ 2. Select the data fields to be included in the export, selections are remembered for next export.
103
+ 3. Each dataset (e.g. Products, Orders, etc.) include filter options to filter by date, status, type, customer and more.
104
+ 4. A range of export options can be adjusted to suit different languages and file formatting requirements.
105
+ 5. Export a list of WooCommerce Product Categories into a CSV file.
106
+ 6. Export a list of WooCommerce Product Tags into a CSV file.
107
+ 7. Download archived copies of previous exports
108
+ 8. Use the Field Editor to relabel export fields to your preferred names
109
+ 9. Drag-and-drop export fields to your preferred ordering, sorting is saved between screen refreshes.
110
+
111
+ == Changelog ==
112
+
113
+ = 1.8.2 =
114
+ * Added: Order support for Extra Product Options
115
+ * Fixed: Detect corrupted Date Format
116
+ * Added: Detection of corrupted WordPress options at export time
117
+ * Added: Total Sales to Products export
118
+ * Fixed: Advanced Google Product Feed not being included in Products export
119
+ * Added: Custom User meta to Customers export
120
+ * Added: Support for exporting Shipping Classes
121
+ * Changed: Product URL is now External URL
122
+ * Added: Product URL is the absolute URL to the Product
123
+ * Added: Support for custom User fields
124
+ * Fixed: Admin notice not showing for saving custom fields
125
+
126
+ = 1.8.1 =
127
+ * Adeded: Export modules to the Export screen
128
+
129
+ = 1.8 =
130
+ * Fixed: Up-sells formatting not saving between screen refreshes
131
+ * Fixed: Cross-sells formatting not saving between screen refreshes
132
+ * Fixed: PHP 5.2 compatibility for anonymous functions
133
+ * Added: Admin notice for PHP 5.2 users to update to supported releases of PHP
134
+
135
+ = 1.7.9 =
136
+ * Changed: Moved Up-sells formatting option to products.php
137
+ * Changed: Moved Cross-sells formatting option to products.php
138
+
139
+ = 1.7.8 =
140
+ * Added: Gravity Form ID to Orders export
141
+ * Added: Gravity Form Name to Orders export
142
+ * Added: Support for changing the export format of scheduled exports
143
+ * Fixed: Display of multiple queued Admin notices
144
+ * Fixed: PHP warning on Subscriptions export
145
+ * Fixed: Attributes showing Term Slug in Products export
146
+ * Fixed: Attributes not including Taxonomy based Terms in Products export
147
+ * Fixed: Empty export rows under certain environments in Products export
148
+ * Added: Support for filtering Orders by Order Dates for scheduled exports
149
+ * Fixed: Compatibility with WooCommerce 2.2+
150
+ * Changed: Moved Brands sorting to brands.php
151
+
152
+ = 1.7.7 =
153
+ * Added: Support for WooCommerce Checkout Add-ons in Orders export
154
+ * Fixed: Saving Export filename option over-sanitized
155
+
156
+ = 1.7.6 =
157
+ * Fixed: Limit volume for Users export
158
+ * Fixed: Offset for Users export
159
+ * Fixed: Sanitize form fields
160
+ * Fixed: Data validation on outputs
161
+ * Fixed: Saving of Order in Users export
162
+ * Fixed: Saving of Order By in Users export
163
+ * Fixed: Count of Customers for large store catalogues
164
+
165
+ = 1.7.5 =
166
+ * Fixed: Custom Product meta not working
167
+ * Changed: Moved Product Gallery support to Pro
168
+ * Changed: Moved Default e-mail recipient to General Settings
169
+ * Changed: Moved Default remote URL POST to General Settings
170
+ * Added: Export Users type in basic Store Exporter
171
+ * Fixed: Add missing WordPress options for Plugin if not present on activation
172
+
173
+ = 1.7.4 =
174
+ * Added: Subscriptions export type
175
+ * Added: Support for Subscription Key in Subscriptions export
176
+ * Added: Support for Subscription Status in Subscriptions export
177
+ * Added: Support for Subscription Name in Subscriptions export
178
+ * Added: Support for User in Subscriptions export
179
+ * Added: Support for User ID in Subscriptions export
180
+ * Added: Support for Order ID in Subscriptions export
181
+ * Added: Support for Order Status in Subscriptions export
182
+ * Added: Support for Post Status in Subscriptions export
183
+ * Added: Support for Start Date in Subscriptions export
184
+ * Added: Support for Expiration in Subscriptions export
185
+ * Added: Support for End Date in Subscriptions export
186
+ * Added: Support for Trial End Date in Subscriptions export
187
+ * Added: Support for Last Payment in Subscriptions export
188
+ * Added: Support for Next Payment in Subscriptions export
189
+ * Added: Support for Renewals in Subscriptions export
190
+ * Added: Support for Product ID in Subscriptions export
191
+ * Added: Support for Product SKU in Subscriptions export
192
+ * Added: Support for Variation ID in Subscriptions export
193
+ * Added: Support for Coupon Code in Subscription export
194
+ * Added: Support for Limit Volume in Subscription export
195
+
196
+ = 1.7.3 =
197
+ * Added: Export type is remembered between screen refreshes
198
+ * Changed: Moved Product Sorting widget to products.php
199
+ * Changed: Moved Filter Products by Product Category widget to products.php
200
+ * Changed: Moved Filter Products by Product Tag widget to products.php
201
+ * Changed: Moved Filter Products by Product Status widget to products.php
202
+
203
+ = 1.7.2 =
204
+ * Fixed: Check for wc_format_localized_price() in older releases of WooCommerce
205
+ * Added: Brands export type
206
+ * Added: Support for Brand Name in Brands export
207
+ * Added: Support for Brand Description in Brands export
208
+ * Added: Support for Brand Slug in Brands export
209
+ * Added: Support for Parent ID in Brands export
210
+ * Added: Support for Brand Image in Brands export
211
+ * Added: Support for sorting options in Brands export
212
+ * Fixed: Added checks for 3rd party classes and legacy WooCommerce functions for 2.0.20
213
+ * Added: Support for Category Description in Categories export
214
+ * Added: Support for Category Image in Categories export
215
+ * Added: Support for Display Type in Categories export
216
+
217
+ = 1.7.1 =
218
+ * Added: Brands support to Orders export
219
+ * Added: Brands support for Order Items in Orders export
220
+ * Fixed: PHP warning notice in Orders export
221
+ * Added: Option to filter different Order Items types from Orders export
222
+
223
+ = 1.7 =
224
+ * Added: Rename of export files across Plugin
225
+ * Added: Coupon Code to Orders export
226
+ * Added: Export Users
227
+ * Added: Support for User ID in Users export
228
+ * Added: Support for Username in Users export
229
+ * Added: Support for User Role in Users export
230
+ * Added: Support for First Name in Users export
231
+ * Added: Support for Last Name in Users export
232
+ * Added: Support for Full Name in Users export
233
+ * Added: Support for Nickname in Users export
234
+ * Added: Support for E-mail in Users export
235
+ * Added: Support for Website in Users export
236
+ * Added: Support for Date Registered in Users export
237
+ * Added: Support for WooCommerce User Profile fields in Users export
238
+ * Added: Product Gallery formatting support includes Media URL
239
+ * Added: Sorting support for Users export
240
+ * Added: Sorting options for Coupons
241
+ * Added: Filter Orders by Coupon Codes
242
+
243
+ = 1.6.2 =
244
+ * Added: MSRP Pricing support for Products
245
+ * Added: WooCommerce Print Invoice & Delivery Note Invoice Number support for Orders
246
+ * Added: WooCommerce Sequential Order Numbers (free) support for Orders
247
+ * Changed: Get 3rd Party Plugin support from woo_ce_product_fields filter
248
+ * Changed: Preparations for sortable export column
249
+ * Fixed: URL to Add New export button after empty export
250
+ * Added: jQuery checks for functions before running
251
+ * Fixed: Conflicts with other WooCommerce Plugins due to shared 'save' form action
252
+ * Fixed: Support for WooCommerce Checkout Manager (Free!)
253
+ * Added: Support for WooCommerce Checkout Manager Pro
254
+ * Added: Support for Currency Switcher in Orders export
255
+ * Added: Support for Checkout Field Editor
256
+
257
+ = 1.6.1 =
258
+ * Fixed: Empty exports
259
+ * Changed: Better detection of empty exports
260
+ * Changed: Better detection of empty data types
261
+ * Added: Customer Filter to Export screen
262
+ * Added: Filter Customers by Order Status option
263
+ * Added: Using is_wp_error() throughout CPT and Term requests
264
+
265
+ = 1.6 =
266
+ * Fixed: Coupon export as XML
267
+ * Fixed: Order export as XML
268
+ * Fixed: Customer export as XML
269
+ * Fixed: Compatibility with WordPress 3.9.1
270
+ * Added: Product export support for Advanced Google Product Feed
271
+ * Added: Product export support for All in One SEO Pack
272
+ * Added: Product export support for WordPress SEO
273
+ * Added: Product export support for Ultimate SEO
274
+ * Fixed: Fatal error affecting CRON export for XML export
275
+ * Fixed: Remember column options after exporting Orders
276
+
277
+ = 1.5.9 =
278
+ * Fixed: Clearing the Limit Volume or Offset values would not be saved
279
+ * Fixed: Force file extension if removed from the Filename option on Settings screen
280
+ * Changed: Reduced memory load by storing $args in $export global
281
+
282
+ = 1.5.8 =
283
+ * Fixed: Fatal error if Store Exporter is not activated
284
+
285
+ = 1.5.7 =
286
+ * Changed: Replaced woo_ce_save_csv_file_attachment() with generic woo_ce_save_file_attachment()
287
+ * Changed: Replaced woo_ce_save_csv_file_guid() with generic woo_ce_save_file_guid()
288
+ * Changed: Replaced woo_ce_save_csv_file_details() with generic woo_ce_save_file_details()
289
+ * Changed: Replaced woo_ce_update_csv_file_detail() with generic woo_ce_update_file_detail()
290
+ * Changed: Moved woo_ce_save_file_details() into common Plugin space
291
+ * Changed: Added third allow_empty property to custom get_option()
292
+
293
+ = 1.5.6 =
294
+ * Added: Disabled support for XML Export Format under Export Option
295
+ * Changed: Created new functions-csv.php file
296
+ * Changed: Moved woo_ce_generate_csv_filename() to functions-csv.php
297
+ * Changed: Moved woo_ce_generate_csv_header() to functions-csv.php
298
+
299
+ = 1.5.5 =
300
+ * Fixed: Export error prompt displaying due to WordPress transient
301
+
302
+ = 1.5.4 =
303
+ * Changed: Removed WooCommere Plugins dashboard widget
304
+ * Added: CSS class to Custom Product Fields
305
+ * Fixed: Broken export checks that may affect export options
306
+
307
+ = 1.5.3 =
308
+ * Added: Support for exporting Local Pickup Plus fields in Orders
309
+ * Fixed: Memory leak in woo_ce_expand_state_name
310
+ * Fixed: Memory leak in woo_ce_expand_country_name
311
+ * Changed: Removed duplicate Order Items: Type field
312
+ * Added: Disabled Custom Order Fields widget to Export screen
313
+ * Changed: Using WP_Query instead of get_posts for bulk export
314
+ * Changed: Cross-Sells and Up-Sells get their own formatting functions
315
+ * Changed: Moved export function into common space for CRON and scheduled exports
316
+ * Added: Toggle visibility of each export types fields within Export Options
317
+
318
+ = 1.5.2 =
319
+ * Added: Option for Up-Sells to export Product SKU instead of Product ID
320
+ * Added: Option for Cross-Sells to export Product SKU instead of Product ID
321
+ * Changed: Toggle visibility of dataset relevant export options
322
+ * Changed: Moved Field delimiter option to Settings tab
323
+ * Changed: Moved Category separator option to Settings tab
324
+ * Changed: Moved Add BOM character option to Settings tab
325
+ * Changed: Moved Character encoding option to Settings tab
326
+ * Changed: Moved Field escape formatting option to Settings tab
327
+ * Changed: Moved Order Item Formatting option to Export Options widget
328
+ * Changed: Combined Volume offset and Limit volume
329
+ * Added: Skip Overview screen option to Overview screen
330
+
331
+ = 1.5.1 =
332
+ * Fixed: CSV File not being displayed on Media screen
333
+ * Added: Download Type support to Products export
334
+ * Fixed: File Download support for WooCommerce 2.0+
335
+ * Changed: Legacy support for File Download export support in pre-WooCommerce 2.0
336
+ * Changed: An empty weight/height/width/length will make the dimension unit empty
337
+ * Added: Setttings tab for managing global export settings
338
+ * Added: Custom export filename support with variables: %store_name%, %dataset%, %date%, %time%
339
+ * Changed: Moved Date Format option to Settings tab
340
+ * Changed: Moved Max unique Order items option to Settings tab
341
+ * Changed: Moved Enable Archives options to Settings tab
342
+ * Changed: Removed Manage Custom Product Fields link from Export Options
343
+ * Changed: Moved Script Timeout option to Settings tab
344
+
345
+ = 1.5 =
346
+ * Added: Menu Order to Products export
347
+ * Changed: Comment Status to Enable Reviews in Products export
348
+
349
+ = 1.4.9 =
350
+ * Added: Order Items: Category and Order Items: Tag to Orders export
351
+ * Added: Clicking an export type from the opening screen will open that export tab
352
+
353
+ = 1.4.8 =
354
+ * Changed: Dropped $woo_ce global
355
+ * Added: Using Plugin constants
356
+ * Changed: Moved debug log to WordPress transient
357
+ * Added: Disabled Custom Product Fields dialog
358
+ * Changed: Removed duplicate Sale Price from Product export
359
+ * Fixed: Empty Parent SKU and Product SKU for Product Variations
360
+ * Fixed: Fill default Stock Status for Products
361
+ * Fixed: Set Product Type to Simple Product by default
362
+ * Added: Error notice after blank screen on export
363
+ * Fixed: Product Categories empty for Variations in Product export
364
+
365
+ = 1.4.7 =
366
+ * Fixed: Multi-site support resolved
367
+ * Changed: Permanently delete failed exports
368
+
369
+ = 1.4.6 =
370
+ * Fixed: Blank screen on export in some instances
371
+ * Changed: Removed legacy progress bar
372
+ * Changed: Removed legacy Javascript in export screen
373
+ * Added: Admin notice confirming deleted archive file
374
+ * Changed: Removed bold headings from admin notices
375
+ * Added: Error notice to explain blank CSV
376
+ * Changed: Renamed "Delete temporary CSV after download" to "Enable Archives"
377
+ * Changed: Removed woo_ce_unload_export_global()
378
+ * Fixed: Delete WordPress Media on failed export
379
+ * Added: Link to Usage document when an error is encountered "Need help?"
380
+ * Changed: Using 'export' capability check for Store Export menu
381
+ * Changed: Using 'update_plugins' capability check for Jigoshop Plugins Dashboard widget (thanks Marcus!)
382
+
383
+ = 1.4.5 =
384
+ * Added: Custom Product fields
385
+ * Added: Memory optimisations for get_posts()
386
+ * Changed: Standard admin notices
387
+
388
+ = 1.4.4 =
389
+ * Changed: Default Date Format to d/m/Y
390
+
391
+ = 1.4.3 =
392
+ * Fixed: Export Orders by User Role
393
+ * Added: Formatting of User Role
394
+
395
+ = 1.4.2 =
396
+ * Added: Product Published and Product Modified dates to Products export
397
+ * Added: Date formatting independant of WordPress > Settings > General
398
+
399
+ = 1.4.1 =
400
+ * Fixed: Default file encoding can trigger PHP warning
401
+ * Added: File encoding support for Categories and Tags
402
+ * Added: Product Tags sorting export support
403
+ * Added: Category sorting export support
404
+ * Added: Separate files for each dataset
405
+
406
+ = 1.4 =
407
+ * Added: File encoding for datasets
408
+ * Changed: Default file encoding to UTF-8
409
+ * Added: Product sorting and ordering
410
+ * Changed: Ordering of Export Options
411
+
412
+ = 1.3.9 =
413
+ * Added: Payment Gateway ID to Orders export
414
+ * Added: Shipping Method ID to Orders export
415
+ * Added: Shipping Cost to Orders export
416
+ * Added: Checkout IP Address to Orders export
417
+ * Added: User Role to Orders export
418
+ * Changed: Removed encoding changes to Description and Excerpt
419
+
420
+ = 1.3.8 =
421
+ * Fixed: PHP 4 notices for File Encoding dropdown
422
+ * Fixed: Translation string on Export screen
423
+ * Added: WordPress get_posts() optimisation
424
+ * Fixed: Ignore Variant Products without Base Products (ala 'phantom Posts')
425
+
426
+ = 1.3.7 =
427
+ * Added: Additional Category column support
428
+ * Added: Additional Tag column support
429
+ * Fixed: HTML entities now print in plain-text
430
+
431
+ = 1.3.6 =
432
+ * Fixed: PHP error for missing function within Store Exporter Deluxe
433
+
434
+ = 1.3.5 =
435
+ * Fixed: Admin icon on Store Exporter screen
436
+ * Fixed: PHP error on Store Exporter screen without Products
437
+ * Changed: Moved CSV File dialog on Media screen to template file
438
+
439
+ = 1.3.4 =
440
+ * Added: Total incl. GST
441
+ * Added: Total excl. GST
442
+ * Added: Purchase Time
443
+ * Changed: Moved woo_ce_count_object() to formatting.php
444
+ * Added: Commenting to each function
445
+ * Fixed: PHP 4 support for missing mb_list_encodings()
446
+
447
+ = 1.3.3 =
448
+ * Added: New Product filter 'woo_ce_product_item'
449
+
450
+ = 1.3.2 =
451
+ * Fixed: Order Notes on Orders export
452
+
453
+ = 1.3.1 =
454
+ * Added: Link to submit additional fields
455
+
456
+ = 1.3 =
457
+ * Changed: Using manage_woocommerce instead of manage_options for permission check
458
+ * Changed: Removed woo_is_admin_valid_icon
459
+ * Changed: Using default WooCommerce icons
460
+
461
+ = 1.2.9 =
462
+ * Fixed: Urgent fix for duplicate formatting function
463
+
464
+ = 1.2.8 =
465
+ * Added: Product ID support
466
+ * Added: Post Parent ID support
467
+ * Added: Export Product variation support
468
+ * Added: Product Attribute support
469
+ * Added: Filter Products export by Type
470
+ * Added: Sale Price Dates From/To support
471
+ * Added: Virtual and Downloadable Product support
472
+ * Added: Remove archived export
473
+ * Added: Count and filter of archived exports
474
+ * Fixed: Hide User ID 0 (guest) from Orders
475
+
476
+ = 1.2.7 =
477
+ * Added: jQuery Chosen support to Orders Customer dropdown
478
+ * Fixed: Incorrect counts on some Export types
479
+
480
+ = 1.2.6 =
481
+ * Added: Product Type support
482
+ * Added: Native jQuery UI support
483
+ * Fixed: Various small bugs
484
+
485
+ = 1.2.5 =
486
+ * Added: Featured Image support
487
+
488
+ = 1.2.3 =
489
+ * Fixed: Tags export
490
+ * Added: Export Products by Product Tag filter
491
+ * Added: Notice for empty export files
492
+ * Changed: UI changes to Filter dialogs
493
+
494
+ = 1.2.2 =
495
+ * Changed: Free version can see Order, Coupon and Customer export options
496
+ * Added: Plugin screenshots
497
+
498
+ = 1.2.1 =
499
+ * Added: Support for BOM
500
+ * Added: Escape field formatting option
501
+ * Added: New line support
502
+ * Added: Payment Status (number) option
503
+
504
+ = 1.2 =
505
+ * Fixed: Surplus cell separator at end of lines
506
+ * Added: Remember field selections
507
+
508
+ = 1.1.1 =
509
+ * Added: Expiry Date support to Coupons
510
+ * Added: Individual Use to Coupons
511
+ * Added: Apply before tax to Coupons
512
+ * Added: Exclude sale items to Coupons
513
+ * Added: Expiry Date to Coupons
514
+ * Added: Minimum Amount to Coupons
515
+ * Added: Exclude Product ID's to Coupons
516
+ * Added: Product Categories to Coupons
517
+ * Added: Exclude Product Categories to Coupons
518
+ * Added: Usage Limit to Coupons
519
+ * Fixed: Customers count causing memory error
520
+ * Added: Formatting of 'on' and 'off' values
521
+ * Changed: Memory overrides
522
+
523
+ = 1.1.0 =
524
+ * Added: Save option for delimiter
525
+ * Added: Save option for category separator
526
+ * Added: Save options for limit volume
527
+ * Added: Save options for offset
528
+ * Added: Save options for timeout
529
+
530
+ = 1.0.9 =
531
+ * Fixed: Export buttons not adjusting Export Dataset
532
+ * Added: Select All options to Export
533
+ * Added: Partial export support
534
+ * Changed: Integration with Exporter Deluxe
535
+
536
+ = 1.0.8 =
537
+ * Added: Integration with Exporter Deluxe
538
+
539
+ = 1.0.7 =
540
+ * Fixed: Excerpt/Product Short description
541
+
542
+ = 1.0.6 =
543
+ * Changed: Options engine
544
+ * Changed: Moved styles to admin_enqueue_scripts
545
+ * Added: Coupons support
546
+
547
+ = 1.0.5 =
548
+ * Fixed: Template header bug
549
+ * Added: Tabbed viewing on the Exporter screen
550
+ * Added: Export Orders
551
+ * Added: Product columns
552
+ * Added: Order columns
553
+ * Added: Category heirachy support (up to 3 levels deep)
554
+ * Fixed: Foreign character support
555
+ * Changed: More efficient Tag generation
556
+ * Fixed: Link error on Export within Plugin screen
557
+
558
+ = 1.0.4 =
559
+ * Added: Duplicate e-mail address filtering
560
+ * Changed: Updated readme.txt
561
+
562
+ = 1.0.3 =
563
+ * Added: Support for Customers
564
+
565
+ = 1.0.2 =
566
+ * Changed: Migrated to WordPress Extend
567
+
568
+ = 1.0.1 =
569
+ * Fixed: Dashboard widget not loading
570
+
571
+ = 1.0 =
572
+ * Added: First working release of the Plugin
573
+
574
+ == Disclaimer ==
575
+
576
+ It is not responsible for any harm or wrong doing this Plugin may cause. Users are fully responsible for their own use. This Plugin is to be used WITHOUT warranty.
templates/admin/chosen-sprite.png ADDED
Binary file
templates/admin/chosen.css ADDED
@@ -0,0 +1,397 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* @group Base */
2
+ .chzn-container {
3
+ font-size: 12px;
4
+ position: relative;
5
+ display: inline-block;
6
+ zoom: 1;
7
+ *display: inline;
8
+ }
9
+ .chzn-container .chzn-drop {
10
+ background: #fff;
11
+ border: 1px solid #aaa;
12
+ border-top: 0;
13
+ position: absolute;
14
+ top: 29px;
15
+ left: 0;
16
+ -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
17
+ -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
18
+ box-shadow : 0 4px 5px rgba(0,0,0,.15);
19
+ z-index: 1010;
20
+ }
21
+ /* @end */
22
+
23
+ /* @group Single Chosen */
24
+ .chzn-container-single .chzn-single {
25
+ background-color: #ffffff;
26
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
27
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
28
+ background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
29
+ background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
30
+ background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
31
+ background-image: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
32
+ -webkit-border-radius: 5px;
33
+ -moz-border-radius : 5px;
34
+ border-radius : 5px;
35
+ -moz-background-clip : padding;
36
+ -webkit-background-clip: padding-box;
37
+ background-clip : padding-box;
38
+ border: 1px solid #aaaaaa;
39
+ -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
40
+ -moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
41
+ box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
42
+ display: block;
43
+ overflow: hidden;
44
+ white-space: nowrap;
45
+ position: relative;
46
+ height: 23px;
47
+ line-height: 24px;
48
+ padding: 0 0 0 8px;
49
+ color: #444444;
50
+ text-decoration: none;
51
+ }
52
+ .chzn-container-single .chzn-default {
53
+ color: #999;
54
+ }
55
+ .chzn-container-single .chzn-single span {
56
+ margin-right: 26px;
57
+ display: block;
58
+ overflow: hidden;
59
+ white-space: nowrap;
60
+ -o-text-overflow: ellipsis;
61
+ -ms-text-overflow: ellipsis;
62
+ text-overflow: ellipsis;
63
+ }
64
+ .chzn-container-single .chzn-single abbr {
65
+ display: block;
66
+ position: absolute;
67
+ right: 26px;
68
+ top: 6px;
69
+ width: 12px;
70
+ height: 13px;
71
+ font-size: 1px;
72
+ background: url('chosen-sprite.png') right top no-repeat;
73
+ }
74
+ .chzn-container-single .chzn-single abbr:hover {
75
+ background-position: right -11px;
76
+ }
77
+ .chzn-container-single.chzn-disabled .chzn-single abbr:hover {
78
+ background-position: right top;
79
+ }
80
+ .chzn-container-single .chzn-single div {
81
+ position: absolute;
82
+ right: 0;
83
+ top: 0;
84
+ display: block;
85
+ height: 100%;
86
+ width: 18px;
87
+ }
88
+ .chzn-container-single .chzn-single div b {
89
+ background: url('chosen-sprite.png') no-repeat 0 0;
90
+ display: block;
91
+ width: 100%;
92
+ height: 100%;
93
+ }
94
+ .chzn-container-single .chzn-search {
95
+ padding: 3px 4px;
96
+ position: relative;
97
+ margin: 0;
98
+ white-space: nowrap;
99
+ z-index: 1010;
100
+ }
101
+ .chzn-container-single .chzn-search input {
102
+ background: #fff url('chosen-sprite.png') no-repeat 100% -22px;
103
+ background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
104
+ background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
105
+ background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
106
+ background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
107
+ background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(#eeeeee 1%, #ffffff 15%);
108
+ margin: 1px 0;
109
+ padding: 4px 20px 4px 5px;
110
+ outline: 0;
111
+ border: 1px solid #aaa;
112
+ font-family: sans-serif;
113
+ font-size: 1em;
114
+ }
115
+ .chzn-container-single .chzn-drop {
116
+ -webkit-border-radius: 0 0 4px 4px;
117
+ -moz-border-radius : 0 0 4px 4px;
118
+ border-radius : 0 0 4px 4px;
119
+ -moz-background-clip : padding;
120
+ -webkit-background-clip: padding-box;
121
+ background-clip : padding-box;
122
+ }
123
+ /* @end */
124
+
125
+ .chzn-container-single-nosearch .chzn-search input {
126
+ position: absolute;
127
+ left: -9000px;
128
+ }
129
+
130
+ /* @group Multi Chosen */
131
+ .chzn-container-multi .chzn-choices {
132
+ background-color: #fff;
133
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
134
+ background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
135
+ background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
136
+ background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
137
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
138
+ border: 1px solid #aaa;
139
+ margin: 0;
140
+ padding: 0;
141
+ cursor: text;
142
+ overflow: hidden;
143
+ height: auto !important;
144
+ height: 1%;
145
+ position: relative;
146
+ }
147
+ .chzn-container-multi .chzn-choices li {
148
+ float: left;
149
+ list-style: none;
150
+ }
151
+ .chzn-container-multi .chzn-choices .search-field {
152
+ white-space: nowrap;
153
+ margin: 0;
154
+ padding: 0;
155
+ }
156
+ .chzn-container-multi .chzn-choices .search-field input {
157
+ color: #666;
158
+ background: transparent !important;
159
+ border: 0 !important;
160
+ font-family: sans-serif;
161
+ font-size: 100%;
162
+ height: 15px;
163
+ padding: 5px;
164
+ margin: 1px 0;
165
+ outline: 0;
166
+ -webkit-box-shadow: none;
167
+ -moz-box-shadow : none;
168
+ box-shadow : none;
169
+ }
170
+ .chzn-container-multi .chzn-choices .search-field .default {
171
+ color: #999;
172
+ }
173
+ .chzn-container-multi .chzn-choices .search-choice {
174
+ -webkit-border-radius: 3px;
175
+ -moz-border-radius : 3px;
176
+ border-radius : 3px;
177
+ -moz-background-clip : padding;
178
+ -webkit-background-clip: padding-box;
179
+ background-clip : padding-box;
180
+ background-color: #e4e4e4;
181
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
182
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
183
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
184
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
185
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
186
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
187
+ -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
188
+ -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
189
+ box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
190
+ color: #333;
191
+ border: 1px solid #aaaaaa;
192
+ line-height: 13px;
193
+ padding: 3px 20px 3px 5px;
194
+ margin: 3px 0 3px 5px;
195
+ position: relative;
196
+ cursor: default;
197
+ }
198
+ .chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
199
+ background-color: #e4e4e4;
200
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
201
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
202
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
203
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
204
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
205
+ background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
206
+ background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
207
+ color: #666;
208
+ border: 1px solid #cccccc;
209
+ padding-right: 5px;
210
+ }
211
+ .chzn-container-multi .chzn-choices .search-choice-focus {
212
+ background: #d4d4d4;
213
+ }
214
+ .chzn-container-multi .chzn-choices .search-choice .search-choice-close {
215
+ display: block;
216
+ position: absolute;
217
+ right: 3px;
218
+ top: 4px;
219
+ width: 12px;
220
+ height: 13px;
221
+ font-size: 1px;
222
+ background: url('chosen-sprite.png') right top no-repeat;
223
+ }
224
+ .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
225
+ background-position: right -11px;
226
+ }
227
+ .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
228
+ background-position: right -11px;
229
+ }
230
+ /* @end */
231
+
232
+ /* @group Results */
233
+ .chzn-container .chzn-results {
234
+ margin: 0 4px 4px 0;
235
+ max-height: 240px;
236
+ padding: 0 0 0 4px;
237
+ position: relative;
238
+ overflow-x: hidden;
239
+ overflow-y: auto;
240
+ -webkit-overflow-scrolling: touch;
241
+ }
242
+ .chzn-container-multi .chzn-results {
243
+ margin: -1px 0 0;
244
+ padding: 0;
245
+ }
246
+ .chzn-container .chzn-results li {
247
+ display: none;
248
+ line-height: 15px;
249
+ padding: 5px 6px;
250
+ margin: 0;
251
+ list-style: none;
252
+ }
253
+ .chzn-container .chzn-results .active-result {
254
+ cursor: pointer;
255
+ display: list-item;
256
+ }
257
+ .chzn-container .chzn-results .highlighted {
258
+ background-color: #3875d7;
259
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
260
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
261
+ background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
262
+ background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
263
+ background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
264
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
265
+ color: #fff;
266
+ }
267
+ .chzn-container .chzn-results li em {
268
+ background: #feffde;
269
+ font-style: normal;
270
+ }
271
+ .chzn-container .chzn-results .highlighted em {
272
+ background: transparent;
273
+ }
274
+ .chzn-container .chzn-results .no-results {
275
+ background: #f4f4f4;
276
+ display: list-item;
277
+ }
278
+ .chzn-container .chzn-results .group-result {
279
+ cursor: default;
280
+ color: #999;
281
+ font-weight: bold;
282
+ }
283
+ .chzn-container .chzn-results .group-option {
284
+ padding-left: 15px;
285
+ }
286
+ .chzn-container-multi .chzn-drop .result-selected {
287
+ display: none;
288
+ }
289
+ .chzn-container .chzn-results-scroll {
290
+ background: white;
291
+ margin: 0 4px;
292
+ position: absolute;
293
+ text-align: center;
294
+ width: 321px; /* This should by dynamic with js */
295
+ z-index: 1;
296
+ }
297
+ .chzn-container .chzn-results-scroll span {
298
+ display: inline-block;
299
+ height: 17px;
300
+ text-indent: -5000px;
301
+ width: 9px;
302
+ }
303
+ .chzn-container .chzn-results-scroll-down {
304
+ bottom: 0;
305
+ }
306
+ .chzn-container .chzn-results-scroll-down span {
307
+ background: url('chosen-sprite.png') no-repeat -4px -3px;
308
+ }
309
+ .chzn-container .chzn-results-scroll-up span {
310
+ background: url('chosen-sprite.png') no-repeat -22px -3px;
311
+ }
312
+ /* @end */
313
+
314
+ /* @group Active */
315
+ .chzn-container-active .chzn-single {
316
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
317
+ -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
318
+ box-shadow : 0 0 5px rgba(0,0,0,.3);
319
+ border: 1px solid #5897fb;
320
+ }
321
+ .chzn-container-active .chzn-single-with-drop {
322
+ border: 1px solid #aaa;
323
+ -webkit-box-shadow: 0 1px 0 #fff inset;
324
+ -moz-box-shadow : 0 1px 0 #fff inset;
325
+ box-shadow : 0 1px 0 #fff inset;
326
+ background-color: #eee;
327
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
328
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
329
+ background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
330
+ background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
331
+ background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
332
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
333
+ -webkit-border-bottom-left-radius : 0;
334
+ -webkit-border-bottom-right-radius: 0;
335
+ -moz-border-radius-bottomleft : 0;
336
+ -moz-border-radius-bottomright: 0;
337
+ border-bottom-left-radius : 0;
338
+ border-bottom-right-radius: 0;
339
+ }
340
+ .chzn-container-active .chzn-single-with-drop div {
341
+ background: transparent;
342
+ border-left: none;
343
+ }
344
+ .chzn-container-active .chzn-single-with-drop div b {
345
+ background-position: -18px 1px;
346
+ }
347
+ .chzn-container-active .chzn-choices {
348
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
349
+ -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
350
+ box-shadow : 0 0 5px rgba(0,0,0,.3);
351
+ border: 1px solid #5897fb;
352
+ }
353
+ .chzn-container-active .chzn-choices .search-field input {
354
+ color: #111 !important;
355
+ }
356
+ /* @end */
357
+
358
+ /* @group Disabled Support */
359
+ .chzn-disabled {
360
+ cursor: default;
361
+ opacity:0.5 !important;
362
+ }
363
+ .chzn-disabled .chzn-single {
364
+ cursor: default;
365
+ }
366
+ .chzn-disabled .chzn-choices .search-choice .search-choice-close {
367
+ cursor: default;
368
+ }
369
+
370
+ /* @group Right to Left */
371
+ .chzn-rtl { text-align: right; }
372
+ .chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
373
+ .chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
374
+
375
+ .chzn-rtl .chzn-single div { left: 3px; right: auto; }
376
+ .chzn-rtl .chzn-single abbr {
377
+ left: 26px;
378
+ right: auto;
379
+ }
380
+ .chzn-rtl .chzn-choices .search-field input { direction: rtl; }
381
+ .chzn-rtl .chzn-choices li { float: right; }
382
+ .chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
383
+ .chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; background-position: right top;}
384
+ .chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
385
+ .chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
386
+ .chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
387
+ .chzn-rtl .chzn-search input {
388
+ background: #fff url('chosen-sprite.png') no-repeat -38px -22px;
389
+ background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
390
+ background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
391
+ background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
392
+ background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
393
+ background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(#eeeeee 1%, #ffffff 15%);
394
+ padding: 4px 5px 4px 20px;
395
+ direction: rtl;
396
+ }
397
+ /* @end */
templates/admin/export.css ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Tabbed navigation */
2
+
3
+ #woo-ce h2 .nav-tab {
4
+ font-size: 16px;
5
+ margin-right:0;
6
+ }
7
+ #woo-ce h2.nav-tab-wrapper {
8
+ padding-left:7px;
9
+ }
10
+
11
+ /* Overview */
12
+
13
+ #woo-ce .overview-left {
14
+ float:left;
15
+ width:73%;
16
+ }
17
+ #woo-ce .overview-right {
18
+ float:left;
19
+ width:24%;
20
+ }
21
+ #woo-ce .overview-right h3 {
22
+ font-size:16px;
23
+ }
24
+ #woo-ce .overview-right h3 span {
25
+ float:right;
26
+ font-size:11px;
27
+ font-weight:normal;
28
+ }
29
+ #woo-ce .overview-right p {
30
+ font-size:12px;
31
+ color:#333;
32
+ line-height:1.6em;
33
+ }
34
+ #woo-ce .overview-right ul {
35
+ font-size:12px;
36
+ line-height:1.2em;
37
+ }
38
+
39
+ /* Export */
40
+
41
+ #woo-ce #export-type th {
42
+ padding:0;
43
+ }
44
+ #woo-ce #export-type td {
45
+ padding:0;
46
+ }
47
+ #woo-ce .postbox .submit {
48
+ padding:0.3em 0;
49
+ }
50
+ #woo-ce textarea#export_log {
51
+ font:12px Consolas, Monaco, Courier, monospace;
52
+ width:100%;
53
+ height:200px;
54
+ }
55
+ #woo-ce #export_sheet {
56
+ overflow: scroll;
57
+ margin-bottom:1em;
58
+ }
59
+ #woo-ce #export_sheet table {
60
+ width:100%;
61
+ }
62
+
63
+ #woo-ce .separator {
64
+ border-bottom:1px solid #dfdfdf;
65
+ }
66
+ #woo-ce .woo_vm_version_table .export_module {
67
+ background-color:#fff;
68
+ padding:0.2em 0 0 0.5em;
69
+ }
70
+ #woo-ce .woo_vm_version_table .dashicons {
71
+ color:#666;
72
+ }
73
+ #woo-ce .woo_vm_version_table .status {
74
+ width:80px;
75
+ }
76
+
77
+ /* Settings */
78
+
79
+ #woo-ce .auto_method_options li.ftp-options label {
80
+ display:inline-block;
81
+ width:120px;
82
+ }
83
+
84
+ /* Support - Donate / Rate */
85
+
86
+ #woo-ce .support-donate_rate {
87
+ display:block;
88
+ float:right;
89
+ }
90
+ #woo-ce .support-donate_rate p {
91
+ margin-top:16px;
92
+ }
93
+ #woo-ce .support-donate_rate .star {
94
+ vertical-align:bottom;
95
+ display:inline-block;
96
+ width:17px;
97
+ height:17px;
98
+ background:url('images/star.png') no-repeat;
99
+ }
100
+ #woo-ce .support-donate_rate span {
101
+ display:none;
102
+ }
templates/admin/export.js ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var $j = jQuery.noConflict();
2
+ $j(function() {
3
+
4
+ // This controls the Skip Overview link on the Overview screen
5
+ $j('#skip_overview').click(function(){
6
+ $j('#skip_overview_form').submit();
7
+ });
8
+
9
+ // Date Picker
10
+ if( $j.isFunction($j.fn.datepicker) ) {
11
+ $j('.datepicker').datepicker({
12
+ dateFormat: 'dd/mm/yy'
13
+ });
14
+ }
15
+
16
+ // Chosen
17
+ if( $j.isFunction($j.fn.chosen) ) {
18
+ $j(".chzn-select").chosen({
19
+ search_contains: true
20
+ });
21
+ }
22
+
23
+ // Sortable export columns
24
+ if( $j.isFunction($j.fn.sortable) ) {
25
+ $j('table.ui-sortable').sortable({
26
+ items:'tr',
27
+ cursor:'move',
28
+ axis:'y',
29
+ handle: 'td',
30
+ scrollSensitivity:40,
31
+ helper:function(e,ui){
32
+ ui.children().each(function(){
33
+ jQuery(this).width(jQuery(this).width());
34
+ });
35
+ ui.css('left', '0');
36
+ return ui;
37
+ },
38
+ start:function(event,ui){
39
+ ui.item.css('background-color','#f6f6f6');
40
+ },
41
+ stop:function(event,ui){
42
+ ui.item.removeAttr('style');
43
+ field_row_indexes(this);
44
+ }
45
+ });
46
+
47
+ function field_row_indexes(obj) {
48
+ rows = $j(obj).find('tr');
49
+ $j(rows).each(function(index, el){
50
+ $j('input.field_order', el).val( parseInt( $j(el).index() ) );
51
+ });
52
+ };
53
+ }
54
+
55
+ // Select all field options for this export type
56
+ $j('.checkall').click(function () {
57
+ $j(this).closest('.postbox').find(':checkbox').attr('checked', true);
58
+ });
59
+ // Unselect all field options for this export type
60
+ $j('.uncheckall').click(function () {
61
+ $j(this).closest('.postbox').find(':checkbox').attr('checked', false);
62
+ });
63
+
64
+ $j('.export-types').hide();
65
+ $j('.export-options').hide();
66
+
67
+ // Categories
68
+ $j('#export-products-filters-categories').hide();
69
+ if( $j('#products-filters-categories').attr('checked') ) {
70
+ $j('#export-products-filters-categories').show();
71
+ }
72
+ // Tags
73
+ $j('#export-products-filters-tags').hide();
74
+ if( $j('#products-filters-tags').attr('checked') ) {
75
+ $j('#export-products-filters-tags').show();
76
+ }
77
+ // Brands
78
+ $j('#export-products-filters-brands').hide();
79
+ if( $j('#products-filters-brands').attr('checked') ) {
80
+ $j('#export-products-filters-brands').show();
81
+ }
82
+ // Product Status
83
+ $j('#export-products-filters-status').hide();
84
+ if( $j('#products-filters-status').attr('checked') ) {
85
+ $j('#export-products-filters-status').show();
86
+ }
87
+ $j('#export-products-filters-type').hide();
88
+ if( $j('#products-filters-type').attr('checked') ) {
89
+ $j('#export-products-filters-type').show();
90
+ }
91
+ $j('#export-products-filters-stock').hide();
92
+ if( $j('#products-filters-stock').attr('checked') ) {
93
+ $j('#export-products-filters-stock').show();
94
+ }
95
+
96
+ $j('#export-category').hide();
97
+
98
+ $j('#export-tag').hide();
99
+
100
+ $j('#export-brand').hide();
101
+
102
+ $j('#export-order').hide();
103
+ $j('#export-orders-filters-status').hide();
104
+ if( $j('#orders-filters-status').attr('checked') ) {
105
+ $j('#export-orders-filters-status').show();
106
+ }
107
+ $j('#export-orders-filters-date').hide();
108
+ if( $j('#orders-filters-date').attr('checked') ) {
109
+ $j('#export-orders-filters-date').show();
110
+ }
111
+ $j('#export-orders-filters-customer').hide();
112
+ if( $j('#orders-filters-customer').attr('checked') ) {
113
+ $j('#export-orders-filters-customer').show();
114
+ }
115
+ $j('#export-orders-filters-user_role').hide();
116
+ if( $j('#orders-filters-user_role').attr('checked') ) {
117
+ $j('#export-orders-filters-user_role').show();
118
+ }
119
+ $j('#export-orders-filters-coupon').hide();
120
+ if( $j('#orders-filters-coupon').attr('checked') ) {
121
+ $j('#export-orders-filters-coupon').show();
122
+ }
123
+ $j('#export-orders-filters-category').hide();
124
+ if( $j('#orders-filters-category').attr('checked') ) {
125
+ $j('#export-orders-filters-category').show();
126
+ }
127
+ $j('#export-orders-filters-tag').hide();
128
+ if( $j('#orders-filters-tag').attr('checked') ) {
129
+ $j('#export-orders-filters-tag').show();
130
+ }
131
+
132
+ $j('#export-customers-filters-status').hide();
133
+ if( $j('#customers-filters-status').attr('checked') ) {
134
+ $j('#export-customers-filters-status').show();
135
+ }
136
+ $j('#export-customer').hide();
137
+ $j('#export-user').hide();
138
+ $j('#export-coupon').hide();
139
+ $j('#export-subscription').hide();
140
+ $j('#export-product_vendor').hide();
141
+ $j('#export-shipping_class').hide();
142
+ $j('#export-attribute').hide();
143
+
144
+ $j('#products-filters-categories').click(function(){
145
+ $j('#export-products-filters-categories').toggle();
146
+ });
147
+ $j('#products-filters-tags').click(function(){
148
+ $j('#export-products-filters-tags').toggle();
149
+ });
150
+ $j('#products-filters-status').click(function(){
151
+ $j('#export-products-filters-status').toggle();
152
+ });
153
+ $j('#products-filters-type').click(function(){
154
+ $j('#export-products-filters-type').toggle();
155
+ });
156
+ $j('#products-filters-stock').click(function(){
157
+ $j('#export-products-filters-stock').toggle();
158
+ });
159
+
160
+ $j('#orders-filters-date').click(function(){
161
+ $j('#export-orders-filters-date').toggle();
162
+ });
163
+ $j('#orders-filters-status').click(function(){
164
+ $j('#export-orders-filters-status').toggle();
165
+ });
166
+ $j('#orders-filters-customer').click(function(){
167
+ $j('#export-orders-filters-customer').toggle();
168
+ });
169
+ $j('#orders-filters-user_role').click(function(){
170
+ $j('#export-orders-filters-user_role').toggle();
171
+ });
172
+ $j('#orders-filters-coupon').click(function(){
173
+ $j('#export-orders-filters-coupon').toggle();
174
+ });
175
+ $j('#orders-filters-category').click(function(){
176
+ $j('#export-orders-filters-category').toggle();
177
+ });
178
+ $j('#orders-filters-tag').click(function(){
179
+ $j('#export-orders-filters-tag').toggle();
180
+ });
181
+
182
+ $j('#customers-filters-status').click(function(){
183
+ $j('#export-customers-filters-status').toggle();
184
+ });
185
+
186
+ // Export types
187
+ $j('#product').click(function(){
188
+ $j('.export-types').hide();
189
+ $j('#export-product').show();
190
+
191
+ $j('.export-options').hide();
192
+ $j('.product-options').show();
193
+ });
194
+ $j('#category').click(function(){
195
+ $j('.export-types').hide();
196
+ $j('#export-category').show();
197
+
198
+ $j('.export-options').hide();
199
+ $j('.category-options').show();
200
+ });
201
+ $j('#tag').click(function(){
202
+ $j('.export-types').hide();
203
+ $j('#export-tag').show();
204
+
205
+ $j('.export-options').hide();
206
+ $j('.tag-options').show();
207
+ });
208
+ $j('#brand').click(function(){
209
+ $j('.export-types').hide();
210
+ $j('#export-brand').show();
211
+
212
+ $j('.export-options').hide();
213
+ $j('.brand-options').show();
214
+ });
215
+ $j('#order').click(function(){
216
+ $j('.export-types').hide();
217
+ $j('#export-order').show();
218
+
219
+ $j('.export-options').hide();
220
+ $j('.order-options').show();
221
+ });
222
+ $j('#customer').click(function(){
223
+ $j('.export-types').hide();
224
+ $j('#export-customer').show();
225
+
226
+ $j('.export-options').hide();
227
+ $j('.customer-options').show();
228
+ });
229
+ $j('#user').click(function(){
230
+ $j('.export-types').hide();
231
+ $j('#export-user').show();
232
+
233
+ $j('.export-options').hide();
234
+ $j('.user-options').show();
235
+ });
236
+ $j('#coupon').click(function(){
237
+ $j('.export-types').hide();
238
+ $j('#export-coupon').show();
239
+
240
+ $j('.export-options').hide();
241
+ $j('.coupon-options').show();
242
+ });
243
+ $j('#subscription').click(function(){
244
+ $j('.export-types').hide();
245
+ $j('#export-subscription').show();
246
+
247
+ $j('.export-options').hide();
248
+ $j('.subscription-options').show();
249
+ });
250
+ $j('#product_vendor').click(function(){
251
+ $j('.export-types').hide();
252
+ $j('#export-product_vendor').show();
253
+
254
+ $j('.export-options').hide();
255
+ $j('.product_vendor-options').show();
256
+ });
257
+ $j('#shipping_class').click(function(){
258
+ $j('.export-types').hide();
259
+ $j('#export-shipping_class').show();
260
+
261
+ $j('.export-options').hide();
262
+ $j('.shipping_class-options').show();
263
+ });
264
+ $j('#attribute').click(function(){
265
+ $j('.export-types').hide();
266
+ $j('#export-attribute').show();
267
+
268
+ $j('.export-options').hide();
269
+ $j('.attribute-options').show();
270
+ });
271
+
272
+ // Export button
273
+ $j('#export_product').click(function(){
274
+ $j('input:radio[name=dataset]:nth(0)').attr('checked',true);
275
+ });
276
+ $j('#export_category').click(function(){
277
+ $j('input:radio[name=dataset]:nth(1)').attr('checked',true);
278
+ });
279
+ $j('#export_tag').click(function(){
280
+ $j('input:radio[name=dataset]:nth(2)').attr('checked',true);
281
+ });
282
+ $j('#export_brand').click(function(){
283
+ $j('input:radio[name=dataset]:nth(3)').attr('checked',true);
284
+ });
285
+ $j('#export_order').click(function(){
286
+ $j('input:radio[name=dataset]:nth(4)').attr('checked',true);
287
+ });
288
+ $j('#export_customer').click(function(){
289
+ $j('input:radio[name=dataset]:nth(5)').attr('checked',true);
290
+ });
291
+ $j('#export_user').click(function(){
292
+ $j('input:radio[name=dataset]:nth(6)').attr('checked',true);
293
+ });
294
+ $j('#export_coupon').click(function(){
295
+ $j('input:radio[name=dataset]:nth(7)').attr('checked',true);
296
+ });
297
+ $j('#export_subscription').click(function(){
298
+ $j('input:radio[name=dataset]:nth(8)').attr('checked',true);
299
+ });
300
+ $j('#export_product_vendor').click(function(){
301
+ $j('input:radio[name=dataset]:nth(9)').attr('checked',true);
302
+ });
303
+ $j('#export_shipping_class').click(function(){
304
+ $j('input:radio[name=dataset]:nth(10)').attr('checked',true);
305
+ });
306
+ $j('#export_attribute').click(function(){
307
+ $j('input:radio[name=dataset]:nth(11)').attr('checked',true);
308
+ });
309
+
310
+ $j("#auto_type").change(function () {
311
+ var type = $j('select[name=auto_type]').val();
312
+ $j('.auto_type_options .export-options').hide();
313
+ $j('.auto_type_options .'+type+'-options').show();
314
+ });
315
+
316
+ $j("#auto_method").change(function () {
317
+ var type = $j('select[name=auto_method]').val();
318
+ $j('.auto_method_options .export-options').hide();
319
+ $j('.auto_method_options .'+type+'-options').show();
320
+ });
321
+
322
+ $j(document).ready(function() {
323
+ // This auto-selects the export type based on the link from the Overview screen
324
+ var href = jQuery(location).attr('href');
325
+ // If this is the Export tab
326
+ if (href.toLowerCase().indexOf('tab=export') >= 0) {
327
+ // If the URL includes an in-line link
328
+ if (href.toLowerCase().indexOf('#') >= 0 ) {
329
+ var type = href.substr(href.indexOf("#") + 1);
330
+ var type = type.replace('export-','');
331
+ $j('#'+type).trigger('click');
332
+ } else {
333
+ // This auto-selects the last known export type based on stored WordPress option, defaults to Products
334
+ var type = $j('input:radio[name=dataset]:checked').val();
335
+ $j('#'+type).trigger('click');
336
+ }
337
+ } else if (href.toLowerCase().indexOf('tab=settings') >= 0) {
338
+ $j("#auto_type").trigger("change");
339
+ $j("#auto_method").trigger("change");
340
+ } else {
341
+ // This auto-selects the last known export type based on stored WordPress option, defaults to Products
342
+ var type = $j('input:radio[name=dataset]:checked').val();
343
+ $j('#'+type).trigger('click');
344
+ }
345
+ });
346
+
347
+ });
templates/admin/images/animated-overlay.gif ADDED
Binary file
templates/admin/images/progress.gif ADDED
Binary file
templates/admin/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
templates/admin/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
templates/admin/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
templates/admin/images/ui-icons_222222_256x240.png ADDED
Binary file
templates/admin/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
templates/admin/images/ui-icons_454545_256x240.png ADDED
Binary file
templates/admin/images/ui-icons_888888_256x240.png ADDED
Binary file
templates/admin/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
templates/admin/jquery-csvtable.css ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSV Table Classes */
2
+ TABLE.CSVTable {
3
+ font: 0.8em Verdana,Arial,Geneva,Helvetica,sans-serif;
4
+ border-collapse: collapse;
5
+ width: 450px;
6
+ }
7
+
8
+ /* Header */
9
+ TABLE.CSVTable THEAD TR {
10
+ background: #E8EDFF;
11
+ }
12
+ TABLE.CSVTable TH {
13
+ font-family: "Lucida Sans Unicode","Lucida Grande",Sans-Serif;
14
+ font-size: 1.2em;
15
+ }
16
+
17
+ /* Table Cells */
18
+ TABLE.CSVTable TD, TABLE.CSVTable TH {
19
+ padding: 8px;
20
+ text-align: left;
21
+ border-bottom: 1px solid #FFFFFF;
22
+ border-top: 1px solid transparent;
23
+ }
24
+ /* Default background color for rows */
25
+ TABLE.CSVTable TR {
26
+ background: #F0F0F0;
27
+ }
28
+ /* Background color for odd rows */
29
+ TABLE.CSVTable TR.odd {
30
+ background: #F9F9F9;
31
+ }
32
+ /* Hover color for all rows */
33
+ TABLE.CSVTable TR:hover {
34
+ background: #E8EDFF;
35
+ }
36
+
37
+ /* Source code */
38
+ .source {
39
+ background-color: #FAFAFA; border: 1px solid #999999
40
+ }
templates/admin/jquery-ui-datepicker.css ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI CSS Framework
3
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
4
+ * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
5
+ */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden { display: none; }
10
+ .ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
11
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
12
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
13
+ .ui-helper-clearfix { display: inline-block; }
14
+ /* required comment for clearfix to work in Opera \*/
15
+ * html .ui-helper-clearfix { height:1%; }
16
+ .ui-helper-clearfix { display:block; }
17
+ /* end clearfix */
18
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
19
+
20
+
21
+ /* Interaction Cues
22
+ ----------------------------------*/
23
+ .ui-state-disabled { cursor: default !important; }
24
+
25
+
26
+ /* Icons
27
+ ----------------------------------*/
28
+
29
+ /* states and images */
30
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
31
+
32
+
33
+ /* Misc visuals
34
+ ----------------------------------*/
35
+
36
+ /* Overlays */
37
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
38
+
39
+
40
+
41
+ /*
42
+ * jQuery UI CSS Framework
43
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
44
+ * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
45
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
46
+ */
47
+
48
+
49
+ /* Component containers
50
+ ----------------------------------*/
51
+ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
52
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
53
+ .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
54
+ .ui-widget-content a { color: #222222; }
55
+ .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
56
+ .ui-widget-header a { color: #222222; }
57
+
58
+ /* Interaction states
59
+ ----------------------------------*/
60
+ .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; outline: none; }
61
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; outline: none; }
62
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; }
63
+ .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; outline: none; }
64
+ .ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; }
65
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; outline: none; text-decoration: none; }
66
+
67
+ /* Interaction Cues
68
+ ----------------------------------*/
69
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
70
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; }
71
+ .ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
72
+ .ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; }
73
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; }
74
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
75
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
76
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
77
+
78
+ /* Icons
79
+ ----------------------------------*/
80
+
81
+ /* states and images */
82
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
83
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
84
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
85
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
86
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
87
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
88
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
89
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
90
+
91
+ /* positioning */
92
+ .ui-icon-carat-1-n { background-position: 0 0; }
93
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
94
+ .ui-icon-carat-1-e { background-position: -32px 0; }
95
+ .ui-icon-carat-1-se { background-position: -48px 0; }
96
+ .ui-icon-carat-1-s { background-position: -64px 0; }
97
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
98
+ .ui-icon-carat-1-w { background-position: -96px 0; }
99
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
100
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
101
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
102
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
103
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
104
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
105
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
106
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
107
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
108
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
109
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
110
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
111
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
112
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
113
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
114
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
115
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
116
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
117
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
118
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
119
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
120
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
121
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
122
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
123
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
124
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
125
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
126
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
127
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
128
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
129
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
130
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
131
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
132
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
133
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
134
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
135
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
136
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
137
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
138
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
139
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
140
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
141
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
142
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
143
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
144
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
145
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
146
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
147
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
148
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
149
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
150
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
151
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
152
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
153
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
154
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
155
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
156
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
157
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
158
+ .ui-icon-extlink { background-position: -32px -80px; }
159
+ .ui-icon-newwin { background-position: -48px -80px; }
160
+ .ui-icon-refresh { background-position: -64px -80px; }
161
+ .ui-icon-shuffle { background-position: -80px -80px; }
162
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
163
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
164
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
165
+ .ui-icon-folder-open { background-position: -16px -96px; }
166
+ .ui-icon-document { background-position: -32px -96px; }
167
+ .ui-icon-document-b { background-position: -48px -96px; }
168
+ .ui-icon-note { background-position: -64px -96px; }
169
+ .ui-icon-mail-closed { background-position: -80px -96px; }
170
+ .ui-icon-mail-open { background-position: -96px -96px; }
171
+ .ui-icon-suitcase { background-position: -112px -96px; }
172
+ .ui-icon-comment { background-position: -128px -96px; }
173
+ .ui-icon-person { background-position: -144px -96px; }
174
+ .ui-icon-print { background-position: -160px -96px; }
175
+ .ui-icon-trash { background-position: -176px -96px; }
176
+ .ui-icon-locked { background-position: -192px -96px; }
177
+ .ui-icon-unlocked { background-position: -208px -96px; }
178
+ .ui-icon-bookmark { background-position: -224px -96px; }
179
+ .ui-icon-tag { background-position: -240px -96px; }
180
+ .ui-icon-home { background-position: 0 -112px; }
181
+ .ui-icon-flag { background-position: -16px -112px; }
182
+ .ui-icon-calendar { background-position: -32px -112px; }
183
+ .ui-icon-cart { background-position: -48px -112px; }
184
+ .ui-icon-pencil { background-position: -64px -112px; }
185
+ .ui-icon-clock { background-position: -80px -112px; }
186
+ .ui-icon-disk { background-position: -96px -112px; }
187
+ .ui-icon-calculator { background-position: -112px -112px; }
188
+ .ui-icon-zoomin { background-position: -128px -112px; }
189
+ .ui-icon-zoomout { background-position: -144px -112px; }
190
+ .ui-icon-search { background-position: -160px -112px; }
191
+ .ui-icon-wrench { background-position: -176px -112px; }
192
+ .ui-icon-gear { background-position: -192px -112px; }
193
+ .ui-icon-heart { background-position: -208px -112px; }
194
+ .ui-icon-star { background-position: -224px -112px; }
195
+ .ui-icon-link { background-position: -240px -112px; }
196
+ .ui-icon-cancel { background-position: 0 -128px; }
197
+ .ui-icon-plus { background-position: -16px -128px; }
198
+ .ui-icon-plusthick { background-position: -32px -128px; }
199
+ .ui-icon-minus { background-position: -48px -128px; }
200
+ .ui-icon-minusthick { background-position: -64px -128px; }
201
+ .ui-icon-close { background-position: -80px -128px; }
202
+ .ui-icon-closethick { background-position: -96px -128px; }
203
+ .ui-icon-key { background-position: -112px -128px; }
204
+ .ui-icon-lightbulb { background-position: -128px -128px; }
205
+ .ui-icon-scissors { background-position: -144px -128px; }
206
+ .ui-icon-clipboard { background-position: -160px -128px; }
207
+ .ui-icon-copy { background-position: -176px -128px; }
208
+ .ui-icon-contact { background-position: -192px -128px; }
209
+ .ui-icon-image { background-position: -208px -128px; }
210
+ .ui-icon-video { background-position: -224px -128px; }
211
+ .ui-icon-script { background-position: -240px -128px; }
212
+ .ui-icon-alert { background-position: 0 -144px; }
213
+ .ui-icon-info { background-position: -16px -144px; }
214
+ .ui-icon-notice { background-position: -32px -144px; }
215
+ .ui-icon-help { background-position: -48px -144px; }
216
+ .ui-icon-check { background-position: -64px -144px; }
217
+ .ui-icon-bullet { background-position: -80px -144px; }
218
+ .ui-icon-radio-off { background-position: -96px -144px; }
219
+ .ui-icon-radio-on { background-position: -112px -144px; }
220
+ .ui-icon-pin-w { background-position: -128px -144px; }
221
+ .ui-icon-pin-s { background-position: -144px -144px; }
222
+ .ui-icon-play { background-position: 0 -160px; }
223
+ .ui-icon-pause { background-position: -16px -160px; }
224
+ .ui-icon-seek-next { background-position: -32px -160px; }
225
+ .ui-icon-seek-prev { background-position: -48px -160px; }
226
+ .ui-icon-seek-end { background-position: -64px -160px; }
227
+ .ui-icon-seek-first { background-position: -80px -160px; }
228
+ .ui-icon-stop { background-position: -96px -160px; }
229
+ .ui-icon-eject { background-position: -112px -160px; }
230
+ .ui-icon-volume-off { background-position: -128px -160px; }
231
+ .ui-icon-volume-on { background-position: -144px -160px; }
232
+ .ui-icon-power { background-position: 0 -176px; }
233
+ .ui-icon-signal-diag { background-position: -16px -176px; }
234
+ .ui-icon-signal { background-position: -32px -176px; }
235
+ .ui-icon-battery-0 { background-position: -48px -176px; }
236
+ .ui-icon-battery-1 { background-position: -64px -176px; }
237
+ .ui-icon-battery-2 { background-position: -80px -176px; }
238
+ .ui-icon-battery-3 { background-position: -96px -176px; }
239
+ .ui-icon-circle-plus { background-position: 0 -192px; }
240
+ .ui-icon-circle-minus { background-position: -16px -192px; }
241
+ .ui-icon-circle-close { background-position: -32px -192px; }
242
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
243
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
244
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
245
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
246
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
247
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
248
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
249
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
250
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
251
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
252
+ .ui-icon-circle-check { background-position: -208px -192px; }
253
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
254
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
255
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
256
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
257
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
258
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
259
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
260
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
261
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
262
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
263
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
264
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
265
+
266
+
267
+ /* Misc visuals
268
+ ----------------------------------*/
269
+
270
+ /* Corner radius */
271
+ .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; }
272
+ .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
273
+ .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
274
+ .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
275
+ .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
276
+ .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
277
+ .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
278
+ .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
279
+ .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; }
280
+
281
+ /* Overlays */
282
+ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
283
+ .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Datepicker
284
+ ----------------------------------*/
285
+ .ui-datepicker { width: 17em; padding: .2em .2em 0; }
286
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
287
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
288
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
289
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
290
+ .ui-datepicker .ui-datepicker-next { right:2px; }
291
+ .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
292
+ .ui-datepicker .ui-datepicker-next-hover { right:1px; }
293
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
294
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
295
+ .ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
296
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
297
+ .ui-datepicker select.ui-datepicker-month,
298
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
299
+ .ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
300
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
301
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
302
+ .ui-datepicker td { border: 0; padding: 1px; }
303
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
304
+ .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
305
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
306
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
307
+
308
+ /* with multiple calendars */
309
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
310
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
311
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
312
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
313
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
314
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
315
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
316
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
317
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
318
+ .ui-datepicker-row-break { clear:both; width:100%; }
319
+
320
+ /* RTL support */
321
+ .ui-datepicker-rtl { direction: rtl; }
322
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
323
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
324
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
325
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
326
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
327
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
328
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
329
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
330
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
331
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
332
+
333
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
334
+ .ui-datepicker-cover {
335
+ display: none; /*sorry for IE5*/
336
+ display/**/: block; /*sorry for IE5*/
337
+ position: absolute; /*must have*/
338
+ z-index: -1; /*must have*/
339
+ filter: mask(); /*must have*/
340
+ top: -4px; /*must have*/
341
+ left: -4px; /*must have*/
342
+ width: 200px; /*must have*/
343
+ height: 200px; /*must have*/
344
+ }
345
+
346
+ /* Icon Cursor Mouseover */
347
+ img.ui-datepicker-trigger { cursor:pointer; }
templates/admin/media-csv_file.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="postbox-container">
2
+ <div class="postbox">
3
+ <h3 class="hndle"><?php _e( 'Export File', 'woo_ce' ); ?></h3>
4
+ <div class="inside">
5
+ <textarea style="font:12px Consolas, Monaco, Courier, monospace; width:100%; height:200px;"><?php echo esc_textarea( $contents ); ?></textarea>
6
+ </div>
7
+ <!-- .inside -->
8
+ </div>
9
+ <!-- .postbox -->
10
+
11
+ </div>
12
+ <!-- .postbox-container -->
templates/admin/media-export_details.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table class="widefat" style="font-family:monospace;">
2
+ <thead>
3
+
4
+ <tr>
5
+ <th colspan="2"><?php _e( 'Export Details', 'woo_ce' ); ?></th>
6
+ </tr>
7
+
8
+ </thead>
9
+ <tbody>
10
+
11
+ <tr>
12
+ <th style="width:20%;"><?php _e( 'Export type', 'woo_ce' ); ?></th>
13
+ <td><?php echo woo_ce_export_type_label( $export_type ); ?></td>
14
+ </tr>
15
+ <tr>
16
+ <th><?php _e( 'Filepath', 'woo_ce' ); ?></th>
17
+ <td><?php echo $filepath; ?></td>
18
+ </tr>
19
+ <tr>
20
+ <th><?php _e( 'Total columns', 'woo_ce' ); ?></th>
21
+ <td><?php echo ( ( $columns != false ) ? $columns : '-' ); ?></td>
22
+ </tr>
23
+ <tr>
24
+ <th><?php _e( 'Total rows', 'woo_ce' ); ?></th>
25
+ <td><?php echo ( ( $rows != false ) ? $rows : '-' ); ?></td>
26
+ </tr>
27
+ <tr>
28
+ <th><?php _e( 'Process time', 'woo_ce' ); ?></th>
29
+ <td><?php echo ( ( ( $start_time != false ) && ( $end_time != false ) ) ? woo_ce_display_time_elapsed( $start_time, $end_time ) : '-' ); ?></td>
30
+ </tr>
31
+ <tr>
32
+ <th><?php _e( 'Idle memory usage (start)', 'woo_ce' ); ?></th>
33
+ <td><?php echo ( ( $idle_memory_start != false ) ? woo_ce_display_memory( $idle_memory_start ) : '-' ); ?></td>
34
+ </tr>
35
+ <tr>
36
+ <th><?php _e( 'Memory usage prior to loading export type', 'woo_ce' ); ?></th>
37
+ <td><?php echo ( ( $data_memory_start != false ) ? woo_ce_display_memory( $data_memory_start ) : '-' ); ?></td>
38
+ </tr>
39
+ <tr>
40
+ <th><?php _e( 'Memory usage after loading export type', 'woo_ce' ); ?></th>
41
+ <td><?php echo ( ( $data_memory_end != false ) ? woo_ce_display_memory( $data_memory_end ) : '-' ); ?></td>
42
+ </tr>
43
+ <tr>
44
+ <th><?php _e( 'Memory usage at render time', 'woo_ce' ); ?></th>
45
+ <td>-</td>
46
+ </tr>
47
+ <tr>
48
+ <th><?php _e( 'Idle memory usage (end)', 'woo_ce' ); ?></th>
49
+ <td><?php echo ( ( $idle_memory_end != false ) ? woo_ce_display_memory( $idle_memory_end ) : '-' ); ?></td>
50
+ </tr>
51
+
52
+ </tbody>
53
+ </table>
54
+ <br />
templates/admin/tabs-archive.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="subsubsub">
2
+ <li><a href="<?php echo add_query_arg( 'filter', null ); ?>"<?php woo_ce_archives_quicklink_current( 'all' ); ?>><?php _e( 'All', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count(); ?>)</span></a> |</li>
3
+ <li><a href="<?php echo add_query_arg( 'filter', 'product' ); ?>"<?php woo_ce_archives_quicklink_current( 'product' ); ?>><?php _e( 'Products', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'product' ); ?>)</span></a> |</li>
4
+ <li><a href="<?php echo add_query_arg( 'filter', 'category' ); ?>"<?php woo_ce_archives_quicklink_current( 'category' ); ?>><?php _e( 'Categories', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'category' ); ?>)</span></a> |</li>
5
+ <li><a href="<?php echo add_query_arg( 'filter', 'tag' ); ?>"<?php woo_ce_archives_quicklink_current( 'tag' ); ?>><?php _e( 'Tags', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'tag' ); ?>)</span></a> |</li>
6
+ <li><?php _e( 'Brands', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'brand' ); ?>)</span> |</li>
7
+ <li><?php _e( 'Orders', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'order' ); ?>)</span> |</li>
8
+ <li><?php _e( 'Customers', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'customer' ); ?>)</span> |</li>
9
+ <li><a href="<?php echo add_query_arg( 'filter', 'user' ); ?>"<?php woo_ce_archives_quicklink_current( 'user' ); ?>><?php _e( 'Users', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'user' ); ?>)</span></a> |</li>
10
+ <li><?php _e( 'Coupon', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'coupon' ); ?>)</span> |</li>
11
+ <li><?php _e( 'Subscriptions', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'subscription' ); ?>)</span></li>
12
+ <li><?php _e( 'Product Vendors', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'product_vendor' ); ?>)</span> |</li>
13
+ <li><?php _e( 'Shipping Classes', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'shipping_class' ); ?>)</span> |</li>
14
+ <!-- <li><?php _e( 'Attributes', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'attribute' ); ?>)</span></li> -->
15
+ </ul>
16
+ <!-- .subsubsub -->
17
+ <br class="clear" />
18
+ <form action="" method="GET">
19
+ <table class="widefat fixed media" cellspacing="0">
20
+ <thead>
21
+
22
+ <tr>
23
+ <th scope="col" id="icon" class="manage-column column-icon"></th>
24
+ <th scope="col" id="title" class="manage-column column-title"><?php _e( 'Filename', 'woo_ce' ); ?></th>
25
+ <th scope="col" class="manage-column column-type"><?php _e( 'Type', 'woo_ce' ); ?></th>
26
+ <th scope="col" class="manage-column column-author"><?php _e( 'Author', 'woo_ce' ); ?></th>
27
+ <th scope="col" id="title" class="manage-column column-title"><?php _e( 'Date', 'woo_ce' ); ?></th>
28
+ </tr>
29
+
30
+ </thead>
31
+ <tfoot>
32
+
33
+ <tr>
34
+ <th scope="col" class="manage-column column-icon"></th>
35
+ <th scope="col" class="manage-column column-title"><?php _e( 'Filename', 'woo_ce' ); ?></th>
36
+ <th scope="col" class="manage-column column-type"><?php _e( 'Type', 'woo_ce' ); ?></th>
37
+ <th scope="col" class="manage-column column-author"><?php _e( 'Author', 'woo_ce' ); ?></th>
38
+ <th scope="col" class="manage-column column-title"><?php _e( 'Date', 'woo_ce' ); ?></th>
39
+ </tr>
40
+
41
+ </tfoot>
42
+ <tbody id="the-list">
43
+
44
+ <?php if( $files ) { ?>
45
+ <?php foreach( $files as $file ) { ?>
46
+ <tr id="post-<?php echo $file->ID; ?>" class="author-self status-<?php echo $file->post_status; ?>" valign="top">
47
+ <td class="column-icon media-icon">
48
+ <?php echo $file->media_icon; ?>
49
+ </td>
50
+ <td class="post-title page-title column-title">
51
+ <strong><a href="<?php echo $file->guid; ?>" class="row-title"><?php echo $file->post_title; ?></a></strong>
52
+ <div class="row-actions">
53
+ <span class="view"><a href="<?php echo get_edit_post_link( $file->ID ); ?>" title="<?php _e( 'Edit', 'woo_ce' ); ?>"><?php _e( 'Edit', 'woo_ce' ); ?></a></span> |
54
+ <span class="trash"><a href="<?php echo get_delete_post_link( $file->ID, '', true ); ?>" title="<?php _e( 'Delete Permanently', 'woo_ce' ); ?>"><?php _e( 'Delete', 'woo_ce' ); ?></a></span>
55
+ </div>
56
+ </td>
57
+ <td class="title">
58
+ <a href="<?php echo add_query_arg( 'filter', $file->export_type ); ?>"><?php echo $file->export_type_label; ?></a>
59
+ </td>
60
+ <td class="author column-author"><?php echo $file->post_author_name; ?></td>
61
+ <td class="date column-date"><?php echo $file->post_date; ?></td>
62
+ </tr>
63
+ <?php } ?>
64
+ <?php } else { ?>
65
+ <tr id="post-<?php echo $file->ID; ?>" class="author-self" valign="top">
66
+ <td colspan="3" class="colspanchange"><?php _e( 'No past exports were found.', 'woo_ce' ); ?></td>
67
+ </tr>
68
+ <?php } ?>
69
+
70
+ </tbody>
71
+ </table>
72
+ <div class="tablenav bottom">
73
+ <div class="tablenav-pages one-page">
74
+ <span class="displaying-num"><?php printf( __( '%d items', 'woo_ce' ), woo_ce_archives_quicklink_count() ); ?></span>
75
+ </div>
76
+ <!-- .tablenav-pages -->
77
+ <br class="clear">
78
+ </div>
79
+ <!-- .tablenav -->
80
+ </form>
templates/admin/tabs-export.php ADDED
@@ -0,0 +1,846 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="subsubsub">
2
+ <li><a href="#export-type"><?php _e( 'Export Type', 'woo_ce' ); ?></a> |</li>
3
+ <li><a href="#export-options"><?php _e( 'Export Options', 'woo_ce' ); ?></a></li>
4
+ <li>| <a href="#export-modules"><?php _e( 'Export Modules', 'woo_ce' ); ?></a></li>
5
+ <?php do_action( 'woo_ce_export_quicklinks' ); ?>
6
+ </ul>
7
+ <!-- .subsubsub -->
8
+ <br class="clear" />
9
+
10
+ <p><?php _e( 'Select an export type from the list below to export entries. Once you have selected an export type you may select the fields you would like to export and optional filters available for each export type. When you click the export button below, Store Exporter will create an export file for you to save to your computer.', 'woo_ce' ); ?></p>
11
+ <div id="poststuff">
12
+ <form method="post" action="<?php echo add_query_arg( array( 'failed' => null, 'empty' => null, 'message' => null ) ); ?>" id="postform">
13
+
14
+ <div id="export-type" class="postbox">
15
+ <h3 class="hndle"><?php _e( 'Export Type', 'woo_ce' ); ?></h3>
16
+ <div class="inside">
17
+ <p class="description"><?php _e( 'Select the data type you want to export.', 'woo_ce' ); ?></p>
18
+ <table class="form-table">
19
+
20
+ <tr>
21
+ <th>
22
+ <input type="radio" id="product" name="dataset" value="product"<?php disabled( $products, 0 ); ?><?php checked( $export_type, 'product' ); ?> />
23
+ <label for="product"><?php _e( 'Products', 'woo_ce' ); ?></label>
24
+ </th>
25
+ <td>
26
+ <span class="description">(<?php echo $products; ?>)</span>
27
+ </td>
28
+ </tr>
29
+
30
+ <tr>
31
+ <th>
32
+ <input type="radio" id="category" name="dataset" value="category"<?php disabled( $categories, 0 ); ?><?php checked( $export_type, 'category' ); ?> />
33
+ <label for="category"><?php _e( 'Categories', 'woo_ce' ); ?></label>
34
+ </th>
35
+ <td>
36
+ <span class="description">(<?php echo $categories; ?>)</span>
37
+ </td>
38
+ </tr>
39
+
40
+ <tr>
41
+ <th>
42
+ <input type="radio" id="tag" name="dataset" value="tag"<?php disabled( $tags, 0 ); ?><?php checked( $export_type, 'tag' ); ?> />
43
+ <label for="tag"><?php _e( 'Tags', 'woo_ce' ); ?></label>
44
+ </th>
45
+ <td>
46
+ <span class="description">(<?php echo $tags; ?>)</span>
47
+ </td>
48
+ </tr>
49
+
50
+ <tr>
51
+ <th>
52
+ <input type="radio" id="brand" name="dataset" value="brand"<?php disabled( $brands, 0 ); ?><?php checked( $export_type, 'brand' ); ?> />
53
+ <label for="brand"><?php _e( 'Brands', 'woo_ce' ); ?></label>
54
+ </th>
55
+ <td>
56
+ <span class="description">(<?php echo $brands; ?>)</span>
57
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
58
+ </td>
59
+ </tr>
60
+
61
+ <tr>
62
+ <th>
63
+ <input type="radio" id="order" name="dataset" value="order"<?php disabled( $orders, 0 ); ?><?php checked( $export_type, 'order' ); ?>/>
64
+ <label for="order"><?php _e( 'Orders', 'woo_ce' ); ?></label>
65
+ </th>
66
+ <td>
67
+ <span class="description">(<?php echo $orders; ?>)</span>
68
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
69
+ </td>
70
+ </tr>
71
+
72
+ <tr>
73
+ <th>
74
+ <input type="radio" id="customer" name="dataset" value="customer"<?php disabled( $customers, 0 ); ?><?php checked( $export_type, 'customer' ); ?>/>
75
+ <label for="customer"><?php _e( 'Customers', 'woo_ce' ); ?></label>
76
+ </th>
77
+ <td>
78
+ <span class="description">(<?php echo $customers; ?>)</span>
79
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
80
+ </td>
81
+ </tr>
82
+
83
+ <tr>
84
+ <th>
85
+ <input type="radio" id="user" name="dataset" value="user"<?php disabled( $users, 0 ); ?><?php checked( $export_type, 'user' ); ?>/>
86
+ <label for="user"><?php _e( 'Users', 'woo_ce' ); ?></label>
87
+ </th>
88
+ <td>
89
+ <span class="description">(<?php echo $users; ?>)</span>
90
+ </td>
91
+ </tr>
92
+
93
+ <tr>
94
+ <th>
95
+ <input type="radio" id="coupon" name="dataset" value="coupon"<?php disabled( $coupons, 0 ); ?><?php checked( $export_type, 'coupon' ); ?> />
96
+ <label for="coupon"><?php _e( 'Coupons', 'woo_ce' ); ?></label>
97
+ </th>
98
+ <td>
99
+ <span class="description">(<?php echo $coupons; ?>)</span>
100
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
101
+ </td>
102
+ </tr>
103
+
104
+ <tr>
105
+ <th>
106
+ <input type="radio" id="subscription" name="dataset" value="subscription"<?php disabled( $subscriptions, 0 ); ?><?php checked( $export_type, 'subscription' ); ?> />
107
+ <label for="subscription"><?php _e( 'Subscriptions', 'woo_ce' ); ?></label>
108
+ </th>
109
+ <td>
110
+ <span class="description">(<?php echo $subscriptions; ?>)</span>
111
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
112
+ </td>
113
+ </tr>
114
+
115
+ <tr>
116
+ <th>
117
+ <input type="radio" id="product_vendor" name="dataset" value="product_vendor"<?php disabled( $product_vendors, 0 ); ?><?php checked( $export_type, 'product_vendor' ); ?> />
118
+ <label for="product_vendor"><?php _e( 'Product Vendors', 'woo_ce' ); ?></label>
119
+ </th>
120
+ <td>
121
+ <span class="description">(<?php echo $product_vendors; ?>)</span>
122
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
123
+ </td>
124
+ </tr>
125
+
126
+ <tr>
127
+ <th>
128
+ <input type="radio" id="shipping_class" name="dataset" value="shipping_class"<?php disabled( $shipping_classes, 0 ); ?><?php checked( $export_type, 'shipping_class' ); ?> />
129
+ <label for="shipping_class"><?php _e( 'Shipping Classes', 'woo_ce' ); ?></label>
130
+ </th>
131
+ <td>
132
+ <span class="description">(<?php echo $shipping_classes; ?>)</span>
133
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
134
+ </td>
135
+ </tr>
136
+
137
+ <!--
138
+ <tr>
139
+ <th>
140
+ <input type="radio" id="attribute" name="dataset" value="attribute"<?php disabled( $attributes, 0 ); ?><?php checked( $export_type, 'attribute' ); ?> />
141
+ <label for="attribute"><?php _e( 'Attributes', 'woo_ce' ); ?></label>
142
+ </th>
143
+ <td>
144
+ <span class="description">(<?php echo $attributes; ?>)</span>
145
+ </td>
146
+ </tr>
147
+ -->
148
+
149
+ </table>
150
+ <!-- .form-table -->
151
+ </div>
152
+ <!-- .inside -->
153
+ </div>
154
+ <!-- .postbox -->
155
+
156
+ <?php if( $product_fields ) { ?>
157
+ <div id="export-product" class="export-types">
158
+
159
+ <div class="postbox">
160
+ <h3 class="hndle">
161
+ <?php _e( 'Product Fields', 'woo_ce' ); ?>
162
+ <a href="<?php echo add_query_arg( array( 'tab' => 'fields', 'type' => 'product' ) ); ?>" style="float:right;"><?php _e( 'Configure', 'woo_ce' ); ?></a>
163
+ </h3>
164
+ <div class="inside">
165
+ <?php if( $products ) { ?>
166
+ <p class="description"><?php _e( 'Select the Product fields you would like to export, your field selection is saved for future exports.', 'woo_ce' ); ?></p>
167
+ <p><a href="javascript:void(0)" id="product-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="product-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
168
+ <table id="product-fields" class="ui-sortable">
169
+
170
+ <?php foreach( $product_fields as $product_field ) { ?>
171
+ <tr>
172
+ <td>
173
+ <label>
174
+ <input type="checkbox" name="product_fields[<?php echo $product_field['name']; ?>]" class="product_field"<?php ( isset( $product_field['default'] ) ? checked( $product_field['default'], 1 ) : '' ); ?><?php disabled( $product_field['disabled'], 1 ); ?> />
175
+ <?php echo $product_field['label']; ?>
176
+ <?php if( $product_field['disabled'] ) { ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span><?php } ?>
177
+ <input type="hidden" name="product_fields_order[<?php echo $product_field['name']; ?>]" class="field_order" value="<?php echo $product_field['order']; ?>" />
178
+ </label>
179
+ </td>
180
+ </tr>
181
+
182
+ <?php } ?>
183
+ </table>
184
+ <p class="submit">
185
+ <input type="submit" id="export_product" value="<?php _e( 'Export Products', 'woo_ce' ); ?> " class="button-primary" />
186
+ </p>
187
+ <p class="description"><?php _e( 'Can\'t find a particular Product field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
188
+ <?php } else { ?>
189
+ <p><?php _e( 'No Products were found.', 'woo_ce' ); ?></p>
190
+ <?php } ?>
191
+ </div>
192
+ </div>
193
+ <!-- .postbox -->
194
+
195
+ <div id="export-products-filters" class="postbox">
196
+ <h3 class="hndle"><?php _e( 'Product Filters', 'woo_ce' ); ?></h3>
197
+ <div class="inside">
198
+
199
+ <?php do_action( 'woo_ce_export_product_options_before_table' ); ?>
200
+
201
+ <table class="form-table">
202
+ <?php do_action( 'woo_ce_export_product_options_table' ); ?>
203
+ </table>
204
+
205
+ <?php do_action( 'woo_ce_export_product_options_after_table' ); ?>
206
+
207
+ </div>
208
+ <!-- .inside -->
209
+
210
+ </div>
211
+ <!-- .postbox -->
212
+
213
+ </div>
214
+ <!-- #export-product -->
215
+
216
+ <?php } ?>
217
+ <?php if( $category_fields ) { ?>
218
+ <div id="export-category" class="export-types">
219
+
220
+ <div class="postbox">
221
+ <h3 class="hndle">
222
+ <?php _e( 'Category Fields', 'woo_ce' ); ?>
223
+ <a href="<?php echo add_query_arg( array( 'tab' => 'fields', 'type' => 'category' ) ); ?>" style="float:right;"><?php _e( 'Configure', 'woo_ce' ); ?></a>
224
+ </h3>
225
+ <div class="inside">
226
+ <p class="description"><?php _e( 'Select the Category fields you would like to export.', 'woo_ce' ); ?></p>
227
+ <p><a href="javascript:void(0)" id="category-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="category-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
228
+ <table id="category-fields" class="ui-sortable">
229
+
230
+ <?php foreach( $category_fields as $category_field ) { ?>
231
+ <tr>
232
+ <td>
233
+ <label>
234
+ <input type="checkbox" name="category_fields[<?php echo $category_field['name']; ?>]" class="category_field"<?php ( isset( $category_field['default'] ) ? checked( $category_field['default'], 1 ) : '' ); ?><?php disabled( $category_field['disabled'], 1 ); ?> />
235
+ <?php echo $category_field['label']; ?>
236
+ <input type="hidden" name="category_fields_order[<?php echo $category_field['name']; ?>]" class="field_order" value="" />
237
+ </label>
238
+ </td>
239
+ </tr>
240
+
241
+ <?php } ?>
242
+ </table>
243
+ <p class="submit">
244
+ <input type="submit" id="export_category" value="<?php _e( 'Export Categories', 'woo_ce' ); ?> " class="button-primary" />
245
+ </p>
246
+ <p class="description"><?php _e( 'Can\'t find a particular Category field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
247
+ </div>
248
+ <!-- .inside -->
249
+ </div>
250
+ <!-- .postbox -->
251
+
252
+ <div id="export-categories-filters" class="postbox">
253
+ <h3 class="hndle"><?php _e( 'Category Filters', 'woo_ce' ); ?></h3>
254
+ <div class="inside">
255
+
256
+ <?php do_action( 'woo_ce_export_category_options_before_table' ); ?>
257
+
258
+ <table class="form-table">
259
+ <?php do_action( 'woo_ce_export_category_options_table' ); ?>
260
+ </table>
261
+
262
+ <?php do_action( 'woo_ce_export_category_options_after_table' ); ?>
263
+
264
+ </div>
265
+ <!-- .inside -->
266
+ </div>
267
+ <!-- #export-categories-filters -->
268
+
269
+ </div>
270
+ <!-- #export-category -->
271
+ <?php } ?>
272
+ <?php if( $tag_fields ) { ?>
273
+ <div id="export-tag" class="export-types">
274
+
275
+ <div class="postbox">
276
+ <h3 class="hndle">
277
+ <?php _e( 'Tag Fields', 'woo_ce' ); ?>
278
+ <a href="<?php echo add_query_arg( array( 'tab' => 'fields', 'type' => 'tag' ) ); ?>" style="float:right;"><?php _e( 'Configure', 'woo_ce' ); ?></a>
279
+ </h3>
280
+ <div class="inside">
281
+ <p class="description"><?php _e( 'Select the Tag fields you would like to export.', 'woo_ce' ); ?></p>
282
+ <p><a href="javascript:void(0)" id="tag-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="tag-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
283
+ <table id="tag-fields" class="ui-sortable">
284
+
285
+ <?php foreach( $tag_fields as $tag_field ) { ?>
286
+ <tr>
287
+ <td>
288
+ <label>
289
+ <input type="checkbox" name="tag_fields[<?php echo $tag_field['name']; ?>]" class="tag_field"<?php ( isset( $tag_field['default'] ) ? checked( $tag_field['default'], 1 ) : '' ); ?><?php disabled( $tag_field['disabled'], 1 ); ?> />
290
+ <?php echo $tag_field['label']; ?>
291
+ <input type="hidden" name="tag_fields_order[<?php echo $tag_field['name']; ?>]" class="field_order" value="" />
292
+ </label>
293
+ </td>
294
+ </tr>
295
+
296
+ <?php } ?>
297
+ </table>
298
+ <p class="submit">
299
+ <input type="submit" id="export_tag" value="<?php _e( 'Export Tags', 'woo_ce' ); ?> " class="button-primary" />
300
+ </p>
301
+ <p class="description"><?php _e( 'Can\'t find a particular Tag field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
302
+ </div>
303
+ <!-- .inside -->
304
+ </div>
305
+ <!-- .postbox -->
306
+
307
+ <div id="export-tags-filters" class="postbox">
308
+ <h3 class="hndle"><?php _e( 'Product Tag Filters', 'woo_ce' ); ?></h3>
309
+ <div class="inside">
310
+
311
+ <?php do_action( 'woo_ce_export_tag_options_before_table' ); ?>
312
+
313
+ <table class="form-table">
314
+ <?php do_action( 'woo_ce_export_tag_options_table' ); ?>
315
+ </table>
316
+
317
+ <?php do_action( 'woo_ce_export_tag_options_after_table' ); ?>
318
+
319
+ </div>
320
+ <!-- .inside -->
321
+ </div>
322
+ <!-- #export-tags-filters -->
323
+
324
+ </div>
325
+ <!-- #export-tag -->
326
+ <?php } ?>
327
+
328
+ <?php if( $brand_fields ) { ?>
329
+ <div id="export-brand" class="export-types">
330
+
331
+ <div class="postbox">
332
+ <h3 class="hndle">
333
+ <?php _e( 'Brand Fields', 'woo_ce' ); ?>
334
+ </h3>
335
+ <div class="inside">
336
+ <?php if( $brands ) { ?>
337
+ <p class="description"><?php _e( 'Select the Brand fields you would like to export.', 'woo_ce' ); ?></p>
338
+ <p><a href="javascript:void(0)" id="brand-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="brand-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
339
+ <table id="brand-fields" class="ui-sortable">
340
+
341
+ <?php foreach( $brand_fields as $brand_field ) { ?>
342
+ <tr>
343
+ <td>
344
+ <label>
345
+ <input type="checkbox" name="brand_fields[<?php echo $brand_field['name']; ?>]" class="brand_field"<?php ( isset( $brand_field['default'] ) ? checked( $brand_field['default'], 1 ) : '' ); ?> disabled="disabled" />
346
+ <?php echo $brand_field['label']; ?>
347
+ </label>
348
+ </td>
349
+ </tr>
350
+
351
+ <?php } ?>
352
+ </table>
353
+ <p class="submit">
354
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Brands', 'woo_ce' ); ?>" />
355
+ </p>
356
+ <p class="description"><?php _e( 'Can\'t find a particular Brand field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
357
+ <?php } else { ?>
358
+ <p><?php _e( 'No Brands were found.', 'woo_ce' ); ?></p>
359
+ <?php } ?>
360
+ </div>
361
+ <!-- .inside -->
362
+ </div>
363
+ <!-- .postbox -->
364
+
365
+ <div id="export-brands-filters" class="postbox">
366
+ <h3 class="hndle"><?php _e( 'Brand Filters', 'woo_ce' ); ?></h3>
367
+ <div class="inside">
368
+
369
+ <?php do_action( 'woo_ce_export_brand_options_before_table' ); ?>
370
+
371
+ <table class="form-table">
372
+ <?php do_action( 'woo_ce_export_brand_options_table' ); ?>
373
+ </table>
374
+
375
+ <?php do_action( 'woo_ce_export_brand_options_after_table' ); ?>
376
+
377
+ </div>
378
+ <!-- .inside -->
379
+ </div>
380
+ <!-- .postbox -->
381
+
382
+ </div>
383
+ <!-- #export-brand -->
384
+
385
+ <?php } ?>
386
+ <?php if( $order_fields ) { ?>
387
+ <div id="export-order" class="export-types">
388
+
389
+ <div class="postbox">
390
+ <h3 class="hndle">
391
+ <?php _e( 'Order Fields', 'woo_ce' ); ?>
392
+ </h3>
393
+ <div class="inside">
394
+
395
+ <?php if( $orders ) { ?>
396
+ <p class="description"><?php _e( 'Select the Order fields you would like to export.', 'woo_ce' ); ?></p>
397
+ <p><a href="javascript:void(0)" id="order-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="order-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
398
+ <table id="order-fields" class="ui-sortable">
399
+
400
+ <?php foreach( $order_fields as $order_field ) { ?>
401
+ <tr>
402
+ <td>
403
+ <label>
404
+ <input type="checkbox" name="order_fields[<?php echo $order_field['name']; ?>]" class="order_field"<?php ( isset( $order_field['default'] ) ? checked( $order_field['default'], 1 ) : '' ); ?> disabled="disabled" />
405
+ <?php echo $order_field['label']; ?>
406
+ </label>
407
+ </td>
408
+ </tr>
409
+
410
+ <?php } ?>
411
+ </table>
412
+ <p class="submit">
413
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Orders', 'woo_ce' ); ?>" />
414
+ </p>
415
+ <p class="description"><?php _e( 'Can\'t find a particular Order field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
416
+ <?php } else { ?>
417
+ <p><?php _e( 'No Orders were found.', 'woo_ce' ); ?></p>
418
+ <?php } ?>
419
+
420
+ </div>
421
+ </div>
422
+ <!-- .postbox -->
423
+
424
+ <div id="export-orders-filters" class="postbox">
425
+ <h3 class="hndle"><?php _e( 'Order Filters', 'woo_ce' ); ?></h3>
426
+ <div class="inside">
427
+
428
+ <?php do_action( 'woo_ce_export_order_options_before_table' ); ?>
429
+
430
+ <table class="form-table">
431
+ <?php do_action( 'woo_ce_export_order_options_table' ); ?>
432
+ </table>
433
+
434
+ <?php do_action( 'woo_ce_export_order_options_after_table' ); ?>
435
+
436
+ </div>
437
+ <!-- .inside -->
438
+ </div>
439
+ <!-- .postbox -->
440
+
441
+ </div>
442
+ <!-- #export-order -->
443
+
444
+ <?php } ?>
445
+ <?php if( $customer_fields ) { ?>
446
+ <div id="export-customer" class="export-types">
447
+
448
+ <div class="postbox">
449
+ <h3 class="hndle">
450
+ <?php _e( 'Customer Fields', 'woo_ce' ); ?>
451
+ </h3>
452
+ <div class="inside">
453
+ <?php if( $customers ) { ?>
454
+ <p class="description"><?php _e( 'Select the Customer fields you would like to export.', 'woo_ce' ); ?></p>
455
+ <p><a href="javascript:void(0)" id="customer-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="customer-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
456
+ <table id="customer-fields" class="ui-sortable">
457
+
458
+ <?php foreach( $customer_fields as $customer_field ) { ?>
459
+ <tr>
460
+ <td>
461
+ <label>
462
+ <input type="checkbox" name="customer_fields[<?php echo $customer_field['name']; ?>]" class="customer_field"<?php ( isset( $customer_field['default'] ) ? checked( $customer_field['default'], 1 ) : '' ); ?> disabled="disabled" />
463
+ <?php echo $customer_field['label']; ?>
464
+ </label>
465
+ </td>
466
+ </tr>
467
+
468
+ <?php } ?>
469
+ </table>
470
+ <p class="submit">
471
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Customers', 'woo_ce' ); ?>" />
472
+ </p>
473
+ <p class="description"><?php _e( 'Can\'t find a particular Customer field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
474
+ <?php } else { ?>
475
+ <p><?php _e( 'No Customers were found.', 'woo_ce' ); ?></p>
476
+ <?php } ?>
477
+ </div>
478
+ <!-- .inside -->
479
+ </div>
480
+ <!-- .postbox -->
481
+
482
+ <div id="export-customers-filters" class="postbox">
483
+ <h3 class="hndle"><?php _e( 'Customer Filters', 'woo_ce' ); ?></h3>
484
+ <div class="inside">
485
+
486
+ <?php do_action( 'woo_ce_export_customer_options_before_table' ); ?>
487
+
488
+ <table class="form-table">
489
+ <?php do_action( 'woo_ce_export_customer_options_table' ); ?>
490
+ </table>
491
+
492
+ <?php do_action( 'woo_ce_export_customer_options_after_table' ); ?>
493
+
494
+ </div>
495
+ <!-- .inside -->
496
+ </div>
497
+ <!-- .postbox -->
498
+
499
+ </div>
500
+ <!-- #export-customer -->
501
+
502
+ <?php } ?>
503
+ <?php if( $user_fields ) { ?>
504
+ <div id="export-user" class="export-types">
505
+
506
+ <div class="postbox">
507
+ <h3 class="hndle">
508
+ <?php _e( 'User Fields', 'woo_ce' ); ?>
509
+ <a href="<?php echo add_query_arg( array( 'tab' => 'fields', 'type' => 'user' ) ); ?>" style="float:right;"><?php _e( 'Configure', 'woo_ce' ); ?></a>
510
+ </h3>
511
+ <div class="inside">
512
+ <?php if( $users ) { ?>
513
+ <p class="description"><?php _e( 'Select the User fields you would like to export.', 'woo_ce' ); ?></p>
514
+ <p><a href="javascript:void(0)" id="user-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="user-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
515
+ <table id="user-fields" class="ui-sortable">
516
+
517
+ <?php foreach( $user_fields as $user_field ) { ?>
518
+ <tr>
519
+ <td>
520
+ <label>
521
+ <input type="checkbox" name="user_fields[<?php echo $user_field['name']; ?>]" class="user_field"<?php ( isset( $user_field['default'] ) ? checked( $user_field['default'], 1 ) : '' ); ?><?php disabled( $user_field['disabled'], 1 ); ?> />
522
+ <?php echo $user_field['label']; ?>
523
+ <?php if( $user_field['disabled'] ) { ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span><?php } ?>
524
+ <input type="hidden" name="user_fields_order[<?php echo $user_field['name']; ?>]" class="field_order" value="" />
525
+ </label>
526
+ </td>
527
+ </tr>
528
+
529
+ <?php } ?>
530
+ </table>
531
+ <p class="submit">
532
+ <input type="submit" id="export_user" class="button-primary" value="<?php _e( 'Export Users', 'woo_ce' ); ?>" />
533
+ </p>
534
+ <p class="description"><?php _e( 'Can\'t find a particular User field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
535
+ <?php } else { ?>
536
+ <p><?php _e( 'No Users were found.', 'woo_ce' ); ?></p>
537
+ <?php } ?>
538
+ </div>
539
+ <!-- .inside -->
540
+ </div>
541
+ <!-- .postbox -->
542
+
543
+ <div id="export-users-filters" class="postbox">
544
+ <h3 class="hndle"><?php _e( 'User Filters', 'woo_ce' ); ?></h3>
545
+ <div class="inside">
546
+
547
+ <?php do_action( 'woo_ce_export_user_options_before_table' ); ?>
548
+
549
+ <table class="form-table">
550
+ <?php do_action( 'woo_ce_export_user_options_table' ); ?>
551
+ </table>
552
+
553
+ <?php do_action( 'woo_ce_export_user_options_after_table' ); ?>
554
+
555
+ </div>
556
+ <!-- .inside -->
557
+ </div>
558
+ <!-- .postbox -->
559
+
560
+ </div>
561
+ <!-- #export-user -->
562
+
563
+ <?php } ?>
564
+ <?php if( $coupon_fields ) { ?>
565
+ <div id="export-coupon" class="export-types">
566
+
567
+ <div class="postbox">
568
+ <h3 class="hndle">
569
+ <?php _e( 'Coupon Fields', 'woo_ce' ); ?>
570
+ </h3>
571
+ <div class="inside">
572
+ <?php if( $coupons ) { ?>
573
+ <p class="description"><?php _e( 'Select the Coupon fields you would like to export.', 'woo_ce' ); ?></p>
574
+ <p><a href="javascript:void(0)" id="coupon-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="coupon-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
575
+ <table id="coupon-fields" class="ui-sortable">
576
+
577
+ <?php foreach( $coupon_fields as $coupon_field ) { ?>
578
+ <tr>
579
+ <td>
580
+ <label>
581
+ <input type="checkbox" name="coupon_fields[<?php echo $coupon_field['name']; ?>]" class="coupon_field"<?php ( isset( $coupon_field['default'] ) ? checked( $coupon_field['default'], 1 ) : '' ); ?> disabled="disabled" />
582
+ <?php echo $coupon_field['label']; ?>
583
+ </label>
584
+ </td>
585
+ </tr>
586
+
587
+ <?php } ?>
588
+ </table>
589
+ <p class="submit">
590
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Coupons', 'woo_ce' ); ?>" />
591
+ </p>
592
+ <p class="description"><?php _e( 'Can\'t find a particular Coupon field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
593
+ <?php } else { ?>
594
+ <p><?php _e( 'No Coupons were found.', 'woo_ce' ); ?></p>
595
+ <?php } ?>
596
+ </div>
597
+ <!-- .inside -->
598
+ </div>
599
+ <!-- .postbox -->
600
+
601
+ <div id="export-coupons-filters" class="postbox">
602
+ <h3 class="hndle"><?php _e( 'Coupon Filters', 'woo_ce' ); ?></h3>
603
+ <div class="inside">
604
+
605
+ <?php do_action( 'woo_ce_export_coupon_options_before_table' ); ?>
606
+
607
+ <table class="form-table">
608
+ <?php do_action( 'woo_ce_export_coupon_options_table' ); ?>
609
+ </table>
610
+
611
+ <?php do_action( 'woo_ce_export_coupon_options_after_table' ); ?>
612
+
613
+ </div>
614
+ <!-- .inside -->
615
+ </div>
616
+ <!-- .postbox -->
617
+
618
+ </div>
619
+ <!-- #export-coupon -->
620
+
621
+ <?php } ?>
622
+ <?php if( $subscription_fields ) { ?>
623
+ <div id="export-subscription" class="export-types">
624
+
625
+ <div class="postbox">
626
+ <h3 class="hndle">
627
+ <?php _e( 'Subscription Fields', 'woo_ce' ); ?>
628
+ </h3>
629
+ <div class="inside">
630
+ <?php if( $subscriptions ) { ?>
631
+ <p class="description"><?php _e( 'Select the Subscription fields you would like to export.', 'woo_ce' ); ?></p>
632
+ <p><a href="javascript:void(0)" id="subscription-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="subscription-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
633
+ <table id="subscription-fields" class="ui-sortable">
634
+
635
+ <?php foreach( $subscription_fields as $subscription_field ) { ?>
636
+ <tr>
637
+ <td>
638
+ <label>
639
+ <input type="checkbox" name="subscription_fields[<?php echo $subscription_field['name']; ?>]" class="subscription_field"<?php ( isset( $subscription_field['default'] ) ? checked( $subscription_field['default'], 1 ) : '' ); ?> disabled="disabled" />
640
+ <?php echo $subscription_field['label']; ?>
641
+ </label>
642
+ </td>
643
+ </tr>
644
+
645
+ <?php } ?>
646
+ </table>
647
+ <p class="submit">
648
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Subscriptions', 'woo_ce' ); ?>" />
649
+ </p>
650
+ <p class="description"><?php _e( 'Can\'t find a particular Subscription field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
651
+ <?php } else { ?>
652
+ <p><?php _e( 'No Subscriptions were found.', 'woo_ce' ); ?></p>
653
+ <?php } ?>
654
+ </div>
655
+ <!-- .inside -->
656
+ </div>
657
+ <!-- .postbox -->
658
+ </div>
659
+ <!-- #export-subscription -->
660
+
661
+ <?php } ?>
662
+ <?php if( $product_vendor_fields ) { ?>
663
+ <div id="export-product_vendor" class="export-types">
664
+
665
+ <div class="postbox">
666
+ <h3 class="hndle">
667
+ <?php _e( 'Product Vendor Fields', 'woo_ce' ); ?>
668
+ </h3>
669
+ <div class="inside">
670
+ <?php if( $product_vendors ) { ?>
671
+ <p class="description"><?php _e( 'Select the Product Vendor fields you would like to export.', 'woo_ce' ); ?></p>
672
+ <p><a href="javascript:void(0)" id="product_vendor-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="product_vendor-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
673
+ <table id="product_vendor-fields" class="ui-sortable">
674
+
675
+ <?php foreach( $product_vendor_fields as $product_vendor_field ) { ?>
676
+ <tr>
677
+ <td>
678
+ <label>
679
+ <input type="checkbox" name="product_vendor_fields[<?php echo $product_vendor_field['name']; ?>]" class="product_vendor_field"<?php ( isset( $product_vendor_field['default'] ) ? checked( $product_vendor_field['default'], 1 ) : '' ); ?> disabled="disabled" />
680
+ <?php echo $product_vendor_field['label']; ?>
681
+ </label>
682
+ </td>
683
+ </tr>
684
+
685
+ <?php } ?>
686
+ </table>
687
+ <p class="submit">
688
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Product Vendors', 'woo_ce' ); ?>" />
689
+ </p>
690
+ <p class="description"><?php _e( 'Can\'t find a particular Product Vendor field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
691
+ <?php } else { ?>
692
+ <p><?php _e( 'No Product Vendors were found.', 'woo_ce' ); ?></p>
693
+ <?php } ?>
694
+ </div>
695
+ <!-- .inside -->
696
+ </div>
697
+ <!-- .postbox -->
698
+
699
+ </div>
700
+ <!-- #export-product_vendor -->
701
+
702
+ <?php } ?>
703
+ <?php if( $shipping_class_fields ) { ?>
704
+ <div id="export-shipping_class" class="export-types">
705
+
706
+ <div class="postbox">
707
+ <h3 class="hndle">
708
+ <?php _e( 'Shipping Class Fields', 'woo_ce' ); ?>
709
+ </h3>
710
+ <div class="inside">
711
+ <?php if( $shipping_classes ) { ?>
712
+ <p class="description"><?php _e( 'Select the Shipping Class fields you would like to export.', 'woo_ce' ); ?></p>
713
+ <p><a href="javascript:void(0)" id="shipping_class-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="shipping_class-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
714
+ <table id="shipping_class-fields" class="ui-sortable">
715
+
716
+ <?php foreach( $shipping_class_fields as $shipping_class_field ) { ?>
717
+ <tr>
718
+ <td>
719
+ <label>
720
+ <input type="checkbox" name="shipping_class_fields[<?php echo $shipping_class_field['name']; ?>]" class="shipping_class_field"<?php ( isset( $shipping_class_field['default'] ) ? checked( $shipping_class_field['default'], 1 ) : '' ); ?> disabled="disabled" />
721
+ <?php echo $shipping_class_field['label']; ?>
722
+ </label>
723
+ </td>
724
+ </tr>
725
+
726
+ <?php } ?>
727
+ </table>
728
+ <p class="submit">
729
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Shipping Classes', 'woo_ce' ); ?>" />
730
+ </p>
731
+ <p class="description"><?php _e( 'Can\'t find a particular Shipping Class field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
732
+ <?php } else { ?>
733
+ <p><?php _e( 'No Shipping Classes were found.', 'woo_ce' ); ?></p>
734
+ <?php } ?>
735
+ </div>
736
+ <!-- .inside -->
737
+ </div>
738
+ <!-- .postbox -->
739
+
740
+ <div id="export-shipping-classes-filters" class="postbox">
741
+ <h3 class="hndle"><?php _e( 'Shipping Class Filters', 'woo_ce' ); ?></h3>
742
+ <div class="inside">
743
+
744
+ <?php do_action( 'woo_ce_export_shipping_class_options_before_table' ); ?>
745
+
746
+ <table class="form-table">
747
+ <?php do_action( 'woo_ce_export_shipping_class_options_table' ); ?>
748
+ </table>
749
+
750
+ <?php do_action( 'woo_ce_export_shipping_class_options_after_table' ); ?>
751
+
752
+ </div>
753
+ <!-- .inside -->
754
+ </div>
755
+ <!-- .postbox -->
756
+
757
+ </div>
758
+ <!-- #export-shipping_class -->
759
+
760
+ <?php } ?>
761
+ <?php do_action( 'woo_ce_before_options' ); ?>
762
+
763
+ <div class="postbox" id="export-options">
764
+ <h3 class="hndle"><?php _e( 'Export Options', 'woo_ce' ); ?></h3>
765
+ <div class="inside">
766
+ <p class="description"><?php _e( 'You can find additional export options under the Settings tab at the top of this screen.', 'woo_ce' ); ?></p>
767
+
768
+ <?php do_action( 'woo_ce_export_options_before' ); ?>
769
+
770
+ <table class="form-table">
771
+
772
+ <?php do_action( 'woo_ce_export_options' ); ?>
773
+
774
+ <tr>
775
+ <th>
776
+ <label for="offset"><?php _e( 'Volume offset', 'woo_ce' ); ?></label> / <label for="limit_volume"><?php _e( 'Limit volume', 'woo_ce' ); ?></label>
777
+ </th>
778
+ <td>
779
+ <input type="text" size="3" id="offset" name="offset" value="<?php echo esc_attr( $offset ); ?>" size="5" class="text" title="<?php _e( 'Volume Offset', 'woo_ce' ); ?>" /> <?php _e( 'to', 'woo_ce' ); ?> <input type="text" size="3" id="limit_volume" name="limit_volume" value="<?php echo esc_attr( $limit_volume ); ?>" size="5" class="text" title="<?php _e( 'Limit Volume', 'woo_ce' ); ?>" />
780
+ <p class="description"><?php _e( 'Volume offset and limit allows for partial exporting of an export type (e.g. records 0 to 500, etc.). This is useful when encountering timeout and/or memory errors during the a large or memory intensive export. To be used effectively both fields must be filled. By default this is not used and is left empty.', 'woo_ce' ); ?></p>
781
+ </td>
782
+ </tr>
783
+
784
+ <?php do_action( 'woo_ce_export_options_table_after' ); ?>
785
+
786
+ </table>
787
+
788
+ <?php do_action( 'woo_ce_export_options_after' ); ?>
789
+
790
+ </div>
791
+ </div>
792
+ <!-- .postbox -->
793
+
794
+ <?php do_action( 'woo_ce_after_options' ); ?>
795
+
796
+ <input type="hidden" name="action" value="export" />
797
+ </form>
798
+
799
+ <?php do_action( 'woo_ce_export_after_form' ); ?>
800
+
801
+ <?php do_action( 'woo_ce_before_modules' ); ?>
802
+
803
+ <div id="export-modules" class="postbox">
804
+ <h3 class="hndle"><?php _e( 'Export Modules', 'woo_ce' ); ?></h3>
805
+ <div class="inside">
806
+ <p><?php _e( 'Export store details from other WooCommerce and WordPress Plugins, simply install and activate one of the below Plugins to enable those additional export options.', 'woo_ce' ); ?></p>
807
+ <?php if( $modules ) { ?>
808
+ <div class="table table_content">
809
+ <table class="woo_vm_version_table">
810
+ <?php foreach( $modules as $module ) { ?>
811
+ <tr>
812
+ <td class="export_module">
813
+ <?php if( $module['description'] ) { ?>
814
+ <strong><?php echo $module['title']; ?></strong>: <span class="description"><?php echo $module['description']; ?></span>
815
+ <?php } else { ?>
816
+ <strong><?php echo $module['title']; ?></strong>
817
+ <?php } ?>
818
+ </td>
819
+ <td class="status">
820
+ <div class="<?php woo_ce_modules_status_class( $module['status'] ); ?>">
821
+ <?php if( $module['status'] == 'active' ) { ?>
822
+ <div class="dashicons dashicons-yes" style="color:#008000;"></div><?php woo_ce_modules_status_label( $module['status'] ); ?>
823
+ <?php } else { ?>
824
+ <?php if( $module['url'] ) { ?>
825
+ <?php if( isset( $module['slug'] ) ) { echo '<div class="dashicons dashicons-download" style="color:#0074a2;"></div>'; } else { echo '<div class="dashicons dashicons-admin-links"></div>'; } ?>&nbsp;<a href="<?php echo $module['url']; ?>" target="_blank"<?php if( isset( $module['slug'] ) ) { echo ' title="' . __( 'Install via WordPress Plugin Directory', 'woo_ce' ) . '"'; } else { echo ' title="' . __( 'Visit the Plugin website', 'woo_ce' ) . '"'; } ?>><?php woo_ce_modules_status_label( $module['status'] ); ?></a>
826
+ <?php } ?>
827
+ <?php } ?>
828
+ </div>
829
+ </td>
830
+ </tr>
831
+ <?php } ?>
832
+ </table>
833
+ </div>
834
+ <!-- .table -->
835
+ <?php } else { ?>
836
+ <p><?php _e( 'No export modules are available at this time.', 'woo_ce' ); ?></p>
837
+ <?php } ?>
838
+ </div>
839
+ <!-- .inside -->
840
+ </div>
841
+ <!-- .postbox -->
842
+
843
+ <?php do_action( 'woo_ce_after_modules' ); ?>
844
+
845
+ </div>
846
+ <!-- #poststuff -->
templates/admin/tabs-fields.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3><?php _e( 'Field Editor', 'woo_ce' ); ?></h3>
2
+ <p><?php _e( 'Customise the field labels for this export type by filling in the fields, an empty field label will revert to the default Store Exporter field label at export time.', 'woo_ce' ); ?></p>
3
+ <?php if( $fields ) { ?>
4
+ <form method="post" id="postform">
5
+ <table class="form-table">
6
+ <tbody>
7
+ <?php foreach( $fields as $field ) { ?>
8
+ <?php if( isset( $field['name'] ) ) { ?>
9
+ <tr>
10
+ <th scope="row"><label for="<?php echo $field['name']; ?>"><?php echo $field['name']; ?></label></th>
11
+ <td>
12
+ <input type="text" name="fields[<?php echo $field['name']; ?>]" placeholder="<?php echo $field['label']; ?>" value="<?php if( isset( $labels[$field['name']] ) ) { echo $labels[$field['name']]; } ?>" class="regular-text all-options" />
13
+ </td>
14
+ </tr>
15
+ <?php } ?>
16
+ <?php } ?>
17
+ </tbody>
18
+ </table>
19
+ <!-- .form-table -->
20
+
21
+ <p class="submit">
22
+ <input type="submit" value="<?php _e( 'Save Changes', 'woo_ce' ); ?> " class="button-primary" />
23
+ </p>
24
+ <input type="hidden" name="action" value="save-fields" />
25
+ <input type="hidden" name="type" value="<?php echo esc_attr( $export_type ); ?>" />
26
+
27
+ </form>
28
+ <?php } ?>
templates/admin/tabs-overview.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="overview-left">
2
+
3
+ <h3><div class="dashicons dashicons-migrate"></div>&nbsp;<a href="<?php echo add_query_arg( 'tab', 'export' ); ?>"><?php _e( 'Export', 'woo_ce' ); ?></a></h3>
4
+ <p><?php _e( 'Export store details out of WooCommerce into a CSV-formatted file.', 'woo_ce' ); ?></p>
5
+ <ul class="ul-disc">
6
+ <li>
7
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-product"><?php _e( 'Export Products', 'woo_ce' ); ?></a>
8
+ </li>
9
+ <li>
10
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-category"><?php _e( 'Export Categories', 'woo_ce' ); ?></a>
11
+ </li>
12
+ <li>
13
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-tag"><?php _e( 'Export Tags', 'woo_ce' ); ?></a>
14
+ </li>
15
+ <li>
16
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-brand"><?php _e( 'Export Brands', 'woo_ce' ); ?></a>
17
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
18
+ </li>
19
+ <li>
20
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-order"><?php _e( 'Export Orders', 'woo_ce' ); ?></a>
21
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
22
+ </li>
23
+ <li>
24
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-customer"><?php _e( 'Export Customers', 'woo_ce' ); ?></a>
25
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
26
+ </li>
27
+ <li>
28
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-user"><?php _e( 'Export Users', 'woo_ce' ); ?></a>
29
+ </li>
30
+ <li>
31
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-coupon"><?php _e( 'Export Coupons', 'woo_ce' ); ?></a>
32
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
33
+ </li>
34
+ <li>
35
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-subscription"><?php _e( 'Export Subscriptions', 'woo_ce' ); ?></a>
36
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
37
+ </li>
38
+ <li>
39
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-product_vendor"><?php _e( 'Export Product Vendors', 'woo_ce' ); ?></a>
40
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
41
+ </li>
42
+ <li>
43
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-shipping_class"><?php _e( 'Export Shipping Classes', 'woo_ce' ); ?></a>
44
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
45
+ </li>
46
+ <!--
47
+ <li>
48
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-attribute"><?php _e( 'Export Attributes', 'woo_ce' ); ?></a>
49
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
50
+ </li>
51
+ -->
52
+ </ul>
53
+
54
+ <h3><div class="dashicons dashicons-list-view"></div>&nbsp;<a href="<?php echo add_query_arg( 'tab', 'archive' ); ?>"><?php _e( 'Archives', 'woo_ce' ); ?></a></h3>
55
+ <p><?php _e( 'Download copies of prior store exports.', 'woo_ce' ); ?></p>
56
+
57
+ <h3><div class="dashicons dashicons-admin-settings"></div>&nbsp;<a href="<?php echo add_query_arg( 'tab', 'settings' ); ?>"><?php _e( 'Settings', 'woo_ce' ); ?></a></h3>
58
+ <p><?php _e( 'Manage export options from a single detailed screen.', 'woo_ce' ); ?></p>
59
+ <ul class="ul-disc">
60
+ <li>
61
+ <a href="<?php echo add_query_arg( 'tab', 'settings' ); ?>#general-settings"><?php _e( 'General Settings', 'woo_ce' ); ?></a>
62
+ </li>
63
+ <li>
64
+ <a href="<?php echo add_query_arg( 'tab', 'settings' ); ?>#csv-settings"><?php _e( 'CSV Settings', 'woo_ce' ); ?></a>
65
+ </li>
66
+ <li>
67
+ <a href="<?php echo add_query_arg( 'tab', 'settings' ); ?>#xml-settings"><?php _e( 'XML Settings', 'woo_ce' ); ?></a>
68
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
69
+ </li>
70
+ <li>
71
+ <a href="<?php echo add_query_arg( 'tab', 'settings' ); ?>#scheduled-exports"><?php _e( 'Scheduled Exports', 'woo_ce' ); ?></a>
72
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
73
+ </li>
74
+ <li>
75
+ <a href="<?php echo add_query_arg( 'tab', 'settings' ); ?>#cron-exports"><?php _e( 'CRON Exports', 'woo_ce' ); ?></a>
76
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
77
+ </li>
78
+ </ul>
79
+
80
+ <h3><div class="dashicons dashicons-hammer"></div>&nbsp;<a href="<?php echo add_query_arg( 'tab', 'tools' ); ?>"><?php _e( 'Tools', 'woo_ce' ); ?></a></h3>
81
+ <p><?php _e( 'Export tools for WooCommerce.', 'woo_ce' ); ?></p>
82
+
83
+ <hr />
84
+ <label class="description">
85
+ <input type="checkbox" disabled="disabled" /> <?php _e( 'Jump to Export screen in the future', 'woo_ce' ); ?>
86
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
87
+ </label>
88
+
89
+ </div>
90
+ <!-- .overview-left -->
91
+ <div class="welcome-panel overview-right">
92
+ <h3>
93
+ <!-- <span><a href="#"><attr title="<?php _e( 'Dismiss this message', 'woo_ce' ); ?>"><?php _e( 'Dismiss', 'woo_ce' ); ?></attr></a></span> -->
94
+ <?php _e( 'Upgrade to Pro', 'woo_ce' ); ?>
95
+ </h3>
96
+ <p class="clear"><?php _e( 'Upgrade to Store Exporter Deluxe to unlock business focused e-commerce features within Store Exporter, including:', 'woo_ce' ); ?></p>
97
+ <ul class="ul-disc">
98
+ <li><?php _e( 'Select export date ranges', 'woo_ce' ); ?></li>
99
+ <li><?php _e( 'Select export fields to export', 'woo_ce' ); ?></li>
100
+ <li><?php _e( 'Filter exports by multiple filter options', 'woo_ce' ); ?></li>
101
+ <li><?php _e( 'Export Orders', 'woo_ce' ); ?></li>
102
+ <li><?php _e( 'Export custom Order and Order Item meta', 'woo_ce' ); ?></li>
103
+ <li><?php _e( 'Export Customers', 'woo_ce' ); ?></li>
104
+ <li><?php _e( 'Export custom Customer meta', 'woo_ce' ); ?></li>
105
+ <li><?php _e( 'Export Coupons', 'woo_ce' ); ?></li>
106
+ <li><?php _e( 'Export custom User meta', 'woo_ce' ); ?></li>
107
+ <li><?php _e( 'Export Subscriptions', 'woo_ce' ); ?></li>
108
+ <li><?php _e( 'Export Product Vendors', 'woo_ce' ); ?></li>
109
+ <li><?php _e( 'Export Shipping Classes', 'woo_ce' ); ?></li>
110
+ <li><?php _e( 'CRON export engine', 'woo_ce' ); ?></li>
111
+ <li><?php _e( 'Schedule automatic exports with filtering options', 'woo_ce' ); ?></li>
112
+ <li><?php _e( 'Export to remote POST', 'woo_ce' ); ?></li>
113
+ <li><?php _e( 'Export to e-mail addresses', 'woo_ce' ); ?></li>
114
+ <li><?php _e( 'Export to remote FTP', 'woo_ce' ); ?></li>
115
+ <li><?php _e( 'Export to XML file', 'woo_ce' ); ?></li>
116
+ <li><?php _e( 'Export to Excel 2007 (XLS) file', 'woo_ce' ); ?></li>
117
+ <li><?php _e( 'Premium Support', 'woo_ce' ); ?></li>
118
+ <li><?php _e( '...and more.', 'woo_ce' ); ?></li>
119
+ </ul>
120
+ <p>
121
+ <a href="<?php echo $woo_cd_url; ?>" target="_blank" class="button"><?php _e( 'More Features', 'woo_ce' ); ?></a>&nbsp;
122
+ <a href="<?php echo $woo_cd_url; ?>" target="_blank" class="button button-primary"><?php _e( 'Buy Now', 'woo_ce' ); ?></a>
123
+ </p>
124
+ </div>
125
+ <!-- .overview-right -->
templates/admin/tabs-settings.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="subsubsub">
2
+ <li><a href="#general-settings"><?php _e( 'General Settings', 'woo_ce' ); ?></a> |</li>
3
+ <li><a href="#csv-settings"><?php _e( 'CSV Settings', 'woo_ce' ); ?></a></li>
4
+ <?php do_action( 'woo_ce_export_settings_top' ); ?>
5
+ </ul>
6
+ <!-- .subsubsub -->
7
+ <br class="clear" />
8
+
9
+ <form method="post">
10
+ <table class="form-table">
11
+ <tbody>
12
+
13
+ <?php do_action( 'woo_ce_export_settings_before' ); ?>
14
+
15
+ <tr id="general-settings">
16
+ <td colspan="2" style="padding:0;">
17
+ <h3><div class="dashicons dashicons-admin-settings"></div>&nbsp;<?php _e( 'General Settings', 'woo_ce' ); ?></h3>
18
+ <p class="description"><?php _e( 'Manage export options across Store Exporter from this screen.', 'woo_ce' ); ?></p>
19
+ </td>
20
+ </tr>
21
+
22
+ <tr valign="top">
23
+ <th scope="row"><label for="export_filename"><?php _e( 'Export filename', 'woo_ce' ); ?></label></th>
24
+ <td>
25
+ <input type="text" name="export_filename" id="export_filename" value="<?php echo esc_attr( $export_filename ); ?>" class="large-text code" />
26
+ <p class="description"><?php _e( 'The filename of the exported export type. Tags can be used: ', 'woo_ce' ); ?> <code>%dataset%</code>, <code>%date%</code>, <code>%time%</code>, <code>%store_name%</code>.</p>
27
+ </td>
28
+ </tr>
29
+
30
+ <tr>
31
+ <th>
32
+ <label for="delete_file"><?php _e( 'Enable archives', 'woo_ce' ); ?></label>
33
+ </th>
34
+ <td>
35
+ <select id="delete_file" name="delete_file">
36
+ <option value="0"<?php selected( $delete_file, 0 ); ?>><?php _e( 'Yes', 'woo_ce' ); ?></option>
37
+ <option value="1"<?php selected( $delete_file, 1 ); ?>><?php _e( 'No', 'woo_ce' ); ?></option>
38
+ </select>
39
+ <p class="description"><?php _e( 'Save copies of exports to the WordPress Media for later downloading. By default this option is turned on.', 'woo_ce' ); ?></p>
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <th>
44
+ <label for="encoding"><?php _e( 'Character encoding', 'woo_ce' ); ?></label>
45
+ </th>
46
+ <td>
47
+ <?php if( $file_encodings ) { ?>
48
+ <select id="encoding" name="encoding">
49
+ <option value=""><?php _e( 'System default', 'woo_ce' ); ?></option>
50
+ <?php foreach( $file_encodings as $key => $chr ) { ?>
51
+ <option value="<?php echo $chr; ?>"<?php selected( $chr, $encoding ); ?>><?php echo $chr; ?></option>
52
+ <?php } ?>
53
+ </select>
54
+ <?php } else { ?>
55
+ <?php if( version_compare( phpversion(), '5', '<' ) ) { ?>
56
+ <p class="description"><?php _e( 'Character encoding options are unavailable in PHP 4, contact your hosting provider to update your site install to use PHP 5 or higher.', 'woo_ce' ); ?></p>
57
+ <?php } else { ?>
58
+ <p class="description"><?php _e( 'Character encoding options are unavailable as the required mb_list_encodings() function is missing, contact your hosting provider to have the mbstring extension installed.', 'woo_ce' ); ?></p>
59
+ <?php } ?>
60
+ <?php } ?>
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <th><?php _e( 'Date format', 'woo_ce' ); ?></th>
65
+ <td>
66
+ <ul style="margin-top:0.2em;">
67
+ <li><label title="F j, Y"><input type="radio" name="date_format" value="F j, Y"<?php checked( $date_format, 'F j, Y' ); ?>> <span><?php echo date( 'F j, Y' ); ?></span></label></li>
68
+ <li><label title="Y/m/d"><input type="radio" name="date_format" value="Y/m/d"<?php checked( $date_format, 'Y/m/d' ); ?>> <span><?php echo date( 'Y/m/d' ); ?></span></label></li>
69
+ <li><label title="m/d/Y"><input type="radio" name="date_format" value="m/d/Y"<?php checked( $date_format, 'm/d/Y' ); ?>> <span><?php echo date( 'm/d/Y' ); ?></span></label></li>
70
+ <li><label title="d/m/Y"><input type="radio" name="date_format" value="d/m/Y"<?php checked( $date_format, 'd/m/Y' ); ?>> <span><?php echo date( 'd/m/Y' ); ?></span></label></li>
71
+ <li><label><input type="radio" name="date_format" value="custom"<?php checked( in_array( $date_format, array( 'F j, Y', 'Y/m/d', 'm/d/Y', 'd/m/Y' ) ), false ); ?>/> <?php _e( 'Custom', 'woo_ce' ); ?>: </label><input type="text" name="date_format_custom" value="<?php echo sanitize_text_field( $date_format ); ?>" class="text" /></li>
72
+ <li><a href="http://codex.wordpress.org/Formatting_Date_and_Time" target="_blank"><?php _e( 'Documentation on date and time formatting', 'woo_ce' ); ?></a>.</li>
73
+ </ul>
74
+ <p class="description"><?php _e( 'The date format option affects how date\'s are presented within your export file. Default is set to DD/MM/YYYY.', 'woo_ce' ); ?></p>
75
+ </td>
76
+ </tr>
77
+ <?php if( !ini_get( 'safe_mode' ) ) { ?>
78
+ <tr>
79
+ <th>
80
+ <label for="timeout"><?php _e( 'Script timeout', 'woo_ce' ); ?></label>
81
+ </th>
82
+ <td>
83
+ <select id="timeout" name="timeout">
84
+ <option value="600"<?php selected( $timeout, 600 ); ?>><?php printf( __( '%s minutes', 'woo_ce' ), 10 ); ?></option>
85
+ <option value="1800"<?php selected( $timeout, 1800 ); ?>><?php printf( __( '%s minutes', 'woo_ce' ), 30 ); ?></option>
86
+ <option value="3600"<?php selected( $timeout, 3600 ); ?>><?php printf( __( '%s hour', 'woo_ce' ), 1 ); ?></option>
87
+ <option value="0"<?php selected( $timeout, 0 ); ?>><?php _e( 'Unlimited', 'woo_ce' ); ?></option>
88
+ </select>
89
+ <p class="description"><?php _e( 'Script timeout defines how long Store Exporter is \'allowed\' to process your export file, once the time limit is reached the export process halts.', 'woo_ce' ); ?></p>
90
+ </td>
91
+ </tr>
92
+ <?php } ?>
93
+
94
+ <?php do_action( 'woo_ce_export_settings_general' ); ?>
95
+
96
+ <tr id="csv-settings">
97
+ <td colspan="2" style="padding:0;">
98
+ <hr />
99
+ <h3><div class="dashicons dashicons-media-spreadsheet"></div>&nbsp;<?php _e( 'CSV Settings', 'woo_ce' ); ?></h3>
100
+ </td>
101
+ </tr>
102
+ <tr>
103
+ <th>
104
+ <label for="delimiter"><?php _e( 'Field delimiter', 'woo_ce' ); ?></label>
105
+ </th>
106
+ <td>
107
+ <input type="text" size="3" id="delimiter" name="delimiter" value="<?php echo esc_attr( $delimiter ); ?>" maxlength="1" class="text" />
108
+ <p class="description"><?php _e( 'The field delimiter is the character separating each cell in your CSV. This is typically the \',\' (comma) character.', 'woo_ce' ); ?></p>
109
+ </td>
110
+ </tr>
111
+ <tr>
112
+ <th>
113
+ <label for="category_separator"><?php _e( 'Category separator', 'woo_ce' ); ?></label>
114
+ </th>
115
+ <td>
116
+ <input type="text" size="3" id="category_separator" name="category_separator" value="<?php echo esc_attr( $category_separator ); ?>" maxlength="1" class="text" />
117
+ <p class="description"><?php _e( 'The Product Category separator allows you to assign individual Products to multiple Product Categories/Tags/Images at a time. It is suggested to use the \'|\' (vertical pipe) character between each item. For instance: <code>Clothing|Mens|Shirts</code>.', 'woo_ce' ); ?></p>
118
+ </td>
119
+ </tr>
120
+ <tr>
121
+ <th>
122
+ <label for="bom"><?php _e( 'Add BOM character', 'woo_ce' ); ?></label>
123
+ </th>
124
+ <td>
125
+ <select id="bom" name="bom">
126
+ <option value="1"<?php selected( $bom, 1 ); ?>><?php _e( 'Yes', 'woo_ce' ); ?></option>
127
+ <option value="0"<?php selected( $bom, 0 ); ?>><?php _e( 'No', 'woo_ce' ); ?></option>
128
+ </select>
129
+ <p class="description"><?php _e( 'Mark the CSV file as UTF8 by adding a byte order mark (BOM) to the export, useful for non-English character sets.', 'woo_ce' ); ?></p>
130
+ </td>
131
+ </tr>
132
+ <tr>
133
+ <th>
134
+ <label for="escape_formatting"><?php _e( 'Field escape formatting', 'woo_ce' ); ?></label>
135
+ </th>
136
+ <td>
137
+ <ul style="margin-top:0.2em;">
138
+ <li><label><input type="radio" name="escape_formatting" value="all"<?php checked( $escape_formatting, 'all' ); ?> />&nbsp;<?php _e( 'Escape all fields', 'woo_ce' ); ?></label></li>
139
+ <li><label><input type="radio" name="escape_formatting" value="excel"<?php checked( $escape_formatting, 'excel' ); ?> />&nbsp;<?php _e( 'Escape fields as Excel would', 'woo_ce' ); ?></label></li>
140
+ </ul>
141
+ <p class="description"><?php _e( 'Choose the field escape format that suits your spreadsheet software (e.g. Excel).', 'woo_ce' ); ?></p>
142
+ </td>
143
+ </tr>
144
+
145
+ <?php do_action( 'woo_ce_export_settings_after' ); ?>
146
+
147
+ </tbody>
148
+ </table>
149
+ <!-- .form-table -->
150
+ <p class="submit">
151
+ <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e( 'Save Changes', 'woo_ce' ); ?>" />
152
+ </p>
153
+ <input type="hidden" name="action" value="save-settings" />
154
+ </form>
155
+ <?php do_action( 'woo_ce_export_settings_bottom' ); ?>
templates/admin/tabs-tools.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3><div class="dashicons dashicons-hammer"></div>&nbsp;<?php _e( 'WooCommerce Tools', 'woo_ce' ); ?></h3>
2
+ <p class="description"><?php _e( 'Extend your store with other WooCommerce extensions from us.', 'woo_ce' ); ?></p>
3
+ <div id="poststuff">
4
+
5
+ <div id="tools" class="postbox">
6
+ <h3 class="hndle"><?php _e( 'Tools', 'woo_ce' ); ?></h3>
7
+ <div class="inside">
8
+ <table class="form-table">
9
+
10
+ <tr>
11
+ <td>
12
+ <a href="<?php echo $woo_pd_url; ?>"<?php echo $woo_pd_target; ?>><?php _e( 'Import Products from CSV', 'woo_ce' ); ?></a>
13
+ <p class="description"><?php _e( 'Use Product Importer Deluxe to import Product changes back into your WooCommerce store.', 'woo_ce' ); ?></p>
14
+ </td>
15
+ </tr>
16
+
17
+ <tr>
18
+ <td>
19
+ <a href="<?php echo $woo_st_url; ?>"<?php echo $woo_st_target; ?>><?php _e( 'Store Toolkit', 'woo_ce' ); ?></a>
20
+ <p class="description"><?php _e( 'Store Toolkit includes a growing set of commonly-used WooCommerce administration tools aimed at web developers and store maintainers.', 'woo_ce' ); ?></p>
21
+ </td>
22
+ </tr>
23
+
24
+ </table>
25
+ </div>
26
+ </div>
27
+ <!-- .postbox -->
28
+
29
+ </div>
30
+ <!-- #poststuff -->
templates/admin/tabs.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="content">
2
+
3
+ <h2 class="nav-tab-wrapper">
4
+ <a data-tab-id="overview" class="nav-tab<?php woo_ce_admin_active_tab( 'overview' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'overview' ), 'admin.php' ); ?>"><?php _e( 'Overview', 'woo_ce' ); ?></a>
5
+ <a data-tab-id="export" class="nav-tab<?php woo_ce_admin_active_tab( 'export' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'export' ), 'admin.php' ); ?>"><?php _e( 'Export', 'woo_ce' ); ?></a>
6
+ <a data-tab-id="archive" class="nav-tab<?php woo_ce_admin_active_tab( 'archive' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'archive' ), 'admin.php' ); ?>"><?php _e( 'Archives', 'woo_ce' ); ?></a>
7
+ <a data-tab-id="settings" class="nav-tab<?php woo_ce_admin_active_tab( 'settings' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'settings' ), 'admin.php' ); ?>"><?php _e( 'Settings', 'woo_ce' ); ?></a>
8
+ <a data-tab-id="tools" class="nav-tab<?php woo_ce_admin_active_tab( 'tools' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'tools' ), 'admin.php' ); ?>"><?php _e( 'Tools', 'woo_ce' ); ?></a>
9
+ </h2>
10
+ <?php woo_ce_tab_template( $tab ); ?>
11
+
12
+ </div>
13
+ <!-- #content -->
templates/admin/woocommerce-admin_dashboard_vm-plugins.css ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .woo_vm_version_table {
2
+ color:#333;
3
+ width:100%;
4
+ }
5
+ .woo_vm_version_table th {
6
+ border-bottom:1px solid #ddd;
7
+ padding-bottom:0.2em;
8
+ }
9
+ .woo_vm_version_table td {
10
+ border-bottom:1px solid #f9f9f9;
11
+ padding:0.3em 0;
12
+ }
13
+ .woo_vm_version_table td.version, .woo_vm_version_table td.status {
14
+ font-size:12px;
15
+ }
16
+ .woo_vm_version_table td.version {
17
+ color:#666;
18
+ }
19
+ .woo_vm_version_table td.version span {
20
+ font-size:13px;
21
+ color:#333;
22
+ }
23
+ .woo_vm_version_table td.status {
24
+ text-align:center;
25
+ border:1px dotted #ddd;
26
+ }
27
+ .woo_vm_version_table td.status .green {
28
+ color:#008000;
29
+ }
30
+ .woo_vm_version_table td.status .red {
31
+ color:#ff0000;
32
+ }
33
+ .woo_vm_version_table td.status .yellow {
34
+ color:#e66f00;
35
+ }
36
+ #woo_vm_status_widget p {
37
+ font-size:12px;
38
+ }
39
+ #woo_vm_status_widget .message {
40
+ color:#000;
41
+ font-size:12px;
42
+ margin-bottom:1em;
43
+ padding:9px 9px 8px 9px;
44
+ background-color:#ffffe0;
45
+ border-color:#e6db55;
46
+ border-width:1px;
47
+ border-style:solid;
48
+ -moz-border-radius:5px;
49
+ -khtml-border-radius:5px;
50
+ -webkit-border-radius:5px;
51
+ border-radius:5px;
52
+ }
53
+ #woo_vm_status_widget .link {
54
+ text-align:right;
55
+ }