Version Description
- Heads up! This version has been revamped majorly. The new version update will not automatically adopt the existing settings. Please make sure you record/note the existing plugin settings and redo them in the new version after an update.
- Improved UI for better user experience
- Export/Import options: via a pre-saved template or a quick(standard columns) export/import
- Option to export/import selective columns
- Option to reorder columns during export
- Import: Support for different types of delimiters
- Export/Import options: Batch option with configurable batch count
- History of all the Import/Export process
- Dedicated logs for debugging failures
- Tested OK with WC 4.6.0
Download this release
Release Info
Developer | webtoffee |
Plugin | Import Export WordPress Users and WooCommerce Customers |
Version | 2.0.0 |
Comparing to | |
See all releases |
Code changes from version 1.4.4 to 2.0.0
- Sample_Users.csv +2 -2
- admin/class-wt-import-export-for-woo-admin.php +340 -0
- admin/classes/class-csvreader.php +252 -0
- admin/classes/class-csvwriter.php +160 -0
- admin/classes/class-log.php +105 -0
- admin/classes/class-logreader.php +113 -0
- admin/classes/class-logwriter.php +97 -0
- admin/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- admin/css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- admin/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- admin/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- admin/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- admin/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- admin/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- admin/css/images/ui-icons_222222_256x240.png +0 -0
- admin/css/images/ui-icons_2e83ff_256x240.png +0 -0
- admin/css/images/ui-icons_454545_256x240.png +0 -0
- admin/css/images/ui-icons_888888_256x240.png +0 -0
- admin/css/images/ui-icons_cd0a0a_256x240.png +0 -0
- admin/css/jquery-ui.css +470 -0
- {styles → admin/css}/select2.css +0 -0
- admin/css/wt-import-export-for-woo-admin.css +444 -0
- admin/index.php +1 -0
- admin/js/dropzone.min.js +1 -0
- {styles → admin/js}/select2.js +0 -0
- admin/js/tiptip.js +1 -0
- admin/js/wt-import-export-for-woo-admin.js +723 -0
- admin/modules/export/assets/js/main.js +903 -0
- admin/modules/export/classes/class-export-ajax.php +684 -0
- admin/modules/export/export.php +793 -0
- admin/modules/export/views/_export_advanced_page.php +52 -0
- admin/modules/export/views/_export_filter_page.php +15 -0
- admin/modules/export/views/_export_footer.php +65 -0
- admin/modules/export/views/_export_header.php +15 -0
- admin/modules/export/views/_export_mapping_page.php +97 -0
- admin/modules/export/views/_export_mapping_tr_html.php +20 -0
- admin/modules/export/views/_export_meta_step_page.php +56 -0
- admin/modules/export/views/_export_method_export_page.php +90 -0
- admin/modules/export/views/_export_post_type_page.php +30 -0
- admin/modules/export/views/main.php +64 -0
- admin/modules/history/assets/js/main.js +196 -0
- admin/modules/history/history.php +849 -0
- admin/modules/history/views/_history_list.php +198 -0
- admin/modules/history/views/_log_list.php +74 -0
- admin/modules/history/views/_log_table.php +80 -0
- admin/modules/history/views/settings.php +46 -0
- admin/modules/import/assets/js/main.js +1450 -0
- admin/modules/import/classes/class-import-ajax.php +1191 -0
- admin/modules/import/import.php +1279 -0
- admin/modules/import/views/_import_advanced_page.php +25 -0
- admin/modules/import/views/_import_footer.php +65 -0
- admin/modules/import/views/_import_header.php +15 -0
- admin/modules/import/views/_import_mapping_page.php +282 -0
- admin/modules/import/views/_import_mapping_tr_html.php +20 -0
- admin/modules/import/views/_import_meta_step_page.php +43 -0
- admin/modules/import/views/_import_method_import_page.php +75 -0
- admin/modules/import/views/_import_post_type_page.php +30 -0
- admin/modules/import/views/main.php +70 -0
- admin/modules/user/data/data-user-columns.php +77 -0
- admin/modules/user/data/data/data-wf-reserved-fields-pair.php +75 -0
- admin/modules/user/export/export.php +226 -0
- admin/modules/user/import/import.php +698 -0
- admin/modules/user/user.php +441 -0
- admin/partials/_form_field_generator.php +377 -0
- admin/partials/wt-import-export-for-woo-admin-display.php +73 -0
- admin/views/_save_template_popup.php +34 -0
- admin/views/admin-settings-advanced.php +20 -0
- admin/views/admin-settings-debug.php +8 -0
- admin/views/admin-settings-help.php +37 -0
- admin/views/admin-settings-save-button.php +20 -0
- assets/images/documentation.png +0 -0
- assets/images/drag_icon.png +0 -0
- assets/images/loading.gif +0 -0
- assets/images/support.png +0 -0
- helpers/class-wt-common-helper.php +284 -0
- helpers/class-wt-import-export-helper.php +223 -0
- {includes → helpers}/class-wt-security-helper.php +41 -8
- images/calendar.png +0 -0
- images/csv.png +0 -0
- images/documentation.png +0 -0
- images/setup.png +0 -0
- images/storefrog.png +0 -0
- images/support.png +0 -0
- images/video.png +0 -0
- images/wf-ajax-loader.gif +0 -0
- images/wf-failed.png +0 -0
- images/wf-import.png +0 -0
- images/wf-notice.png +0 -0
- images/wf-success.png +0 -0
- includes/class-wf-customerimpexpcsv-admin-screen.php +0 -88
- includes/class-wf-customerimpexpcsv-ajax-handler.php +0 -25
- includes/class-wt-import-export-for-woo-activator.php +160 -0
- includes/class-wt-import-export-for-woo-deactivator.php +38 -0
- includes/class-wt-import-export-for-woo-i18n.php +49 -0
- includes/class-wt-import-export-for-woo-loader.php +131 -0
- includes/class-wt-import-export-for-woo-remoteadapter.php +14 -0
- includes/class-wt-import-export-for-woo.php +331 -0
- includes/class-wt-legecy-menu-moved.php +162 -0
- includes/class-wt-userimport-uninstall-feedback.php +1 -1
- includes/exporter/class-wf-customerimpexpcsv-exporter.php +0 -144
- includes/exporter/data/data-wf-post-columns.php +0 -24
- includes/importer/class-wf-csv-parser.php +0 -133
- includes/importer/class-wf-customerimpexpcsv-customer-import.php +0 -732
- includes/importer/class-wf-customerimpexpcsv-importer.php +0 -41
- includes/importer/data/data-wf-reserved-fields-pair.php +0 -21
- includes/importer/views/html-wf-import-greeting.php +0 -38
- includes/importer/views/html-wf-import-options.php +0 -15
- includes/importer/views/market.php +0 -115
- includes/index.php +1 -0
- includes/views/export/html-wf-export-customers.php +0 -107
- includes/views/export/market.php +0 -133
- includes/views/html-wf-admin-screen.php +0 -19
- includes/views/html-wf-common-header.php +0 -7
- includes/views/html-wf-help-guide.php +0 -62
- includes/views/import/html-wf-import-customers.php +0 -8
- includes/views/market.php +0 -132
- index.php +1 -0
- lang/users-customers-import-export-for-wp-woocommerce-de_DE.mo +0 -0
- lang/users-customers-import-export-for-wp-woocommerce-de_DE.po +0 -536
- lang/users-customers-import-export-for-wp-woocommerce-fr_FR.mo +0 -0
- lang/users-customers-import-export-for-wp-woocommerce-fr_FR.po +0 -4016
- temp-import.csv → languages/wt-import-export-for-woo.pot +0 -0
- public/class-wt-import-export-for-woo-public.php +105 -0
- public/css/wt-import-export-for-woo-public.css +4 -0
- public/index.php +1 -0
- public/js/wt-import-export-for-woo-public.js +32 -0
- public/partials/wt-import-export-for-woo-public-display.php +16 -0
- readme.txt +26 -4
- styles/wf-style.css +0 -156
- uninstall.php +31 -0
- users-customers-import-export-for-wp-woocommerce.php +113 -218
Sample_Users.csv
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
ID,user_login,user_pass,
|
2 |
-
9,Mark,$P$By6K6/oknjRBovyyxs3sCDogZgO6ST1,
|
1 |
+
ID,customer_id,user_login,user_pass,user_nicename,user_email,user_url,user_registered,display_name,first_name,last_name,user_status,roles,nickname,description,rich_editing,syntax_highlighting,admin_color,use_ssl,show_admin_bar_front,locale,wp_user_level,dismissed_wp_pointers,last_update
|
2 |
+
9,9,Mark,$P$By6K6/oknjRBovyyxs3sCDogZgO6ST1,mark,mark@webtoffee.com,http://www.webtoffee.com,2020-10-01 11:52:04,Mark,Mark,Wough,,"subscriber, customer",,,,,,,,,,,
|
admin/class-wt-import-export-for-woo-admin.php
ADDED
@@ -0,0 +1,340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* The admin-specific functionality of the plugin.
|
5 |
+
*
|
6 |
+
* @link https://www.webtoffee.com/
|
7 |
+
* @since 1.0.0
|
8 |
+
*
|
9 |
+
* @package Wt_Import_Export_For_Woo
|
10 |
+
* @subpackage Wt_Import_Export_For_Woo/admin
|
11 |
+
*/
|
12 |
+
|
13 |
+
/**
|
14 |
+
* The admin-specific functionality of the plugin.
|
15 |
+
*
|
16 |
+
* Defines the plugin name, version, and two examples hooks for how to
|
17 |
+
* enqueue the admin-specific stylesheet and JavaScript.
|
18 |
+
*
|
19 |
+
* @package Wt_Import_Export_For_Woo
|
20 |
+
* @subpackage Wt_Import_Export_For_Woo/admin
|
21 |
+
* @author Webtoffee <info@webtoffee.com>
|
22 |
+
*/
|
23 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Admin_Basic')){
|
24 |
+
class Wt_Import_Export_For_Woo_Admin_Basic {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The ID of this plugin.
|
28 |
+
*
|
29 |
+
* @since 1.0.0
|
30 |
+
* @access private
|
31 |
+
* @var string $plugin_name The ID of this plugin.
|
32 |
+
*/
|
33 |
+
private $plugin_name;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* The version of this plugin.
|
37 |
+
*
|
38 |
+
* @since 1.0.0
|
39 |
+
* @access private
|
40 |
+
* @var string $version The current version of this plugin.
|
41 |
+
*/
|
42 |
+
private $version;
|
43 |
+
|
44 |
+
/*
|
45 |
+
* module list, Module folder and main file must be same as that of module name
|
46 |
+
* Please check the `register_modules` method for more details
|
47 |
+
*/
|
48 |
+
public static $modules=array(
|
49 |
+
'history',
|
50 |
+
'export',
|
51 |
+
'import',
|
52 |
+
// 'user',
|
53 |
+
);
|
54 |
+
|
55 |
+
public static $existing_modules=array();
|
56 |
+
|
57 |
+
public static $addon_modules=array();
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Initialize the class and set its properties.
|
61 |
+
*
|
62 |
+
* @since 1.0.0
|
63 |
+
* @param string $plugin_name The name of this plugin.
|
64 |
+
* @param string $version The version of this plugin.
|
65 |
+
*/
|
66 |
+
public function __construct( $plugin_name, $version ) {
|
67 |
+
|
68 |
+
$this->plugin_name = $plugin_name;
|
69 |
+
$this->version = $version;
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Register the stylesheets for the admin area.
|
75 |
+
*
|
76 |
+
* @since 1.0.0
|
77 |
+
*/
|
78 |
+
public function enqueue_styles() {
|
79 |
+
if(Wt_Import_Export_For_Woo_Basic_Common_Helper::wt_is_screen_allowed()){
|
80 |
+
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wt-import-export-for-woo-admin.css', array(), $this->version, 'all' );
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Register the JavaScript for the admin area.
|
86 |
+
*
|
87 |
+
* @since 1.0.0
|
88 |
+
*/
|
89 |
+
public function enqueue_scripts()
|
90 |
+
{
|
91 |
+
if(Wt_Import_Export_For_Woo_Basic_Common_Helper::wt_is_screen_allowed()){
|
92 |
+
/* enqueue scripts */
|
93 |
+
if(!function_exists('is_plugin_active'))
|
94 |
+
{
|
95 |
+
include_once(ABSPATH.'wp-admin/includes/plugin.php');
|
96 |
+
}
|
97 |
+
if(is_plugin_active('woocommerce/woocommerce.php'))
|
98 |
+
{
|
99 |
+
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wt-import-export-for-woo-admin.js', array( 'jquery', 'jquery-tiptip'), $this->version, false );
|
100 |
+
}else
|
101 |
+
{
|
102 |
+
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wt-import-export-for-woo-admin.js', array( 'jquery'), $this->version, false );
|
103 |
+
wp_enqueue_script(WT_IEW_PLUGIN_ID_BASIC.'-tiptip', WT_U_IEW_PLUGIN_URL.'admin/js/tiptip.js', array('jquery'), WT_U_IEW_VERSION, false);
|
104 |
+
}
|
105 |
+
|
106 |
+
$params=array(
|
107 |
+
'nonces' => array(
|
108 |
+
'main' => wp_create_nonce(WT_IEW_PLUGIN_ID_BASIC),
|
109 |
+
),
|
110 |
+
'ajax_url' => admin_url('admin-ajax.php'),
|
111 |
+
'plugin_id' =>WT_IEW_PLUGIN_ID_BASIC,
|
112 |
+
'msgs'=>array(
|
113 |
+
'settings_success'=>__('Settings updated.'),
|
114 |
+
'all_fields_mandatory'=>__('All fields are mandatory'),
|
115 |
+
'settings_error'=>__('Unable to update Settings.'),
|
116 |
+
'value_empty'=>__('Value is empty.'),
|
117 |
+
'error'=>__('Error.'),
|
118 |
+
'success'=>__('Success.'),
|
119 |
+
'loading'=>__('Loading...'),
|
120 |
+
'sure'=>__('Are you sure?'),
|
121 |
+
'use_expression'=>__('Use expression as value.'),
|
122 |
+
'cancel'=>__('Cancel'),
|
123 |
+
)
|
124 |
+
);
|
125 |
+
wp_localize_script($this->plugin_name, 'wt_iew_basic_params', $params);
|
126 |
+
}
|
127 |
+
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Registers menu options
|
132 |
+
* Hooked into admin_menu
|
133 |
+
*
|
134 |
+
* @since 1.0.0
|
135 |
+
*/
|
136 |
+
public function admin_menu()
|
137 |
+
{
|
138 |
+
$menus=array(
|
139 |
+
'general-settings'=>array(
|
140 |
+
'menu',
|
141 |
+
__('General Settings'),
|
142 |
+
__('WebToffee Import Export (Basic)'),
|
143 |
+
'manage_options',
|
144 |
+
WT_IEW_PLUGIN_ID_BASIC,
|
145 |
+
array($this,'admin_settings_page'),
|
146 |
+
'dashicons-controls-repeat',
|
147 |
+
56
|
148 |
+
),
|
149 |
+
'general-settings-sub'=>array(
|
150 |
+
'submenu',
|
151 |
+
WT_IEW_PLUGIN_ID_BASIC,
|
152 |
+
__('General Settings'),
|
153 |
+
__('General Settings'),
|
154 |
+
"manage_options",
|
155 |
+
WT_IEW_PLUGIN_ID_BASIC,
|
156 |
+
array($this, 'admin_settings_page')
|
157 |
+
)
|
158 |
+
);
|
159 |
+
$menus=apply_filters('wt_iew_admin_menu_basic',$menus);
|
160 |
+
if(count($menus)>0)
|
161 |
+
{
|
162 |
+
foreach($menus as $menu)
|
163 |
+
{
|
164 |
+
if($menu[0]=='submenu')
|
165 |
+
{
|
166 |
+
add_submenu_page($menu[1],$menu[2],$menu[3],$menu[4],$menu[5],$menu[6]);
|
167 |
+
}else
|
168 |
+
{
|
169 |
+
add_menu_page($menu[1],$menu[2],$menu[3],$menu[4],$menu[5],$menu[6],$menu[7]);
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
if(function_exists('remove_submenu_page')){
|
174 |
+
//remove_submenu_page(WT_PIEW_POST_TYPE,WT_PIEW_POST_TYPE);
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
public function admin_settings_page()
|
179 |
+
{
|
180 |
+
include(plugin_dir_path( __FILE__ ).'partials/wt-import-export-for-woo-admin-display.php');
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Save admin settings and module settings ajax hook
|
185 |
+
*/
|
186 |
+
public function save_settings()
|
187 |
+
{
|
188 |
+
$out=array(
|
189 |
+
'status'=>false,
|
190 |
+
'msg'=>__('Error'),
|
191 |
+
);
|
192 |
+
|
193 |
+
if(Wt_Iew_Sh::check_write_access(WT_IEW_PLUGIN_ID_BASIC))
|
194 |
+
{
|
195 |
+
$advanced_settings=Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings();
|
196 |
+
$advanced_fields=Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings_fields();
|
197 |
+
$validation_rule=Wt_Import_Export_For_Woo_Basic_Common_Helper::extract_validation_rules($advanced_fields);
|
198 |
+
$new_advanced_settings=array();
|
199 |
+
foreach($advanced_fields as $key => $value)
|
200 |
+
{
|
201 |
+
$field_name=(substr($value['field_name'],0,8)!=='wt_iew_' ? 'wt_iew_' : '').$value['field_name'];
|
202 |
+
$validation_key=str_replace('wt_iew_', '', $field_name);
|
203 |
+
if(isset($_POST[$field_name]))
|
204 |
+
{
|
205 |
+
$new_advanced_settings[$field_name]=Wt_Iew_Sh::sanitize_data($_POST[$field_name], $validation_key, $validation_rule);
|
206 |
+
}
|
207 |
+
}
|
208 |
+
Wt_Import_Export_For_Woo_Basic_Common_Helper::set_advanced_settings($new_advanced_settings);
|
209 |
+
$out['status']=true;
|
210 |
+
$out['msg']=__('Settings Updated');
|
211 |
+
do_action('wt_iew_after_advanced_setting_update_basic', $new_advanced_settings);
|
212 |
+
}
|
213 |
+
echo json_encode($out);
|
214 |
+
exit();
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
Registers modules: admin
|
219 |
+
*/
|
220 |
+
public function admin_modules()
|
221 |
+
{
|
222 |
+
$wt_iew_admin_modules=get_option('wt_iew_admin_modules');
|
223 |
+
if($wt_iew_admin_modules===false)
|
224 |
+
{
|
225 |
+
$wt_iew_admin_modules=array();
|
226 |
+
}
|
227 |
+
foreach (self::$modules as $module) //loop through module list and include its file
|
228 |
+
{
|
229 |
+
$is_active=1;
|
230 |
+
if(isset($wt_iew_admin_modules[$module]))
|
231 |
+
{
|
232 |
+
$is_active=$wt_iew_admin_modules[$module]; //checking module status
|
233 |
+
}else
|
234 |
+
{
|
235 |
+
$wt_iew_admin_modules[$module]=1; //default status is active
|
236 |
+
}
|
237 |
+
$module_file=plugin_dir_path( __FILE__ )."modules/$module/$module.php";
|
238 |
+
if(file_exists($module_file) && $is_active==1)
|
239 |
+
{
|
240 |
+
self::$existing_modules[]=$module; //this is for module_exits checking
|
241 |
+
require_once $module_file;
|
242 |
+
}else
|
243 |
+
{
|
244 |
+
$wt_iew_admin_modules[$module]=0;
|
245 |
+
}
|
246 |
+
}
|
247 |
+
$out=array();
|
248 |
+
foreach($wt_iew_admin_modules as $k=>$m)
|
249 |
+
{
|
250 |
+
if(in_array($k, self::$modules))
|
251 |
+
{
|
252 |
+
$out[$k]=$m;
|
253 |
+
}
|
254 |
+
}
|
255 |
+
update_option('wt_iew_admin_modules',$out);
|
256 |
+
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Add on modules
|
260 |
+
*/
|
261 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
262 |
+
foreach (self::$addon_modules as $module) //loop through module list and include its file
|
263 |
+
{
|
264 |
+
$plugin_file="wt-import-export-for-woo-$module/wt-import-export-for-woo-$module.php";
|
265 |
+
if(is_plugin_active($plugin_file))
|
266 |
+
{
|
267 |
+
$module_file=WP_PLUGIN_DIR."/wt-import-export-for-woo-$module/$module/$module.php";
|
268 |
+
if(file_exists($module_file))
|
269 |
+
{
|
270 |
+
self::$existing_modules[]=$module;
|
271 |
+
require_once $module_file;
|
272 |
+
}
|
273 |
+
}
|
274 |
+
}
|
275 |
+
|
276 |
+
$addon_modules_basic = array(
|
277 |
+
'user'=>'users-customers-import-export-for-wp-woocommerce',
|
278 |
+
'product'=>'product-import-export-for-woo',
|
279 |
+
'order'=>'order-import-export-for-woocommerce',
|
280 |
+
'coupon'=>'order-import-export-for-woocommerce',
|
281 |
+
);
|
282 |
+
foreach ($addon_modules_basic as $module_key => $module_path)
|
283 |
+
{
|
284 |
+
if(is_plugin_active("{$module_path}/{$module_path}.php"))
|
285 |
+
{
|
286 |
+
$module_file=WP_CONTENT_DIR."/plugins/{$module_path}/admin/modules/$module_key/$module_key.php";
|
287 |
+
if(file_exists($module_file))
|
288 |
+
{
|
289 |
+
self::$existing_modules[]=$module;
|
290 |
+
require_once $module_file;
|
291 |
+
}
|
292 |
+
}
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
public static function module_exists($module)
|
297 |
+
{
|
298 |
+
return in_array($module, self::$existing_modules);
|
299 |
+
}
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Envelope settings tab content with tab div.
|
303 |
+
* relative path is not acceptable in view file
|
304 |
+
*/
|
305 |
+
public static function envelope_settings_tabcontent($target_id,$view_file="",$html="",$variables=array(),$need_submit_btn=0)
|
306 |
+
{
|
307 |
+
extract($variables);
|
308 |
+
?>
|
309 |
+
<div class="wt-iew-tab-content" data-id="<?php echo $target_id;?>">
|
310 |
+
<?php
|
311 |
+
if($view_file!="" && file_exists($view_file))
|
312 |
+
{
|
313 |
+
include_once $view_file;
|
314 |
+
}else
|
315 |
+
{
|
316 |
+
echo $html;
|
317 |
+
}
|
318 |
+
?>
|
319 |
+
<?php
|
320 |
+
if($need_submit_btn==1)
|
321 |
+
{
|
322 |
+
include WT_U_IEW_PLUGIN_PATH."admin/views/admin-settings-save-button.php";
|
323 |
+
}
|
324 |
+
?>
|
325 |
+
</div>
|
326 |
+
<?php
|
327 |
+
}
|
328 |
+
|
329 |
+
/**
|
330 |
+
* Plugin page action links
|
331 |
+
*/
|
332 |
+
public function plugin_action_links($links)
|
333 |
+
{
|
334 |
+
$links[] = '<a href="'.admin_url('admin.php?page='.WT_IEW_PLUGIN_ID_BASIC).'">'.__('Settings').'</a>';
|
335 |
+
$links[] = '<a href="https://www.webtoffee.com/" target="_blank">'.__('Documentation').'</a>';
|
336 |
+
$links[] = '<a href="https://www.webtoffee.com/support/" target="_blank">'.__('Support').'</a>';
|
337 |
+
return $links;
|
338 |
+
}
|
339 |
+
}
|
340 |
+
}
|
admin/classes/class-csvreader.php
ADDED
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* CSV reading section of the plugin
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Csvreader')){
|
13 |
+
class Wt_Import_Export_For_Woo_Basic_Csvreader
|
14 |
+
{
|
15 |
+
public $delimiter=',';
|
16 |
+
public $fgetcsv_esc_check=0;
|
17 |
+
public function __construct($delimiter=',')
|
18 |
+
{
|
19 |
+
$this->delimiter=$delimiter;
|
20 |
+
$this->delimiter=($this->delimiter=='tab' ? "\t" : $this->delimiter);
|
21 |
+
|
22 |
+
/* version 5.3.0 onwards 5th escaping argument introduced in `fgetcsv` function */
|
23 |
+
$this->fgetcsv_esc_check = (version_compare(PHP_VERSION, '5.3.0') >= 0);
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Taking sample data for mapping screen preparation
|
28 |
+
* This function skip empty rows and take first two non empty rows
|
29 |
+
*/
|
30 |
+
public function get_sample_data($file, $grouping=false)
|
31 |
+
{
|
32 |
+
$enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
|
33 |
+
if($enc)
|
34 |
+
{
|
35 |
+
setlocale(LC_ALL, 'en_US.'.$enc);
|
36 |
+
}
|
37 |
+
@ini_set('auto_detect_line_endings', true);
|
38 |
+
|
39 |
+
$sample_data_key=array();
|
40 |
+
$sample_data_val=array();
|
41 |
+
$sample_data=array();
|
42 |
+
|
43 |
+
if(($handle=@fopen($file, "r"))!== false)
|
44 |
+
{
|
45 |
+
$row_count=0;
|
46 |
+
while(($row=($this->fgetcsv_esc_check) ? fgetcsv($handle, 0, $this->delimiter, '"', '"') : fgetcsv($handle, 0, $this->delimiter, '"') )!==false)
|
47 |
+
{
|
48 |
+
if(count(array_filter($row))==0)
|
49 |
+
{
|
50 |
+
continue;
|
51 |
+
}else
|
52 |
+
{
|
53 |
+
$row_count++;
|
54 |
+
}
|
55 |
+
|
56 |
+
if($row_count==1) //taking heading row
|
57 |
+
{
|
58 |
+
$sample_data_key=$row;
|
59 |
+
}else //taking data row
|
60 |
+
{
|
61 |
+
$sample_data_val=$row;
|
62 |
+
break; //only single data row needed
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
foreach($sample_data_key as $k => $key)
|
67 |
+
{
|
68 |
+
if(!$key)
|
69 |
+
{
|
70 |
+
continue;
|
71 |
+
}
|
72 |
+
|
73 |
+
$val=(isset($sample_data_val[$k]) ? $this->format_data_from_csv($sample_data_val[$k], $enc) : '');
|
74 |
+
|
75 |
+
/* removing BOM like non characters */
|
76 |
+
// $key=preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $key);
|
77 |
+
$key= wt_removeBomUtf8_basic($key);
|
78 |
+
if($grouping)
|
79 |
+
{
|
80 |
+
if(strrpos($key, ':')!==false)
|
81 |
+
{
|
82 |
+
$key_arr=explode(":", $key);
|
83 |
+
if(count($key_arr)>1)
|
84 |
+
{
|
85 |
+
$meta_key=$key_arr[0];
|
86 |
+
if(!isset($sample_data[$meta_key]))
|
87 |
+
{
|
88 |
+
$sample_data[$meta_key]=array();
|
89 |
+
}
|
90 |
+
$sample_data[$meta_key][$key]=$val;
|
91 |
+
}else
|
92 |
+
{
|
93 |
+
$sample_data[$key]=$val;
|
94 |
+
}
|
95 |
+
}else
|
96 |
+
{
|
97 |
+
$sample_data[$key]=$val;
|
98 |
+
}
|
99 |
+
}else
|
100 |
+
{
|
101 |
+
$sample_data[$key]=$val;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
fclose($handle);
|
106 |
+
}
|
107 |
+
|
108 |
+
return $sample_data;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Get data from CSV as batch
|
113 |
+
*/
|
114 |
+
public function get_data_as_batch($file, $offset, $batch_count, $module_obj, $form_data)
|
115 |
+
{
|
116 |
+
// Set locale
|
117 |
+
$enc = mb_detect_encoding( $file, 'UTF-8, ISO-8859-1', true );
|
118 |
+
if($enc)
|
119 |
+
{
|
120 |
+
setlocale( LC_ALL, 'en_US.' . $enc );
|
121 |
+
}
|
122 |
+
@ini_set('auto_detect_line_endings', true);
|
123 |
+
|
124 |
+
$out=array(
|
125 |
+
'response'=>false,
|
126 |
+
'offset'=>$offset,
|
127 |
+
'data_arr'=>array(),
|
128 |
+
);
|
129 |
+
|
130 |
+
if(($handle=@fopen($file, "r"))!== false)
|
131 |
+
{
|
132 |
+
/**
|
133 |
+
* taking head
|
134 |
+
*/
|
135 |
+
$head_arr=array();
|
136 |
+
while(($row=($this->fgetcsv_esc_check) ? fgetcsv($handle, 0, $this->delimiter, '"', '"') : fgetcsv($handle, 0, $this->delimiter, '"') )!==false)
|
137 |
+
{
|
138 |
+
if(count(array_filter($row))!=0) /* first non empty array */
|
139 |
+
{
|
140 |
+
$head_arr=$row;
|
141 |
+
if($offset==0) /* on first batch */
|
142 |
+
{
|
143 |
+
$offset_after_head=ftell($handle);
|
144 |
+
fseek($handle, $offset_after_head); /* skipping head row */
|
145 |
+
}
|
146 |
+
break;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
$empty_head_columns=array();
|
151 |
+
foreach($head_arr as $head_key=>$head_val)
|
152 |
+
{
|
153 |
+
if(trim($head_val)=='')
|
154 |
+
{
|
155 |
+
$empty_head_columns[]=$head_key;
|
156 |
+
unset($head_arr[$head_key]);
|
157 |
+
}else
|
158 |
+
{
|
159 |
+
/* removing BOM like non characters */
|
160 |
+
// $head_arr[$head_key]=preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $head_val);
|
161 |
+
$head_arr[$head_key]= wt_removeBomUtf8_basic($head_val);
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
/* moving the pointer to corresponding batch. If not first batch */
|
166 |
+
if($offset!=0)
|
167 |
+
{
|
168 |
+
fseek($handle, $offset);
|
169 |
+
}
|
170 |
+
|
171 |
+
$out_arr=array();
|
172 |
+
|
173 |
+
$row_count=0;
|
174 |
+
/* taking data */
|
175 |
+
while(($row=($this->fgetcsv_esc_check) ? fgetcsv($handle, 0, $this->delimiter, '"', '"') : fgetcsv($handle, 0, $this->delimiter, '"') )!==false)
|
176 |
+
{
|
177 |
+
$offset=ftell($handle); /* next offset */
|
178 |
+
|
179 |
+
/*
|
180 |
+
* Skipping empty rows
|
181 |
+
*/
|
182 |
+
if(count(array_filter($row))==0)
|
183 |
+
{
|
184 |
+
continue;
|
185 |
+
}
|
186 |
+
|
187 |
+
/*
|
188 |
+
* Remove values of empty head
|
189 |
+
*/
|
190 |
+
foreach($empty_head_columns as $key)
|
191 |
+
{
|
192 |
+
unset($row[$key]);
|
193 |
+
}
|
194 |
+
|
195 |
+
/*
|
196 |
+
* Creating associative array with heading and data
|
197 |
+
*/
|
198 |
+
$row_column_count=count($row);
|
199 |
+
$head_column_count=count($head_arr);
|
200 |
+
if($row_column_count<$head_column_count)
|
201 |
+
{
|
202 |
+
$empty_row=array_fill($row_column_count, ($head_column_count-$row_column_count), '');
|
203 |
+
$row=array_merge($row, $empty_row);
|
204 |
+
$empty_row=null;
|
205 |
+
unset($empty_row);
|
206 |
+
}
|
207 |
+
elseif($row_column_count>$head_column_count)
|
208 |
+
{
|
209 |
+
continue;
|
210 |
+
}
|
211 |
+
|
212 |
+
/* clearing temp variables */
|
213 |
+
$row_column_count=$head_column_count=null;
|
214 |
+
unset($row_column_count, $head_column_count);
|
215 |
+
|
216 |
+
/* preparing associative array */
|
217 |
+
$data_row=array_combine($head_arr, $row);
|
218 |
+
|
219 |
+
$out_arr[]=$module_obj->process_column_val($data_row, $form_data);
|
220 |
+
//$out_arr[]=$data_row;
|
221 |
+
|
222 |
+
unset($data_row);
|
223 |
+
|
224 |
+
$row_count++;
|
225 |
+
if($row_count==$batch_count)
|
226 |
+
{
|
227 |
+
break;
|
228 |
+
}
|
229 |
+
}
|
230 |
+
fclose($handle);
|
231 |
+
|
232 |
+
$out=array(
|
233 |
+
'response'=>true,
|
234 |
+
'offset'=>$offset,
|
235 |
+
'rows_processed'=>$row_count,
|
236 |
+
'data_arr'=>$out_arr,
|
237 |
+
);
|
238 |
+
|
239 |
+
$head_arr=$form_data=$row=$out_arr=null;
|
240 |
+
unset($head_arr, $form_data, $row, $out_arr);
|
241 |
+
}
|
242 |
+
|
243 |
+
return $out;
|
244 |
+
}
|
245 |
+
|
246 |
+
protected function format_data_from_csv($data, $enc)
|
247 |
+
{
|
248 |
+
//return sanitize_text_field(( $enc == 'UTF-8' ) ? trim($data) : utf8_encode(trim($data))); sanitize_text_field stripping html content
|
249 |
+
return (( $enc == 'UTF-8' ) ? trim($data) : utf8_encode(trim($data)));
|
250 |
+
}
|
251 |
+
}
|
252 |
+
}
|
admin/classes/class-csvwriter.php
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* CSV writing section of the plugin
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Csvwriter')){
|
13 |
+
class Wt_Import_Export_For_Woo_Basic_Csvwriter
|
14 |
+
{
|
15 |
+
public $file_path='';
|
16 |
+
public $data_ar='';
|
17 |
+
public $csv_delimiter='';
|
18 |
+
public function __construct($file_path, $offset, $csv_delimiter=",")
|
19 |
+
{
|
20 |
+
$this->csv_delimiter=$csv_delimiter;
|
21 |
+
$this->file_path=$file_path;
|
22 |
+
$this->get_file_pointer($offset);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* This is used in XML to CSV converting
|
27 |
+
*/
|
28 |
+
public function write_row($row_data, $offset=0, $is_last_offset=false)
|
29 |
+
{
|
30 |
+
if($is_last_offset)
|
31 |
+
{
|
32 |
+
$this->close_file_pointer();
|
33 |
+
}else
|
34 |
+
{
|
35 |
+
if($offset==0) /* set heading */
|
36 |
+
{
|
37 |
+
$this->fput_csv($this->file_pointer, array_keys($row_data), $this->csv_delimiter);
|
38 |
+
}
|
39 |
+
$this->fput_csv($this->file_pointer, $row_data, $this->csv_delimiter);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Create CSV
|
45 |
+
*
|
46 |
+
*/
|
47 |
+
public function write_to_file($export_data, $offset, $is_last_offset, $to_export)
|
48 |
+
{
|
49 |
+
$this->export_data=$export_data;
|
50 |
+
$this->set_head($export_data, $offset, $this->csv_delimiter);
|
51 |
+
$this->set_content($export_data, $this->csv_delimiter);
|
52 |
+
$this->close_file_pointer();
|
53 |
+
}
|
54 |
+
private function get_file_pointer($offset)
|
55 |
+
{
|
56 |
+
if($offset==0)
|
57 |
+
{
|
58 |
+
$this->file_pointer=fopen($this->file_path, 'w');
|
59 |
+
}else
|
60 |
+
{
|
61 |
+
$this->file_pointer=fopen($this->file_path, 'a+');
|
62 |
+
}
|
63 |
+
}
|
64 |
+
private function close_file_pointer()
|
65 |
+
{
|
66 |
+
if($this->file_pointer!=null)
|
67 |
+
{
|
68 |
+
fclose($this->file_pointer);
|
69 |
+
}
|
70 |
+
}
|
71 |
+
/**
|
72 |
+
* Escape a string to be used in a CSV context
|
73 |
+
*
|
74 |
+
* Malicious input can inject formulas into CSV files, opening up the possibility
|
75 |
+
* for phishing attacks and disclosure of sensitive information.
|
76 |
+
*
|
77 |
+
* Additionally, Excel exposes the ability to launch arbitrary commands through
|
78 |
+
* the DDE protocol.
|
79 |
+
*
|
80 |
+
* @see http://www.contextis.com/resources/blog/comma-separated-vulnerabilities/
|
81 |
+
* @see https://hackerone.com/reports/72785
|
82 |
+
*
|
83 |
+
* @param string $data CSV field to escape.
|
84 |
+
* @return string
|
85 |
+
*/
|
86 |
+
public function escape_data( $data )
|
87 |
+
{
|
88 |
+
$active_content_triggers = array( '=', '+', '-', '@' );
|
89 |
+
|
90 |
+
if ( in_array( mb_substr( $data, 0, 1 ), $active_content_triggers, true ) ) {
|
91 |
+
$data = "'" . $data;
|
92 |
+
}
|
93 |
+
|
94 |
+
return $data;
|
95 |
+
}
|
96 |
+
public function format_data( $data )
|
97 |
+
{
|
98 |
+
if ( ! is_scalar( $data ) ) {
|
99 |
+
if ( is_a( $data, 'WC_Datetime' ) ) {
|
100 |
+
$data = $data->date( 'Y-m-d G:i:s' );
|
101 |
+
} else {
|
102 |
+
$data = ''; // Not supported.
|
103 |
+
}
|
104 |
+
} elseif ( is_bool( $data ) ) {
|
105 |
+
$data = $data ? 1 : 0;
|
106 |
+
}
|
107 |
+
|
108 |
+
$use_mb = function_exists( 'mb_convert_encoding' );
|
109 |
+
|
110 |
+
if ( $use_mb ) {
|
111 |
+
$encoding = mb_detect_encoding( $data, 'UTF-8, ISO-8859-1', true );
|
112 |
+
$data = 'UTF-8' === $encoding ? $data : utf8_encode( $data );
|
113 |
+
}
|
114 |
+
|
115 |
+
return $this->escape_data( $data );
|
116 |
+
}
|
117 |
+
private function set_content($export_data, $delm=',')
|
118 |
+
{
|
119 |
+
if(isset($export_data) && isset($export_data['body_data']) && count($export_data['body_data'])>0)
|
120 |
+
{
|
121 |
+
$row_datas=array_values($export_data['body_data']);
|
122 |
+
foreach($row_datas as $row_data)
|
123 |
+
{
|
124 |
+
foreach($row_data as $key => $value)
|
125 |
+
{
|
126 |
+
$row_data[$key]=$this->format_data($value);
|
127 |
+
}
|
128 |
+
$this->fput_csv($this->file_pointer, $row_data, $delm);
|
129 |
+
}
|
130 |
+
}
|
131 |
+
}
|
132 |
+
private function set_head($export_data, $offset, $delm=',')
|
133 |
+
{
|
134 |
+
if($offset==0 && isset($export_data) && isset($export_data['head_data']) && count($export_data['head_data'])>0)
|
135 |
+
{
|
136 |
+
foreach($export_data['head_data'] as $key => $value)
|
137 |
+
{
|
138 |
+
$export_data['head_data'][$key]=$this->format_data($value);
|
139 |
+
}
|
140 |
+
$this->fput_csv($this->file_pointer, $export_data['head_data'], $delm);
|
141 |
+
}
|
142 |
+
}
|
143 |
+
private function fput_csv($fp, $row, $delm=',', $encloser='"' )
|
144 |
+
{
|
145 |
+
fputcsv($fp,$row,$delm,$encloser);
|
146 |
+
}
|
147 |
+
private function array_to_csv($arr, $delm=',', $encloser='"')
|
148 |
+
{
|
149 |
+
$fp=fopen('php://memory','rw');
|
150 |
+
foreach($arr as $row)
|
151 |
+
{
|
152 |
+
$this->fput_csv($fp, $row, $delm, $encloser);
|
153 |
+
}
|
154 |
+
rewind($fp);
|
155 |
+
$csv=stream_get_contents($fp);
|
156 |
+
fclose($fp);
|
157 |
+
return $csv;
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
admin/classes/class-log.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Log writing section of the plugin
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Log')){
|
13 |
+
class Wt_Import_Export_For_Woo_Basic_Log
|
14 |
+
{
|
15 |
+
public static $log_dir=WP_CONTENT_DIR.'/webtoffee_iew_log';
|
16 |
+
public static $history_id='';
|
17 |
+
public function __construct()
|
18 |
+
{
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Get given temp file path.
|
24 |
+
* If file name is empty then file path will return
|
25 |
+
*/
|
26 |
+
public static function get_file_path($file_name="")
|
27 |
+
{
|
28 |
+
if(!is_dir(self::$log_dir))
|
29 |
+
{
|
30 |
+
if(!mkdir(self::$log_dir, 0700))
|
31 |
+
{
|
32 |
+
return false;
|
33 |
+
}else
|
34 |
+
{
|
35 |
+
$files_to_create=array('.htaccess' => 'deny from all', 'index.php'=>'<?php // Silence is golden');
|
36 |
+
foreach($files_to_create as $file=>$file_content)
|
37 |
+
{
|
38 |
+
if(!file_exists(self::$log_dir.'/'.$file))
|
39 |
+
{
|
40 |
+
$fh=@fopen(self::$log_dir.'/'.$file, "w");
|
41 |
+
if(is_resource($fh))
|
42 |
+
{
|
43 |
+
fwrite($fh, $file_content);
|
44 |
+
fclose($fh);
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
return self::$log_dir.'/'.$file_name;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Checks a log file created for the history entry for current day
|
55 |
+
* @param int $history_id id of history entry
|
56 |
+
* @return string/bool if file found returns file name otherwise false
|
57 |
+
*/
|
58 |
+
public static function check_log_exists_for_entry($history_id)
|
59 |
+
{
|
60 |
+
$log_dir=self::get_file_path();
|
61 |
+
$exp='~^'.$history_id.'.*\.log$~';
|
62 |
+
$files = preg_grep($exp, scandir($log_dir));
|
63 |
+
|
64 |
+
if(count($files)>0) /* file exists */
|
65 |
+
{
|
66 |
+
foreach($files as $key => $value)
|
67 |
+
{
|
68 |
+
$file_name=pathinfo($value, PATHINFO_FILENAME);
|
69 |
+
$file_name_arr=explode('_', $file_name);
|
70 |
+
$file_date_time=end($file_name_arr);
|
71 |
+
$file_date_time_arr=explode(' ', $file_date_time);
|
72 |
+
$file_time=strtotime($file_date_time_arr[0]);
|
73 |
+
if($file_time) //file time exists
|
74 |
+
{
|
75 |
+
$today=strtotime(date('Y-m-d'));
|
76 |
+
$file_time=strtotime(date('Y-m-d', $file_time));
|
77 |
+
if($today==$file_time) //file exists with the current day
|
78 |
+
{
|
79 |
+
return $value;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
}
|
84 |
+
return false;
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Generate log file name
|
89 |
+
*
|
90 |
+
*/
|
91 |
+
public static function generate_file_name($post_type='', $action_type='', $history_id='')
|
92 |
+
{
|
93 |
+
$arr=array($history_id, $post_type);
|
94 |
+
if(defined( 'WT_IEW_CRON' )) /* this is a cron run so add a schedule prefix */
|
95 |
+
{
|
96 |
+
$arr[]='schedule';
|
97 |
+
}
|
98 |
+
$arr[]=$action_type;
|
99 |
+
$arr[]=date('Y-m-d h i s A'); /* if changing this format please consider `check_log_exists_for_entry` method */
|
100 |
+
|
101 |
+
$arr=array_filter($arr);
|
102 |
+
return implode("_", $arr).'.log';
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
admin/classes/class-logreader.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Log reading section of the plugin
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Logreader')){
|
13 |
+
class Wt_Import_Export_For_Woo_Basic_Logreader
|
14 |
+
{
|
15 |
+
private $file_path='';
|
16 |
+
private $file_pointer=null;
|
17 |
+
private $mode='';
|
18 |
+
public function __construct()
|
19 |
+
{
|
20 |
+
|
21 |
+
}
|
22 |
+
public function init($file_path)
|
23 |
+
{
|
24 |
+
$this->file_path=$file_path;
|
25 |
+
$this->mode=$mode;
|
26 |
+
$this->file_pointer=@fopen($file_path, 'r');
|
27 |
+
}
|
28 |
+
public function close_file_pointer()
|
29 |
+
{
|
30 |
+
if($this->file_pointer!=null)
|
31 |
+
{
|
32 |
+
fclose($this->file_pointer);
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
public function get_full_data($file_path)
|
37 |
+
{
|
38 |
+
$out=array(
|
39 |
+
'response'=>false,
|
40 |
+
'data_str'=>'',
|
41 |
+
);
|
42 |
+
$this->init($file_path);
|
43 |
+
if(!is_resource($this->file_pointer))
|
44 |
+
{
|
45 |
+
return $out;
|
46 |
+
}
|
47 |
+
$data=fread($this->file_pointer, filesize($file_path));
|
48 |
+
|
49 |
+
$this->close_file_pointer();
|
50 |
+
|
51 |
+
$out=array(
|
52 |
+
'response'=>false,
|
53 |
+
'data_str'=>$data,
|
54 |
+
);
|
55 |
+
return $out;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Read log file as batch
|
60 |
+
* @param string path of file to read
|
61 |
+
* @param int offset in bytes. default 0
|
62 |
+
* @param int total row in a batch. default 50
|
63 |
+
* @return array response, next offset, data array, finished or not flag
|
64 |
+
*/
|
65 |
+
public function get_data_as_batch($file_path, $offset=0, $batch_count=50)
|
66 |
+
{
|
67 |
+
$out=array(
|
68 |
+
'response'=>false,
|
69 |
+
'offset'=>$offset,
|
70 |
+
'data_arr'=>array(),
|
71 |
+
'finished'=>false, //end of file reached or not
|
72 |
+
);
|
73 |
+
$this->init($file_path);
|
74 |
+
if(!is_resource($this->file_pointer))
|
75 |
+
{
|
76 |
+
return $out;
|
77 |
+
}
|
78 |
+
|
79 |
+
fseek($this->file_pointer, $offset);
|
80 |
+
$row_count=0;
|
81 |
+
$next_offset=$offset;
|
82 |
+
$finished=false;
|
83 |
+
$data_arr=array();
|
84 |
+
while(($data=fgets($this->file_pointer))!==false)
|
85 |
+
{
|
86 |
+
$data=maybe_unserialize($data);
|
87 |
+
if(is_array($data))
|
88 |
+
{
|
89 |
+
$data_arr[]=$data;
|
90 |
+
$row_count++;
|
91 |
+
$next_offset=ftell($this->file_pointer);
|
92 |
+
}
|
93 |
+
if($row_count==$batch_count)
|
94 |
+
{
|
95 |
+
break;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
if($next_offset==filesize($file_path))
|
99 |
+
{
|
100 |
+
$finished=true;
|
101 |
+
}
|
102 |
+
$this->close_file_pointer();
|
103 |
+
|
104 |
+
$out=array(
|
105 |
+
'response'=>true,
|
106 |
+
'offset'=>$next_offset,
|
107 |
+
'data_arr'=>$data_arr,
|
108 |
+
'finished'=>$finished,
|
109 |
+
);
|
110 |
+
return $out;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
admin/classes/class-logwriter.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Log writing section of the plugin
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Logwriter')){
|
13 |
+
class Wt_Import_Export_For_Woo_Basic_Logwriter extends Wt_Import_Export_For_Woo_Basic_Log
|
14 |
+
{
|
15 |
+
private static $file_path='';
|
16 |
+
private static $file_pointer=null;
|
17 |
+
private static $mode='';
|
18 |
+
public function __construct()
|
19 |
+
{
|
20 |
+
|
21 |
+
}
|
22 |
+
public static function init($file_path, $mode="a+")
|
23 |
+
{
|
24 |
+
self::$file_path=$file_path;
|
25 |
+
self::$mode=$mode;
|
26 |
+
self::$file_pointer=@fopen($file_path, $mode);
|
27 |
+
}
|
28 |
+
public static function write_row($text, $is_writing_finished=false)
|
29 |
+
{
|
30 |
+
if(is_null(self::$file_pointer))
|
31 |
+
{
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
@fwrite(self::$file_pointer, $text.PHP_EOL);
|
35 |
+
if($is_writing_finished)
|
36 |
+
{
|
37 |
+
self::close_file_pointer();
|
38 |
+
}
|
39 |
+
}
|
40 |
+
public static function close_file_pointer()
|
41 |
+
{
|
42 |
+
if(self::$file_pointer!=null)
|
43 |
+
{
|
44 |
+
fclose(self::$file_pointer);
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Debug log writing function
|
50 |
+
* @param string $post_type post type
|
51 |
+
* @param string $action_type action type
|
52 |
+
* @param mixed $data array/string of data to write
|
53 |
+
*/
|
54 |
+
public static function write_log($post_type, $action_type, $data)
|
55 |
+
{
|
56 |
+
/**
|
57 |
+
* Checks log file created for the current day
|
58 |
+
*/
|
59 |
+
$old_file_name=self::check_log_exists_for_entry(self::$history_id);
|
60 |
+
if(!$old_file_name)
|
61 |
+
{
|
62 |
+
$file_name=self::generate_file_name($post_type, $action_type, self::$history_id);
|
63 |
+
}else
|
64 |
+
{
|
65 |
+
$file_name=$old_file_name;
|
66 |
+
}
|
67 |
+
$file_path=self::get_file_path($file_name);
|
68 |
+
self::init($file_path);
|
69 |
+
$date_string=date_i18n('m-d-Y @ H:i:s');
|
70 |
+
if(is_array($data))
|
71 |
+
{
|
72 |
+
foreach ($data as $value)
|
73 |
+
{
|
74 |
+
self::write_row($date_string." - ".maybe_serialize($value));
|
75 |
+
}
|
76 |
+
}else
|
77 |
+
{
|
78 |
+
self::write_row($date_string." - ".$data);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Import response log
|
84 |
+
* @param array $data array/string of import response data
|
85 |
+
* @param string $file_path import log file
|
86 |
+
*/
|
87 |
+
public static function write_import_log($data_arr, $file_path)
|
88 |
+
{
|
89 |
+
self::init($file_path);
|
90 |
+
foreach($data_arr as $key => $data)
|
91 |
+
{
|
92 |
+
self::write_row(maybe_serialize($data));
|
93 |
+
}
|
94 |
+
self::close_file_pointer();
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
admin/css/images/ui-bg_flat_0_aaaaaa_40x100.png
ADDED
Binary file
|
admin/css/images/ui-bg_flat_75_ffffff_40x100.png
ADDED
Binary file
|
admin/css/images/ui-bg_glass_55_fbf9ee_1x400.png
ADDED
Binary file
|
admin/css/images/ui-bg_glass_65_ffffff_1x400.png
ADDED
Binary file
|
admin/css/images/ui-bg_glass_75_dadada_1x400.png
ADDED
Binary file
|
admin/css/images/ui-bg_glass_75_e6e6e6_1x400.png
ADDED
Binary file
|
admin/css/images/ui-bg_glass_95_fef1ec_1x400.png
ADDED
Binary file
|
admin/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
ADDED
Binary file
|
admin/css/images/ui-icons_222222_256x240.png
ADDED
Binary file
|
admin/css/images/ui-icons_2e83ff_256x240.png
ADDED
Binary file
|
admin/css/images/ui-icons_454545_256x240.png
ADDED
Binary file
|
admin/css/images/ui-icons_888888_256x240.png
ADDED
Binary file
|
admin/css/images/ui-icons_cd0a0a_256x240.png
ADDED
Binary file
|
admin/css/jquery-ui.css
ADDED
@@ -0,0 +1,470 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery UI - v1.9.0 - 2012-10-05
|
2 |
+
* http://jqueryui.com
|
3 |
+
* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
|
4 |
+
* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
|
5 |
+
|
6 |
+
/* Layout helpers
|
7 |
+
----------------------------------*/
|
8 |
+
.ui-helper-hidden { display: none; }
|
9 |
+
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
|
10 |
+
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
11 |
+
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
|
12 |
+
.ui-helper-clearfix:after { clear: both; }
|
13 |
+
.ui-helper-clearfix { zoom: 1; }
|
14 |
+
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
15 |
+
|
16 |
+
|
17 |
+
/* Interaction Cues
|
18 |
+
----------------------------------*/
|
19 |
+
.ui-state-disabled { cursor: default !important; }
|
20 |
+
|
21 |
+
|
22 |
+
/* Icons
|
23 |
+
----------------------------------*/
|
24 |
+
|
25 |
+
/* states and images */
|
26 |
+
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
27 |
+
|
28 |
+
|
29 |
+
/* Misc visuals
|
30 |
+
----------------------------------*/
|
31 |
+
|
32 |
+
/* Overlays */
|
33 |
+
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
34 |
+
|
35 |
+
.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
|
36 |
+
.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
|
37 |
+
.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
|
38 |
+
.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
|
39 |
+
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
40 |
+
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
|
41 |
+
|
42 |
+
.ui-autocomplete { position: absolute; cursor: default; }
|
43 |
+
|
44 |
+
/* workarounds */
|
45 |
+
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
46 |
+
|
47 |
+
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
|
48 |
+
.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
|
49 |
+
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
50 |
+
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
51 |
+
.ui-button-icons-only { width: 3.4em; }
|
52 |
+
button.ui-button-icons-only { width: 3.7em; }
|
53 |
+
|
54 |
+
/*button text element */
|
55 |
+
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
56 |
+
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
57 |
+
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
58 |
+
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
59 |
+
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
60 |
+
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
61 |
+
/* no icon support for input elements, provide padding by default */
|
62 |
+
input.ui-button { padding: .4em 1em; }
|
63 |
+
|
64 |
+
/*button icon element(s) */
|
65 |
+
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
66 |
+
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
|
67 |
+
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
68 |
+
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
69 |
+
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
70 |
+
|
71 |
+
/*button sets*/
|
72 |
+
.ui-buttonset { margin-right: 7px; }
|
73 |
+
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
74 |
+
|
75 |
+
/* workarounds */
|
76 |
+
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
77 |
+
|
78 |
+
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
79 |
+
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
80 |
+
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
81 |
+
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
82 |
+
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
83 |
+
.ui-datepicker .ui-datepicker-next { right:2px; }
|
84 |
+
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
85 |
+
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
86 |
+
.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; }
|
87 |
+
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
88 |
+
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
89 |
+
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
90 |
+
.ui-datepicker select.ui-datepicker-month,
|
91 |
+
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
92 |
+
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
93 |
+
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
94 |
+
.ui-datepicker td { border: 0; padding: 1px; }
|
95 |
+
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
96 |
+
.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; }
|
97 |
+
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
98 |
+
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
99 |
+
|
100 |
+
/* with multiple calendars */
|
101 |
+
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
102 |
+
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
103 |
+
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
104 |
+
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
105 |
+
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
106 |
+
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
107 |
+
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
108 |
+
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
109 |
+
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
110 |
+
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
111 |
+
|
112 |
+
/* RTL support */
|
113 |
+
.ui-datepicker-rtl { direction: rtl; }
|
114 |
+
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
115 |
+
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
116 |
+
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
117 |
+
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
118 |
+
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
119 |
+
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
120 |
+
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
121 |
+
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
122 |
+
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
123 |
+
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
124 |
+
|
125 |
+
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
126 |
+
.ui-datepicker-cover {
|
127 |
+
position: absolute; /*must have*/
|
128 |
+
z-index: -1; /*must have*/
|
129 |
+
filter: mask(); /*must have*/
|
130 |
+
top: -4px; /*must have*/
|
131 |
+
left: -4px; /*must have*/
|
132 |
+
width: 200px; /*must have*/
|
133 |
+
height: 200px; /*must have*/
|
134 |
+
}
|
135 |
+
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
|
136 |
+
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
137 |
+
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
138 |
+
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
139 |
+
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
140 |
+
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
141 |
+
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
142 |
+
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
143 |
+
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
144 |
+
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
145 |
+
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
146 |
+
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
147 |
+
|
148 |
+
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
|
149 |
+
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
|
150 |
+
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
|
151 |
+
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
|
152 |
+
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
|
153 |
+
.ui-menu .ui-menu-item a.ui-state-focus,
|
154 |
+
.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
|
155 |
+
|
156 |
+
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
|
157 |
+
.ui-menu .ui-state-disabled a { cursor: default; }
|
158 |
+
|
159 |
+
/* icon support */
|
160 |
+
.ui-menu-icons { position: relative; }
|
161 |
+
.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
|
162 |
+
|
163 |
+
/* left-aligned */
|
164 |
+
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
|
165 |
+
|
166 |
+
/* right-aligned */
|
167 |
+
.ui-menu .ui-menu-icon { position: static; float: right; }
|
168 |
+
|
169 |
+
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
170 |
+
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
171 |
+
.ui-resizable { position: relative;}
|
172 |
+
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
|
173 |
+
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
174 |
+
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
175 |
+
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
176 |
+
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
177 |
+
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
178 |
+
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
179 |
+
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
180 |
+
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
181 |
+
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
|
182 |
+
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
183 |
+
|
184 |
+
.ui-slider { position: relative; text-align: left; }
|
185 |
+
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
186 |
+
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
187 |
+
|
188 |
+
.ui-slider-horizontal { height: .8em; }
|
189 |
+
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
190 |
+
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
191 |
+
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
192 |
+
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
193 |
+
|
194 |
+
.ui-slider-vertical { width: .8em; height: 100px; }
|
195 |
+
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
196 |
+
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
197 |
+
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
198 |
+
.ui-slider-vertical .ui-slider-range-max { top: 0; }
|
199 |
+
.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
|
200 |
+
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
|
201 |
+
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; z-index: 100; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
|
202 |
+
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
|
203 |
+
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
|
204 |
+
.ui-spinner-up { top: 0; }
|
205 |
+
.ui-spinner-down { bottom: 0; }
|
206 |
+
|
207 |
+
/* TR overrides */
|
208 |
+
span.ui-spinner { background: none; }
|
209 |
+
.ui-spinner .ui-icon-triangle-1-s {
|
210 |
+
/* need to fix icons sprite */
|
211 |
+
background-position:-65px -16px;
|
212 |
+
}
|
213 |
+
|
214 |
+
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
215 |
+
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
216 |
+
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
|
217 |
+
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
218 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
|
219 |
+
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
|
220 |
+
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
221 |
+
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
222 |
+
|
223 |
+
.ui-tooltip {
|
224 |
+
padding:8px;
|
225 |
+
position:absolute;
|
226 |
+
z-index:9999;
|
227 |
+
-o-box-shadow: 0 0 5px #aaa;
|
228 |
+
-moz-box-shadow: 0 0 5px #aaa;
|
229 |
+
-webkit-box-shadow: 0 0 5px #aaa;
|
230 |
+
box-shadow: 0 0 5px #aaa;
|
231 |
+
}
|
232 |
+
/* Fades and background-images don't work well together in IE6, drop the image */
|
233 |
+
* html .ui-tooltip {
|
234 |
+
background-image: none;
|
235 |
+
}
|
236 |
+
body .ui-tooltip { border-width:2px; }
|
237 |
+
|
238 |
+
/* Component containers
|
239 |
+
----------------------------------*/
|
240 |
+
.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
|
241 |
+
.ui-widget .ui-widget { font-size: 1em; }
|
242 |
+
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
|
243 |
+
.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
|
244 |
+
.ui-widget-content a { color: #222222/*{fcContent}*/; }
|
245 |
+
.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; }
|
246 |
+
.ui-widget-header a { color: #222222/*{fcHeader}*/; }
|
247 |
+
|
248 |
+
/* Interaction states
|
249 |
+
----------------------------------*/
|
250 |
+
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }
|
251 |
+
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; }
|
252 |
+
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; }
|
253 |
+
.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; }
|
254 |
+
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; }
|
255 |
+
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; }
|
256 |
+
|
257 |
+
/* Interaction Cues
|
258 |
+
----------------------------------*/
|
259 |
+
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
|
260 |
+
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
|
261 |
+
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
|
262 |
+
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
|
263 |
+
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
|
264 |
+
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
265 |
+
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
266 |
+
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
267 |
+
|
268 |
+
/* Icons
|
269 |
+
----------------------------------*/
|
270 |
+
|
271 |
+
/* states and images */
|
272 |
+
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
|
273 |
+
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
|
274 |
+
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
|
275 |
+
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
|
276 |
+
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; }
|
277 |
+
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
|
278 |
+
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
|
279 |
+
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
|
280 |
+
|
281 |
+
/* positioning */
|
282 |
+
.ui-icon-carat-1-n { background-position: 0 0; }
|
283 |
+
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
284 |
+
.ui-icon-carat-1-e { background-position: -32px 0; }
|
285 |
+
.ui-icon-carat-1-se { background-position: -48px 0; }
|
286 |
+
.ui-icon-carat-1-s { background-position: -64px 0; }
|
287 |
+
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
288 |
+
.ui-icon-carat-1-w { background-position: -96px 0; }
|
289 |
+
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
290 |
+
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
291 |
+
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
292 |
+
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
293 |
+
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
294 |
+
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
295 |
+
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
296 |
+
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
297 |
+
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
298 |
+
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
299 |
+
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
300 |
+
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
301 |
+
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
302 |
+
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
303 |
+
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
304 |
+
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
305 |
+
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
306 |
+
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
307 |
+
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
308 |
+
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
309 |
+
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
310 |
+
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
311 |
+
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
312 |
+
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
313 |
+
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
314 |
+
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
315 |
+
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
316 |
+
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
317 |
+
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
318 |
+
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
319 |
+
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
320 |
+
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
321 |
+
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
322 |
+
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
323 |
+
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
324 |
+
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
325 |
+
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
326 |
+
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
327 |
+
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
328 |
+
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
329 |
+
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
330 |
+
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
331 |
+
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
332 |
+
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
333 |
+
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
334 |
+
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
335 |
+
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
336 |
+
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
337 |
+
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
338 |
+
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
339 |
+
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
340 |
+
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
341 |
+
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
342 |
+
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
343 |
+
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
344 |
+
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
345 |
+
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
346 |
+
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
347 |
+
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
348 |
+
.ui-icon-extlink { background-position: -32px -80px; }
|
349 |
+
.ui-icon-newwin { background-position: -48px -80px; }
|
350 |
+
.ui-icon-refresh { background-position: -64px -80px; }
|
351 |
+
.ui-icon-shuffle { background-position: -80px -80px; }
|
352 |
+
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
353 |
+
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
354 |
+
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
355 |
+
.ui-icon-folder-open { background-position: -16px -96px; }
|
356 |
+
.ui-icon-document { background-position: -32px -96px; }
|
357 |
+
.ui-icon-document-b { background-position: -48px -96px; }
|
358 |
+
.ui-icon-note { background-position: -64px -96px; }
|
359 |
+
.ui-icon-mail-closed { background-position: -80px -96px; }
|
360 |
+
.ui-icon-mail-open { background-position: -96px -96px; }
|
361 |
+
.ui-icon-suitcase { background-position: -112px -96px; }
|
362 |
+
.ui-icon-comment { background-position: -128px -96px; }
|
363 |
+
.ui-icon-person { background-position: -144px -96px; }
|
364 |
+
.ui-icon-print { background-position: -160px -96px; }
|
365 |
+
.ui-icon-trash { background-position: -176px -96px; }
|
366 |
+
.ui-icon-locked { background-position: -192px -96px; }
|
367 |
+
.ui-icon-unlocked { background-position: -208px -96px; }
|
368 |
+
.ui-icon-bookmark { background-position: -224px -96px; }
|
369 |
+
.ui-icon-tag { background-position: -240px -96px; }
|
370 |
+
.ui-icon-home { background-position: 0 -112px; }
|
371 |
+
.ui-icon-flag { background-position: -16px -112px; }
|
372 |
+
.ui-icon-calendar { background-position: -32px -112px; }
|
373 |
+
.ui-icon-cart { background-position: -48px -112px; }
|
374 |
+
.ui-icon-pencil { background-position: -64px -112px; }
|
375 |
+
.ui-icon-clock { background-position: -80px -112px; }
|
376 |
+
.ui-icon-disk { background-position: -96px -112px; }
|
377 |
+
.ui-icon-calculator { background-position: -112px -112px; }
|
378 |
+
.ui-icon-zoomin { background-position: -128px -112px; }
|
379 |
+
.ui-icon-zoomout { background-position: -144px -112px; }
|
380 |
+
.ui-icon-search { background-position: -160px -112px; }
|
381 |
+
.ui-icon-wrench { background-position: -176px -112px; }
|
382 |
+
.ui-icon-gear { background-position: -192px -112px; }
|
383 |
+
.ui-icon-heart { background-position: -208px -112px; }
|
384 |
+
.ui-icon-star { background-position: -224px -112px; }
|
385 |
+
.ui-icon-link { background-position: -240px -112px; }
|
386 |
+
.ui-icon-cancel { background-position: 0 -128px; }
|
387 |
+
.ui-icon-plus { background-position: -16px -128px; }
|
388 |
+
.ui-icon-plusthick { background-position: -32px -128px; }
|
389 |
+
.ui-icon-minus { background-position: -48px -128px; }
|
390 |
+
.ui-icon-minusthick { background-position: -64px -128px; }
|
391 |
+
.ui-icon-close { background-position: -80px -128px; }
|
392 |
+
.ui-icon-closethick { background-position: -96px -128px; }
|
393 |
+
.ui-icon-key { background-position: -112px -128px; }
|
394 |
+
.ui-icon-lightbulb { background-position: -128px -128px; }
|
395 |
+
.ui-icon-scissors { background-position: -144px -128px; }
|
396 |
+
.ui-icon-clipboard { background-position: -160px -128px; }
|
397 |
+
.ui-icon-copy { background-position: -176px -128px; }
|
398 |
+
.ui-icon-contact { background-position: -192px -128px; }
|
399 |
+
.ui-icon-image { background-position: -208px -128px; }
|
400 |
+
.ui-icon-video { background-position: -224px -128px; }
|
401 |
+
.ui-icon-script { background-position: -240px -128px; }
|
402 |
+
.ui-icon-alert { background-position: 0 -144px; }
|
403 |
+
.ui-icon-info { background-position: -16px -144px; }
|
404 |
+
.ui-icon-notice { background-position: -32px -144px; }
|
405 |
+
.ui-icon-help { background-position: -48px -144px; }
|
406 |
+
.ui-icon-check { background-position: -64px -144px; }
|
407 |
+
.ui-icon-bullet { background-position: -80px -144px; }
|
408 |
+
.ui-icon-radio-on { background-position: -96px -144px; }
|
409 |
+
.ui-icon-radio-off { background-position: -112px -144px; }
|
410 |
+
.ui-icon-pin-w { background-position: -128px -144px; }
|
411 |
+
.ui-icon-pin-s { background-position: -144px -144px; }
|
412 |
+
.ui-icon-play { background-position: 0 -160px; }
|
413 |
+
.ui-icon-pause { background-position: -16px -160px; }
|
414 |
+
.ui-icon-seek-next { background-position: -32px -160px; }
|
415 |
+
.ui-icon-seek-prev { background-position: -48px -160px; }
|
416 |
+
.ui-icon-seek-end { background-position: -64px -160px; }
|
417 |
+
.ui-icon-seek-start { background-position: -80px -160px; }
|
418 |
+
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
419 |
+
.ui-icon-seek-first { background-position: -80px -160px; }
|
420 |
+
.ui-icon-stop { background-position: -96px -160px; }
|
421 |
+
.ui-icon-eject { background-position: -112px -160px; }
|
422 |
+
.ui-icon-volume-off { background-position: -128px -160px; }
|
423 |
+
.ui-icon-volume-on { background-position: -144px -160px; }
|
424 |
+
.ui-icon-power { background-position: 0 -176px; }
|
425 |
+
.ui-icon-signal-diag { background-position: -16px -176px; }
|
426 |
+
.ui-icon-signal { background-position: -32px -176px; }
|
427 |
+
.ui-icon-battery-0 { background-position: -48px -176px; }
|
428 |
+
.ui-icon-battery-1 { background-position: -64px -176px; }
|
429 |
+
.ui-icon-battery-2 { background-position: -80px -176px; }
|
430 |
+
.ui-icon-battery-3 { background-position: -96px -176px; }
|
431 |
+
.ui-icon-circle-plus { background-position: 0 -192px; }
|
432 |
+
.ui-icon-circle-minus { background-position: -16px -192px; }
|
433 |
+
.ui-icon-circle-close { background-position: -32px -192px; }
|
434 |
+
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
435 |
+
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
436 |
+
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
437 |
+
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
438 |
+
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
439 |
+
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
440 |
+
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
441 |
+
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
442 |
+
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
443 |
+
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
444 |
+
.ui-icon-circle-check { background-position: -208px -192px; }
|
445 |
+
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
446 |
+
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
447 |
+
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
448 |
+
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
449 |
+
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
450 |
+
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
451 |
+
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
452 |
+
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
453 |
+
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
454 |
+
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
455 |
+
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
456 |
+
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
457 |
+
|
458 |
+
|
459 |
+
/* Misc visuals
|
460 |
+
----------------------------------*/
|
461 |
+
|
462 |
+
/* Corner radius */
|
463 |
+
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; }
|
464 |
+
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; }
|
465 |
+
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; }
|
466 |
+
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; }
|
467 |
+
|
468 |
+
/* Overlays */
|
469 |
+
.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
|
470 |
+
.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
|
{styles → admin/css}/select2.css
RENAMED
File without changes
|
admin/css/wt-import-export-for-woo-admin.css
ADDED
@@ -0,0 +1,444 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* All of the CSS for your admin-specific functionality should be
|
3 |
+
* included in this file.
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Tab section
|
8 |
+
*/
|
9 |
+
.wt_iew_page_hd{ font-size:20px; }
|
10 |
+
.wt-iew-tab-head{ margin-right:0px; margin-top:20px; clear:both;}
|
11 |
+
.wt-iew-tab-container{ padding:15px; padding-bottom:0px; background:#fff; box-shadow:0px 2px 2px #ccc; float:left; box-sizing:border-box; width:100%; height:auto;}
|
12 |
+
.wt-iew-tab-head .nav-tab-active{ background: #fff; border-bottom: solid 1px #fff; }
|
13 |
+
.wt-iew-tab-head .nav-tab:focus{ box-shadow:none;}
|
14 |
+
.wt-iew-tab-content{ display:none; float:left; width:100%; height:auto; }
|
15 |
+
.wt_iew_sub_tab_container{float:left; width:100%; height:auto; padding-bottom:0px;}
|
16 |
+
.wt_iew_sub_tab{ display:inline-block; margin:0px;}
|
17 |
+
.wt_iew_sub_tab li{ display:inline-block; border-left: solid 1px #ccc; padding:3px 10px; cursor: pointer;}
|
18 |
+
.wt_iew_sub_tab_content{ display: none; float:left; width:100%; height:auto; }
|
19 |
+
.wt-iew-settings-header{border-bottom:dashed 1px #ccc; margin-left:-15px; margin-right:-15px; padding-top:0px;}
|
20 |
+
.wt-iew-settings-header h3{margin-top:0px; margin-left:15px; width:60%; display:inline-block;}
|
21 |
+
.wt-iew-settings-header .wt_iew_step_info{float:right; font-weight:bold; margin-right:15px; background:#dceff4; display:inline-block; padding:5px 10px; margin-top:-6px; margin-bottom:-15px; padding-bottom:6px; line-height:24px; border-radius:6px; }
|
22 |
+
.wt-iew-plugin-toolbar {
|
23 |
+
height: 40px;
|
24 |
+
width: 100%;
|
25 |
+
margin: 0;
|
26 |
+
padding: 0;
|
27 |
+
}
|
28 |
+
.wt-iew-plugin-toolbar .left {
|
29 |
+
float: left;
|
30 |
+
margin: 0;
|
31 |
+
padding: 0;
|
32 |
+
}
|
33 |
+
.wt-iew-plugin-toolbar .left img {
|
34 |
+
vertical-align: text-bottom;
|
35 |
+
margin-right: 10px;
|
36 |
+
}
|
37 |
+
.wt-iew-plugin-toolbar .right {
|
38 |
+
float: right;
|
39 |
+
margin: 0 10px 0 0;
|
40 |
+
padding: 0;
|
41 |
+
}
|
42 |
+
.wt-iew-plugin-toolbar.top {
|
43 |
+
margin-bottom: -5px;
|
44 |
+
}
|
45 |
+
.wt-iew-plugin-toolbar.bottom {
|
46 |
+
margin-top: 12px;
|
47 |
+
background: #f5f5f5;
|
48 |
+
border-top: 1px solid #ddd;
|
49 |
+
margin-left: -15px;
|
50 |
+
margin-right: -15px;
|
51 |
+
margin-bottom:0px;
|
52 |
+
padding:9px 15px;
|
53 |
+
}
|
54 |
+
.wt-iew-plugin-toolbar.top {
|
55 |
+
margin-top:-15px;
|
56 |
+
background: #f5f5f5;
|
57 |
+
border-bottom: 1px solid #ddd;
|
58 |
+
border-top: 1px solid #ddd;
|
59 |
+
margin-left: -15px;
|
60 |
+
margin-right: -15px;
|
61 |
+
margin-bottom: -15px;
|
62 |
+
padding:15px;
|
63 |
+
}
|
64 |
+
.wt-iew-plugin-toolbar.bottom .button{padding:0.2rem 0.75rem; margin-top:2px; height:auto;}
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Form section
|
69 |
+
*/
|
70 |
+
.wt_notify_msg{ position:fixed; width:300px; padding:15px; color:#fff; right:60px; top:0px; opacity:0; box-shadow:0px 2px 2px #333; border-radius:5px; z-index:1000000000;}
|
71 |
+
.wt_iew_overlayed_loader{ position:absolute; z-index:10000; background:rgba(255,255,255,.5); width:100%; height:auto; margin-left:-15px; margin-top:-15px;}
|
72 |
+
.wt_iew_loader_info_box{display:none; position:fixed; z-index:10001; width:300px; left:50%; top:50%; font-size:14px; font-weight:bold; background:#0073aa; text-align:center; line-height:20px; box-shadow:2px 2px 4px 0px #ccc; margin-left:-155px; margin-top:-45px; padding:10px 5px; color:#fff;}
|
73 |
+
.wt_iew_loader_info_box a{ color:#fff; text-decoration:underline; cursor:pointer; }
|
74 |
+
.wt_iew_loader_info_box .wt_iew_info_box_title{ font-size:16px; }
|
75 |
+
.wt_iew_loader_info_box .wt_iew_info_box_finished_text{ display:inline-block; font-weight:normal; margin-top:0px; }
|
76 |
+
.wf-help-links li{ float:left; padding:40px; margin:20px; display: inline-block; text-align: center; box-shadow:1px 1px 5px 1px rgba(0,0,0,.1); width: 185px; height: 245px;}
|
77 |
+
.wf-help-links li a{ text-decoration: none; height: 28px !important; margin-top: 20px; }
|
78 |
+
.wf-help-links li img{
|
79 |
+
margin-top: 15px;
|
80 |
+
}
|
81 |
+
.wt_iew_noselect {
|
82 |
+
-webkit-touch-callout: none; /* iOS Safari */
|
83 |
+
-webkit-user-select: none; /* Safari */
|
84 |
+
-khtml-user-select: none; /* Konqueror HTML */
|
85 |
+
-moz-user-select: none; /* Old versions of Firefox */
|
86 |
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
87 |
+
user-select: none; /* Non-prefixed version, currently
|
88 |
+
supported by Chrome, Opera and Firefox */
|
89 |
+
}
|
90 |
+
/* copied from bootstrap */
|
91 |
+
.wt-iew-form-table input[type="text"], .wt-iew-form-table input[type="number"], .wt-iew-form-table input[type="password"], .wt-iew-form-table select, .wt_iew_select, .wt_iew_text{
|
92 |
+
display: block;
|
93 |
+
width:100%;
|
94 |
+
padding: 0.35rem 0.75rem;
|
95 |
+
font-size: 1rem;
|
96 |
+
line-height: 1.5;
|
97 |
+
color: #495057;
|
98 |
+
background-color: #fff;
|
99 |
+
background-clip: padding-box;
|
100 |
+
border: 1px solid #ced4da;
|
101 |
+
border-radius: 0.25rem;
|
102 |
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
103 |
+
height:36px;
|
104 |
+
max-width:none;
|
105 |
+
}
|
106 |
+
.wt-iew-form-table *::placeholder{ font-size:12px; }
|
107 |
+
.wt-iew-form-table .select2-container .select2-selection--multiple{ border-color:#ced4da !important; }
|
108 |
+
|
109 |
+
|
110 |
+
.wt-iew-form-table select, .wt_iew_select{
|
111 |
+
padding: 0.44rem 0.75rem;
|
112 |
+
}
|
113 |
+
.wt-iew-form-table textarea{
|
114 |
+
display: block;
|
115 |
+
width:100%;
|
116 |
+
padding: 0.375rem 0.75rem;
|
117 |
+
font-size: 1rem;
|
118 |
+
line-height: 1.5;
|
119 |
+
color: #495057;
|
120 |
+
background-color: #fff;
|
121 |
+
background-clip: padding-box;
|
122 |
+
border: 1px solid #ced4da;
|
123 |
+
border-radius: 0.25rem;
|
124 |
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
125 |
+
}
|
126 |
+
.wt-iew-form-table .select2-selection, .wt-iew-form-table .select2-selection.select2-selection--multiple{
|
127 |
+
display: block;
|
128 |
+
width:100%;
|
129 |
+
color: #495057;
|
130 |
+
background-color: #fff;
|
131 |
+
background-clip: padding-box;
|
132 |
+
border: 1px solid #ced4da;
|
133 |
+
border-radius: 0.25rem;
|
134 |
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
135 |
+
min-height: 60px; font-size: 12px;
|
136 |
+
}
|
137 |
+
.wt-iew-form-table .select2-container {
|
138 |
+
width:100% !important;
|
139 |
+
}
|
140 |
+
.wf_select_multi{
|
141 |
+
width:100%;
|
142 |
+
}
|
143 |
+
.wf_select_multi .select2-container{
|
144 |
+
width:100% !important;
|
145 |
+
}
|
146 |
+
.wt-iew-form-table .button {
|
147 |
+
padding:0.2rem 0.75rem; height: auto;
|
148 |
+
}
|
149 |
+
.wf_settings_form .button {
|
150 |
+
padding:0.2rem 0.75rem; height: auto;
|
151 |
+
}
|
152 |
+
.wt-iew_form_help{ color:#666; font-style: italic; font-weight:400; font-size:12px; display:inline-block; width:100%; margin-top:10px; }
|
153 |
+
.wt-iew_conditional_help_text{ display:none;}
|
154 |
+
.wt-iew-form-table tr th:first-child{ width:25%; padding:10px 15px 10px 0; vertical-align:top; }
|
155 |
+
.wt-iew-form-table tr th:first-child label{ margin-top:5px; display:inline-block; }
|
156 |
+
.wt-iew-form-table tr td:nth-child(2){ width:40%; padding:10px 5px 10px 0; }
|
157 |
+
.wt-iew-form-table tr td:nth-child(3){ width:35%; }
|
158 |
+
.wt_form_radio_block, .wt_form_checkbox_block{ display:inline-block; margin-top:8px; }
|
159 |
+
.wt-iew-tab-container .wp-list-table thead th{ font-weight:bold; }
|
160 |
+
.wt-iew-exporter-step-btn, .wt-iew-exporter-step-export-btn{ float:right; }
|
161 |
+
|
162 |
+
.wt-iew-form-table select.wt_iew_delimiter_preset{ width:70%; float:left; }
|
163 |
+
.wt-iew-form-table input[type="text"].wt_iew_custom_delimiter{ width:25%; float:right; }
|
164 |
+
|
165 |
+
.wt-iew-form-table select.wt_iew_date_format_preset{ width:70%; float:left; }
|
166 |
+
.wt-iew-form-table input[type="text"].wt_iew_custom_date_format{ width:25%; float:right; }
|
167 |
+
|
168 |
+
|
169 |
+
.wt_iew_warn_box{padding:20px; padding-bottom:0px;}
|
170 |
+
.wt_iew_warn{ display:inline-block; width:100%; box-sizing:border-box; padding:10px; background-color:#fff8e5; border-left:solid 2px #ffb900; color:#333; }
|
171 |
+
.wt_iew_rerun_warn{ width:95%; margin:30px 2.5%; }
|
172 |
+
|
173 |
+
.wt_iew_info_box{padding:20px; padding-bottom:0px;}
|
174 |
+
.wt_iew_info{ display:inline-block; width:100%; box-sizing:border-box; padding:10px; background-color:#d1ecf1; border-left:solid 2px #0c5460; color:#185b8d; }
|
175 |
+
|
176 |
+
|
177 |
+
/* mapping step */
|
178 |
+
.wt-iew-mapping-tb{ border:1px solid #e5e5e5; width:90%; max-width:700px; }
|
179 |
+
.wt-iew-mapping-tb th{ text-align:left; height:30px; /* background:#e5e5e5; */ border-bottom:solid 1px #e5e5e5; }
|
180 |
+
.wt-iew-mapping-tb tr td:first-child, .wt-iew-mapping-tb tr th:first-child{ width:50px; }
|
181 |
+
.wt-iew-mapping-tb td, .wt-iew-mapping-tb th{ padding:5px; }
|
182 |
+
.wt-iew-mapping-tb td input[type="text"], .wt_iew_text_field{
|
183 |
+
display: block;
|
184 |
+
max-width:500px;
|
185 |
+
width:100%;
|
186 |
+
color: #495057;
|
187 |
+
background-clip: padding-box;
|
188 |
+
border: 1px solid #ced4da !important;
|
189 |
+
border-radius: 0.25rem;
|
190 |
+
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
191 |
+
height:32px;
|
192 |
+
}
|
193 |
+
.wt_iew_sort_handle{ width:25px; cursor:move; }
|
194 |
+
.wt-iew-mapping-tb tbody tr:hover td{ background:#f6f6f6; }
|
195 |
+
.wt-iew-mapping-tb .wt_iew_mapping_checkbox_main{ margin-left:29px; }
|
196 |
+
.wt-iew-mapping-tb .wt_iew_mapping_checkbox_sub{ margin-left:4px; margin-top:6px; }
|
197 |
+
.wt_iew_sort_handle{ float:left; }
|
198 |
+
.wt_iew_sort_handle img{ margin-top:5px; color:#ccc; height:15px; opacity:.8; }
|
199 |
+
.wt_iew_checkbox{ display:inline-block; padding:0px 15px; }
|
200 |
+
.wt_iew_mapping_field_val{ width:100%; min-height:32px; display:inline-block; background:#fff; padding:5px 5px; box-sizing:border-box; border:solid 1px #ced4da; border-radius:0.25rem; cursor:text; }
|
201 |
+
|
202 |
+
.wt-iew-sortable-placeholder td{ height:30px; background:#fff; border-top:dashed 1px #ccc; border-bottom:dashed 1px #ccc; }
|
203 |
+
.wt-iew-sortable-placeholder td:first-child{ border:dashed 1px #ccc; border-right:none; }
|
204 |
+
.wt-iew-sortable-placeholder td:last-child{ border:dashed 1px #ccc; border-left:none; }
|
205 |
+
|
206 |
+
.meta_mapping_box{width:100%; float:left; height:auto; margin-bottom:0px;}
|
207 |
+
.meta_mapping_box_hd{min-width:720px; width:auto; display:inline-block; height:40px; line-height:40px; font-weight:bold; background:#f6f6f6; box-sizing:border-box; padding:2px 10px; box-shadow:1px 1px 1px #e0e0e0; border-bottom:solid 1px #ccc; border-top:solid 1px #fff; cursor:pointer;}
|
208 |
+
.meta_mapping_box_hd .dashicons{ margin-top:10px; }
|
209 |
+
.meta_mapping_box_selected_count_box{ float:right; margin-top:-3px; font-weight:normal; font-style:italic; }
|
210 |
+
.meta_mapping_box_con{min-width:720px; width:auto; display:inline-block; height:auto; padding:0px; display:none;}
|
211 |
+
.wt-iew-mapping-tb{ min-width:720px; }
|
212 |
+
.meta_mapping_box_toggle{ font-weight:normal; float:right; cursor:pointer; }
|
213 |
+
.wt_iew_invalid_mapping_field{ color:red; display:inline-block !important; padding:0px !important; margin:0px !important; }
|
214 |
+
|
215 |
+
|
216 |
+
/* popup */
|
217 |
+
.wt_iew_overlay{ position:fixed; z-index:100000000; width:100%; height:100%; background-color:rgba(0,0,0,.5); left:0px; top:0px; display:none;}
|
218 |
+
.wt_iew_popup{position:fixed; z-index:100000001; background:#fff; border:solid 1px #eee; text-align:center; box-shadow:0px 2px 5px #333; left:50%; display:none;}
|
219 |
+
.wt_iew_popup_hd{display:inline-block; width:100%; box-sizing:border-box; font-weight:bold; background-color:#f3f3f3; height:40px; text-align:left; line-height:40px; padding:0px 20px;}
|
220 |
+
.wt_iew_popup_close{float:right; width:40px; height:40px; text-align:right; line-height:40px; cursor:pointer;}
|
221 |
+
.wt_iew_popup_footer{width:100%; text-align:right; margin-top:10px;}
|
222 |
+
|
223 |
+
.wt_iew_data_dv{ display:none; }
|
224 |
+
.wt_iew_action_btn{ cursor:pointer; }
|
225 |
+
|
226 |
+
.wt-iew-form-table .wt_iew_radio_block p{ margin-bottom:15px; line-height:18px; }
|
227 |
+
.wt-iew-form-table .wt_iew_radio_block span{ display:inline-block; padding-left:25px; }
|
228 |
+
.wt-iew-form-table .wt_iew_radio_block b{ display:inline-block; margin-left:5px; }
|
229 |
+
|
230 |
+
.wt-iew-form-table .wt_iew_field_group{ padding-left:0px; }
|
231 |
+
.wt-iew-form-table .wt_iew_field_group_hd{ display:block; border-bottom:dashed 1px #ccc; padding-bottom:5px; padding-top:20px; font-size:15px; font-weight:bold; cursor:pointer; }
|
232 |
+
.wt-iew-form-table .wt_iew_field_group_hd .wt_iew_field_group_toggle_btn{float:left; margin-right:10px; width:20px; height:20px; border-radius:10px; color:#666; cursor:pointer; }
|
233 |
+
.wt-iew-form-table .wt_iew_field_group_content{ padding-left:10px; display:none; }
|
234 |
+
|
235 |
+
|
236 |
+
/* Dropdown */
|
237 |
+
.wt_iew_dropdown{ position:absolute; z-index:100; background:#fff; border:1px solid #ccc; border-radius:4px; padding:0px; display:none; box-shadow:1px 3px 2px 2px rgba(0,0,0,0.1); }
|
238 |
+
.wt_iew_dropdown li{ padding:7px 14px; margin:5px 0px; cursor:pointer; }
|
239 |
+
.wt_iew_dropdown li:hover{ background:#fafafa; }
|
240 |
+
|
241 |
+
/* template saving popup */
|
242 |
+
.wt_iew_template_name{width:100%; max-width:320px;}
|
243 |
+
.wt_iew_template_name_box{ float:left; width:90%; padding:5%; padding-top:0px; }
|
244 |
+
.wt_iew_template_name_wrn{display:none; text-align:left; }
|
245 |
+
.wt_iew_template_name_label{ display:inline-block; width:100%; text-align:left; font-weight:bold; padding:3px 0px; }
|
246 |
+
|
247 |
+
/* file attacher */
|
248 |
+
.wt-iew-form-table .wt_iew_file_attacher_dv{width:100%; }
|
249 |
+
.wt-iew-form-table .wt_iew_file_attacher_dv input[type="text"]{width:70%; float:left; }
|
250 |
+
.wt-iew-form-table .wt_iew_file_attacher_dv input[type="button"]{width:25%; float:right; }
|
251 |
+
.wt_iew_file_attacher_dv{ float:left; width:100%; }
|
252 |
+
|
253 |
+
/* popover */
|
254 |
+
.wt_iew_popover{ position: absolute; min-width:250px; min-height:150px; height: auto; background: #fff; border-radius: 5px; box-shadow: 0 5px 10px rgba(0,0,0,.2); top:50px; border: 1px solid #ccc;}
|
255 |
+
.wt_iew_popover:after, .wt_iew_popover:before {
|
256 |
+
right: 100%;
|
257 |
+
top:25%;
|
258 |
+
border: solid transparent;
|
259 |
+
content: " ";
|
260 |
+
height: 0;
|
261 |
+
width: 0;
|
262 |
+
position: absolute;
|
263 |
+
pointer-events: none;
|
264 |
+
}
|
265 |
+
|
266 |
+
.wt_iew_popover:after {
|
267 |
+
border-color: rgba(255, 255, 255, 0);
|
268 |
+
border-right-color: #fff;
|
269 |
+
border-width: 20px;
|
270 |
+
margin-top: -20px;
|
271 |
+
}
|
272 |
+
.wt_iew_popover:before {
|
273 |
+
border-color: rgba(204, 204, 204, 0);
|
274 |
+
border-right-color: #ccc;
|
275 |
+
border-width: 21px;
|
276 |
+
margin-top: -21px;
|
277 |
+
}
|
278 |
+
.wt_iew_popover-title{ background:#f7f7f7; height:35px;
|
279 |
+
margin: 0px;
|
280 |
+
border-top-left-radius: 5px;
|
281 |
+
border-top-right-radius: 5px; padding:5px; padding-left: 15px; line-height: 35px; font-size: 14px;}
|
282 |
+
.popover_close_icon_button{ float:right; height:20px; width:20px; border-radius:20px; color:#fff; background:#666; padding:3px; font-weight:bold; text-align:center; line-height:20px; margin-top:5px; margin-right:5px; cursor:pointer; }
|
283 |
+
.wt_iew_popover-content{
|
284 |
+
min-height:65px; height: auto; padding:15px; float:left; clear:both;
|
285 |
+
}
|
286 |
+
.wt_iew_popover-footer{ background:#f7f7f7; clear:both; height:30px; margin:0px; margin-top:10px; border-bottom-left-radius:5px; border-bottom-right-radius:5px; padding:7px 15px;}
|
287 |
+
.wt_iew_popover-content input[type="text"]{
|
288 |
+
margin:5px 0px; border-radius:3px; padding: 0.2rem 0.3rem;
|
289 |
+
font-size: 1rem;
|
290 |
+
line-height: 1.5;
|
291 |
+
}
|
292 |
+
.wt_iew_popover-footer .button{
|
293 |
+
float: right; margin-left: 5px;
|
294 |
+
}
|
295 |
+
|
296 |
+
/* mapping field editor */
|
297 |
+
.wt_iew_mapping_field_editor_container{ display:none; }
|
298 |
+
.wt_iew_mapping_field_editor{ float:left; width:400px; padding:0px; background:#fff; margin:0px;}
|
299 |
+
.wt_iew_mapping_field_editor *{ box-sizing:border-box; }
|
300 |
+
.wt_iew_mapping_field_editor label{ float:left; width:100%; margin-bottom:3px; font-weight:bold; font-size:13px; color:#333; }
|
301 |
+
.wt_iew_mapping_field_editor_box{border:solid 1px #ddd; float:left; width:100%; height:auto; min-height:50px; padding:3px; margin-bottom:10px; margin-top:5px;}
|
302 |
+
.wt_iew_mapping_field_editor_box textarea{border:none; float:left; width:100%; height:50px; outline:none; resize:none;}
|
303 |
+
.wt_iew_mapping_field_editor_box input[type="text"]{width:100%; font-size:12px;}
|
304 |
+
.wt_iew_mapping_field_editor_box input[type="text"]::placeholder{ font-size:12px; }
|
305 |
+
.wt_iew_mapping_field_editor_info{ margin:0px; }
|
306 |
+
.wt_iew_mapping_field_editor_er{ margin:0px; color:red; }
|
307 |
+
.wt_iew_mapping_field_selector_box{ float:left; width:100%; height:120px; overflow:auto; margin-top:5px; }
|
308 |
+
.wt_iew_mapping_field_selector{ float:left; width:100%; margin:0px; padding:0px; }
|
309 |
+
.wt_iew_mapping_field_selector li{ float:left; width:100%; padding:5px; margin:0px; cursor:pointer;}
|
310 |
+
.wt_iew_mapping_field_selector li:hover{ background:#0073aa; color:#fff; }
|
311 |
+
.wt_iew_mapping_field_selector_no_column{ float:left; width:100%; color:red; }
|
312 |
+
.wt_iew_no_sample_mapping_data{ color:gray; display:inline-block !important; padding:0px !important; margin:0px !important; font-style:italic; }
|
313 |
+
|
314 |
+
/* debug panel */
|
315 |
+
.wt_iew_debug_panel{ position:fixed; top:30px; right:0px; background:#fff; padding:5px; padding-bottom:0px; box-shadow:2px 2px 2px #ccc; }
|
316 |
+
.wt_iew_debug_panel_hd{ width:100%; font-size:12px; font-weight:bold; padding:2px; }
|
317 |
+
.wt_iew_debug_panel_con{ width:100%; min-height:30px; font-size:12px; text-align:center;}
|
318 |
+
.wt_iew_debug_panel_con a{ display:inline-block; padding:2px; border-right:solid 1px #ccc; cursor:pointer; }
|
319 |
+
.wt_iew_debug_panel_con a:last-child{ border-right:solid 0px #ccc; }
|
320 |
+
|
321 |
+
/* pagination */
|
322 |
+
.wt_iew_pagination{ float:right; width:auto; height:auto; margin:10px 0px;}
|
323 |
+
.wt_iew_pagination a{ float:left; padding:6px 12px; background:#f3f5f6; border:solid 1px #cccccc; color:#2e8ab6; text-decoration:none; margin-right:5px; border-radius:5px; }
|
324 |
+
.wt_iew_pagination a.wt_iew_pageactive{ background:#fff; color:#333; border:solid 1px #ddd; }
|
325 |
+
.wt_iew_pagination a.wt_iew_pagedisabled{ background:#f7f7f7; color:#a0a5aa; border:solid 1px #ddd; }
|
326 |
+
.wt_iew_pagination a.wt_iew_page{ cursor:pointer; }
|
327 |
+
.wt_iew_pagination_total_info{ float:left; padding:8px; }
|
328 |
+
|
329 |
+
/* listing */
|
330 |
+
.wt_iew_badge{ display:inline-block; padding:2px 6px; font-size:12px; border-radius:3px; background:#ccc; color:#fff; text-align:center; }
|
331 |
+
|
332 |
+
/* responsive */
|
333 |
+
@media (max-width:768px) {
|
334 |
+
.wt-iew-form-table tr th:first-child{ width:100%; }
|
335 |
+
.wt-iew-form-table tr td:nth-child(2){ width:100%; }
|
336 |
+
.wt-iew-form-table tr td:nth-child(3){ width:100%; }
|
337 |
+
.wt-iew-form-table .wt_iew_file_attacher_dv input[type="text"]{width:50%; float:left; }
|
338 |
+
.wt-iew-form-table .wt_iew_file_attacher_dv input[type="button"]{width:45%; float:right; }
|
339 |
+
}
|
340 |
+
|
341 |
+
/* tooltip */
|
342 |
+
.wt-iew-tips{ color:#16a7c5; }
|
343 |
+
.wt_iew_tooltip_span{ display:inline-block; margin-bottom:9px; line-height:16px; text-align:left; border-top:
|
344 |
+
dashed 1px #efefef; }
|
345 |
+
#tiptip_content .wt_iew_tooltip_span:first-child{ border:none; margin-top:4px; }
|
346 |
+
#tiptip_content .wt_iew_tooltip_span:last-child{ margin-bottom:4px; }
|
347 |
+
.tips {
|
348 |
+
cursor:help;
|
349 |
+
text-decoration:none
|
350 |
+
}
|
351 |
+
img.tips {
|
352 |
+
padding:5px 0 0
|
353 |
+
}
|
354 |
+
#tiptip_holder {
|
355 |
+
display:none;
|
356 |
+
z-index:8675309;
|
357 |
+
position:absolute;
|
358 |
+
top:0;
|
359 |
+
left:0
|
360 |
+
}
|
361 |
+
#tiptip_holder.tip_top {
|
362 |
+
padding-bottom:5px
|
363 |
+
}
|
364 |
+
#tiptip_holder.tip_top #tiptip_arrow_inner {
|
365 |
+
margin-top:-7px;
|
366 |
+
margin-left:-6px;
|
367 |
+
border-top-color:#333
|
368 |
+
}
|
369 |
+
#tiptip_holder.tip_bottom {
|
370 |
+
padding-top:5px
|
371 |
+
}
|
372 |
+
#tiptip_holder.tip_bottom #tiptip_arrow_inner {
|
373 |
+
margin-top:-5px;
|
374 |
+
margin-left:-6px;
|
375 |
+
border-bottom-color:#333
|
376 |
+
}
|
377 |
+
#tiptip_holder.tip_right {
|
378 |
+
padding-left:5px
|
379 |
+
}
|
380 |
+
#tiptip_holder.tip_right #tiptip_arrow_inner {
|
381 |
+
margin-top:-6px;
|
382 |
+
margin-left:-5px;
|
383 |
+
border-right-color:#333
|
384 |
+
}
|
385 |
+
#tiptip_holder.tip_left {
|
386 |
+
padding-right:5px
|
387 |
+
}
|
388 |
+
#tiptip_holder.tip_left #tiptip_arrow_inner {
|
389 |
+
margin-top:-6px;
|
390 |
+
margin-left:-7px;
|
391 |
+
border-left-color:#333
|
392 |
+
}
|
393 |
+
#tiptip_content,
|
394 |
+
.chart-tooltip,
|
395 |
+
.wc_error_tip {
|
396 |
+
color:#fff;
|
397 |
+
font-size:.8em;
|
398 |
+
max-width:150px;
|
399 |
+
background:#333;
|
400 |
+
text-align:center;
|
401 |
+
border-radius:3px;
|
402 |
+
padding:.618em 1em;
|
403 |
+
box-shadow:0 1px 3px rgba(0,
|
404 |
+
0,
|
405 |
+
0,
|
406 |
+
.2)
|
407 |
+
}
|
408 |
+
#tiptip_content code,
|
409 |
+
.chart-tooltip code,
|
410 |
+
.wc_error_tip code {
|
411 |
+
padding:1px;
|
412 |
+
background:#888
|
413 |
+
}
|
414 |
+
#tiptip_arrow,
|
415 |
+
#tiptip_arrow_inner {
|
416 |
+
position:absolute;
|
417 |
+
border-color:transparent;
|
418 |
+
border-style:solid;
|
419 |
+
border-width:6px;
|
420 |
+
height:0;
|
421 |
+
width:0
|
422 |
+
}
|
423 |
+
|
424 |
+
/**
|
425 |
+
* Dropzone: Drag and Drop file upload
|
426 |
+
*/
|
427 |
+
.wt_iew_dropzone{ text-align:center; cursor:pointer; width:100%; height:200px; border:dashed 3px #ccc; }
|
428 |
+
.wt_iew_dropzone.wt_drag_start{ border-color:#92b0b3; background:#c8dadf; }
|
429 |
+
.dz-preview{ width:300px; display:inline-block; margin-top:70px; }
|
430 |
+
.dz-message{ font-size:1.5em; margin-top:85px; line-height:14px; }
|
431 |
+
.wt_iew_dropzone .dz-preview .dz-details{ font-size:14px}
|
432 |
+
.wt_iew_dropzone .dz-preview.dz-processing .dz-progress{ opacity:1;-webkit-transition:all .2s linear;-moz-transition:all .2s linear;-ms-transition:all .2s linear;-o-transition:all .2s linear;transition:all .2s linear}
|
433 |
+
.wt_iew_dropzone .dz-preview.dz-complete .dz-progress{opacity:0;-webkit-transition:opacity .4s ease-in;-moz-transition:opacity .4s ease-in;-ms-transition:opacity .4s ease-in;-o-transition:opacity .4s ease-in;transition:opacity .4s ease-in}
|
434 |
+
.wt_iew_dropzone .dz-preview:not(.dz-processing) .dz-progress{-webkit-animation:pulse 6s ease infinite;-moz-animation:pulse 6s ease infinite;-ms-animation:pulse 6s ease infinite;-o-animation:pulse 6s ease infinite;animation:pulse 6s ease infinite}
|
435 |
+
.wt_iew_dropzone .dz-preview .dz-progress{opacity:1;z-index:1000;pointer-events:none;position:absolute;height:16px;margin-top:-8px;margin-left:-40px;background:rgba(255,255,255,.9);-webkit-transform:scale(1);border-radius:8px;overflow:hidden}
|
436 |
+
.wt_iew_dropzone .dz-preview .dz-progress .dz-upload{background:#333;background:linear-gradient(to bottom,#666,#444);position:absolute;top:0;left:0;bottom:0;width:0;-webkit-transition:width .3s ease-in-out;-moz-transition:width .3s ease-in-out;-ms-transition:width .3s ease-in-out;-o-transition:width .3s ease-in-out;transition:width .3s ease-in-out}
|
437 |
+
.wt_iew_dropzone .dz-preview .dz-progress{width:300px;margin-left:0;margin-top:5px}
|
438 |
+
.wt_iew_dropzone .dz-preview .dz-progress .dz-upload{background:#2092ea}
|
439 |
+
.wt_iew_dz_file_name, .wt_iew_dz_remove_link, .wt_iew_dz_file_success{ display:inline-block; font-size:14px; }
|
440 |
+
.wt_iew_dz_remove_link{ cursor:pointer; color:#4289a9; }
|
441 |
+
.wt_iew_dz_file_success{ line-height:20px; }
|
442 |
+
.wt_iew_dropzone .dz-preview .dz-progress .dz-upload-info{display:inline-block;text-align:center;width:100%;}
|
443 |
+
.wt_iew_dropzone.dz-started .dz-message{ display:none;}
|
444 |
+
|
admin/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
admin/js/dropzone.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}var Emitter=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"on",value:function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}},{key:"emit",value:function(e){this._callbacks=this._callbacks||{};var t=this._callbacks[e];if(t){for(var n=arguments.length,i=new Array(1<n?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=!0,a=!1,l=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){s.value.apply(this,i)}}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}}return this}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var i=0;i<n.length;i++){if(n[i]===t){n.splice(i,1);break}}return this}}]),e}(),Dropzone=function(){function C(e,t){var n,i,r;if(_classCallCheck(this,C),(n=_possibleConstructorReturn(this,_getPrototypeOf(C).call(this))).element=e,n.version=C.version,n.defaultOptions.previewTemplate=n.defaultOptions.previewTemplate.replace(/\n*/g,""),n.clickableElements=[],n.listeners=[],n.files=[],"string"==typeof n.element&&(n.element=document.querySelector(n.element)),!n.element||null==n.element.nodeType)throw new Error("Invalid dropzone element.");if(n.element.dropzone)throw new Error("Dropzone already attached.");C.instances.push(_assertThisInitialized(n)),n.element.dropzone=_assertThisInitialized(n);var o=null!=(r=C.optionsForElement(n.element))?r:{};if(n.options=C.extend({},n.defaultOptions,o,null!=t?t:{}),n.options.forceFallback||!C.isBrowserSupported())return _possibleConstructorReturn(n,n.options.fallback.call(_assertThisInitialized(n)));if(null==n.options.url&&(n.options.url=n.element.getAttribute("action")),!n.options.url)throw new Error("No URL provided.");if(n.options.acceptedFiles&&n.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(n.options.uploadMultiple&&n.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return n.options.acceptedMimeTypes&&(n.options.acceptedFiles=n.options.acceptedMimeTypes,delete n.options.acceptedMimeTypes),null!=n.options.renameFilename&&(n.options.renameFile=function(e){return n.options.renameFilename.call(_assertThisInitialized(n),e.name,e)}),n.options.method=n.options.method.toUpperCase(),(i=n.getExistingFallback())&&i.parentNode&&i.parentNode.removeChild(i),!1!==n.options.previewsContainer&&(n.options.previewsContainer?n.previewsContainer=C.getElement(n.options.previewsContainer,"previewsContainer"):n.previewsContainer=n.element),n.options.clickable&&(!0===n.options.clickable?n.clickableElements=[n.element]:n.clickableElements=C.getElements(n.options.clickable,"clickable")),n.init(),n}return _inherits(C,Emitter),_createClass(C,null,[{key:"initClass",value:function(){this.prototype.Emitter=Emitter,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(e,t,n){if(n)return{dzuuid:n.file.upload.uuid,dzchunkindex:n.index,dztotalfilesize:n.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:n.file.upload.totalChunkCount,dzchunkbyteoffset:n.index*this.options.chunkSize}},accept:function(e,t){return t()},chunksUploaded:function(e,t){t()},fallback:function(){var e;this.element.className="".concat(this.element.className," dz-browser-not-supported");var t=!0,n=!1,i=void 0;try{for(var r,o=this.element.getElementsByTagName("div")[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;if(/(^| )dz-message($| )/.test(a.className)){(e=a).className="dz-message";break}}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}e||(e=C.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e));var l=e.getElementsByTagName("span")[0];return l&&(null!=l.textContent?l.textContent=this.options.dictFallbackMessage:null!=l.innerText&&(l.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,n,i){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==n?(t=r.srcWidth,n=r.srcHeight):null==t?t=n*o:null==n&&(n=t/o);var a=(t=Math.min(t,r.srcWidth))/(n=Math.min(n,r.srcHeight));if(r.srcWidth>t||r.srcHeight>n)if("crop"===i)a<o?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*a):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/a);else{if("contain"!==i)throw new Error("Unknown resizeMethod '".concat(i,"'"));a<o?n=t/o:t=n*o}return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=n,r},transformFile:function(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Check</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Error</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>',drop:function(){return this.element.classList.remove("dz-drag-hover")},dragstart:function(){},dragend:function(){return this.element.classList.remove("dz-drag-hover")},dragenter:function(){return this.element.classList.add("dz-drag-hover")},dragover:function(){return this.element.classList.add("dz-drag-hover")},dragleave:function(){return this.element.classList.remove("dz-drag-hover")},paste:function(){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var n=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){t.previewElement=C.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement);var e=!0,i=!1,r=void 0;try{for(var o,a=t.previewElement.querySelectorAll("[data-dz-name]")[Symbol.iterator]();!(e=(o=a.next()).done);e=!0){var l=o.value;l.textContent=t.name}}catch(e){i=!0,r=e}finally{try{e||null==a.return||a.return()}finally{if(i)throw r}}var s=!0,u=!1,c=void 0;try{for(var d,p=t.previewElement.querySelectorAll("[data-dz-size]")[Symbol.iterator]();!(s=(d=p.next()).done);s=!0)(l=d.value).innerHTML=this.filesize(t.size)}catch(e){u=!0,c=e}finally{try{s||null==p.return||p.return()}finally{if(u)throw c}}this.options.addRemoveLinks&&(t._removeLink=C.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"</a>")),t.previewElement.appendChild(t._removeLink));var h=function(e){return e.preventDefault(),e.stopPropagation(),t.status===C.UPLOADING?C.confirm(n.options.dictCancelUploadConfirmation,function(){return n.removeFile(t)}):n.options.dictRemoveFileConfirmation?C.confirm(n.options.dictRemoveFileConfirmation,function(){return n.removeFile(t)}):n.removeFile(t)},f=!0,v=!1,m=void 0;try{for(var y,g=t.previewElement.querySelectorAll("[data-dz-remove]")[Symbol.iterator]();!(f=(y=g.next()).done);f=!0){y.value.addEventListener("click",h)}}catch(e){v=!0,m=e}finally{try{f||null==g.return||g.return()}finally{if(v)throw m}}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");var n=!0,i=!1,r=void 0;try{for(var o,a=e.previewElement.querySelectorAll("[data-dz-thumbnail]")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;l.alt=e.name,l.src=t}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error);var n=!0,i=!1,r=void 0;try{for(var o,a=e.previewElement.querySelectorAll("[data-dz-errormessage]")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){o.value.textContent=t}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t){if(e.previewElement){var n=!0,i=!1,r=void 0;try{for(var o,a=e.previewElement.querySelectorAll("[data-dz-uploadprogress]")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;"PROGRESS"===l.nodeName?l.value=t:l.style.width="".concat(t,"%")}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(var r=0,o=n;r<o.length;r++){var a=o[r];for(var l in a){var s=a[l];e[l]=s}}return e}}]),_createClass(C,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(e){return e.accepted}).map(function(e){return e})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(e){return!e.accepted}).map(function(e){return e})}},{key:"getFilesWithStatus",value:function(t){return this.files.filter(function(e){return e.status===t}).map(function(e){return e})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(C.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(C.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(C.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(e){return e.status===C.UPLOADING||e.status===C.QUEUED}).map(function(e){return e})}},{key:"init",value:function(){var s=this;if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(C.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"</button></div>"))),this.clickableElements.length){!function l(){return s.hiddenFileInput&&s.hiddenFileInput.parentNode.removeChild(s.hiddenFileInput),s.hiddenFileInput=document.createElement("input"),s.hiddenFileInput.setAttribute("type","file"),(null===s.options.maxFiles||1<s.options.maxFiles)&&s.hiddenFileInput.setAttribute("multiple","multiple"),s.hiddenFileInput.className="dz-hidden-input",null!==s.options.acceptedFiles&&s.hiddenFileInput.setAttribute("accept",s.options.acceptedFiles),null!==s.options.capture&&s.hiddenFileInput.setAttribute("capture",s.options.capture),s.hiddenFileInput.style.visibility="hidden",s.hiddenFileInput.style.position="absolute",s.hiddenFileInput.style.top="0",s.hiddenFileInput.style.left="0",s.hiddenFileInput.style.height="0",s.hiddenFileInput.style.width="0",C.getElement(s.options.hiddenInputContainer,"hiddenInputContainer").appendChild(s.hiddenFileInput),s.hiddenFileInput.addEventListener("change",function(){var e=s.hiddenFileInput.files;if(e.length){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;s.addFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}return s.emit("addedfiles",e),l()})}()}this.URL=null!==window.URL?window.URL:window.webkitURL;var e=!0,t=!1,n=void 0;try{for(var i,r=this.events[Symbol.iterator]();!(e=(i=r.next()).done);e=!0){var o=i.value;this.on(o,this.options[o])}}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}this.on("uploadprogress",function(){return s.updateTotalUploadProgress()}),this.on("removedfile",function(){return s.updateTotalUploadProgress()}),this.on("canceled",function(e){return s.emit("complete",e)}),this.on("complete",function(e){if(0===s.getAddedFiles().length&&0===s.getUploadingFiles().length&&0===s.getQueuedFiles().length)return setTimeout(function(){return s.emit("queuecomplete")},0)});function a(e){var t;return(t=e).dataTransfer.types&&t.dataTransfer.types.some(function(e){return"Files"==e})&&(e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1)}return this.listeners=[{element:this.element,events:{dragstart:function(e){return s.emit("dragstart",e)},dragenter:function(e){return a(e),s.emit("dragenter",e)},dragover:function(e){var t;try{t=e.dataTransfer.effectAllowed}catch(e){}return e.dataTransfer.dropEffect="move"===t||"linkMove"===t?"move":"copy",a(e),s.emit("dragover",e)},dragleave:function(e){return s.emit("dragleave",e)},drop:function(e){return a(e),s.drop(e)},dragend:function(e){return s.emit("dragend",e)}}}],this.clickableElements.forEach(function(t){return s.listeners.push({element:t,events:{click:function(e){return t===s.element&&e.target!==s.element&&!C.elementInside(e.target,s.element.querySelector(".dz-message"))||s.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),null!=this.hiddenFileInput&&this.hiddenFileInput.parentNode&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,C.instances.splice(C.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e,t=0,n=0;if(this.getActiveFiles().length){var i=!0,r=!1,o=void 0;try{for(var a,l=this.getActiveFiles()[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;t+=s.upload.bytesSent,n+=s.upload.total}}catch(e){r=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(e,"]"):"")}},{key:"_renameFile",value:function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var e,t;if(e=this.getExistingFallback())return e;var n='<div class="dz-fallback">';this.options.dictFallbackText&&(n+="<p>".concat(this.options.dictFallbackText,"</p>")),n+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"></div>');var i=C.createElement(n);return"FORM"!==this.element.tagName?(t=C.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"></form>'))).appendChild(i):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:i}},{key:"getExistingFallback",value:function(){for(var e=function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;if(/(^| )fallback($| )/.test(a.className))return a}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}},t=0,n=["div","form"];t<n.length;t++){var i,r=n[t];if(i=e(this.element.getElementsByTagName(r)))return i}}},{key:"setupEventListeners",value:function(){return this.listeners.map(function(i){return function(){var e=[];for(var t in i.events){var n=i.events[t];e.push(i.element.addEventListener(t,n,!1))}return e}()})}},{key:"removeEventListeners",value:function(){return this.listeners.map(function(i){return function(){var e=[];for(var t in i.events){var n=i.events[t];e.push(i.element.removeEventListener(t,n,!1))}return e}()})}},{key:"disable",value:function(){var t=this;return this.clickableElements.forEach(function(e){return e.classList.remove("dz-clickable")}),this.removeEventListeners(),this.disabled=!0,this.files.map(function(e){return t.cancelUpload(e)})}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach(function(e){return e.classList.add("dz-clickable")}),this.setupEventListeners()}},{key:"filesize",value:function(e){var t=0,n="b";if(0<e){for(var i=["tb","gb","mb","kb","b"],r=0;r<i.length;r++){var o=i[r];if(Math.pow(this.options.filesizeBase,4-r)/10<=e){t=e/Math.pow(this.options.filesizeBase,4-r),n=o;break}}t=Math.round(10*t)/10}return"<strong>".concat(t,"</strong> ").concat(this.options.dictFileSizeUnits[n])}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);for(var t=[],n=0;n<e.dataTransfer.files.length;n++)t[n]=e.dataTransfer.files[n];if(t.length){var i=e.dataTransfer.items;i&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(t)}this.emit("addedfiles",t)}}},{key:"paste",value:function(e){if(null!=__guard__(null!=e?e.clipboardData:void 0,function(e){return e.items})){this.emit("paste",e);var t=e.clipboardData.items;return t.length?this._addFilesFromItems(t):void 0}}},{key:"handleFiles",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;this.addFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"_addFilesFromItems",value:function(s){var u=this;return function(){var e=[],t=!0,n=!1,i=void 0;try{for(var r,o=s[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a,l=r.value;null!=l.webkitGetAsEntry&&(a=l.webkitGetAsEntry())?a.isFile?e.push(u.addFile(l.getAsFile())):a.isDirectory?e.push(u._addFilesFromDirectory(a,a.name)):e.push(void 0):null!=l.getAsFile&&(null==l.kind||"file"===l.kind)?e.push(u.addFile(l.getAsFile())):e.push(void 0)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return e}()}},{key:"_addFilesFromDirectory",value:function(e,s){function t(t){return __guardMethod__(console,"log",function(e){return e.log(t)})}var u=this,n=e.createReader();return function l(){return n.readEntries(function(e){if(0<e.length){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;a.isFile?a.file(function(e){if(!u.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath="".concat(s,"/").concat(e.name),u.addFile(e)}):a.isDirectory&&u._addFilesFromDirectory(a,"".concat(s,"/").concat(a.name))}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}l()}return null},t)}()}},{key:"accept",value:function(e,t){this.options.maxFilesize&&e.size>1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):C.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}},{key:"addFile",value:function(t){var n=this;t.upload={uuid:C.uuidv4(),progress:0,total:t.size,bytesSent:0,filename:this._renameFile(t)},this.files.push(t),t.status=C.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,function(e){e?(t.accepted=!1,n._errorProcessing([t],e)):(t.accepted=!0,n.options.autoQueue&&n.enqueueFile(t)),n._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;this.enqueueFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return null}},{key:"enqueueFile",value:function(e){var t=this;if(e.status!==C.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=C.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return t.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var t=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var n=this._thumbnailQueue.shift();return this.createThumbnail(n,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(e){return t.emit("thumbnail",n,e),t._processingThumbnail=!1,t._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===C.UPLOADING&&this.cancelUpload(e),this.files=without(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);var t=!0,n=!1,i=void 0;try{for(var r,o=this.files.slice()[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;a.status===C.UPLOADING&&!e||this.removeFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return null}},{key:"resizeImage",value:function(r,e,t,n,o){var a=this;return this.createThumbnail(r,e,t,n,!0,function(e,t){if(null==t)return o(r);var n=a.options.resizeMimeType;null==n&&(n=r.type);var i=t.toDataURL(n,a.options.resizeQuality);return"image/jpeg"!==n&&"image/jpg"!==n||(i=ExifRestore.restore(r.dataURL,i)),o(C.dataURItoBlob(i))})}},{key:"createThumbnail",value:function(e,t,n,i,r,o){var a=this,l=new FileReader;l.onload=function(){e.dataURL=l.result,"image/svg+xml"!==e.type?a.createThumbnailFromUrl(e,t,n,i,r,o):null!=o&&o(l.result)},l.readAsDataURL(e)}},{key:"displayExistingFile",value:function(t,e,n,i,r){var o=this,a=!(4<arguments.length&&void 0!==r)||r;if(this.emit("addedfile",t),this.emit("complete",t),a){t.dataURL=e,this.createThumbnailFromUrl(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.resizeMethod,this.options.fixOrientation,function(e){o.emit("thumbnail",t,e),n&&n()},i)}else this.emit("thumbnail",t,e),n&&n()}},{key:"createThumbnailFromUrl",value:function(o,a,l,s,t,u,e){var c=this,d=document.createElement("img");return e&&(d.crossOrigin=e),d.onload=function(){var e=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&t&&(e=function(e){return EXIF.getData(d,function(){return e(EXIF.getTag(this,"Orientation"))})}),e(function(e){o.width=d.width,o.height=d.height;var t=c.options.resize.call(c,o,a,l,s),n=document.createElement("canvas"),i=n.getContext("2d");switch(n.width=t.trgWidth,n.height=t.trgHeight,4<e&&(n.width=t.trgHeight,n.height=t.trgWidth),e){case 2:i.translate(n.width,0),i.scale(-1,1);break;case 3:i.translate(n.width,n.height),i.rotate(Math.PI);break;case 4:i.translate(0,n.height),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-n.width);break;case 7:i.rotate(.5*Math.PI),i.translate(n.height,-n.width),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-n.height,0)}drawImageIOSFix(i,d,null!=t.srcX?t.srcX:0,null!=t.srcY?t.srcY:0,t.srcWidth,t.srcHeight,null!=t.trgX?t.trgX:0,null!=t.trgY?t.trgY:0,t.trgWidth,t.trgHeight);var r=n.toDataURL("image/png");if(null!=u)return u(r,n)})},null!=u&&(d.onerror=u),d.src=o.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,n=t;if(!(e<=t)){var i=this.getQueuedFiles();if(0<i.length){if(this.options.uploadMultiple)return this.processFiles(i.slice(0,e-t));for(;n<e;){if(!i.length)return;this.processFile(i.shift()),n++}}}}},{key:"processFile",value:function(e){return this.processFiles([e])}},{key:"processFiles",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;a.processing=!0,a.status=C.UPLOADING,this.emit("processing",a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}},{key:"_getFilesWithXhr",value:function(t){return this.files.filter(function(e){return e.xhr===t}).map(function(e){return e})}},{key:"cancelUpload",value:function(e){if(e.status===C.UPLOADING){var t=this._getFilesWithXhr(e.xhr),n=!0,i=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){o.value.status=C.CANCELED}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}void 0!==e.xhr&&e.xhr.abort();var l=!0,s=!1,u=void 0;try{for(var c,d=t[Symbol.iterator]();!(l=(c=d.next()).done);l=!0){var p=c.value;this.emit("canceled",p)}}catch(e){s=!0,u=e}finally{try{l||null==d.return||d.return()}finally{if(s)throw u}}this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==C.ADDED&&e.status!==C.QUEUED||(e.status=C.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"!=typeof e)return e;for(var t=arguments.length,n=new Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e.apply(this,n)}},{key:"uploadFile",value:function(e){return this.uploadFiles([e])}},{key:"uploadFiles",value:function(s){var u=this;this._transformFiles(s,function(e){if(u.options.chunking){var t=e[0];s[0].upload.chunked=u.options.chunking&&(u.options.forceChunking||t.size>u.options.chunkSize),s[0].upload.totalChunkCount=Math.ceil(t.size/u.options.chunkSize)}if(s[0].upload.chunked){var r=s[0],o=e[0];r.upload.chunks=[];var i=function(){for(var e=0;void 0!==r.upload.chunks[e];)e++;if(!(e>=r.upload.totalChunkCount)){0;var t=e*u.options.chunkSize,n=Math.min(t+u.options.chunkSize,r.size),i={name:u._getParamName(0),data:o.webkitSlice?o.webkitSlice(t,n):o.slice(t,n),filename:r.upload.filename,chunkIndex:e};r.upload.chunks[e]={file:r,index:e,dataBlock:i,status:C.UPLOADING,progress:0,retries:0},u._uploadData(s,[i])}};if(r.upload.finishedChunkUpload=function(e){var t=!0;e.status=C.SUCCESS,e.dataBlock=null,e.xhr=null;for(var n=0;n<r.upload.totalChunkCount;n++){if(void 0===r.upload.chunks[n])return i();r.upload.chunks[n].status!==C.SUCCESS&&(t=!1)}t&&u.options.chunksUploaded(r,function(){u._finished(s,"",null)})},u.options.parallelChunkUploads)for(var n=0;n<r.upload.totalChunkCount;n++)i();else i()}else{for(var a=[],l=0;l<s.length;l++)a[l]={name:u._getParamName(l),data:e[l],filename:s[l].upload.filename};u._uploadData(s,a)}})}},{key:"_getChunk",value:function(e,t){for(var n=0;n<e.upload.totalChunkCount;n++)if(void 0!==e.upload.chunks[n]&&e.upload.chunks[n].xhr===t)return e.upload.chunks[n]}},{key:"_uploadData",value:function(t,e){var n=this,i=new XMLHttpRequest,r=!0,o=!1,a=void 0;try{for(var l,s=t[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){l.value.xhr=i}}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}t[0].upload.chunked&&(t[0].upload.chunks[e[0].chunkIndex].xhr=i);var u=this.resolveOption(this.options.method,t),c=this.resolveOption(this.options.url,t);i.open(u,c,!0),i.timeout=this.resolveOption(this.options.timeout,t),i.withCredentials=!!this.options.withCredentials,i.onload=function(e){n._finishedUploading(t,i,e)},i.ontimeout=function(){n._handleUploadError(t,i,"Request timedout after ".concat(n.options.timeout," seconds"))},i.onerror=function(){n._handleUploadError(t,i)},(null!=i.upload?i.upload:i).onprogress=function(e){return n._updateFilesUploadProgress(t,i,e)};var d={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var p in this.options.headers&&C.extend(d,this.options.headers),d){var h=d[p];h&&i.setRequestHeader(p,h)}var f=new FormData;if(this.options.params){var v=this.options.params;for(var m in"function"==typeof v&&(v=v.call(this,t,i,t[0].upload.chunked?this._getChunk(t[0],i):null)),v){var y=v[m];f.append(m,y)}}var g=!0,b=!1,k=void 0;try{for(var w,F=t[Symbol.iterator]();!(g=(w=F.next()).done);g=!0){var z=w.value;this.emit("sending",z,i,f)}}catch(e){b=!0,k=e}finally{try{g||null==F.return||F.return()}finally{if(b)throw k}}this.options.uploadMultiple&&this.emit("sendingmultiple",t,i,f),this._addFormElementData(f);for(var x=0;x<e.length;x++){var E=e[x];f.append(E.name,E.data,E.filename)}this.submitRequest(i,f,t)}},{key:"_transformFiles",value:function(n,i){for(var e=this,r=[],o=0,t=function(t){e.options.transformFile.call(e,n[t],function(e){r[t]=e,++o===n.length&&i(r)})},a=0;a<n.length;a++)t(a)}},{key:"_addFormElementData",value:function(e){if("FORM"===this.element.tagName){var t=!0,n=!1,i=void 0;try{for(var r,o=this.element.querySelectorAll("input, textarea, select, button")[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value,l=a.getAttribute("name"),s=a.getAttribute("type");if(s=s&&s.toLowerCase(),null!=l)if("SELECT"===a.tagName&&a.hasAttribute("multiple")){var u=!0,c=!1,d=void 0;try{for(var p,h=a.options[Symbol.iterator]();!(u=(p=h.next()).done);u=!0){var f=p.value;f.selected&&e.append(l,f.value)}}catch(e){c=!0,d=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw d}}}else(!s||"checkbox"!==s&&"radio"!==s||a.checked)&&e.append(l,a.value)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}}},{key:"_updateFilesUploadProgress",value:function(e,t,n){var i;if(void 0!==n){if(i=100*n.loaded/n.total,e[0].upload.chunked){var r=e[0],o=this._getChunk(r,t);o.progress=i,o.total=n.total,o.bytesSent=n.loaded;r.upload.progress=0,r.upload.total=0;for(var a=r.upload.bytesSent=0;a<r.upload.totalChunkCount;a++)void 0!==r.upload.chunks[a]&&void 0!==r.upload.chunks[a].progress&&(r.upload.progress+=r.upload.chunks[a].progress,r.upload.total+=r.upload.chunks[a].total,r.upload.bytesSent+=r.upload.chunks[a].bytesSent);r.upload.progress=r.upload.progress/r.upload.totalChunkCount}else{var l=!0,s=!1,u=void 0;try{for(var c,d=e[Symbol.iterator]();!(l=(c=d.next()).done);l=!0){var p=c.value;p.upload.progress=i,p.upload.total=n.total,p.upload.bytesSent=n.loaded}}catch(e){s=!0,u=e}finally{try{l||null==d.return||d.return()}finally{if(s)throw u}}}var h=!0,f=!1,v=void 0;try{for(var m,y=e[Symbol.iterator]();!(h=(m=y.next()).done);h=!0){var g=m.value;this.emit("uploadprogress",g,g.upload.progress,g.upload.bytesSent)}}catch(e){f=!0,v=e}finally{try{h||null==y.return||y.return()}finally{if(f)throw v}}}else{var b=!0,k=!0,w=!(i=100),F=void 0;try{for(var z,x=e[Symbol.iterator]();!(k=(z=x.next()).done);k=!0){var E=z.value;100===E.upload.progress&&E.upload.bytesSent===E.upload.total||(b=!1),E.upload.progress=i,E.upload.bytesSent=E.upload.total}}catch(e){w=!0,F=e}finally{try{k||null==x.return||x.return()}finally{if(w)throw F}}if(b)return;var C=!0,_=!1,S=void 0;try{for(var D,T=e[Symbol.iterator]();!(C=(D=T.next()).done);C=!0){var L=D.value;this.emit("uploadprogress",L,i,L.upload.bytesSent)}}catch(e){_=!0,S=e}finally{try{C||null==T.return||T.return()}finally{if(_)throw S}}}}},{key:"_finishedUploading",value:function(e,t,n){var i;if(e[0].status!==C.CANCELED&&4===t.readyState){if("arraybuffer"!==t.responseType&&"blob"!==t.responseType&&(i=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{i=JSON.parse(i)}catch(e){n=e,i="Invalid JSON response from server."}this._updateFilesUploadProgress(e),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t)):this._finished(e,i,n):this._handleUploadError(e,t,i)}}},{key:"_handleUploadError",value:function(e,t,n){if(e[0].status!==C.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){var i=this._getChunk(e[0],t);if(i.retries++<this.options.retryChunksLimit)return void this._uploadData(e,[i.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(e,n||this.options.dictResponseError.replace("{{statusCode}}",t.status),t)}}},{key:"submitRequest",value:function(e,t){e.send(t)}},{key:"_finished",value:function(e,t,n){var i=!0,r=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;s.status=C.SUCCESS,this.emit("success",s,t,n),this.emit("complete",s)}}catch(e){r=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(e,t,n){var i=!0,r=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;s.status=C.ERROR,this.emit("error",s,t,n),this.emit("complete",s)}}catch(e){r=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}]),C}();Dropzone.initClass(),Dropzone.version="5.7.0",Dropzone.options={},Dropzone.optionsForElement=function(e){return e.getAttribute("id")?Dropzone.options[camelize(e.getAttribute("id"))]:void 0},Dropzone.instances=[],Dropzone.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},Dropzone.autoDiscover=!0,Dropzone.discover=function(){var s;if(document.querySelectorAll)s=document.querySelectorAll(".dropzone");else{s=[];var e=function(l){return function(){var e=[],t=!0,n=!1,i=void 0;try{for(var r,o=l[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;/(^| )dropzone($| )/.test(a.className)?e.push(s.push(a)):e.push(void 0)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return e}()};e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))}return function(){var e=[],t=!0,n=!1,i=void 0;try{for(var r,o=s[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;!1!==Dropzone.optionsForElement(a)?e.push(new Dropzone(a)):e.push(void 0)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return e}()},Dropzone.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],Dropzone.isBrowserSupported=function(){var e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){var t=!0,n=!1,i=void 0;try{for(var r,o=Dropzone.blacklistedBrowsers[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){r.value.test(navigator.userAgent)&&(e=!1)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}else e=!1;else e=!1;return e},Dropzone.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),r=new Uint8Array(i),o=0,a=t.length,l=0<=a;l?o<=a:a<=o;l?o++:o--)r[o]=t.charCodeAt(o);return new Blob([i],{type:n})};var without=function(e,t){return e.filter(function(e){return e!==t}).map(function(e){return e})},camelize=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})};Dropzone.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},Dropzone.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},Dropzone.getElement=function(e,t){var n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector or a plain HTML element."));return n},Dropzone.getElements=function(e,t){var n,i;if(e instanceof Array){i=[];try{var r=!0,o=!1,a=void 0;try{for(var l,s=e[Symbol.iterator]();!(r=(l=s.next()).done);r=!0)n=l.value,i.push(this.getElement(n,t))}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}}catch(e){i=null}}else if("string"==typeof e){var u=!0,c=!(i=[]),d=void 0;try{for(var p,h=document.querySelectorAll(e)[Symbol.iterator]();!(u=(p=h.next()).done);u=!0)n=p.value,i.push(n)}catch(e){c=!0,d=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw d}}}else null!=e.nodeType&&(i=[e]);if(null==i||!i.length)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return i},Dropzone.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},Dropzone.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");var n=e.type,i=n.replace(/\/.*$/,""),r=!0,o=!1,a=void 0;try{for(var l,s=t[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var u=l.value;if("."===(u=u.trim()).charAt(0)){if(-1!==e.name.toLowerCase().indexOf(u.toLowerCase(),e.name.length-u.length))return!0}else if(/\/\*$/.test(u)){if(i===u.replace(/\/.*$/,""))return!0}else if(n===u)return!0}}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new Dropzone(this,e)})}),"undefined"!=typeof module&&null!==module?module.exports=Dropzone:window.Dropzone=Dropzone,Dropzone.ADDED="added",Dropzone.QUEUED="queued",Dropzone.ACCEPTED=Dropzone.QUEUED,Dropzone.UPLOADING="uploading",Dropzone.PROCESSING=Dropzone.UPLOADING,Dropzone.CANCELED="canceled",Dropzone.ERROR="error",Dropzone.SUCCESS="success";var detectVerticalSquash=function(e){e.naturalWidth;var t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;var i=n.getContext("2d");i.drawImage(e,0,0);for(var r=i.getImageData(1,0,1,t).data,o=0,a=t,l=t;o<l;){0===r[4*(l-1)+3]?a=l:o=l,l=a+o>>1}var s=l/t;return 0==s?1:s},drawImageIOSFix=function(e,t,n,i,r,o,a,l,s,u){var c=detectVerticalSquash(t);return e.drawImage(t,n,i,r,o,a,l,s,u/c)},ExifRestore=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(e){for(var t="",n=void 0,i=void 0,r="",o=void 0,a=void 0,l=void 0,s="",u=0;o=(n=e[u++])>>2,a=(3&n)<<4|(i=e[u++])>>4,l=(15&i)<<2|(r=e[u++])>>6,s=63&r,isNaN(i)?l=s=64:isNaN(r)&&(s=64),t=t+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l)+this.KEY_STR.charAt(s),n=i=r="",o=a=l=s="",u<e.length;);return t}},{key:"restore",value:function(e,t){if(!e.match("data:image/jpeg;base64,"))return t;var n=this.decode64(e.replace("data:image/jpeg;base64,","")),i=this.slice2Segments(n),r=this.exifManipulation(t,i);return"data:image/jpeg;base64,".concat(this.encode64(r))}},{key:"exifManipulation",value:function(e,t){var n=this.getExifArray(t),i=this.insertExif(e,n);return new Uint8Array(i)}},{key:"getExifArray",value:function(e){for(var t=void 0,n=0;n<e.length;){if(255===(t=e[n])[0]&225===t[1])return t;n++}return[]}},{key:"insertExif",value:function(e,t){var n=e.replace("data:image/jpeg;base64,",""),i=this.decode64(n),r=i.indexOf(255,3),o=i.slice(0,r),a=i.slice(r),l=o;return l=(l=l.concat(t)).concat(a)}},{key:"slice2Segments",value:function(e){for(var t=0,n=[];;){if(255===e[t]&218===e[t+1])break;if(255===e[t]&216===e[t+1])t+=2;else{var i=t+(256*e[t+2]+e[t+3])+2,r=e.slice(t,i);n.push(r),t=i}if(t>e.length)break}return n}},{key:"decode64",value:function(e){var t=void 0,n=void 0,i="",r=void 0,o=void 0,a="",l=0,s=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=this.KEY_STR.indexOf(e.charAt(l++))<<2|(r=this.KEY_STR.indexOf(e.charAt(l++)))>>4,n=(15&r)<<4|(o=this.KEY_STR.indexOf(e.charAt(l++)))>>2,i=(3&o)<<6|(a=this.KEY_STR.indexOf(e.charAt(l++))),s.push(t),64!==o&&s.push(n),64!==a&&s.push(i),t=n=i="",r=o=a="",l<e.length;);return s}}]),e}();ExifRestore.initClass();var contentLoaded=function(t,n){function i(e){if("readystatechange"!==e.type||"complete"===o.readyState)return("load"===e.type?t:o)[s](u+e.type,i,!1),!r&&(r=!0)?n.call(t,e.type||e):void 0}var r=!1,e=!0,o=t.document,a=o.documentElement,l=o.addEventListener?"addEventListener":"attachEvent",s=o.addEventListener?"removeEventListener":"detachEvent",u=o.addEventListener?"":"on";if("complete"!==o.readyState){if(o.createEventObject&&a.doScroll){try{e=!t.frameElement}catch(e){}e&&!function t(){try{a.doScroll("left")}catch(e){return void setTimeout(t,50)}return i("poll")}()}return o[l](u+"DOMContentLoaded",i,!1),o[l](u+"readystatechange",i,!1),t[l](u+"load",i,!1)}};function __guard__(e,t){return null!=e?t(e):void 0}function __guardMethod__(e,t,n){return null!=e&&"function"==typeof e[t]?n(e,t):void 0}Dropzone._autoDiscoverFunction=function(){if(Dropzone.autoDiscover)return Dropzone.discover()},contentLoaded(window,Dropzone._autoDiscoverFunction);
|
{styles → admin/js}/select2.js
RENAMED
File without changes
|
admin/js/tiptip.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t){t.fn.tipTip=function(e){var o={activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},exit:function(){}},i=t.extend(o,e);if(t("#tiptip_holder").length<=0){var n=t('<div id="tiptip_holder" style="max-width:'+i.maxWidth+';"></div>'),r=t('<div id="tiptip_content"></div>'),a=t('<div id="tiptip_arrow"></div>');t("body").append(n.html(r).prepend(a.html('<div id="tiptip_arrow_inner"></div>')))}else var n=t("#tiptip_holder"),r=t("#tiptip_content"),a=t("#tiptip_arrow");return this.each(function(){function e(){i.enter.call(this),r.html(d),n.hide().removeAttr("class").css("margin","0"),a.removeAttr("style");var e=parseInt(f.offset().top),o=parseInt(f.offset().left),p=parseInt(f.outerWidth()),l=parseInt(f.outerHeight()),h=n.outerWidth(),c=n.outerHeight(),s=Math.round((p-h)/2),_=Math.round((l-c)/2),v=Math.round(o+s),m=Math.round(e+l+i.edgeOffset),g="",b="",M=Math.round(h-12)/2;"bottom"==i.defaultPosition?g="_bottom":"top"==i.defaultPosition?g="_top":"left"==i.defaultPosition?g="_left":"right"==i.defaultPosition&&(g="_right");var w=s+o<parseInt(t(window).scrollLeft()),O=h+o>parseInt(t(window).width());w&&s<0||"_right"==g&&!O||"_left"==g&&o<h+i.edgeOffset+5?(g="_right",b=Math.round(c-13)/2,M=-12,v=Math.round(o+p+i.edgeOffset),m=Math.round(e+_)):(O&&s<0||"_left"==g&&!w)&&(g="_left",b=Math.round(c-13)/2,M=Math.round(h),v=Math.round(o-(h+i.edgeOffset+5)),m=Math.round(e+_));var x=e+l+i.edgeOffset+c+8>parseInt(t(window).height()+t(window).scrollTop()),I=e+l-(i.edgeOffset+c+8)<0;x||"_bottom"==g&&x||"_top"==g&&!I?("_top"==g||"_bottom"==g?g="_top":g+="_top",b=c,m=Math.round(e-(c+5+i.edgeOffset))):(I|("_top"==g&&I)||"_bottom"==g&&!x)&&("_top"==g||"_bottom"==g?g="_bottom":g+="_bottom",b=-12,m=Math.round(e+l+i.edgeOffset)),"_right_top"==g||"_left_top"==g?m+=5:"_right_bottom"!=g&&"_left_bottom"!=g||(m-=5),"_left_top"!=g&&"_left_bottom"!=g||(v+=5),a.css({"margin-left":M+"px","margin-top":b+"px"}),n.css({"margin-left":v+"px","margin-top":m+"px"}).attr("class","tip"+g),u&&clearTimeout(u),u=setTimeout(function(){n.stop(!0,!0).fadeIn(i.fadeIn)},i.delay)}function o(){i.exit.call(this),u&&clearTimeout(u),n.fadeOut(i.fadeOut)}var f=t(this);if(i.content)d=i.content;else var d=f.attr(i.attribute);if(""!=d){i.content||f.removeAttr(i.attribute);var u=!1;"hover"==i.activation?(f.hover(function(){e()},function(){i.keepAlive||o()}),i.keepAlive&&n.hover(function(){},function(){o()})):"focus"==i.activation?f.focus(function(){e()}).blur(function(){o()}):"click"==i.activation&&(f.click(function(){return e(),!1}).hover(function(){},function(){i.keepAlive||o()}),i.keepAlive&&n.hover(function(){},function(){o()}))}})}}(jQuery);
|
admin/js/wt-import-export-for-woo-admin.js
ADDED
@@ -0,0 +1,723 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function( $ ) {
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
$(function() {
|
5 |
+
|
6 |
+
$(".wt-iew-tips").tipTip({'attribute': 'data-wt-iew-tip'});
|
7 |
+
|
8 |
+
|
9 |
+
/* tab view */
|
10 |
+
var wf_tab_view=
|
11 |
+
{
|
12 |
+
Set:function(prnt_selector)
|
13 |
+
{
|
14 |
+
var wf_prnt_obj=$(prnt_selector);
|
15 |
+
var wf_nav_tab=wf_prnt_obj.find('.wt-iew-tab-head .nav-tab');
|
16 |
+
if(wf_nav_tab.length>0)
|
17 |
+
{
|
18 |
+
wf_nav_tab.click(function(){
|
19 |
+
var wf_tab_hash=$(this).attr('href');
|
20 |
+
wf_nav_tab.removeClass('nav-tab-active');
|
21 |
+
$(this).addClass('nav-tab-active');
|
22 |
+
wf_tab_hash=wf_tab_hash.charAt(0)=='#' ? wf_tab_hash.substring(1) : wf_tab_hash;
|
23 |
+
var wf_tab_elm=$('div[data-id="'+wf_tab_hash+'"]');
|
24 |
+
wf_prnt_obj.find('.wt-iew-tab-content').hide();
|
25 |
+
if(wf_tab_elm.length>0 && wf_tab_elm.is(':hidden'))
|
26 |
+
{
|
27 |
+
wf_tab_elm.fadeIn();
|
28 |
+
}
|
29 |
+
});
|
30 |
+
$(window).on('hashchange', function (e) {
|
31 |
+
var location_hash=window.location.hash;
|
32 |
+
if(location_hash!="")
|
33 |
+
{
|
34 |
+
wf_tab_view.showTab(location_hash);
|
35 |
+
}
|
36 |
+
}).trigger('hashchange');
|
37 |
+
|
38 |
+
var location_hash=window.location.hash;
|
39 |
+
if(location_hash!="")
|
40 |
+
{
|
41 |
+
wf_tab_view.showTab(location_hash);
|
42 |
+
}else
|
43 |
+
{
|
44 |
+
wf_nav_tab.eq(0).click();
|
45 |
+
}
|
46 |
+
}
|
47 |
+
this.subTab(wf_prnt_obj);
|
48 |
+
},
|
49 |
+
showTab:function(location_hash)
|
50 |
+
{
|
51 |
+
var wf_tab_hash=location_hash.charAt(0)=='#' ? location_hash.substring(1) : location_hash;
|
52 |
+
if(wf_tab_hash!="")
|
53 |
+
{
|
54 |
+
var wf_tab_elm=$('div[data-id="'+wf_tab_hash+'"]');
|
55 |
+
if(wf_tab_elm.length>0 && wf_tab_elm.is(':hidden'))
|
56 |
+
{
|
57 |
+
$('a[href="#'+wf_tab_hash+'"]').click();
|
58 |
+
}
|
59 |
+
}
|
60 |
+
},
|
61 |
+
subTab:function(wf_prnt_obj)
|
62 |
+
{
|
63 |
+
wf_prnt_obj.find('.wt_iew_sub_tab li').click(function(){
|
64 |
+
var trgt=$(this).attr('data-target');
|
65 |
+
var prnt=$(this).parent('.wt_iew_sub_tab');
|
66 |
+
var ctnr=prnt.siblings('.wt_iew_sub_tab_container');
|
67 |
+
prnt.find('li a').css({'color':'#0073aa','cursor':'pointer'});
|
68 |
+
$(this).find('a').css({'color':'#ccc','cursor':'default'});
|
69 |
+
ctnr.find('.wt_iew_sub_tab_content').hide();
|
70 |
+
ctnr.find('.wt_iew_sub_tab_content[data-id="'+trgt+'"]').fadeIn();
|
71 |
+
});
|
72 |
+
wf_prnt_obj.find('.wt_iew_sub_tab').each(function(){
|
73 |
+
var elm=$(this).children('li').eq(0);
|
74 |
+
elm.click();
|
75 |
+
});
|
76 |
+
}
|
77 |
+
}
|
78 |
+
wf_tab_view.Set('#'+wt_iew_basic_params.plugin_id); /* set plugin main div as parent object to avoid conflict with other WT plugins */
|
79 |
+
/* tab view */
|
80 |
+
|
81 |
+
});
|
82 |
+
|
83 |
+
})( jQuery );
|
84 |
+
|
85 |
+
var wt_iew_settings_form_basic=
|
86 |
+
{
|
87 |
+
Set:function(prnt_selector)
|
88 |
+
{
|
89 |
+
var wf_prnt_obj=jQuery(prnt_selector);
|
90 |
+
wf_prnt_obj.find('.wt_iew_settings_form_basic').submit(function(e){
|
91 |
+
e.preventDefault();
|
92 |
+
var data=jQuery(this).serialize();
|
93 |
+
|
94 |
+
var submit_btn=jQuery(this).find('input[type="submit"]');
|
95 |
+
var spinner=submit_btn.siblings('.spinner');
|
96 |
+
spinner.css({'visibility':'visible'});
|
97 |
+
submit_btn.css({'opacity':'.5','cursor':'default'}).prop('disabled',true);
|
98 |
+
|
99 |
+
jQuery.ajax({
|
100 |
+
url:wt_iew_basic_params.ajax_url,
|
101 |
+
type:'POST',
|
102 |
+
dataType:'json',
|
103 |
+
data:data+'&action=wt_iew_save_settings_basic',
|
104 |
+
success:function(data)
|
105 |
+
{
|
106 |
+
spinner.css({'visibility':'hidden'});
|
107 |
+
submit_btn.css({'opacity':'1','cursor':'pointer'}).prop('disabled',false);
|
108 |
+
if(data.status==true)
|
109 |
+
{
|
110 |
+
wt_iew_notify_msg.success(data.msg);
|
111 |
+
}else
|
112 |
+
{
|
113 |
+
wt_iew_notify_msg.error(data.msg);
|
114 |
+
}
|
115 |
+
},
|
116 |
+
error:function ()
|
117 |
+
{
|
118 |
+
spinner.css({'visibility':'hidden'});
|
119 |
+
submit_btn.css({'opacity':'1','cursor':'pointer'}).prop('disabled',false);
|
120 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.settings_error);
|
121 |
+
}
|
122 |
+
});
|
123 |
+
});
|
124 |
+
}
|
125 |
+
}
|
126 |
+
var wt_drp_menu=
|
127 |
+
{
|
128 |
+
Set:function()
|
129 |
+
{
|
130 |
+
jQuery(document).on('click', '.wt_iew_drp_menu', function(){
|
131 |
+
var trgt=jQuery(this).attr('data-target');
|
132 |
+
var drp_menu=jQuery('.wt_iew_dropdown[data-id="'+trgt+'"]');
|
133 |
+
if(drp_menu.is(':visible'))
|
134 |
+
{
|
135 |
+
drp_menu.hide();
|
136 |
+
}else
|
137 |
+
{
|
138 |
+
var pos=jQuery(this).position();
|
139 |
+
var t=pos.top+(jQuery(this).height()/2)+5;
|
140 |
+
var l=pos.left; //-drp_menu.outerWidth()+jQuery(this).outerWidth();
|
141 |
+
var w=jQuery(this).outerWidth();
|
142 |
+
drp_menu.css({'display':'block','left':l,'top':t,'opacity':0,'width':w}).stop(true, true).animate({'top':t+5, 'opacity':1});
|
143 |
+
}
|
144 |
+
});
|
145 |
+
|
146 |
+
jQuery(document).on('click', 'body, body *', function(e){
|
147 |
+
var drp_menu=jQuery('.wt_iew_dropdown');
|
148 |
+
if(drp_menu.is(':visible'))
|
149 |
+
{
|
150 |
+
if(jQuery(e.target).hasClass('wt_iew_dropdown')===false && jQuery(e.target).hasClass('wt_iew_drp_menu')===false && jQuery(e.target).hasClass('dashicons')===false)
|
151 |
+
{
|
152 |
+
drp_menu.hide();
|
153 |
+
}
|
154 |
+
}
|
155 |
+
});
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
var wt_iew_notify_msg=
|
160 |
+
{
|
161 |
+
error:function(message)
|
162 |
+
{
|
163 |
+
var er_elm=jQuery('<div class="wt_notify_msg" style="background:#f8d7da; border:solid 1px #f5c6cb; color: #721c24">'+message+'</div>');
|
164 |
+
this.setNotify(er_elm);
|
165 |
+
},
|
166 |
+
success:function(message)
|
167 |
+
{
|
168 |
+
var suss_elm=jQuery('<div class="wt_notify_msg" style="background:#d4edda; border:solid 1px #c3e6cb; color: #155724;">'+message+'</div>');
|
169 |
+
this.setNotify(suss_elm);
|
170 |
+
},
|
171 |
+
setNotify:function(elm)
|
172 |
+
{
|
173 |
+
jQuery('body').append(elm);
|
174 |
+
jQuery('.wt_notify_msg').click(function(){
|
175 |
+
jQuery(this).remove();
|
176 |
+
});
|
177 |
+
elm.stop(true,true).animate({'opacity':1,'top':'50px'},1000);
|
178 |
+
setTimeout(function(){
|
179 |
+
elm.animate({'opacity':0,'top':'100px'},1000,function(){
|
180 |
+
elm.remove();
|
181 |
+
});
|
182 |
+
},3000);
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
wt_iew_popup={
|
187 |
+
Set:function()
|
188 |
+
{
|
189 |
+
this.regPopupOpen();
|
190 |
+
this.regPopupClose();
|
191 |
+
jQuery('body').prepend('<div class="wt_iew_overlay"></div>');
|
192 |
+
},
|
193 |
+
regPopupOpen:function()
|
194 |
+
{
|
195 |
+
jQuery('[data-wt_iew_popup]').click(function(){
|
196 |
+
var elm_class=jQuery(this).attr('data-wt_iew_popup');
|
197 |
+
var elm=jQuery('.'+elm_class);
|
198 |
+
if(elm.length>0)
|
199 |
+
{
|
200 |
+
wt_iew_popup.showPopup(elm);
|
201 |
+
}
|
202 |
+
});
|
203 |
+
},
|
204 |
+
showPopup:function(popup_elm)
|
205 |
+
{
|
206 |
+
var pw=popup_elm.outerWidth();
|
207 |
+
var wh=jQuery(window).height();
|
208 |
+
var ph=wh-150;
|
209 |
+
popup_elm.css({'margin-left':((pw/2)*-1),'display':'block','top':'20px'}).animate({'top':'50px'});
|
210 |
+
popup_elm.find('.wt_iew_popup_body').css({'max-height':ph+'px','overflow':'auto'});
|
211 |
+
jQuery('.wt_iew_overlay').show();
|
212 |
+
},
|
213 |
+
hidePopup:function()
|
214 |
+
{
|
215 |
+
jQuery('.wt_iew_popup_close').click();
|
216 |
+
},
|
217 |
+
regPopupClose:function(popup_elm)
|
218 |
+
{
|
219 |
+
jQuery(document).keyup(function(e){
|
220 |
+
if(e.keyCode==27)
|
221 |
+
{
|
222 |
+
wt_iew_popup.hidePopup();
|
223 |
+
}
|
224 |
+
});
|
225 |
+
jQuery('.wt_iew_popup_close, .wt_iew_popup_cancel').unbind('click').click(function(){
|
226 |
+
jQuery('.wt_iew_overlay, .wt_iew_popup').hide();
|
227 |
+
});
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
var wt_field_group=
|
232 |
+
{
|
233 |
+
Set:function()
|
234 |
+
{
|
235 |
+
//jQuery('.wt_iew_field_group_children').hide();
|
236 |
+
jQuery('.wt_iew_field_group_hd .wt_iew_field_group_toggle_btn').each(function(){
|
237 |
+
var group_id = jQuery(this).attr('data-id');
|
238 |
+
var group_content_dv = jQuery(this).parents('tr').find('.wt_iew_field_group_content');
|
239 |
+
var visibility = jQuery(this).attr('data-visibility');
|
240 |
+
jQuery('.wt_iew_field_group_children[data-field-group="'+group_id+'"]').appendTo(group_content_dv.find('table'));
|
241 |
+
if(visibility==1)
|
242 |
+
{
|
243 |
+
group_content_dv.show();
|
244 |
+
}
|
245 |
+
});
|
246 |
+
jQuery('.wt_iew_field_group_hd').click(function(){
|
247 |
+
|
248 |
+
var toggle_btn=jQuery(this).find('.wt_iew_field_group_toggle_btn');
|
249 |
+
var visibility=toggle_btn.attr('data-visibility');
|
250 |
+
var group_content_dv=toggle_btn.parents('tr').find('.wt_iew_field_group_content');
|
251 |
+
if(visibility==1)
|
252 |
+
{
|
253 |
+
toggle_btn.attr('data-visibility',0);
|
254 |
+
toggle_btn.find('.dashicons').removeClass('dashicons-arrow-down').addClass('dashicons-arrow-right');
|
255 |
+
group_content_dv.hide();
|
256 |
+
}else
|
257 |
+
{
|
258 |
+
toggle_btn.attr('data-visibility',1);
|
259 |
+
toggle_btn.find('.dashicons').removeClass('dashicons-arrow-right').addClass('dashicons-arrow-down');
|
260 |
+
group_content_dv.show();
|
261 |
+
}
|
262 |
+
});
|
263 |
+
}
|
264 |
+
}
|
265 |
+
var wt_iew_form_toggler=
|
266 |
+
{
|
267 |
+
Set:function()
|
268 |
+
{
|
269 |
+
this.runToggler();
|
270 |
+
jQuery('select.wt_iew_form_toggler').change(function(){
|
271 |
+
wt_iew_form_toggler.toggle(jQuery(this));
|
272 |
+
});
|
273 |
+
jQuery('input[type="radio"].wt_iew_form_toggler').click(function(){
|
274 |
+
if(jQuery(this).is(':checked'))
|
275 |
+
{
|
276 |
+
wt_iew_form_toggler.toggle(jQuery(this));
|
277 |
+
}
|
278 |
+
});
|
279 |
+
jQuery('input[type="checkbox"].wt_iew_form_toggler').click(function(){
|
280 |
+
wt_iew_form_toggler.toggle(jQuery(this),1);
|
281 |
+
});
|
282 |
+
},
|
283 |
+
runToggler:function(prnt)
|
284 |
+
{
|
285 |
+
prnt=prnt ? prnt : jQuery('body');
|
286 |
+
prnt.find('select.wt_iew_form_toggler').each(function(){
|
287 |
+
wt_iew_form_toggler.toggle(jQuery(this));
|
288 |
+
});
|
289 |
+
prnt.find('input[type="radio"].wt_iew_form_toggler, input[type="checkbox"].wt_iew_form_toggler').each(function(){
|
290 |
+
if(jQuery(this).is(':checked'))
|
291 |
+
{
|
292 |
+
wt_iew_form_toggler.toggle(jQuery(this));
|
293 |
+
}
|
294 |
+
});
|
295 |
+
prnt.find('input[type="checkbox"].wt_iew_form_toggler').each(function(){
|
296 |
+
wt_iew_form_toggler.toggle(jQuery(this),1);
|
297 |
+
});
|
298 |
+
},
|
299 |
+
toggle:function(elm, checkbox)
|
300 |
+
{
|
301 |
+
var vl=elm.val();
|
302 |
+
var trgt=elm.attr('wf_frm_tgl-target');
|
303 |
+
jQuery('[wf_frm_tgl-id="'+trgt+'"]').hide();
|
304 |
+
if(!elm.is(':visible'))
|
305 |
+
{
|
306 |
+
return false;
|
307 |
+
}
|
308 |
+
if(elm.css('display')!='none') /* if parent is visible. `:visible` method. it will not work on JS tabview */
|
309 |
+
{
|
310 |
+
var elms=this.getElms(elm,trgt,vl,checkbox);
|
311 |
+
elms.show().find('th label').css({'margin-left':'0px'})
|
312 |
+
elms.each(function(){
|
313 |
+
var lvl=jQuery(this).attr('wf_frm_tgl-lvl');
|
314 |
+
var mrgin=25;
|
315 |
+
if (typeof lvl!== typeof undefined && lvl!== false) {
|
316 |
+
mrgin=lvl*mrgin;
|
317 |
+
}
|
318 |
+
jQuery(this).find('th label').animate({'margin-left':mrgin+'px'},1000);
|
319 |
+
});
|
320 |
+
}
|
321 |
+
|
322 |
+
/* in case of greater than 1 level */
|
323 |
+
jQuery('[wf_frm_tgl-id="'+trgt+'"]').each(function(){
|
324 |
+
wt_iew_form_toggler.runToggler(jQuery(this));
|
325 |
+
});
|
326 |
+
},
|
327 |
+
getElms:function(elm,trgt,vl,checkbox)
|
328 |
+
{
|
329 |
+
|
330 |
+
return jQuery('[wf_frm_tgl-id="'+trgt+'"]').filter(function(){
|
331 |
+
if(jQuery(this).attr('wf_frm_tgl-val')==vl)
|
332 |
+
{
|
333 |
+
if(checkbox)
|
334 |
+
{
|
335 |
+
if(elm.is(':checked'))
|
336 |
+
{
|
337 |
+
if(jQuery(this).attr('wf_frm_tgl-chk')=='true')
|
338 |
+
{
|
339 |
+
return true;
|
340 |
+
}else
|
341 |
+
{
|
342 |
+
return false;
|
343 |
+
}
|
344 |
+
}else
|
345 |
+
{
|
346 |
+
if(jQuery(this).attr('wf_frm_tgl-chk')=='false')
|
347 |
+
{
|
348 |
+
return true;
|
349 |
+
}else
|
350 |
+
{
|
351 |
+
return false;
|
352 |
+
}
|
353 |
+
}
|
354 |
+
}else
|
355 |
+
{
|
356 |
+
return true;
|
357 |
+
}
|
358 |
+
}else
|
359 |
+
{
|
360 |
+
return false;
|
361 |
+
}
|
362 |
+
});
|
363 |
+
}
|
364 |
+
}
|
365 |
+
|
366 |
+
var wt_iew_file_attacher={
|
367 |
+
|
368 |
+
Set:function()
|
369 |
+
{
|
370 |
+
var file_frame;
|
371 |
+
jQuery(".wt_iew_file_attacher").click(function(event){
|
372 |
+
event.preventDefault();
|
373 |
+
if(jQuery(this).data('file_frame'))
|
374 |
+
{
|
375 |
+
|
376 |
+
}else
|
377 |
+
{
|
378 |
+
/* reset user preference. This will open file uploader by default. */
|
379 |
+
wp.media.controller.Library.prototype.defaults.contentUserSetting=false;
|
380 |
+
|
381 |
+
|
382 |
+
/* Create the media frame. */
|
383 |
+
var file_frame = wp.media.frames.file_frame = wp.media({
|
384 |
+
title: jQuery( this ).data( 'invoice_uploader_title' ),
|
385 |
+
button: {
|
386 |
+
text: jQuery( this ).data( 'invoice_uploader_button_text' ),
|
387 |
+
},
|
388 |
+
/* Set to true to allow multiple files to be selected */
|
389 |
+
multiple: false
|
390 |
+
});
|
391 |
+
jQuery(this).data('file_frame',file_frame);
|
392 |
+
var wf_file_target=jQuery(this).attr('wt_iew_file_attacher_target');
|
393 |
+
var wt_file_attacher_choosed=jQuery(this).parent('.wt_iew_file_attacher_dv').find('.wt_iew_file_attacher_choosed');
|
394 |
+
var elm=jQuery(this);
|
395 |
+
|
396 |
+
/* When an image is selected, run a callback. */
|
397 |
+
jQuery(this).data('file_frame').on( 'select', function() {
|
398 |
+
/* We set multiple to false so only get one image from the uploader */
|
399 |
+
var attachment =file_frame.state().get('selection').first().toJSON();
|
400 |
+
/* Send the value of attachment.url back to shipment label printing settings form */
|
401 |
+
jQuery(wf_file_target).val(attachment.url);
|
402 |
+
if(wt_file_attacher_choosed.length>0)
|
403 |
+
{
|
404 |
+
wt_file_attacher_choosed.css({'visibility':'visible'}).html(attachment.filename);
|
405 |
+
}
|
406 |
+
});
|
407 |
+
/* Finally, open the modal */
|
408 |
+
}
|
409 |
+
jQuery(this).data('file_frame').open();
|
410 |
+
});
|
411 |
+
function wf_update_file_choosed(wf_file_target, wt_file_attacher_choosed)
|
412 |
+
{
|
413 |
+
if(jQuery(wf_file_target).val()=="")
|
414 |
+
{
|
415 |
+
wt_file_attacher_choosed.css({'visibility':'hidden'});
|
416 |
+
}else
|
417 |
+
{
|
418 |
+
wt_file_attacher_choosed.css({'visibility':'visible'});
|
419 |
+
}
|
420 |
+
}
|
421 |
+
jQuery(".wt_iew_file_attacher").each(function(){
|
422 |
+
var wf_file_target=jQuery(this).attr('wt_iew_file_attacher_target');
|
423 |
+
var wt_file_attacher_choosed=jQuery(this).parent('.wt_iew_file_attacher_dv').find('.wt_iew_file_attacher_choosed');
|
424 |
+
if(wt_file_attacher_choosed.length>0)
|
425 |
+
{
|
426 |
+
wf_update_file_choosed(wf_file_target, wt_file_attacher_choosed);
|
427 |
+
jQuery(wf_file_target).change(function(){
|
428 |
+
wf_update_file_choosed(wf_file_target, wt_file_attacher_choosed);
|
429 |
+
});
|
430 |
+
}
|
431 |
+
});
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
var wt_iew_popover=
|
436 |
+
{
|
437 |
+
action_module:false,
|
438 |
+
Set:function()
|
439 |
+
{
|
440 |
+
jQuery('[data-wt_iew_popover="1"]').unbind('click').click(function(){
|
441 |
+
|
442 |
+
/* check popover is visible now */
|
443 |
+
if(jQuery('.wt_iew_popover').length>0 && jQuery('.wt_iew_popover').is(':visible'))
|
444 |
+
{
|
445 |
+
wt_iew_popover.remove_active_row();
|
446 |
+
}
|
447 |
+
|
448 |
+
var cr_elm=jQuery(this);
|
449 |
+
if(cr_elm.attr('data-popup-opened')==1)
|
450 |
+
{
|
451 |
+
jQuery('[data-wt_iew_popover="1"]').attr('data-popup-opened',0);
|
452 |
+
wt_iew_popover.closePop();
|
453 |
+
return false;
|
454 |
+
}else
|
455 |
+
{
|
456 |
+
jQuery('[data-wt_iew_popover="1"]').attr('data-popup-opened',0);
|
457 |
+
cr_elm.attr('data-popup-opened',1);
|
458 |
+
}
|
459 |
+
if(jQuery('.wt_iew_popover').length==0)
|
460 |
+
{
|
461 |
+
var template='<div class="wt_iew_popover"><h3 class="wt_iew_popover-title">'
|
462 |
+
+'<span class="wt_iew_popover-title-text"></span><span class="popover_close_icon_button popover_close">X</span></h3>'
|
463 |
+
+'<div class="wt_iew_popover-content"></div><div class="wt_iew_popover-footer">'
|
464 |
+
+'<button name="wt_iew_popover_do_action" type="button" class="button button-primary">'+wt_iew_basic_params.msgs.use_expression+'</button>'
|
465 |
+
+'<button name="popover_close" type="button" class="button button-secondary popover_close">'+wt_iew_basic_params.msgs.cancel+'</button>'
|
466 |
+
+'<span class="spinner" style="margin-top:5px"></span>'
|
467 |
+
+'</div></div>';
|
468 |
+
jQuery('body').append(template);
|
469 |
+
wt_iew_popover.regclosePop();
|
470 |
+
}
|
471 |
+
|
472 |
+
var ttle=jQuery.trim(cr_elm.attr('data-title'));
|
473 |
+
var pp_elm=jQuery('.wt_iew_popover');
|
474 |
+
var pp_html='';
|
475 |
+
var pp_html_cntr=cr_elm.attr('data-content-container');
|
476 |
+
if(typeof pp_html_cntr!==typeof undefined && pp_html_cntr!==false)
|
477 |
+
{
|
478 |
+
pp_html=jQuery(pp_html_cntr).html();
|
479 |
+
ttle=(ttle=="" ? jQuery(pp_html_cntr).attr('data-title') : ttle);
|
480 |
+
wt_iew_popover.action_module=jQuery(pp_html_cntr).attr('data-module');
|
481 |
+
}else
|
482 |
+
{
|
483 |
+
pp_html=cr_elm.attr('data-content');
|
484 |
+
}
|
485 |
+
pp_elm.css({'display':'block'}).find('.wt_iew_popover-content').html(pp_html);
|
486 |
+
pp_elm.find('.wt_iew_popover-footer').show();
|
487 |
+
var cr_elm_w=cr_elm.width();
|
488 |
+
var cr_elm_h=cr_elm.height();
|
489 |
+
var pp_elm_w=pp_elm.width();
|
490 |
+
var pp_elm_h=pp_elm.height();
|
491 |
+
var cr_elm_pos=cr_elm.offset();
|
492 |
+
var cr_elm_pos_t=cr_elm_pos.top-((pp_elm_h-cr_elm_h)/4);
|
493 |
+
var cr_elm_pos_l=cr_elm_pos.left+cr_elm_w;
|
494 |
+
|
495 |
+
cr_elm_pos_t=cr_elm_pos_t+10; /* 10 px buffer for input span element padding */
|
496 |
+
|
497 |
+
pp_elm.find('.wt_iew_popover-title-text').html(ttle);
|
498 |
+
var target_elm_label=cr_elm.parents('tr').find('.wt_iew_mapping_column_label').html();
|
499 |
+
jQuery('.wt_iew_target_column').html(target_elm_label);
|
500 |
+
jQuery('.wt_iew_popover-content').find('.wt_iew_mapping_field_editor_expression').val(cr_elm.siblings('.columns_val').val());
|
501 |
+
|
502 |
+
wt_iew_popover.set_active_row(cr_elm);
|
503 |
+
pp_elm.css({'display':'block','opacity':0, 'top':cr_elm_pos_t,'left':cr_elm_pos_l}).stop(true,true).animate({'left':cr_elm_pos_l+20,'opacity':1}, 500, function(){
|
504 |
+
jQuery('.wt_iew_mapping_field_editor_expression').focus();
|
505 |
+
});
|
506 |
+
|
507 |
+
jQuery('[name="wt_iew_popover_do_action"]').data('click-elm', cr_elm);
|
508 |
+
wt_iew_popover.do_action();
|
509 |
+
if(wt_iew_popover.action_module=='import')
|
510 |
+
{
|
511 |
+
wt_iew_basic_import.mapping_field_editor();
|
512 |
+
wt_iew_basic_import.mapping_field_editor_output_preview();
|
513 |
+
}
|
514 |
+
|
515 |
+
});
|
516 |
+
},
|
517 |
+
do_action:function()
|
518 |
+
{
|
519 |
+
jQuery('[name="wt_iew_popover_do_action"]').unbind('click').click(function(){
|
520 |
+
var click_elm=jQuery(this).data('click-elm');
|
521 |
+
var vl=jQuery.trim(jQuery('.wt_iew_popover-content').find('.wt_iew_mapping_field_editor_expression').val());
|
522 |
+
|
523 |
+
var html_vl=vl;
|
524 |
+
if(wt_iew_popover.action_module=='import')
|
525 |
+
{
|
526 |
+
var html_vl=wt_iew_basic_import.mapping_field_editor_validate_column_val(vl);
|
527 |
+
}
|
528 |
+
click_elm.html(html_vl);
|
529 |
+
click_elm.siblings('.columns_val').val(vl);
|
530 |
+
wt_iew_popover.closePop();
|
531 |
+
|
532 |
+
if(wt_iew_popover.action_module=='import')
|
533 |
+
{
|
534 |
+
if(vl=="")
|
535 |
+
{
|
536 |
+
click_elm.parents('tr').find('.wt_iew_mapping_checkbox_sub').prop('checked', false);
|
537 |
+
}else
|
538 |
+
{
|
539 |
+
click_elm.parents('tr').find('.wt_iew_mapping_checkbox_sub').prop('checked', true);
|
540 |
+
}
|
541 |
+
wt_iew_basic_import.mapping_fields_selected_count(click_elm.parents('table'));
|
542 |
+
}
|
543 |
+
});
|
544 |
+
},
|
545 |
+
regclosePop:function()
|
546 |
+
{
|
547 |
+
jQuery('.meta_mapping_box_toggle').click(function(){
|
548 |
+
wt_iew_popover.closePop();
|
549 |
+
});
|
550 |
+
jQuery('.popover_close').unbind('click').click(function(){
|
551 |
+
wt_iew_popover.closePop();
|
552 |
+
});
|
553 |
+
},
|
554 |
+
set_active_row:function(cr_elm)
|
555 |
+
{
|
556 |
+
cr_elm.parents('tr').find('td').css({'background':'#f6f6f6'});
|
557 |
+
},
|
558 |
+
remove_active_row:function()
|
559 |
+
{
|
560 |
+
var click_elm=jQuery('[name="wt_iew_popover_do_action"]').data('click-elm');
|
561 |
+
click_elm.parents('tr').find('td').css({'background':'#fff'});
|
562 |
+
},
|
563 |
+
closePop:function()
|
564 |
+
{
|
565 |
+
var pp_elm=jQuery('.wt_iew_popover');
|
566 |
+
if(pp_elm.length>0)
|
567 |
+
{
|
568 |
+
var pp_lft=pp_elm.offset().left-50;
|
569 |
+
jQuery('[data-wt_iew_popover="1"]').attr('data-popup-opened',0);
|
570 |
+
pp_elm.stop(true,true).animate({'opacity':0, 'left':pp_lft},300,function(){
|
571 |
+
jQuery(this).css({'display':'none'});
|
572 |
+
});
|
573 |
+
this.remove_active_row();
|
574 |
+
}
|
575 |
+
}
|
576 |
+
};
|
577 |
+
|
578 |
+
var wt_iew_custom_and_preset=
|
579 |
+
{
|
580 |
+
toggler:function(preset_elm, custom_elm, custom_val) /* Toggle between custom and preset value */
|
581 |
+
{
|
582 |
+
this.do_toggle(preset_elm, custom_elm, custom_val);
|
583 |
+
preset_elm.unbind('change').change(function(){
|
584 |
+
wt_iew_custom_and_preset.do_toggle(preset_elm, custom_elm, custom_val);
|
585 |
+
});
|
586 |
+
},
|
587 |
+
do_toggle:function(preset_elm, custom_elm, custom_val)
|
588 |
+
{
|
589 |
+
if(preset_elm.val()==custom_val)
|
590 |
+
{
|
591 |
+
custom_elm.prop('readonly', false).css({'background':'#ffffff'}).focus().val('');
|
592 |
+
}else
|
593 |
+
{
|
594 |
+
custom_elm.prop('readonly', true).css({'background':'#efefef'}).val(preset_elm.find('option:selected').attr('data-val'));
|
595 |
+
}
|
596 |
+
},
|
597 |
+
delimiter_toggler:function() /* function for delimiter toggle */
|
598 |
+
{
|
599 |
+
this.toggler(jQuery('.wt_iew_delimiter_preset'), jQuery('.wt_iew_custom_delimiter'), 'other');
|
600 |
+
},
|
601 |
+
date_format_toggler:function() /* function for date format toggle */
|
602 |
+
{
|
603 |
+
this.toggler(jQuery('.wt_iew_date_format_preset'), jQuery('.wt_iew_custom_date_format'), 'other');
|
604 |
+
}
|
605 |
+
}
|
606 |
+
var wt_iew_conditional_help_text=
|
607 |
+
{
|
608 |
+
Set:function(prnt)
|
609 |
+
{
|
610 |
+
prnt=prnt ? prnt : jQuery('body');
|
611 |
+
const regex = /\[(.*?)\]/gm;
|
612 |
+
let m;
|
613 |
+
prnt.find('.wt-iew_conditional_help_text').each(function()
|
614 |
+
{
|
615 |
+
var help_text_elm=jQuery(this);
|
616 |
+
var this_condition=jQuery(this).attr('data-iew-help-condition');
|
617 |
+
if(this_condition!='')
|
618 |
+
{
|
619 |
+
var condition_conf=new Array();
|
620 |
+
var field_arr=new Array();
|
621 |
+
while ((m = regex.exec(this_condition)) !== null)
|
622 |
+
{
|
623 |
+
/* This is necessary to avoid infinite loops with zero-width matches */
|
624 |
+
if(m.index === regex.lastIndex)
|
625 |
+
{
|
626 |
+
regex.lastIndex++;
|
627 |
+
}
|
628 |
+
condition_conf.push(m[1]);
|
629 |
+
condition_arr=m[1].split('=');
|
630 |
+
if(condition_arr.length>1) /* field value pair */
|
631 |
+
{
|
632 |
+
field_arr.push(condition_arr[0]);
|
633 |
+
}
|
634 |
+
}
|
635 |
+
if(field_arr.length>0)
|
636 |
+
{
|
637 |
+
var callback_fn=function()
|
638 |
+
{
|
639 |
+
var is_hide=true;
|
640 |
+
var previous_type='';
|
641 |
+
for(var c_i=0; c_i<condition_conf.length; c_i++)
|
642 |
+
{
|
643 |
+
var cr_conf=condition_conf[c_i]; /* conf */
|
644 |
+
var conf_arr=cr_conf.split('=');
|
645 |
+
if(conf_arr.length>1) /* field value pair */
|
646 |
+
{
|
647 |
+
if(previous_type!='field')
|
648 |
+
{
|
649 |
+
previous_type='field';
|
650 |
+
var elm=jQuery('[name="'+conf_arr[0]+'"]');
|
651 |
+
var vl='';
|
652 |
+
if(elm.prop('nodeName').toLowerCase()=='input' && elm.attr('type')=='radio')
|
653 |
+
{
|
654 |
+
vl=jQuery('[name="'+conf_arr[0]+'"]:checked').val();
|
655 |
+
}
|
656 |
+
else if(elm.prop('nodeName').toLowerCase()=='input' && elm.attr('type')=='checkbox')
|
657 |
+
{
|
658 |
+
if(elm.is(':checked'))
|
659 |
+
{
|
660 |
+
vl=elm.val();
|
661 |
+
}
|
662 |
+
}else
|
663 |
+
{
|
664 |
+
vl=elm.val();
|
665 |
+
}
|
666 |
+
is_hide=(vl==conf_arr[1] ? false : true);
|
667 |
+
}
|
668 |
+
}else /* glue */
|
669 |
+
{
|
670 |
+
if(previous_type!='glue')
|
671 |
+
{
|
672 |
+
previous_type='glue';
|
673 |
+
if(conf_arr[0]=='OR')
|
674 |
+
{
|
675 |
+
if(is_hide===false) /* one previous condition is okay, then stop the loop */
|
676 |
+
{
|
677 |
+
break;
|
678 |
+
}
|
679 |
+
|
680 |
+
}else if(conf_arr[0]=='AND')
|
681 |
+
{
|
682 |
+
if(is_hide===true && c_i>0) /* one previous condition is not okay, then stop the loop */
|
683 |
+
{
|
684 |
+
break;
|
685 |
+
}
|
686 |
+
}
|
687 |
+
}
|
688 |
+
}
|
689 |
+
}
|
690 |
+
if(is_hide)
|
691 |
+
{
|
692 |
+
help_text_elm.hide();
|
693 |
+
}else
|
694 |
+
{
|
695 |
+
help_text_elm.css({'display':'inline-block'});
|
696 |
+
}
|
697 |
+
}
|
698 |
+
callback_fn();
|
699 |
+
for(var f_i=0; f_i<field_arr.length; f_i++)
|
700 |
+
{
|
701 |
+
var elm=jQuery('[name="'+field_arr[f_i]+'"]');
|
702 |
+
if(elm.prop('nodeName')=='radio' || elm.prop('nodeName')=='checkbox')
|
703 |
+
{
|
704 |
+
elm.on('click', callback_fn);
|
705 |
+
}else
|
706 |
+
{
|
707 |
+
elm.on('change', callback_fn);
|
708 |
+
}
|
709 |
+
}
|
710 |
+
}
|
711 |
+
}
|
712 |
+
});
|
713 |
+
}
|
714 |
+
}
|
715 |
+
|
716 |
+
|
717 |
+
jQuery(document).ready(function(){
|
718 |
+
wt_iew_popup.Set();
|
719 |
+
wt_iew_settings_form_basic.Set('#'+wt_iew_basic_params.plugin_id);
|
720 |
+
wt_drp_menu.Set();
|
721 |
+
wt_iew_file_attacher.Set();
|
722 |
+
wt_iew_form_toggler.Set();
|
723 |
+
});
|
admin/modules/export/assets/js/main.js
ADDED
@@ -0,0 +1,903 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var wt_iew_basic_export=(function( $ ) {
|
2 |
+
//'use strict';
|
3 |
+
var wt_iew_basic_export=
|
4 |
+
{
|
5 |
+
ajax_data:{},
|
6 |
+
selected_template:0,
|
7 |
+
selected_template_name:'',
|
8 |
+
to_export:'',
|
9 |
+
to_export_title:'',
|
10 |
+
export_method:'',
|
11 |
+
current_step:'',
|
12 |
+
loaded_status_arr:{'loaded':1, 'loading':2, 'not_loaded':0},
|
13 |
+
page_overlay:false,
|
14 |
+
step_keys:[],
|
15 |
+
form_data:{},
|
16 |
+
only_enabled_data:false,
|
17 |
+
on_rerun:false,
|
18 |
+
rerun_id:0,
|
19 |
+
Set:function()
|
20 |
+
{
|
21 |
+
this.step_keys=Object.keys(wt_iew_export_basic_params.steps);
|
22 |
+
if(this.on_rerun)
|
23 |
+
{
|
24 |
+
this.rerun();
|
25 |
+
}else
|
26 |
+
{
|
27 |
+
var first_step=this.step_keys[0];
|
28 |
+
this.load_steps([first_step], first_step);
|
29 |
+
this.show_step_page(first_step, false); /* just to show a loading */
|
30 |
+
}
|
31 |
+
},
|
32 |
+
rerun:function()
|
33 |
+
{
|
34 |
+
var last_step=this.step_keys[this.step_keys.length-1];
|
35 |
+
this.load_steps(this.step_keys, last_step);
|
36 |
+
this.show_step_page(last_step, false); /* just to show a loading */
|
37 |
+
},
|
38 |
+
load_steps:function(steps, step_to_show)
|
39 |
+
{
|
40 |
+
this.prepare_ajax_data('get_steps', 'json');
|
41 |
+
this.ajax_data.steps=steps;
|
42 |
+
if(this.on_rerun)
|
43 |
+
{
|
44 |
+
this.ajax_data.rerun_id=this.rerun_id;
|
45 |
+
}
|
46 |
+
this.set_step_loading_status(steps, 'loading');
|
47 |
+
this.set_ajax_page_loader(steps, 'loading');
|
48 |
+
$.ajax({
|
49 |
+
type: 'POST',
|
50 |
+
url:wt_iew_basic_params.ajax_url,
|
51 |
+
data:this.ajax_data,
|
52 |
+
dataType:'json',
|
53 |
+
success:function(data)
|
54 |
+
{
|
55 |
+
if(data.status==1)
|
56 |
+
{
|
57 |
+
wt_iew_basic_export.set_step_page(data);
|
58 |
+
wt_iew_basic_export.set_step_loading_status(steps, 'loaded');
|
59 |
+
if(step_to_show)
|
60 |
+
{
|
61 |
+
wt_iew_basic_export.show_step_page(step_to_show, true);
|
62 |
+
}
|
63 |
+
if(wt_iew_basic_export.on_rerun)
|
64 |
+
{
|
65 |
+
wt_iew_basic_export.load_meta_mapping_fields();
|
66 |
+
wt_iew_basic_export.on_rerun=false;
|
67 |
+
wt_iew_basic_export.rerun_id=0;
|
68 |
+
}
|
69 |
+
}else
|
70 |
+
{
|
71 |
+
// wt_iew_basic_import.set_step_loading_status(steps, 'not_loaded');
|
72 |
+
wt_iew_basic_export.set_step_loading_status(steps, 'not_loaded');
|
73 |
+
wt_iew_basic_export.set_ajax_page_loader(steps, 'error');
|
74 |
+
}
|
75 |
+
wt_iew_basic_export.remove_ajax_page_loader();
|
76 |
+
},
|
77 |
+
error:function()
|
78 |
+
{
|
79 |
+
// wt_iew_basic_import.set_step_loading_status(steps, 'not_loaded');
|
80 |
+
wt_iew_basic_export.set_step_loading_status(steps, 'not_loaded');
|
81 |
+
wt_iew_basic_export.remove_ajax_page_loader();
|
82 |
+
wt_iew_basic_export.set_ajax_page_loader(steps, 'error');
|
83 |
+
}
|
84 |
+
});
|
85 |
+
},
|
86 |
+
load_meta_mapping_fields:function()
|
87 |
+
{
|
88 |
+
if($('.meta_mapping_box_con').length>0)
|
89 |
+
{
|
90 |
+
if($('.meta_mapping_box_con[data-loaded="0"]').length==0)
|
91 |
+
{
|
92 |
+
return false;
|
93 |
+
}
|
94 |
+
}else
|
95 |
+
{
|
96 |
+
return false;
|
97 |
+
}
|
98 |
+
|
99 |
+
this.prepare_ajax_data('get_meta_mapping_fields', 'json');
|
100 |
+
$('.meta_mapping_box_con[data-loaded="0"]').html('<div class="wt_iew_export_step_loader">'+wt_iew_basic_params.msgs.loading+'</div>');
|
101 |
+
$.ajax({
|
102 |
+
type: 'POST',
|
103 |
+
url:wt_iew_basic_params.ajax_url,
|
104 |
+
data:this.ajax_data,
|
105 |
+
dataType:'json',
|
106 |
+
success:function(data)
|
107 |
+
{
|
108 |
+
if(data.status==1)
|
109 |
+
{
|
110 |
+
$.each(data.meta_html, function(meta_id, meta_content){
|
111 |
+
$('.meta_mapping_box_con[data-key="'+meta_id+'"]').html(meta_content).attr('data-loaded', 1);
|
112 |
+
});
|
113 |
+
wt_iew_basic_export.enable_sortable();
|
114 |
+
wt_iew_basic_export.reg_mapping_field_bulk_action();
|
115 |
+
}else
|
116 |
+
{
|
117 |
+
$('.meta_mapping_box_con[data-loaded="0"]').html('<div class="wt_iew_export_step_loader">'+wt_iew_basic_params.msgs.error+'</div>');
|
118 |
+
}
|
119 |
+
},
|
120 |
+
error:function()
|
121 |
+
{
|
122 |
+
$('.meta_mapping_box_con[data-loaded="0"]').html('<div class="wt_iew_export_step_loader">'+wt_iew_basic_params.msgs.loading+'</div>');
|
123 |
+
}
|
124 |
+
});
|
125 |
+
},
|
126 |
+
console_formdata:function()
|
127 |
+
{
|
128 |
+
console.log(this.form_data);
|
129 |
+
},
|
130 |
+
refresh_step:function(no_overlay)
|
131 |
+
{
|
132 |
+
if(!no_overlay){
|
133 |
+
this.page_overlay=true;
|
134 |
+
}
|
135 |
+
this.load_steps([this.current_step], this.current_step);
|
136 |
+
},
|
137 |
+
load_pending_steps:function(no_overlay)
|
138 |
+
{
|
139 |
+
if(!no_overlay){
|
140 |
+
this.page_overlay=true;
|
141 |
+
}
|
142 |
+
var rest_steps=this.step_keys.slice(0);
|
143 |
+
rest_steps.shift(); /* remove first step. no need to load it agian */
|
144 |
+
this.load_steps(rest_steps, this.current_step);
|
145 |
+
},
|
146 |
+
get_page_dom_object:function(step)
|
147 |
+
{
|
148 |
+
return $('.wt_iew_export_step_'+step);
|
149 |
+
},
|
150 |
+
remove_ajax_page_loader:function()
|
151 |
+
{
|
152 |
+
$('.wt_iew_loader_info_box').hide();
|
153 |
+
$('.wt_iew_overlayed_loader').hide();
|
154 |
+
$('.spinner').css({'visibility':'hidden'});
|
155 |
+
this.page_overlay=false;
|
156 |
+
},
|
157 |
+
set_ajax_page_loader:function(steps, msg_type)
|
158 |
+
{
|
159 |
+
if(this.page_overlay)
|
160 |
+
{
|
161 |
+
var h=parseInt($('.wt_iew_export_step_main').outerHeight());
|
162 |
+
var w=parseInt($('.wt_iew_export_step_main').outerWidth());
|
163 |
+
$('.wt_iew_overlayed_loader').show().css({'height':h,'width':w,'margin-top':'30px','margin-left':'30px'});
|
164 |
+
$('.spinner').css({'visibility':'visible'});
|
165 |
+
}else
|
166 |
+
{
|
167 |
+
var msg='';
|
168 |
+
if(msg_type=='loading')
|
169 |
+
{
|
170 |
+
msg=wt_iew_basic_params.msgs.loading;
|
171 |
+
}else if(msg_type=='error')
|
172 |
+
{
|
173 |
+
msg=wt_iew_basic_params.msgs.error;
|
174 |
+
}
|
175 |
+
$.each(steps, function(step_ind, step){
|
176 |
+
wt_iew_basic_export.get_page_dom_object(step).html('<div class="wt_iew_export_step_loader">'+msg+'</div>');
|
177 |
+
});
|
178 |
+
}
|
179 |
+
},
|
180 |
+
set_export_progress_info:function(msg)
|
181 |
+
{
|
182 |
+
$('.wt_iew_loader_info_box').show().text(msg);
|
183 |
+
},
|
184 |
+
nonstep_actions:function(action)
|
185 |
+
{
|
186 |
+
if(this.export_method=='template' && this.selected_template==0)
|
187 |
+
{
|
188 |
+
$('.wt_iew_warn').hide();
|
189 |
+
$('.wt_iew_export_template_wrn').show();
|
190 |
+
return false;
|
191 |
+
}
|
192 |
+
|
193 |
+
this.prepare_ajax_data(action, 'json');
|
194 |
+
|
195 |
+
if(action=='save_template' || action=='save_template_as' || action=='update_template')
|
196 |
+
{
|
197 |
+
$('.wt_iew_template_name_wrn').hide();
|
198 |
+
var pop_elm=$('.wt_iew_template_name');
|
199 |
+
var popup_label=pop_elm.attr('data-save-label');
|
200 |
+
if(action=='save_template_as')
|
201 |
+
{
|
202 |
+
var popup_label=pop_elm.attr('data-saveas-label');
|
203 |
+
}
|
204 |
+
pop_elm.find('.wt_iew_popup_hd_label, .wt_iew_template_create_btn').text(popup_label);
|
205 |
+
wt_iew_popup.showPopup(pop_elm);
|
206 |
+
$('[name="wt_iew_template_name_field"]').val(this.selected_template_name).focus();
|
207 |
+
|
208 |
+
$('.wt_iew_template_create_btn').unbind('click').click(function(){
|
209 |
+
var name=$.trim($('.wt_iew_template_name_field').val());
|
210 |
+
if(name=='')
|
211 |
+
{
|
212 |
+
$('.wt_iew_template_name_wrn').show();
|
213 |
+
$('.wt_iew_template_name_field').focus();
|
214 |
+
}else
|
215 |
+
{
|
216 |
+
$('.wt_iew_template_name_wrn').hide();
|
217 |
+
wt_iew_popup.hidePopup();
|
218 |
+
|
219 |
+
wt_iew_basic_export.prepare_form_data();
|
220 |
+
wt_iew_basic_export.ajax_data['template_name']=name;
|
221 |
+
wt_iew_basic_export.ajax_data['form_data']=wt_iew_basic_export.form_data;
|
222 |
+
wt_iew_basic_export.do_nonstep_action(action);
|
223 |
+
}
|
224 |
+
});
|
225 |
+
}else if(action=='export' || action=='upload' || action=='export_image')
|
226 |
+
{
|
227 |
+
if(action=='export' || action=='export_image')
|
228 |
+
{
|
229 |
+
this.ajax_data['offset']=0;
|
230 |
+
this.prepare_form_data();
|
231 |
+
this.ajax_data['form_data']=this.form_data;
|
232 |
+
}
|
233 |
+
wt_iew_basic_export.do_nonstep_action(action);
|
234 |
+
}else
|
235 |
+
{
|
236 |
+
/* custom action section for other modules */
|
237 |
+
this.prepare_form_data();
|
238 |
+
this.ajax_data['form_data']=this.form_data;
|
239 |
+
wt_iew_custom_action_basic(this.ajax_data, action, this.selected_template);
|
240 |
+
}
|
241 |
+
},
|
242 |
+
do_nonstep_action:function(action)
|
243 |
+
{
|
244 |
+
this.page_overlay=true;
|
245 |
+
this.set_ajax_page_loader();
|
246 |
+
$.ajax({
|
247 |
+
type: 'POST',
|
248 |
+
url:wt_iew_basic_params.ajax_url,
|
249 |
+
data:this.ajax_data,
|
250 |
+
dataType:'json',
|
251 |
+
success:function(data)
|
252 |
+
{
|
253 |
+
wt_iew_basic_export.remove_ajax_page_loader();
|
254 |
+
if(data.status==1)
|
255 |
+
{
|
256 |
+
if(action=='save_template' || action=='save_template_as' || action=='update_template')
|
257 |
+
{
|
258 |
+
wt_iew_basic_export.selected_template=data.id;
|
259 |
+
wt_iew_basic_export.selected_template_name=data.name;
|
260 |
+
wt_iew_notify_msg.success(wt_iew_basic_params.msgs.success);
|
261 |
+
|
262 |
+
}else if(action=='export' || action=='upload' || action=='export_image')
|
263 |
+
{
|
264 |
+
if(data.finished==1)
|
265 |
+
{
|
266 |
+
wt_iew_notify_msg.success(wt_iew_basic_params.msgs.success);
|
267 |
+
if(data.file_url!="") /* file url only available for local export */
|
268 |
+
{
|
269 |
+
window.open(data.file_url);
|
270 |
+
}
|
271 |
+
}
|
272 |
+
else if(data.finished==2) /* Remote export */
|
273 |
+
{
|
274 |
+
wt_iew_basic_export.set_export_progress_info(data.msg);
|
275 |
+
wt_iew_basic_export.ajax_data['export_id']=data.export_id;
|
276 |
+
wt_iew_basic_export.ajax_data['total_records']=data.total_records;
|
277 |
+
wt_iew_basic_export.ajax_data['export_action']='upload';
|
278 |
+
wt_iew_basic_export.ajax_data['form_data']={};
|
279 |
+
wt_iew_basic_export.do_nonstep_action('upload');
|
280 |
+
}
|
281 |
+
else
|
282 |
+
{
|
283 |
+
wt_iew_basic_export.set_export_progress_info(data.msg);
|
284 |
+
wt_iew_basic_export.ajax_data['offset']=data.new_offset;
|
285 |
+
wt_iew_basic_export.ajax_data['export_id']=data.export_id;
|
286 |
+
wt_iew_basic_export.ajax_data['total_records']=data.total_records;
|
287 |
+
wt_iew_basic_export.do_nonstep_action(action);
|
288 |
+
}
|
289 |
+
}else
|
290 |
+
{
|
291 |
+
|
292 |
+
}
|
293 |
+
}else
|
294 |
+
{
|
295 |
+
if(data.msg!="")
|
296 |
+
{
|
297 |
+
wt_iew_notify_msg.error(data.msg);
|
298 |
+
}else
|
299 |
+
{
|
300 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
301 |
+
}
|
302 |
+
}
|
303 |
+
},
|
304 |
+
error:function()
|
305 |
+
{
|
306 |
+
wt_iew_basic_export.remove_ajax_page_loader();
|
307 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
308 |
+
}
|
309 |
+
});
|
310 |
+
},
|
311 |
+
reg_button_actions:function()
|
312 |
+
{
|
313 |
+
$('.wt_iew_export_action_btn').unbind('click').click(function(e){
|
314 |
+
e.preventDefault();
|
315 |
+
var action=$(this).attr('data-action');
|
316 |
+
var action_type=$(this).attr('data-action-type');
|
317 |
+
var is_previous_step=wt_iew_basic_export.is_previous_step(action);
|
318 |
+
// if(!wt_iew_exporter_validate(action, action_type, is_previous_step))
|
319 |
+
// {
|
320 |
+
// return false;
|
321 |
+
// }
|
322 |
+
|
323 |
+
if(action_type=='step')
|
324 |
+
{
|
325 |
+
wt_iew_basic_export.change_step(action);
|
326 |
+
}else
|
327 |
+
{
|
328 |
+
wt_iew_basic_export.nonstep_actions(action);
|
329 |
+
}
|
330 |
+
});
|
331 |
+
},
|
332 |
+
change_step:function(step_to_go)
|
333 |
+
{
|
334 |
+
/* validation section */
|
335 |
+
if(this.current_step=='post_type')
|
336 |
+
{
|
337 |
+
if(this.to_export=='')
|
338 |
+
{
|
339 |
+
$('.wt_iew_post_type_wrn').show();
|
340 |
+
return false;
|
341 |
+
}
|
342 |
+
}else if(this.current_step=='method_export') /* method export page */
|
343 |
+
{
|
344 |
+
if(this.export_method=='template' && this.selected_template==0 && !this.is_previous_step(step_to_go))
|
345 |
+
{
|
346 |
+
$('.wt_iew_warn').hide();
|
347 |
+
$('.wt_iew_export_template_wrn').show();
|
348 |
+
return false;
|
349 |
+
}
|
350 |
+
}
|
351 |
+
|
352 |
+
/* setting fromdata */
|
353 |
+
this.prepare_form_data();
|
354 |
+
|
355 |
+
/* step changing section */
|
356 |
+
this.show_step_page(step_to_go, true);
|
357 |
+
},
|
358 |
+
reset_form_data:function()
|
359 |
+
{
|
360 |
+
this.form_data={};
|
361 |
+
this.selected_template=0;
|
362 |
+
this.selected_template_name='';
|
363 |
+
this.export_method='';
|
364 |
+
},
|
365 |
+
prepare_form_data:function()
|
366 |
+
{
|
367 |
+
if(this.current_step=='post_type')
|
368 |
+
{
|
369 |
+
this.form_data['post_type_form_data']=JSON.stringify({'item_type':wt_iew_basic_export.to_export});
|
370 |
+
}
|
371 |
+
else if(this.current_step=='method_export')
|
372 |
+
{
|
373 |
+
var mapping_enabled_fields=new Array();
|
374 |
+
$('.wt_iew_export_step_method_export [name="wt_iew_include_these_fields[]"]').each(function(){
|
375 |
+
if($(this).is(':checked'))
|
376 |
+
{
|
377 |
+
mapping_enabled_fields.push($(this).val());
|
378 |
+
}
|
379 |
+
});
|
380 |
+
this.form_data['method_export_form_data']=JSON.stringify({'method_export':wt_iew_basic_export.export_method, 'mapping_enabled_fields':mapping_enabled_fields, 'selected_template':this.selected_template});
|
381 |
+
}
|
382 |
+
else if(this.current_step=='filter')
|
383 |
+
{
|
384 |
+
if($('.wt_iew_export_filter_form').length>0)
|
385 |
+
{
|
386 |
+
var form_data=$('.wt_iew_export_filter_form').serializeArray();
|
387 |
+
var filter_form_data={};
|
388 |
+
$.each(form_data, function(){
|
389 |
+
if(filter_form_data[this.name])
|
390 |
+
{
|
391 |
+
if(!filter_form_data[this.name].push)
|
392 |
+
{
|
393 |
+
filter_form_data[this.name] = [filter_form_data[this.name]];
|
394 |
+
}
|
395 |
+
filter_form_data[this.name].push(this.value || '');
|
396 |
+
}else
|
397 |
+
{
|
398 |
+
if(wt_iew_basic_export.is_multi_select(this.name))
|
399 |
+
{
|
400 |
+
filter_form_data[this.name] = [(this.value || '')];
|
401 |
+
}else
|
402 |
+
{
|
403 |
+
filter_form_data[this.name] = this.value || '';
|
404 |
+
}
|
405 |
+
}
|
406 |
+
});
|
407 |
+
this.form_data['filter_form_data']=JSON.stringify(filter_form_data);
|
408 |
+
}
|
409 |
+
}
|
410 |
+
else if(this.current_step=='mapping')
|
411 |
+
{
|
412 |
+
|
413 |
+
/**
|
414 |
+
* Default mapping fields //===============================================
|
415 |
+
*/
|
416 |
+
|
417 |
+
var mapping_form_data={};
|
418 |
+
var mapping_fields={};
|
419 |
+
var mapping_selected_fields={}; /* this value is only for backend processing */
|
420 |
+
|
421 |
+
$('.wt-iew-exporter-default-mapping-tb tbody tr').each(function(){
|
422 |
+
|
423 |
+
var columns_key=$(this).find('.columns_key').val();
|
424 |
+
var columns_val=$(this).find('.columns_val').val();
|
425 |
+
|
426 |
+
if(wt_iew_basic_export.only_enabled_data===false) /* get whole keys instead of enabled/disabled */
|
427 |
+
{
|
428 |
+
var enabled=($(this).find('.columns_key').is(':checked') ? 1 : 0);
|
429 |
+
mapping_fields[columns_key]=[columns_val,enabled];
|
430 |
+
|
431 |
+
if(enabled==1)
|
432 |
+
{
|
433 |
+
mapping_selected_fields[columns_key]=columns_val;
|
434 |
+
}
|
435 |
+
|
436 |
+
}else
|
437 |
+
{
|
438 |
+
if($(this).find('.columns_key').is(':checked'))
|
439 |
+
{
|
440 |
+
mapping_fields[columns_key]=columns_val;
|
441 |
+
mapping_selected_fields[columns_key]=columns_val;
|
442 |
+
}
|
443 |
+
}
|
444 |
+
});
|
445 |
+
|
446 |
+
var mapping_enabled_fields=new Array();
|
447 |
+
/*
|
448 |
+
$('.wt_iew_export_step_mapping [name="wt_iew_include_these_fields[]"]').each(function(){
|
449 |
+
|
450 |
+
if($(this).is(':checked'))
|
451 |
+
{
|
452 |
+
mapping_enabled_fields.push($(this).val());
|
453 |
+
}
|
454 |
+
|
455 |
+
});
|
456 |
+
*/
|
457 |
+
|
458 |
+
mapping_form_data={'mapping_fields':mapping_fields,'mapping_enabled_fields':mapping_enabled_fields, 'mapping_selected_fields':mapping_selected_fields};
|
459 |
+
this.form_data['mapping_form_data']=JSON.stringify(mapping_form_data);
|
460 |
+
|
461 |
+
|
462 |
+
|
463 |
+
/**
|
464 |
+
* meta mapping fields //===============================================
|
465 |
+
*/
|
466 |
+
|
467 |
+
var meta_step_form_data={};
|
468 |
+
var mapping_fields={};
|
469 |
+
var mapping_selected_fields={}; /* this value is only for backend processing */
|
470 |
+
|
471 |
+
$('.wt-iew-exporter-meta-mapping-tb').each(function(){
|
472 |
+
var mapping_key=$(this).attr('data-field-type');
|
473 |
+
mapping_fields[mapping_key]={};
|
474 |
+
mapping_selected_fields[mapping_key]={};
|
475 |
+
|
476 |
+
$(this).find('tbody tr').each(function(){
|
477 |
+
if($(this).find('.columns_key').length>0 && $(this).find('.columns_val').length>0)
|
478 |
+
{
|
479 |
+
var columns_key=$(this).find('.columns_key').val();
|
480 |
+
var columns_val=$(this).find('.columns_val').val();
|
481 |
+
|
482 |
+
if(wt_iew_basic_export.only_enabled_data===false) /* get whole keys instead of enabled/disabled */
|
483 |
+
{
|
484 |
+
var enabled=($(this).find('.columns_key').is(':checked') ? 1 : 0);
|
485 |
+
mapping_fields[mapping_key][columns_key]=[columns_val,enabled];
|
486 |
+
|
487 |
+
if(enabled==1)
|
488 |
+
{
|
489 |
+
mapping_selected_fields[mapping_key][columns_key]=columns_val;
|
490 |
+
}
|
491 |
+
|
492 |
+
}else
|
493 |
+
{
|
494 |
+
if($(this).find('.columns_key').is(':checked'))
|
495 |
+
{
|
496 |
+
mapping_fields[mapping_key][columns_key]=columns_val;
|
497 |
+
mapping_selected_fields[mapping_key][columns_key]=columns_val;
|
498 |
+
}
|
499 |
+
}
|
500 |
+
}
|
501 |
+
});
|
502 |
+
});
|
503 |
+
|
504 |
+
meta_step_form_data={'mapping_fields':mapping_fields, 'mapping_selected_fields':mapping_selected_fields};
|
505 |
+
this.form_data['meta_step_form_data']=JSON.stringify(meta_step_form_data);
|
506 |
+
|
507 |
+
}
|
508 |
+
else
|
509 |
+
{
|
510 |
+
var current_form_data={};
|
511 |
+
if($('.wt_iew_export_'+this.current_step+'_form').length>0) /* may be user hit the back button */
|
512 |
+
{
|
513 |
+
var form_data=$('.wt_iew_export_'+this.current_step+'_form').serializeArray();
|
514 |
+
$.each(form_data, function(){
|
515 |
+
|
516 |
+
if(current_form_data[this.name])
|
517 |
+
{
|
518 |
+
if(!current_form_data[this.name].push)
|
519 |
+
{
|
520 |
+
current_form_data[this.name] = [current_form_data[this.name]];
|
521 |
+
}
|
522 |
+
current_form_data[this.name].push(this.value || '');
|
523 |
+
}else
|
524 |
+
{
|
525 |
+
current_form_data[this.name] = this.value || '';
|
526 |
+
}
|
527 |
+
|
528 |
+
});
|
529 |
+
|
530 |
+
this.form_data[this.current_step+'_form_data']=JSON.stringify(current_form_data);
|
531 |
+
}
|
532 |
+
}
|
533 |
+
|
534 |
+
/* we are resetting formdata on second step. If user not going to first step then post type formdata will be empty. */
|
535 |
+
if(this.current_step!='post_type')
|
536 |
+
{
|
537 |
+
this.form_data['post_type_form_data']=JSON.stringify({'item_type':wt_iew_basic_export.to_export});
|
538 |
+
}
|
539 |
+
|
540 |
+
},
|
541 |
+
is_multi_select:function(name)
|
542 |
+
{
|
543 |
+
var elm=$('[name="'+name+'"]');
|
544 |
+
if(elm.prop("tagName").toLowerCase()=='select' && this.has_attr(elm,'multiple'))
|
545 |
+
{
|
546 |
+
return true;
|
547 |
+
}else
|
548 |
+
{
|
549 |
+
return false;
|
550 |
+
}
|
551 |
+
},
|
552 |
+
has_attr:function(elm,attr_name)
|
553 |
+
{
|
554 |
+
var attr = elm.attr(attr_name);
|
555 |
+
if(typeof attr!==typeof undefined && attr!==false)
|
556 |
+
{
|
557 |
+
return true;
|
558 |
+
}else
|
559 |
+
{
|
560 |
+
return false;
|
561 |
+
}
|
562 |
+
},
|
563 |
+
is_previous_step:function(step_key)
|
564 |
+
{
|
565 |
+
if(wt_iew_export_basic_params.steps.hasOwnProperty(step_key))
|
566 |
+
{
|
567 |
+
if(this.step_keys.indexOf(step_key)<this.step_keys.indexOf(this.current_step))
|
568 |
+
{
|
569 |
+
return true;
|
570 |
+
}
|
571 |
+
}
|
572 |
+
return false;
|
573 |
+
},
|
574 |
+
is_step_loaded:function(step)
|
575 |
+
{
|
576 |
+
if(this.get_page_dom_object(step).length==0){ return true; } /* block infinite loop, if element is not available */
|
577 |
+
return (this.get_page_dom_object(step).attr('data-loaded')==this.loaded_status_arr['loaded']);
|
578 |
+
},
|
579 |
+
set_step_loading_status:function(steps, status)
|
580 |
+
{
|
581 |
+
$.each(steps, function(step_ind, step){
|
582 |
+
wt_iew_basic_export.get_page_dom_object(step).attr('data-loaded', wt_iew_basic_export.loaded_status_arr[status]);
|
583 |
+
});
|
584 |
+
},
|
585 |
+
show_step_page:function(step, force_check_loaded)
|
586 |
+
{
|
587 |
+
$('.wt_iew_export_step').hide();
|
588 |
+
this.get_page_dom_object(step).show();
|
589 |
+
this.current_step=step;
|
590 |
+
if(force_check_loaded)
|
591 |
+
{
|
592 |
+
if(this.is_step_loaded(step))
|
593 |
+
{
|
594 |
+
this.current_step_actions();
|
595 |
+
}else
|
596 |
+
{
|
597 |
+
this.refresh_step(true);
|
598 |
+
}
|
599 |
+
}else
|
600 |
+
{
|
601 |
+
this.current_step_actions();
|
602 |
+
}
|
603 |
+
wt_iew_form_toggler.runToggler();
|
604 |
+
},
|
605 |
+
current_step_actions:function() /* current page actions after page is visible */
|
606 |
+
{
|
607 |
+
if(this.current_step=='filter')
|
608 |
+
{
|
609 |
+
this.load_meta_mapping_fields();
|
610 |
+
}else if(this.current_step=='advanced')
|
611 |
+
{
|
612 |
+
wt_field_group.Set();
|
613 |
+
}
|
614 |
+
},
|
615 |
+
show_post_type_name:function()
|
616 |
+
{
|
617 |
+
if(this.to_export!="" && this.to_export_title=='')
|
618 |
+
{
|
619 |
+
$('[name="wt_iew_export_post_type"]').val(this.to_export);
|
620 |
+
this.to_export_title=$('[name="wt_iew_export_post_type"] option:selected').text();
|
621 |
+
}
|
622 |
+
$('.wt_iew_step_head_post_type_name').html(this.to_export_title);
|
623 |
+
},
|
624 |
+
page_actions:function(step)
|
625 |
+
{
|
626 |
+
if(step=='post_type') /* post type page */
|
627 |
+
{
|
628 |
+
$('[name="wt_iew_export_post_type"]').unbind('change').change(function(){
|
629 |
+
wt_iew_basic_export.to_export=$(this).val();
|
630 |
+
wt_iew_basic_export.to_export_title='';
|
631 |
+
wt_iew_basic_export.reset_form_data();
|
632 |
+
$('.wt_iew_post_type_name').html('');
|
633 |
+
if(wt_iew_basic_export.to_export=='')
|
634 |
+
{
|
635 |
+
$('.wt_iew_post_type_wrn').show();
|
636 |
+
}else
|
637 |
+
{
|
638 |
+
$('.wt_iew_post_type_wrn').hide();
|
639 |
+
var post_type_name=$('[name="wt_iew_export_post_type"] option:selected').text();
|
640 |
+
/* $('.wt_iew_post_type_name').html(': '+post_type_name); */
|
641 |
+
wt_iew_basic_export.to_export_title=post_type_name;
|
642 |
+
wt_iew_basic_export.load_pending_steps(true);
|
643 |
+
}
|
644 |
+
});
|
645 |
+
}
|
646 |
+
else if(step=='method_export') /* method export page */
|
647 |
+
{
|
648 |
+
this.export_method=$('[name="wt_iew_export_method_export"]:checked').val();
|
649 |
+
this.toggle_export_method_options();
|
650 |
+
|
651 |
+
$('[name="wt_iew_export_method_export"]').unbind('click').click(function(){
|
652 |
+
var vl=$(this).val();
|
653 |
+
if(wt_iew_basic_export.export_method==vl)
|
654 |
+
{
|
655 |
+
return false;
|
656 |
+
}
|
657 |
+
wt_iew_basic_export.reset_form_data();
|
658 |
+
wt_iew_basic_export.export_method=vl;
|
659 |
+
if(wt_iew_basic_export.export_method=='template')
|
660 |
+
{
|
661 |
+
if($('.wt-iew-export-template-sele').val()==0)
|
662 |
+
{
|
663 |
+
wt_iew_basic_export.refresh_step();
|
664 |
+
}else
|
665 |
+
{
|
666 |
+
wt_iew_basic_export.selected_template=$('.wt-iew-export-template-sele').val();
|
667 |
+
wt_iew_basic_export.selected_template_name=$.trim($('.wt-iew-export-template-sele option:selected').text());
|
668 |
+
wt_iew_basic_export.load_pending_steps();
|
669 |
+
}
|
670 |
+
}else
|
671 |
+
{
|
672 |
+
wt_iew_basic_export.load_pending_steps();
|
673 |
+
}
|
674 |
+
});
|
675 |
+
|
676 |
+
$('.wt-iew-export-template-sele').unbind('change').change(function(){
|
677 |
+
wt_iew_basic_export.selected_template=$(this).val();
|
678 |
+
$('.wt_iew_warn').hide();
|
679 |
+
if(wt_iew_basic_export.selected_template==0)
|
680 |
+
{
|
681 |
+
$('.wt_iew_export_template_wrn').show();
|
682 |
+
}else
|
683 |
+
{
|
684 |
+
wt_iew_basic_export.selected_template_name=$.trim($('.wt-iew-export-template-sele option:selected').text());
|
685 |
+
wt_iew_basic_export.load_pending_steps();
|
686 |
+
}
|
687 |
+
});
|
688 |
+
}
|
689 |
+
else if(step=='filter') /* filter page */
|
690 |
+
{
|
691 |
+
$('.wc-enhanced-select').select2();
|
692 |
+
$( document.body ).trigger( 'wc-enhanced-select-init' );
|
693 |
+
}
|
694 |
+
else if(step=='mapping') /* mapping page */
|
695 |
+
{
|
696 |
+
this.enable_sortable();
|
697 |
+
this.mapping_box_accordian();
|
698 |
+
this.reg_mapping_field_bulk_action();
|
699 |
+
}
|
700 |
+
else if(step=='advanced')
|
701 |
+
{
|
702 |
+
/* callback for external adapters */
|
703 |
+
if($('select[name="wt_iew_file_into"]').length>0) /* multiple adapter exists so select box */
|
704 |
+
{
|
705 |
+
var file_into=$('[name="wt_iew_file_into"]').val();
|
706 |
+
$('[name="wt_iew_file_into"]').unbind('change').on('change',function(){
|
707 |
+
var file_into=$(this).val();
|
708 |
+
wt_iew_set_file_into_fields(file_into);
|
709 |
+
});
|
710 |
+
}else /* radio button */
|
711 |
+
{
|
712 |
+
var file_into=$('[name="wt_iew_file_into"]:checked').val();
|
713 |
+
$('[name="wt_iew_file_into"]').on('click',function(){
|
714 |
+
var file_into=$('[name="wt_iew_file_into"]:checked').val();
|
715 |
+
wt_iew_set_file_into_fields(file_into);
|
716 |
+
});
|
717 |
+
}
|
718 |
+
wt_iew_set_file_into_fields(file_into);
|
719 |
+
|
720 |
+
/* separate image export option */
|
721 |
+
if($('.wt_iew_separate_image_export').length>0) /* separate image export option available */
|
722 |
+
{
|
723 |
+
if($('.wt_iew_separate_image_export:checked').val()=='Yes')
|
724 |
+
{
|
725 |
+
$('.iew_export_image_btn').show();
|
726 |
+
}else
|
727 |
+
{
|
728 |
+
$('.iew_export_image_btn').hide();
|
729 |
+
}
|
730 |
+
}else
|
731 |
+
{
|
732 |
+
$('.iew_export_image_btn').hide();
|
733 |
+
}
|
734 |
+
$('.wt_iew_separate_image_export').unbind('click').click(function(){
|
735 |
+
if($(this).val()=='Yes')
|
736 |
+
{
|
737 |
+
$('.iew_export_image_btn').show();
|
738 |
+
}else
|
739 |
+
{
|
740 |
+
$('.iew_export_image_btn').hide();
|
741 |
+
}
|
742 |
+
});
|
743 |
+
|
744 |
+
/* CSV delimiter form toggler. Custom and preset delimiter */
|
745 |
+
wt_iew_custom_and_preset.delimiter_toggler();
|
746 |
+
|
747 |
+
/* file extension info box */
|
748 |
+
$('.wt_iew_file_ext_info').html('.'+$('[name="wt_iew_file_as"]').val());
|
749 |
+
$('[name="wt_iew_file_as"]').unbind('change').change(function(){
|
750 |
+
$('.wt_iew_file_ext_info').html('.'+$(this).val());
|
751 |
+
});
|
752 |
+
}
|
753 |
+
|
754 |
+
/* common events */
|
755 |
+
if($('.wt_iew_datepicker').length>0)
|
756 |
+
{
|
757 |
+
$('.wt_iew_datepicker').datepicker({dateFormat: 'yy-mm-dd'});
|
758 |
+
}
|
759 |
+
wt_field_group.Set();
|
760 |
+
wt_iew_form_toggler.Set();
|
761 |
+
wt_iew_conditional_help_text.Set(this.get_page_dom_object(step));
|
762 |
+
|
763 |
+
},
|
764 |
+
enable_sortable:function()
|
765 |
+
{
|
766 |
+
$('.meta_mapping_box_con[data-sortable="0"]').each(function(){
|
767 |
+
var tb=$(this).find(".wt-iew-mapping-tb tbody");
|
768 |
+
if(tb.length>0)
|
769 |
+
{
|
770 |
+
tb.sortable({
|
771 |
+
handle: ".wt_iew_sort_handle",
|
772 |
+
placeholder: "wt-iew-sortable-placeholder",
|
773 |
+
forcePlaceholderSize: true,
|
774 |
+
revert:true
|
775 |
+
});
|
776 |
+
$(this).attr('data-sortable', 1);
|
777 |
+
}
|
778 |
+
});
|
779 |
+
},
|
780 |
+
toggle_export_method_options:function()
|
781 |
+
{
|
782 |
+
$('.wt-iew-export-method-options').hide();
|
783 |
+
$('.wt-iew-export-method-options-'+this.export_method).show();
|
784 |
+
},
|
785 |
+
mapping_box_accordian:function()
|
786 |
+
{
|
787 |
+
$('.meta_mapping_box_hd').unbind('click').click(function()
|
788 |
+
{
|
789 |
+
var c_dv=$(this).parents('.meta_mapping_box').find('.meta_mapping_box_con');
|
790 |
+
if(c_dv.is(':visible'))
|
791 |
+
{
|
792 |
+
c_dv.hide();
|
793 |
+
$(this).find('.dashicons').removeClass('dashicons-arrow-down').addClass('dashicons-arrow-right');
|
794 |
+
}else
|
795 |
+
{
|
796 |
+
c_dv.show();
|
797 |
+
c_dv.find(".wt-iew-mapping-tb tbody tr td").each(function(){
|
798 |
+
$(this).css({'width':$(this).width()});
|
799 |
+
});
|
800 |
+
$(this).find('.dashicons').removeClass('dashicons-arrow-right').addClass('dashicons-arrow-down');
|
801 |
+
}
|
802 |
+
});
|
803 |
+
},
|
804 |
+
mapping_fields_selected_count:function(tb_elm)
|
805 |
+
{
|
806 |
+
tb_elm.parents('.meta_mapping_box').find('.meta_mapping_box_selected_count_box_num').text(tb_elm.find('.wt_iew_mapping_checkbox_sub:checked').length);
|
807 |
+
},
|
808 |
+
reg_mapping_field_bulk_action:function()
|
809 |
+
{
|
810 |
+
$('.wt_iew_mapping_checkbox_main').each(function()
|
811 |
+
{
|
812 |
+
var tb=$(this).parents('.wt-iew-mapping-tb');
|
813 |
+
if(tb.find('.wt_iew_mapping_checkbox_sub:checked').length==tb.find('.wt_iew_mapping_checkbox_sub').length)
|
814 |
+
{
|
815 |
+
tb.find('.wt_iew_mapping_checkbox_main').prop('checked',true);
|
816 |
+
}else
|
817 |
+
{
|
818 |
+
tb.find('.wt_iew_mapping_checkbox_main').prop('checked',false);
|
819 |
+
}
|
820 |
+
wt_iew_basic_export.mapping_fields_selected_count(tb);
|
821 |
+
});
|
822 |
+
|
823 |
+
$('.wt_iew_mapping_checkbox_main').unbind('click').click(function()
|
824 |
+
{
|
825 |
+
var tb=$(this).parents('.wt-iew-mapping-tb');
|
826 |
+
if($(this).is(':checked'))
|
827 |
+
{
|
828 |
+
tb.find('.wt_iew_mapping_checkbox_sub').prop('checked',true);
|
829 |
+
}else
|
830 |
+
{
|
831 |
+
tb.find('.wt_iew_mapping_checkbox_sub').prop('checked',false);
|
832 |
+
}
|
833 |
+
wt_iew_basic_export.mapping_fields_selected_count(tb);
|
834 |
+
});
|
835 |
+
$('.wt_iew_mapping_checkbox_sub').unbind('click').click(function()
|
836 |
+
{
|
837 |
+
var tb=$(this).parents('.wt-iew-mapping-tb');
|
838 |
+
if($(this).is(':checked') && tb.find('.wt_iew_mapping_checkbox_sub:checked').length==tb.find('.wt_iew_mapping_checkbox_sub').length)
|
839 |
+
{
|
840 |
+
tb.find('.wt_iew_mapping_checkbox_main').prop('checked',true);
|
841 |
+
}else
|
842 |
+
{
|
843 |
+
tb.find('.wt_iew_mapping_checkbox_main').prop('checked',false);
|
844 |
+
}
|
845 |
+
wt_iew_basic_export.mapping_fields_selected_count(tb);
|
846 |
+
});
|
847 |
+
},
|
848 |
+
set_step_page:function(data)
|
849 |
+
{
|
850 |
+
page_html=data.page_html;
|
851 |
+
$.each(page_html, function(step_id, page_content){
|
852 |
+
wt_iew_basic_export.get_page_dom_object(step_id).html(page_content);
|
853 |
+
wt_iew_basic_export.page_actions(step_id);
|
854 |
+
|
855 |
+
if(step_id=='method_export' && (wt_iew_basic_export.selected_template>0 || wt_iew_basic_export.on_rerun))
|
856 |
+
{
|
857 |
+
wt_iew_basic_export.form_data=data.template_data;
|
858 |
+
|
859 |
+
if(wt_iew_basic_export.on_rerun)
|
860 |
+
{
|
861 |
+
if($('.wt-iew-export-template-sele').val()==0)
|
862 |
+
{
|
863 |
+
wt_iew_basic_export.selected_template=0;
|
864 |
+
wt_iew_basic_export.selected_template_name='';
|
865 |
+
}else
|
866 |
+
{
|
867 |
+
wt_iew_basic_export.selected_template=$('.wt-iew-export-template-sele').val();
|
868 |
+
wt_iew_basic_export.selected_template_name=$.trim($('.wt-iew-export-template-sele option:selected').text());
|
869 |
+
}
|
870 |
+
}
|
871 |
+
}
|
872 |
+
wt_iew_basic_export.show_post_type_name();
|
873 |
+
});
|
874 |
+
this.reg_button_actions();
|
875 |
+
},
|
876 |
+
prepare_ajax_data:function(action, data_type)
|
877 |
+
{
|
878 |
+
this.ajax_data = {
|
879 |
+
'_wpnonce': wt_iew_basic_params.nonces.main,
|
880 |
+
'action': "iew_export_ajax_basic",
|
881 |
+
'export_action': action,
|
882 |
+
'selected_template': this.selected_template,
|
883 |
+
'to_export': this.to_export,
|
884 |
+
'data_type': data_type,
|
885 |
+
'export_method': this.export_method,
|
886 |
+
};
|
887 |
+
}
|
888 |
+
}
|
889 |
+
return wt_iew_basic_export;
|
890 |
+
|
891 |
+
})( jQuery );
|
892 |
+
|
893 |
+
jQuery(function() {
|
894 |
+
|
895 |
+
if(wt_iew_export_basic_params.rerun_id>0)
|
896 |
+
{
|
897 |
+
wt_iew_basic_export.to_export=wt_iew_export_basic_params.to_export;
|
898 |
+
wt_iew_basic_export.export_method=wt_iew_export_basic_params.export_method;
|
899 |
+
wt_iew_basic_export.rerun_id=wt_iew_export_basic_params.rerun_id;
|
900 |
+
wt_iew_basic_export.on_rerun=true;
|
901 |
+
}
|
902 |
+
wt_iew_basic_export.Set();
|
903 |
+
});
|
admin/modules/export/classes/class-export-ajax.php
ADDED
@@ -0,0 +1,684 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Ajax section of the Export module
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Export_Ajax')){
|
14 |
+
class Wt_Import_Export_For_Woo_Basic_Export_Ajax
|
15 |
+
{
|
16 |
+
public $step='';
|
17 |
+
public $steps=array();
|
18 |
+
public $step_btns=array();
|
19 |
+
public $export_method='';
|
20 |
+
public $to_export='';
|
21 |
+
|
22 |
+
protected $step_title='';
|
23 |
+
protected $step_keys=array();
|
24 |
+
protected $current_step_index=0;
|
25 |
+
protected $current_step_number=1;
|
26 |
+
protected $last_page=false;
|
27 |
+
protected $total_steps=0;
|
28 |
+
protected $step_summary='';
|
29 |
+
protected $mapping_enabled_fields=array();
|
30 |
+
protected $mapping_templates=array();
|
31 |
+
protected $selected_template=0;
|
32 |
+
protected $selected_template_form_data=array(); /* this variable is using to store form_data of selected template or selected history entry */
|
33 |
+
protected $export_obj=null;
|
34 |
+
protected $rerun_id=0;
|
35 |
+
|
36 |
+
public function __construct($export_obj, $to_export, $steps, $export_method, $selected_template, $rerun_id)
|
37 |
+
{
|
38 |
+
$this->export_obj=$export_obj;
|
39 |
+
$this->to_export=$to_export;
|
40 |
+
$this->steps=$steps;
|
41 |
+
$this->export_method=$export_method;
|
42 |
+
$this->selected_template=$selected_template;
|
43 |
+
$this->rerun_id=$rerun_id;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Ajax main function to retrive steps HTML
|
48 |
+
*/
|
49 |
+
public function get_steps($out)
|
50 |
+
{
|
51 |
+
//sleep(3);
|
52 |
+
$steps=(is_array($_POST['steps']) ? $_POST['steps'] : array($_POST['steps']));
|
53 |
+
$steps=Wt_Iew_Sh::sanitize_item($steps, 'text_arr');
|
54 |
+
$page_html=array();
|
55 |
+
|
56 |
+
if($this->selected_template>0) /* taking selected tamplate form_data */
|
57 |
+
{
|
58 |
+
$this->get_template_form_data($this->selected_template);
|
59 |
+
|
60 |
+
}elseif($this->rerun_id>0)
|
61 |
+
{
|
62 |
+
$this->selected_template_form_data=$this->export_obj->form_data;
|
63 |
+
}
|
64 |
+
|
65 |
+
foreach($steps as $step)
|
66 |
+
{
|
67 |
+
$method_name=$step.'_page';
|
68 |
+
if(method_exists($this, $method_name))
|
69 |
+
{
|
70 |
+
$page_html[$step]=$this->{$method_name}();
|
71 |
+
|
72 |
+
if($step=='method_export' && ($this->selected_template>0 || $this->rerun_id>0))
|
73 |
+
{
|
74 |
+
$out['template_data']=$this->selected_template_form_data;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
}
|
78 |
+
$out['status']=1;
|
79 |
+
$out['page_html']=$page_html;
|
80 |
+
return $out;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Ajax function to retrive meta step data
|
85 |
+
*/
|
86 |
+
public function get_meta_mapping_fields($out)
|
87 |
+
{
|
88 |
+
if($this->selected_template>0) /* taking selected tamplate form_data */
|
89 |
+
{
|
90 |
+
$this->get_template_form_data($this->selected_template);
|
91 |
+
|
92 |
+
}elseif($this->rerun_id>0)
|
93 |
+
{
|
94 |
+
$this->selected_template_form_data=$this->export_obj->form_data;
|
95 |
+
}
|
96 |
+
|
97 |
+
$this->get_mapping_enabled_fields();
|
98 |
+
|
99 |
+
$meta_mapping_screen_fields=array();
|
100 |
+
foreach($this->mapping_enabled_fields as $field_key=>$field_vl)
|
101 |
+
{
|
102 |
+
$field_vl=(!is_array($field_vl) ? array($field_vl, 0) : $field_vl);
|
103 |
+
$meta_mapping_screen_fields[$field_key]=array(
|
104 |
+
'title'=>'',
|
105 |
+
'checked'=>$field_vl[1],
|
106 |
+
'fields'=>array(),
|
107 |
+
);
|
108 |
+
}
|
109 |
+
|
110 |
+
//taking current page form data
|
111 |
+
$meta_step_form_data=(isset($this->selected_template_form_data['meta_step_form_data']) ? $this->selected_template_form_data['meta_step_form_data'] : array());
|
112 |
+
|
113 |
+
/* form_data/template data of fields in mapping page */
|
114 |
+
$form_data_meta_mapping_fields=isset($meta_step_form_data['mapping_fields']) ? $meta_step_form_data['mapping_fields'] : array();
|
115 |
+
|
116 |
+
|
117 |
+
$meta_mapping_screen_fields=apply_filters('wt_iew_exporter_alter_meta_mapping_fields_basic', $meta_mapping_screen_fields, $this->to_export, $form_data_meta_mapping_fields);
|
118 |
+
|
119 |
+
$draggable_tooltip=__("Drag to rearrange the columns");
|
120 |
+
$module_url=plugin_dir_url(dirname(__FILE__));
|
121 |
+
|
122 |
+
$meta_html=array();
|
123 |
+
if($meta_mapping_screen_fields && is_array($meta_mapping_screen_fields))
|
124 |
+
{
|
125 |
+
/* loop through mapping fields */
|
126 |
+
foreach($meta_mapping_screen_fields as $meta_mapping_screen_field_key=>$meta_mapping_screen_field_val)
|
127 |
+
{
|
128 |
+
$current_meta_step_form_data=(isset($form_data_meta_mapping_fields[$meta_mapping_screen_field_key]) ? $form_data_meta_mapping_fields[$meta_mapping_screen_field_key] : array());
|
129 |
+
ob_start();
|
130 |
+
include dirname(plugin_dir_path(__FILE__)).'/views/_export_meta_step_page.php';
|
131 |
+
$meta_html[$meta_mapping_screen_field_key]=ob_get_clean();
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
$out['status']=1;
|
136 |
+
$out['meta_html']=$meta_html;
|
137 |
+
return $out;
|
138 |
+
}
|
139 |
+
|
140 |
+
public function save_template($out)
|
141 |
+
{
|
142 |
+
return $this->do_save_template('save', $out);
|
143 |
+
}
|
144 |
+
|
145 |
+
public function save_template_as($out)
|
146 |
+
{
|
147 |
+
return $this->do_save_template('save_as', $out);
|
148 |
+
}
|
149 |
+
|
150 |
+
public function update_template($out)
|
151 |
+
{
|
152 |
+
return $this->do_save_template('update', $out);
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Ajax hook to upload the exported file.
|
157 |
+
*
|
158 |
+
*/
|
159 |
+
public function upload($out)
|
160 |
+
{
|
161 |
+
$export_id=(isset($_POST['export_id']) ? intval($_POST['export_id']) : 0);
|
162 |
+
$out=$this->export_obj->process_upload('upload', $export_id, $this->to_export);
|
163 |
+
if($out['response']===true)
|
164 |
+
{
|
165 |
+
$out['status']=1;
|
166 |
+
}else
|
167 |
+
{
|
168 |
+
$out['status']=0;
|
169 |
+
}
|
170 |
+
return $out;
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Process the export data
|
176 |
+
*
|
177 |
+
* @return array
|
178 |
+
*/
|
179 |
+
public function export($out)
|
180 |
+
{
|
181 |
+
$offset=(isset($_POST['offset']) ? intval($_POST['offset']) : 0);
|
182 |
+
$export_id=(isset($_POST['export_id']) ? intval($_POST['export_id']) : 0);
|
183 |
+
$file_name='';
|
184 |
+
|
185 |
+
if($export_id==0) /* first batch */
|
186 |
+
{
|
187 |
+
/* process form data */
|
188 |
+
$form_data=(isset($_POST['form_data']) ? Wt_Import_Export_For_Woo_Basic_Common_Helper::process_formdata(maybe_unserialize(($_POST['form_data']))) : array());
|
189 |
+
|
190 |
+
//sanitize form data
|
191 |
+
$form_data=Wt_Iew_IE_Basic_Helper::sanitize_formdata($form_data, $this->export_obj);
|
192 |
+
|
193 |
+
/* taking file name from user input. (If given) */
|
194 |
+
if(isset($form_data['advanced_form_data']) && isset($form_data['advanced_form_data']['wt_iew_file_name']) && $form_data['advanced_form_data']['wt_iew_file_name']!="")
|
195 |
+
{
|
196 |
+
$file_name=$form_data['advanced_form_data']['wt_iew_file_name'];
|
197 |
+
}
|
198 |
+
|
199 |
+
}else
|
200 |
+
{
|
201 |
+
/* no need to send form_data. It will take from history table by `process_action` method */
|
202 |
+
$form_data=array();
|
203 |
+
}
|
204 |
+
|
205 |
+
/* do the export process */
|
206 |
+
$out=$this->export_obj->process_action($form_data, 'export', $this->to_export, $file_name, $export_id, $offset);
|
207 |
+
if($out['response']===true)
|
208 |
+
{
|
209 |
+
$out['status']=1;
|
210 |
+
}else
|
211 |
+
{
|
212 |
+
$out['status']=0;
|
213 |
+
}
|
214 |
+
return $out;
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Save/Update template (Ajax sub function)
|
219 |
+
* @param boolean $is_update is update existing template or save as new
|
220 |
+
* @return array response status, name, id
|
221 |
+
*/
|
222 |
+
public function do_save_template($step, $out)
|
223 |
+
{
|
224 |
+
$is_update=($step=='update' ? true : false);
|
225 |
+
|
226 |
+
/* take template name from post data, if not then create from time stamp */
|
227 |
+
$template_name=(isset($_POST['template_name']) ? sanitize_text_field($_POST['template_name']) : date('d-M-Y h:i:s A'));
|
228 |
+
|
229 |
+
$out['name']=$template_name;
|
230 |
+
$out['id']=0;
|
231 |
+
$out['status']=1;
|
232 |
+
|
233 |
+
if($this->to_export!='')
|
234 |
+
{
|
235 |
+
global $wpdb;
|
236 |
+
|
237 |
+
/* checking: just saved and again click the button so shift the action as update */
|
238 |
+
if($step=='save' && $this->selected_template>0)
|
239 |
+
{
|
240 |
+
$is_update=true;
|
241 |
+
}
|
242 |
+
|
243 |
+
/* checking template with same name exists */
|
244 |
+
$template_data=$this->get_mapping_template_by_name($template_name);
|
245 |
+
if($template_data)
|
246 |
+
{
|
247 |
+
$is_throw_warn=false;
|
248 |
+
if($is_update)
|
249 |
+
{
|
250 |
+
if($template_data['id']!=$this->selected_template)
|
251 |
+
{
|
252 |
+
$is_throw_warn=true;
|
253 |
+
}
|
254 |
+
}else
|
255 |
+
{
|
256 |
+
$is_throw_warn=true;
|
257 |
+
}
|
258 |
+
|
259 |
+
if($is_throw_warn)
|
260 |
+
{
|
261 |
+
$out['status']=0;
|
262 |
+
if($step=='save_as')
|
263 |
+
{
|
264 |
+
$out['msg']=__('Please enter a different name');
|
265 |
+
}else
|
266 |
+
{
|
267 |
+
$out['msg']=__('Template with same name already exists');
|
268 |
+
}
|
269 |
+
return $out;
|
270 |
+
}
|
271 |
+
}
|
272 |
+
|
273 |
+
$tb=$wpdb->prefix. Wt_Import_Export_For_Woo_Basic::$template_tb;
|
274 |
+
|
275 |
+
/* process form data */
|
276 |
+
$form_data=(isset($_POST['form_data']) ? Wt_Import_Export_For_Woo_Basic_Common_Helper::process_formdata(maybe_unserialize(($_POST['form_data']))) : array());
|
277 |
+
|
278 |
+
//sanitize form data
|
279 |
+
$form_data=Wt_Iew_IE_Basic_Helper::sanitize_formdata($form_data, $this->export_obj);
|
280 |
+
|
281 |
+
/* upadte the template */
|
282 |
+
if($is_update)
|
283 |
+
{
|
284 |
+
|
285 |
+
$update_data=array(
|
286 |
+
'data'=>maybe_serialize($form_data),
|
287 |
+
'name'=>$template_name, //may be a rename
|
288 |
+
);
|
289 |
+
$update_data_type=array(
|
290 |
+
'%s',
|
291 |
+
'%s'
|
292 |
+
);
|
293 |
+
$update_where=array(
|
294 |
+
'id'=>$this->selected_template
|
295 |
+
);
|
296 |
+
$update_where_type=array(
|
297 |
+
'%d'
|
298 |
+
);
|
299 |
+
if($wpdb->update($tb, $update_data, $update_where, $update_data_type, $update_where_type)!==false)
|
300 |
+
{
|
301 |
+
$out['id']=$this->selected_template;
|
302 |
+
$out['name']=$template_name;
|
303 |
+
return $out;
|
304 |
+
}
|
305 |
+
}else
|
306 |
+
{
|
307 |
+
$insert_data=array(
|
308 |
+
'template_type'=>'export',
|
309 |
+
'item_type'=>$this->to_export,
|
310 |
+
'name'=>$template_name,
|
311 |
+
'data'=>maybe_serialize($form_data),
|
312 |
+
);
|
313 |
+
$insert_data_type=array(
|
314 |
+
'%s','%s','%s','%s'
|
315 |
+
);
|
316 |
+
if($wpdb->insert($tb, $insert_data, $insert_data_type)) //success
|
317 |
+
{
|
318 |
+
$out['id']=$wpdb->insert_id;
|
319 |
+
return $out;
|
320 |
+
}
|
321 |
+
}
|
322 |
+
}
|
323 |
+
$out['status']=0;
|
324 |
+
return $out;
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Step 1 (Ajax sub function)
|
329 |
+
* Built in steps, post type choosing page
|
330 |
+
*/
|
331 |
+
public function post_type_page()
|
332 |
+
{
|
333 |
+
$post_types=apply_filters('wt_iew_exporter_post_types_basic', array());
|
334 |
+
$post_types=(!is_array($post_types) ? array() : $post_types);
|
335 |
+
$this->step='post_type';
|
336 |
+
$step_info=$this->steps[$this->step];
|
337 |
+
$item_type=$this->to_export;
|
338 |
+
|
339 |
+
$this->prepare_step_summary();
|
340 |
+
$this->prepare_footer_button_list();
|
341 |
+
|
342 |
+
ob_start();
|
343 |
+
$this->prepare_step_header_html();
|
344 |
+
include_once dirname(plugin_dir_path(__FILE__)).'/views/_export_post_type_page.php';
|
345 |
+
$this->prepare_step_footer_html();
|
346 |
+
return ob_get_clean();
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Step 2 (Ajax sub function)
|
351 |
+
* Built in steps, export method choosing page
|
352 |
+
*/
|
353 |
+
public function method_export_page()
|
354 |
+
{
|
355 |
+
$this->step='method_export';
|
356 |
+
$step_info=$this->steps[$this->step];
|
357 |
+
if($this->to_export!="")
|
358 |
+
{
|
359 |
+
/* setting a default export method */
|
360 |
+
$this->export_method=($this->export_method=='' ? $this->export_obj->default_export_method : $this->export_method);
|
361 |
+
$this->export_obj->export_method=$this->export_method;
|
362 |
+
$this->steps=$this->export_obj->get_steps();
|
363 |
+
|
364 |
+
$form_data_export_template=$this->selected_template;
|
365 |
+
$form_data_mapping_enabled=array();
|
366 |
+
if($this->rerun_id>0)
|
367 |
+
{
|
368 |
+
if(isset($this->selected_template_form_data['method_export_form_data']))
|
369 |
+
{
|
370 |
+
if(isset($this->selected_template_form_data['method_export_form_data']['selected_template']))
|
371 |
+
{
|
372 |
+
/* do not set this value to `$this->selected_template` */
|
373 |
+
$form_data_export_template=$this->selected_template_form_data['method_export_form_data']['selected_template'];
|
374 |
+
}
|
375 |
+
if(isset($this->selected_template_form_data['method_export_form_data']['mapping_enabled_fields']))
|
376 |
+
{
|
377 |
+
$form_data_mapping_enabled=$this->selected_template_form_data['method_export_form_data']['mapping_enabled_fields'];
|
378 |
+
$form_data_mapping_enabled=(is_array($form_data_mapping_enabled) ? $form_data_mapping_enabled : array());
|
379 |
+
}
|
380 |
+
}
|
381 |
+
}
|
382 |
+
|
383 |
+
$this->prepare_step_summary();
|
384 |
+
$this->prepare_footer_button_list();
|
385 |
+
|
386 |
+
/* meta field list for quick export */
|
387 |
+
$this->get_mapping_enabled_fields();
|
388 |
+
|
389 |
+
/* template list for template export */
|
390 |
+
$this->get_mapping_templates();
|
391 |
+
|
392 |
+
ob_start();
|
393 |
+
$this->prepare_step_header_html();
|
394 |
+
include_once dirname(plugin_dir_path(__FILE__)).'/views/_export_method_export_page.php';
|
395 |
+
$this->prepare_step_footer_html();
|
396 |
+
return ob_get_clean();
|
397 |
+
}else
|
398 |
+
{
|
399 |
+
return '';
|
400 |
+
}
|
401 |
+
}
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Step 3 (Ajax sub function)
|
405 |
+
* Built in steps, filter page
|
406 |
+
*/
|
407 |
+
public function filter_page()
|
408 |
+
{
|
409 |
+
$this->step='filter';
|
410 |
+
$step_info=$this->steps[$this->step];
|
411 |
+
if($this->to_export!='')
|
412 |
+
{
|
413 |
+
|
414 |
+
$this->prepare_step_summary();
|
415 |
+
$this->prepare_footer_button_list();
|
416 |
+
|
417 |
+
//taking current page form data
|
418 |
+
$filter_form_data=(isset($this->selected_template_form_data['filter_form_data']) ? $this->selected_template_form_data['filter_form_data'] : array());
|
419 |
+
|
420 |
+
$filter_screen_fields=$this->export_obj->get_filter_screen_fields($filter_form_data);
|
421 |
+
|
422 |
+
ob_start();
|
423 |
+
$this->prepare_step_header_html();
|
424 |
+
include_once dirname(plugin_dir_path(__FILE__)).'/views/_export_filter_page.php';
|
425 |
+
$this->prepare_step_footer_html();
|
426 |
+
return ob_get_clean();
|
427 |
+
|
428 |
+
}else
|
429 |
+
{
|
430 |
+
return '';
|
431 |
+
}
|
432 |
+
}
|
433 |
+
|
434 |
+
|
435 |
+
/**
|
436 |
+
* Step 4 (Ajax sub function)
|
437 |
+
* Built in steps, mapping page
|
438 |
+
*/
|
439 |
+
public function mapping_page()
|
440 |
+
{
|
441 |
+
$this->step='mapping';
|
442 |
+
$step_info=$this->steps[$this->step];
|
443 |
+
if($this->to_export!='')
|
444 |
+
{
|
445 |
+
|
446 |
+
$this->prepare_step_summary();
|
447 |
+
$this->prepare_footer_button_list();
|
448 |
+
|
449 |
+
//taking current page form data
|
450 |
+
$mapping_form_data=(isset($this->selected_template_form_data['mapping_form_data']) ? $this->selected_template_form_data['mapping_form_data'] : array());
|
451 |
+
|
452 |
+
|
453 |
+
/* form_data/template data of fields in mapping page */
|
454 |
+
$form_data_mapping_fields=isset($mapping_form_data['mapping_fields']) ? $mapping_form_data['mapping_fields'] : array();
|
455 |
+
|
456 |
+
/* default mapping page fields */
|
457 |
+
$mapping_fields=array();
|
458 |
+
$mapping_fields=apply_filters('wt_iew_exporter_alter_mapping_fields_basic', $mapping_fields, $this->to_export, $form_data_mapping_fields);
|
459 |
+
|
460 |
+
|
461 |
+
/* meta fields list */
|
462 |
+
$this->get_mapping_enabled_fields();
|
463 |
+
|
464 |
+
/* mapping enabled meta fields */
|
465 |
+
$form_data_mapping_enabled_fields=(isset($mapping_form_data['mapping_enabled_fields']) ? $mapping_form_data['mapping_enabled_fields'] : array());
|
466 |
+
|
467 |
+
ob_start();
|
468 |
+
$this->prepare_step_header_html();
|
469 |
+
include_once dirname(plugin_dir_path(__FILE__)).'/views/_export_mapping_page.php';
|
470 |
+
$this->prepare_step_footer_html();
|
471 |
+
return ob_get_clean();
|
472 |
+
}else
|
473 |
+
{
|
474 |
+
return '';
|
475 |
+
}
|
476 |
+
}
|
477 |
+
|
478 |
+
/**
|
479 |
+
* Step 5 (Ajax sub function)
|
480 |
+
* Built in steps, advanced page
|
481 |
+
*/
|
482 |
+
public function advanced_page()
|
483 |
+
{
|
484 |
+
$this->step='advanced';
|
485 |
+
$step_info=$this->steps[$this->step];
|
486 |
+
if($this->to_export!='')
|
487 |
+
{
|
488 |
+
|
489 |
+
$this->prepare_step_summary();
|
490 |
+
$this->prepare_footer_button_list();
|
491 |
+
|
492 |
+
//taking current page form data
|
493 |
+
$advanced_form_data=(isset($this->selected_template_form_data['advanced_form_data']) ? $this->selected_template_form_data['advanced_form_data'] : array());
|
494 |
+
|
495 |
+
$advanced_screen_fields=$this->export_obj->get_advanced_screen_fields($advanced_form_data);
|
496 |
+
|
497 |
+
ob_start();
|
498 |
+
$this->prepare_step_header_html();
|
499 |
+
include_once dirname(plugin_dir_path(__FILE__)).'/views/_export_advanced_page.php';
|
500 |
+
$this->prepare_step_footer_html();
|
501 |
+
return ob_get_clean();
|
502 |
+
|
503 |
+
}else
|
504 |
+
{
|
505 |
+
return '';
|
506 |
+
}
|
507 |
+
}
|
508 |
+
|
509 |
+
/**
|
510 |
+
* Get template form data
|
511 |
+
*/
|
512 |
+
protected function get_template_form_data($id)
|
513 |
+
{
|
514 |
+
$template_data=$this->get_mapping_template_by_id($id);
|
515 |
+
if($template_data)
|
516 |
+
{
|
517 |
+
$decoded_form_data=Wt_Import_Export_For_Woo_Basic_Common_Helper::process_formdata(maybe_unserialize($template_data['data']));
|
518 |
+
$this->selected_template_form_data=(!is_array($decoded_form_data) ? array() : $decoded_form_data);
|
519 |
+
}
|
520 |
+
}
|
521 |
+
|
522 |
+
/**
|
523 |
+
* Taking mapping template by Name
|
524 |
+
*/
|
525 |
+
protected function get_mapping_template_by_name($name)
|
526 |
+
{
|
527 |
+
global $wpdb;
|
528 |
+
$tb=$wpdb->prefix. Wt_Import_Export_For_Woo_Basic::$template_tb;
|
529 |
+
$qry=$wpdb->prepare("SELECT * FROM $tb WHERE template_type=%s AND item_type=%s AND name=%s",array('export', $this->to_export, $name));
|
530 |
+
return $wpdb->get_row($qry, ARRAY_A);
|
531 |
+
}
|
532 |
+
|
533 |
+
/**
|
534 |
+
* Taking mapping template by ID
|
535 |
+
*/
|
536 |
+
protected function get_mapping_template_by_id($id)
|
537 |
+
{
|
538 |
+
global $wpdb;
|
539 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$template_tb;
|
540 |
+
$qry=$wpdb->prepare("SELECT * FROM $tb WHERE template_type=%s AND item_type=%s AND id=%d",array('export', $this->to_export, $id));
|
541 |
+
return $wpdb->get_row($qry, ARRAY_A);
|
542 |
+
}
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Taking all mapping templates
|
546 |
+
*/
|
547 |
+
protected function get_mapping_templates()
|
548 |
+
{
|
549 |
+
if($this->to_export=='')
|
550 |
+
{
|
551 |
+
return;
|
552 |
+
}
|
553 |
+
global $wpdb;
|
554 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$template_tb;
|
555 |
+
$val=$wpdb->get_results("SELECT * FROM $tb WHERE template_type='export' AND item_type='".$this->to_export."' ORDER BY id DESC", ARRAY_A);
|
556 |
+
|
557 |
+
//add a filter here for modules to alter the data
|
558 |
+
$this->mapping_templates=($val ? $val : array());
|
559 |
+
}
|
560 |
+
|
561 |
+
/**
|
562 |
+
* Get meta field list for mapping page
|
563 |
+
*
|
564 |
+
*/
|
565 |
+
protected function get_mapping_enabled_fields()
|
566 |
+
{
|
567 |
+
$mapping_enabled_fields=array(
|
568 |
+
|
569 |
+
);
|
570 |
+
$this->mapping_enabled_fields=apply_filters('wt_iew_exporter_alter_mapping_enabled_fields_basic', $mapping_enabled_fields, $this->to_export, array());
|
571 |
+
}
|
572 |
+
|
573 |
+
protected function prepare_step_footer_html()
|
574 |
+
{
|
575 |
+
include dirname(plugin_dir_path(__FILE__)).'/views/_export_footer.php';
|
576 |
+
}
|
577 |
+
|
578 |
+
protected function prepare_step_summary()
|
579 |
+
{
|
580 |
+
$this->step_title=$this->steps[$this->step]['title'];
|
581 |
+
$this->step_keys=array_keys($this->steps);
|
582 |
+
$this->current_step_index=array_search($this->step, $this->step_keys);
|
583 |
+
$this->current_step_number=$this->current_step_index+1;
|
584 |
+
$this->last_page=(!isset($this->step_keys[$this->current_step_index+1]) ? true : false);
|
585 |
+
$this->total_steps=count($this->step_keys);
|
586 |
+
$this->step_summary=__(sprintf("Step %d of %d", $this->current_step_number, $this->total_steps));
|
587 |
+
}
|
588 |
+
|
589 |
+
protected function prepare_step_header_html()
|
590 |
+
{
|
591 |
+
include dirname(plugin_dir_path(__FILE__)).'/views/_export_header.php';
|
592 |
+
}
|
593 |
+
|
594 |
+
protected function prepare_footer_button_list()
|
595 |
+
{
|
596 |
+
$out=array();
|
597 |
+
$step_keys=$this->step_keys;
|
598 |
+
$current_index=$this->current_step_index;
|
599 |
+
$last_page=$this->last_page;
|
600 |
+
if($current_index!==false) /* step exists */
|
601 |
+
{
|
602 |
+
if($current_index>0) //add back button
|
603 |
+
{
|
604 |
+
$out['back']=array(
|
605 |
+
'type'=>'button',
|
606 |
+
'action_type'=>'step',
|
607 |
+
'key'=>$step_keys[$current_index-1],
|
608 |
+
'text'=>'<span class="dashicons dashicons-arrow-left-alt2" style="line-height:27px;"></span> '.__('Back'),
|
609 |
+
);
|
610 |
+
}
|
611 |
+
|
612 |
+
if(isset($step_keys[$current_index+1])) /* not last step */
|
613 |
+
{
|
614 |
+
$next_number=$current_index+2;
|
615 |
+
$next_key=$step_keys[$current_index+1];
|
616 |
+
$next_title=$this->steps[$next_key]['title'];
|
617 |
+
$out['next']=array(
|
618 |
+
'type'=>'button',
|
619 |
+
'action_type'=>'step',
|
620 |
+
'key'=>$next_key,
|
621 |
+
'text'=>__('Step').' '.$next_number.': '.$next_title.' <span class="dashicons dashicons-arrow-right-alt2" style="line-height:27px;"></span>',
|
622 |
+
);
|
623 |
+
|
624 |
+
if($this->export_method=='quick' || $this->export_method=='template') //Quick Or Template method
|
625 |
+
{
|
626 |
+
$out['or']=array(
|
627 |
+
'type'=>'text',
|
628 |
+
'text'=>__('Or'),
|
629 |
+
);
|
630 |
+
}
|
631 |
+
|
632 |
+
}else
|
633 |
+
{
|
634 |
+
$last_page=true;
|
635 |
+
}
|
636 |
+
|
637 |
+
if($this->export_method=='quick' || $this->export_method=='template' || $last_page) //template method, or last page, or quick export
|
638 |
+
{
|
639 |
+
if($last_page && $this->export_method!='quick') //last page and not quick export
|
640 |
+
{
|
641 |
+
if($this->export_method=='template')
|
642 |
+
{
|
643 |
+
$out['save']=array(
|
644 |
+
'key'=>'save',
|
645 |
+
'icon'=>'',
|
646 |
+
'type'=>'dropdown_button',
|
647 |
+
'text'=>__('Save template'),
|
648 |
+
'items'=>array(
|
649 |
+
'update'=>array(
|
650 |
+
'key'=>'update_template',
|
651 |
+
'text'=>__('Save'), //no prompt
|
652 |
+
),
|
653 |
+
'save'=>array(
|
654 |
+
'key'=>'save_template_as',
|
655 |
+
'text'=>__('Save As'), //prompt for name
|
656 |
+
)
|
657 |
+
)
|
658 |
+
);
|
659 |
+
}else
|
660 |
+
{
|
661 |
+
$out['save']=array(
|
662 |
+
'key'=>'save_template',
|
663 |
+
'icon'=>'',
|
664 |
+
'type'=>'button',
|
665 |
+
'text'=>__('Save template'), //prompt for name
|
666 |
+
);
|
667 |
+
}
|
668 |
+
}
|
669 |
+
|
670 |
+
|
671 |
+
|
672 |
+
$out['export']=array(
|
673 |
+
'key'=>'export',
|
674 |
+
'class'=>'iew_export_btn',
|
675 |
+
'icon'=>'',
|
676 |
+
'type'=>'button',
|
677 |
+
'text'=>__('Export'),
|
678 |
+
);
|
679 |
+
}
|
680 |
+
}
|
681 |
+
$this->step_btns=apply_filters('wt_iew_exporter_alter_footer_btns_basic', $out, $this->step, $this->steps);
|
682 |
+
}
|
683 |
+
}
|
684 |
+
}
|
admin/modules/export/export.php
ADDED
@@ -0,0 +1,793 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Export section of the plugin
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Export')){
|
13 |
+
class Wt_Import_Export_For_Woo_Basic_Export
|
14 |
+
{
|
15 |
+
public $module_id='';
|
16 |
+
public static $module_id_static='';
|
17 |
+
public $module_base='export';
|
18 |
+
|
19 |
+
public static $export_dir=WP_CONTENT_DIR.'/webtoffee_export';
|
20 |
+
public static $export_dir_name='/webtoffee_export';
|
21 |
+
public $steps=array();
|
22 |
+
public $allowed_export_file_type=array();
|
23 |
+
|
24 |
+
private $to_export='';
|
25 |
+
private $to_export_id='';
|
26 |
+
private $rerun_id=0;
|
27 |
+
public $export_method='';
|
28 |
+
public $export_methods=array();
|
29 |
+
public $selected_template=0;
|
30 |
+
public $default_batch_count=0; /* configure this value in `advanced_setting_fields` method */
|
31 |
+
public $selected_template_data=array();
|
32 |
+
public $default_export_method=''; /* configure this value in `advanced_setting_fields` method */
|
33 |
+
public $form_data=array();
|
34 |
+
|
35 |
+
public function __construct()
|
36 |
+
{
|
37 |
+
$this->module_id=Wt_Import_Export_For_Woo_Basic::get_module_id($this->module_base);
|
38 |
+
self::$module_id_static=$this->module_id;
|
39 |
+
|
40 |
+
/* allowed file types */
|
41 |
+
$this->allowed_export_file_type=array(
|
42 |
+
'csv'=>__('CSV'),
|
43 |
+
|
44 |
+
);
|
45 |
+
|
46 |
+
/* default step list */
|
47 |
+
$this->steps=array
|
48 |
+
(
|
49 |
+
'post_type'=>array(
|
50 |
+
'title'=>__('Select a post type'),
|
51 |
+
'description'=>__('Export and download the respective post type into a CSV. This file can also be used to import data related to the specific post type back into your WooCommerce shop. As a first step you need to choose the post type to start the export.'),
|
52 |
+
),
|
53 |
+
'method_export'=>array(
|
54 |
+
'title'=>__('Select an export method'),
|
55 |
+
'description'=>__('Choose from the options below to continue with your export: quick export from DB, based on a pre-saved template or a new export with advanced options.'),
|
56 |
+
),
|
57 |
+
'filter'=>array(
|
58 |
+
'title'=>__('Filter data'),
|
59 |
+
'description'=>__('Filter data that needs to be exported as per the below criteria.'),
|
60 |
+
),
|
61 |
+
'mapping'=>array(
|
62 |
+
'title'=>__('Map and reorder export columns'),
|
63 |
+
'description'=>__('The default export column names can be seen in the screen below. You can edit these if required. If you have chosen a pre-saved template you can see the preferred names and choices that were last saved. You may also drag the columns accordingly to reorder them within the output file.'),
|
64 |
+
),
|
65 |
+
'advanced'=>array(
|
66 |
+
'title'=>__('Advanced options/Batch export'),
|
67 |
+
'description'=>__('Use advanced options from below to decide on the batch export count. You can also save the template file for future exports.'),
|
68 |
+
),
|
69 |
+
);
|
70 |
+
|
71 |
+
|
72 |
+
$this->validation_rule=array(
|
73 |
+
'post_type'=>array(), /* no validation rule. So default sanitization text */
|
74 |
+
'method_export'=>array(
|
75 |
+
'mapping_enabled_fields' => array('type'=>'text_arr') //in case of quick export
|
76 |
+
)
|
77 |
+
);
|
78 |
+
|
79 |
+
$this->step_need_validation_filter=array('filter', 'advanced');
|
80 |
+
|
81 |
+
|
82 |
+
$this->export_methods=array(
|
83 |
+
'quick'=>array('title'=>__('Quick export'), 'description'=> __('Quick export only exports all the basic/standard fields of the respective post type. You do not get to selectively filter the columns with this option.')),
|
84 |
+
'template'=>array('title'=>__('Pre-saved template'), 'description'=> __('Using a pre-saved template retains the previous filter criteria and other column specifications as per the chosen file and exports data accordingly. You can also edit this file in the process and export accordingly or export straightaway.')),
|
85 |
+
'new'=>array('title'=>__('New export'), 'description'=> __('A new export will take you through the entire process of filtering/column selection/advanced options that may be required for your export. You can also save this file for future use.')),
|
86 |
+
);
|
87 |
+
|
88 |
+
/* advanced plugin settings */
|
89 |
+
add_filter('wt_iew_advanced_setting_fields_basic', array($this, 'advanced_setting_fields'));
|
90 |
+
|
91 |
+
/* setting default values, this method must be below of advanced setting filter */
|
92 |
+
$this->get_defaults();
|
93 |
+
|
94 |
+
/* main ajax hook. The callback function will decide which is to execute. */
|
95 |
+
add_action('wp_ajax_iew_export_ajax_basic', array($this, 'ajax_main'), 11);
|
96 |
+
|
97 |
+
/* Admin menu for export */
|
98 |
+
add_filter('wt_iew_admin_menu_basic', array($this, 'add_admin_pages'), 10, 1);
|
99 |
+
|
100 |
+
/* Download export file via nonce URL */
|
101 |
+
add_action('admin_init', array($this, 'download_file'), 11);
|
102 |
+
}
|
103 |
+
|
104 |
+
public function get_defaults()
|
105 |
+
{
|
106 |
+
$this->default_export_method= Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('default_export_method');
|
107 |
+
$this->default_batch_count=Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('default_export_batch');
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Fields for advanced settings
|
112 |
+
*
|
113 |
+
*/
|
114 |
+
public function advanced_setting_fields($fields)
|
115 |
+
{
|
116 |
+
$export_methods=array_map(function($vl){ return $vl['title']; }, $this->export_methods);
|
117 |
+
$fields['default_export_method']=array(
|
118 |
+
'label'=>__("Default Export method"),
|
119 |
+
'type'=>'select',
|
120 |
+
'sele_vals'=>$export_methods,
|
121 |
+
'value' =>'new',
|
122 |
+
'field_name'=>'default_export_method',
|
123 |
+
'help_text'=>__('Select the default method of export.'),
|
124 |
+
);
|
125 |
+
$fields['default_export_batch']=array(
|
126 |
+
'label'=>__("Default Export batch count"),
|
127 |
+
'type'=>'number',
|
128 |
+
'value' =>100,
|
129 |
+
'field_name'=>'default_export_batch',
|
130 |
+
'help_text'=>__('Provide the default count for the records to be exported in a batch.'),
|
131 |
+
'validation_rule'=>array('type'=>'absint'),
|
132 |
+
);
|
133 |
+
return $fields;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Adding admin menus
|
138 |
+
*/
|
139 |
+
public function add_admin_pages($menus)
|
140 |
+
{
|
141 |
+
$first = array_slice($menus, 0, 2, true);
|
142 |
+
$last=array_slice($menus, 2, (count($menus)-1), true);
|
143 |
+
|
144 |
+
$menu=array(
|
145 |
+
$this->module_base=>array(
|
146 |
+
'submenu',
|
147 |
+
WT_IEW_PLUGIN_ID_BASIC,
|
148 |
+
__('Export'),
|
149 |
+
__('Export'),
|
150 |
+
'manage_options',
|
151 |
+
$this->module_id,
|
152 |
+
array($this, 'admin_settings_page')
|
153 |
+
)
|
154 |
+
);
|
155 |
+
|
156 |
+
$menus=array_merge($first, $menu, $last);
|
157 |
+
return $menus;
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Export page
|
162 |
+
*/
|
163 |
+
public function admin_settings_page()
|
164 |
+
{
|
165 |
+
/**
|
166 |
+
* Check it is a rerun call
|
167 |
+
*/
|
168 |
+
$requested_rerun_id=(isset($_GET['wt_iew_rerun']) ? absint($_GET['wt_iew_rerun']) : 0);
|
169 |
+
$this->_process_rerun($requested_rerun_id);
|
170 |
+
|
171 |
+
$this->enqueue_assets();
|
172 |
+
include plugin_dir_path(__FILE__).'views/main.php';
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Main ajax hook to handle all export related requests
|
177 |
+
*/
|
178 |
+
public function ajax_main()
|
179 |
+
{
|
180 |
+
include_once plugin_dir_path(__FILE__).'classes/class-export-ajax.php';
|
181 |
+
if(Wt_Iew_Sh::check_write_access(WT_IEW_PLUGIN_ID_BASIC))
|
182 |
+
{
|
183 |
+
/**
|
184 |
+
* Check it is a rerun call
|
185 |
+
*/
|
186 |
+
if(!$this->_process_rerun((isset($_POST['rerun_id']) ? absint($_POST['rerun_id']) : 0)))
|
187 |
+
{
|
188 |
+
$this->export_method=(isset($_POST['export_method']) ? Wt_Iew_Sh::sanitize_item($_POST['export_method'], 'text') : '');
|
189 |
+
$this->to_export=(isset($_POST['to_export']) ? Wt_Iew_Sh::sanitize_item($_POST['to_export'], 'text') : '');
|
190 |
+
$this->selected_template=(isset($_POST['selected_template']) ? Wt_Iew_Sh::sanitize_item($_POST['selected_template'], 'int') : 0);
|
191 |
+
}
|
192 |
+
|
193 |
+
$this->get_steps();
|
194 |
+
|
195 |
+
$ajax_obj=new Wt_Import_Export_For_Woo_Basic_Export_Ajax($this, $this->to_export, $this->steps, $this->export_method, $this->selected_template, $this->rerun_id);
|
196 |
+
|
197 |
+
$export_action=Wt_Iew_Sh::sanitize_item($_POST['export_action'], 'text');
|
198 |
+
$data_type=Wt_Iew_Sh::sanitize_item($_POST['data_type'], 'text');
|
199 |
+
|
200 |
+
$allowed_ajax_actions=array('get_steps', 'get_meta_mapping_fields', 'save_template', 'save_template_as', 'update_template', 'upload', 'export', 'export_image');
|
201 |
+
|
202 |
+
$out=array(
|
203 |
+
'status'=>0,
|
204 |
+
'msg'=>__('Error'),
|
205 |
+
);
|
206 |
+
|
207 |
+
if(method_exists($ajax_obj, $export_action) && in_array($export_action, $allowed_ajax_actions))
|
208 |
+
{
|
209 |
+
$out=$ajax_obj->{$export_action}($out);
|
210 |
+
}
|
211 |
+
|
212 |
+
if($data_type=='json')
|
213 |
+
{
|
214 |
+
echo json_encode($out);
|
215 |
+
}
|
216 |
+
}
|
217 |
+
exit();
|
218 |
+
}
|
219 |
+
|
220 |
+
public function get_filter_screen_fields($filter_form_data)
|
221 |
+
{
|
222 |
+
$filter_screen_fields=array(
|
223 |
+
'offset'=>array(
|
224 |
+
'label'=>__("Offset"),
|
225 |
+
'value'=>0,
|
226 |
+
'field_name'=>'offset',
|
227 |
+
'help_text'=>__('Specify the number of records that should be skipped from the beginning. e.g. An offset of 10 skips the first 10 records.'),
|
228 |
+
'validation_rule'=>array('type'=>'int'),
|
229 |
+
),
|
230 |
+
'limit'=>array(
|
231 |
+
'label'=>__("Limit"),
|
232 |
+
'value'=>'',
|
233 |
+
'field_name'=>'limit',
|
234 |
+
'placeholder'=>'Unlimited',
|
235 |
+
'help_text'=>__('The actual number of records you want to export. e.g. A limit of 500 with an offset 10 will export records from 11th to 510th position.'),
|
236 |
+
//'validation_rule'=>array('type'=>'int'),
|
237 |
+
),
|
238 |
+
|
239 |
+
);
|
240 |
+
|
241 |
+
$filter_screen_fields=apply_filters('wt_iew_exporter_alter_filter_fields_basic', $filter_screen_fields, $this->to_export, $filter_form_data);
|
242 |
+
return $filter_screen_fields;
|
243 |
+
}
|
244 |
+
|
245 |
+
public function get_advanced_screen_fields($advanced_form_data)
|
246 |
+
{
|
247 |
+
$file_into_arr=array('local'=>__('Local'));
|
248 |
+
|
249 |
+
/* taking available remote adapters */
|
250 |
+
$remote_adapter_names=array();
|
251 |
+
$remote_adapter_names=apply_filters('wt_iew_exporter_remote_adapter_names_basic', $remote_adapter_names);
|
252 |
+
if($remote_adapter_names && is_array($remote_adapter_names))
|
253 |
+
{
|
254 |
+
foreach($remote_adapter_names as $remote_adapter_key => $remote_adapter_vl)
|
255 |
+
{
|
256 |
+
$file_into_arr[$remote_adapter_key]=$remote_adapter_vl;
|
257 |
+
}
|
258 |
+
}
|
259 |
+
|
260 |
+
|
261 |
+
|
262 |
+
//add `is_advanced` field to group it as advanced tab section
|
263 |
+
$advanced_screen_fields=array(
|
264 |
+
|
265 |
+
'batch_count'=>array(
|
266 |
+
'label'=>__("Export in batches of"),
|
267 |
+
'type'=>'text',
|
268 |
+
'value'=>$this->default_batch_count,
|
269 |
+
'field_name'=>'batch_count',
|
270 |
+
'help_text'=>sprintf(__('The number of records that the server will process for every iteration within the configured timeout interval. If the export fails you can lower this number accordingly and try again. Defaulted to 0 records.'), $this->default_batch_count),
|
271 |
+
'validation_rule'=>array('type'=>'absint'),
|
272 |
+
)
|
273 |
+
);
|
274 |
+
|
275 |
+
/* taking advanced fields from post type modules */
|
276 |
+
$advanced_screen_fields=apply_filters('wt_iew_exporter_alter_advanced_fields_basic', $advanced_screen_fields, $this->to_export, $advanced_form_data);
|
277 |
+
return $advanced_screen_fields;
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Get steps
|
282 |
+
*
|
283 |
+
*/
|
284 |
+
public function get_steps()
|
285 |
+
{
|
286 |
+
if($this->export_method=='quick') /* if quick export then remove some steps */
|
287 |
+
{
|
288 |
+
$out=array(
|
289 |
+
'post_type'=>$this->steps['post_type'],
|
290 |
+
'method_export'=>$this->steps['method_export'],
|
291 |
+
'advanced'=>$this->steps['advanced'],
|
292 |
+
);
|
293 |
+
$this->steps=$out;
|
294 |
+
}
|
295 |
+
$this->steps=apply_filters('wt_iew_exporter_steps_basic', $this->steps, $this->to_export);
|
296 |
+
return $this->steps;
|
297 |
+
}
|
298 |
+
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Validating and Processing rerun action
|
302 |
+
*/
|
303 |
+
protected function _process_rerun($rerun_id)
|
304 |
+
{
|
305 |
+
if($rerun_id>0)
|
306 |
+
{
|
307 |
+
/* check the history module is available */
|
308 |
+
$history_module_obj=Wt_Import_Export_For_Woo_Basic::load_modules('history');
|
309 |
+
if(!is_null($history_module_obj))
|
310 |
+
{
|
311 |
+
/* check the history entry is for export and also has form_data */
|
312 |
+
$history_data=$history_module_obj->get_history_entry_by_id($rerun_id);
|
313 |
+
if($history_data && $history_data['template_type']==$this->module_base)
|
314 |
+
{
|
315 |
+
$form_data=maybe_unserialize($history_data['data']);
|
316 |
+
if($form_data && is_array($form_data))
|
317 |
+
{
|
318 |
+
$this->to_export=(isset($form_data['post_type_form_data']) && isset($form_data['post_type_form_data']['item_type']) ? $form_data['post_type_form_data']['item_type'] : '');
|
319 |
+
if($this->to_export!="")
|
320 |
+
{
|
321 |
+
$this->export_method=(isset($form_data['method_export_form_data']) && isset($form_data['method_export_form_data']['method_export']) && $form_data['method_export_form_data']['method_export']!="" ? $form_data['method_export_form_data']['method_export'] : $this->default_export_method);
|
322 |
+
$this->rerun_id=$rerun_id;
|
323 |
+
$this->form_data=$form_data;
|
324 |
+
//process steps based on the export method in the history entry
|
325 |
+
$this->get_steps();
|
326 |
+
|
327 |
+
return true;
|
328 |
+
}
|
329 |
+
}
|
330 |
+
}
|
331 |
+
}
|
332 |
+
}
|
333 |
+
return false;
|
334 |
+
}
|
335 |
+
|
336 |
+
protected function enqueue_assets()
|
337 |
+
{
|
338 |
+
if(Wt_Import_Export_For_Woo_Basic_Common_Helper::wt_is_screen_allowed()){
|
339 |
+
wp_enqueue_script($this->module_id, plugin_dir_url(__FILE__).'assets/js/main.js', array('jquery', 'jquery-ui-sortable', 'jquery-ui-datepicker'), WT_U_IEW_VERSION);
|
340 |
+
wp_enqueue_style('jquery-ui-datepicker');
|
341 |
+
wp_enqueue_style(WT_IEW_PLUGIN_ID_BASIC.'-jquery-ui', WT_U_IEW_PLUGIN_URL.'admin/css/jquery-ui.css', array(), WT_U_IEW_VERSION, 'all');
|
342 |
+
$params=array(
|
343 |
+
'item_type'=>'',
|
344 |
+
'steps'=>$this->steps,
|
345 |
+
'rerun_id'=>$this->rerun_id,
|
346 |
+
'to_export'=>$this->to_export,
|
347 |
+
'export_method'=>$this->export_method,
|
348 |
+
'msgs'=>array(
|
349 |
+
'choosed_template'=>__('Choosed template: '),
|
350 |
+
'choose_export_method'=>__('Please select an export method.'),
|
351 |
+
'choose_template'=>__('Please select an export template.'),
|
352 |
+
'step'=>__('Step'),
|
353 |
+
'choose_ftp_profile'=>__('Please select an FTP profile.'),
|
354 |
+
),
|
355 |
+
);
|
356 |
+
wp_localize_script($this->module_id, 'wt_iew_export_basic_params', $params);
|
357 |
+
|
358 |
+
$this->add_select2_lib(); //adding select2 JS, It checks the availibility of woocommerce
|
359 |
+
}
|
360 |
+
}
|
361 |
+
|
362 |
+
/**
|
363 |
+
*
|
364 |
+
* Enqueue select2 library, if woocommerce available use that
|
365 |
+
*/
|
366 |
+
protected function add_select2_lib()
|
367 |
+
{
|
368 |
+
/* enqueue scripts */
|
369 |
+
if(!function_exists('is_plugin_active'))
|
370 |
+
{
|
371 |
+
include_once(ABSPATH.'wp-admin/includes/plugin.php');
|
372 |
+
}
|
373 |
+
if(is_plugin_active('woocommerce/woocommerce.php'))
|
374 |
+
{
|
375 |
+
wp_enqueue_script('wc-enhanced-select');
|
376 |
+
wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url().'/assets/css/admin.css');
|
377 |
+
}else
|
378 |
+
{
|
379 |
+
wp_enqueue_style(WT_IEW_PLUGIN_ID_BASIC.'-select2', WT_U_IEW_PLUGIN_URL. 'admin/css/select2.css', array(), WT_U_IEW_VERSION, 'all' );
|
380 |
+
wp_enqueue_script(WT_IEW_PLUGIN_ID_BASIC.'-select2', WT_U_IEW_PLUGIN_URL.'admin/js/select2.js', array('jquery'), WT_U_IEW_VERSION, false );
|
381 |
+
}
|
382 |
+
}
|
383 |
+
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Upload data to the user choosed remote method (Eg: FTP)
|
387 |
+
* @param string $step the action to perform, here 'upload'
|
388 |
+
*
|
389 |
+
* @return array
|
390 |
+
*/
|
391 |
+
public function process_upload($step, $export_id, $to_export)
|
392 |
+
{
|
393 |
+
$out=array(
|
394 |
+
'response'=>false,
|
395 |
+
'export_id'=>0,
|
396 |
+
'history_id'=>0, //same as that of export id
|
397 |
+
'finished'=>0,
|
398 |
+
'file_url'=>'',
|
399 |
+
'msg'=>'',
|
400 |
+
);
|
401 |
+
|
402 |
+
if($export_id==0) //it may be an error
|
403 |
+
{
|
404 |
+
return $out;
|
405 |
+
}
|
406 |
+
|
407 |
+
//take history data by export_id
|
408 |
+
$export_data=Wt_Import_Export_For_Woo_Basic_History::get_history_entry_by_id($export_id);
|
409 |
+
if(is_null($export_data)) //no record found so it may be an error
|
410 |
+
{
|
411 |
+
return $out;
|
412 |
+
}
|
413 |
+
|
414 |
+
$form_data=maybe_unserialize($export_data['data']);
|
415 |
+
|
416 |
+
//taking file name
|
417 |
+
$file_name=(isset($export_data['file_name']) ? $export_data['file_name'] : '');
|
418 |
+
|
419 |
+
$file_path=$this->get_file_path($file_name);
|
420 |
+
if($file_path===false)
|
421 |
+
{
|
422 |
+
$update_data=array(
|
423 |
+
'status'=>Wt_Import_Export_For_Woo_Basic_History::$status_arr['failed'],
|
424 |
+
'status_text'=>'File not found.' //no need to add translation function
|
425 |
+
);
|
426 |
+
$update_data_type=array(
|
427 |
+
'%d',
|
428 |
+
'%s',
|
429 |
+
);
|
430 |
+
Wt_Import_Export_For_Woo_Basic_History::update_history_entry($export_id, $update_data, $update_data_type);
|
431 |
+
|
432 |
+
return $out;
|
433 |
+
}
|
434 |
+
|
435 |
+
/* updating output parameters */
|
436 |
+
$out['export_id']=$export_id;
|
437 |
+
$out['history_id']=$export_id;
|
438 |
+
$out['file_url']='';
|
439 |
+
|
440 |
+
//check where to copy the files
|
441 |
+
$file_into='local';
|
442 |
+
if(isset($form_data['advanced_form_data']))
|
443 |
+
{
|
444 |
+
$file_into=(isset($form_data['advanced_form_data']['wt_iew_file_into']) ? $form_data['advanced_form_data']['wt_iew_file_into'] : 'local');
|
445 |
+
}
|
446 |
+
|
447 |
+
if('local' != $file_into) /* file not save to local. Initiate the choosed remote profile */
|
448 |
+
{
|
449 |
+
$remote_adapter=Wt_Import_Export_For_Woo_Basic::get_remote_adapters('export', $file_into);
|
450 |
+
if(is_null($remote_adapter)) /* adapter object not found */
|
451 |
+
{
|
452 |
+
$msg=sprintf('Unable to initailize %s', $file_into);
|
453 |
+
Wt_Import_Export_For_Woo_Basic_History::record_failure($export_id, $msg);
|
454 |
+
$out['msg']=__($msg);
|
455 |
+
return $out;
|
456 |
+
}
|
457 |
+
|
458 |
+
/* upload the file */
|
459 |
+
$upload_out_format = array('response'=>true, 'msg'=>'');
|
460 |
+
|
461 |
+
$advanced_form_data=(isset($form_data['advanced_form_data']) ? $form_data['advanced_form_data'] : array());
|
462 |
+
|
463 |
+
$upload_data = $remote_adapter->upload($file_path, $file_name, $advanced_form_data, $upload_out_format);
|
464 |
+
$out['response'] = (isset($upload_data['response']) ? $upload_data['response'] : false);
|
465 |
+
$out['msg'] = (isset($upload_data['msg']) ? $upload_data['msg'] : __('Error'));
|
466 |
+
|
467 |
+
//unlink the local file
|
468 |
+
@unlink($file_path);
|
469 |
+
}else
|
470 |
+
{
|
471 |
+
$out['response']=true;
|
472 |
+
$out['file_url']=html_entity_decode($this->get_file_url($file_name));
|
473 |
+
}
|
474 |
+
|
475 |
+
$out['finished']=1; //if any error then also its finished, but with errors
|
476 |
+
if($out['response'] === true) //success
|
477 |
+
{
|
478 |
+
$out['msg']=__('Finished');
|
479 |
+
|
480 |
+
/* updating finished status */
|
481 |
+
$update_data=array(
|
482 |
+
'status'=>1 //success
|
483 |
+
);
|
484 |
+
$update_data_type=array(
|
485 |
+
'%d'
|
486 |
+
);
|
487 |
+
Wt_Import_Export_For_Woo_Basic_History::update_history_entry($export_id, $update_data, $update_data_type);
|
488 |
+
|
489 |
+
}else //failed
|
490 |
+
{
|
491 |
+
//no need to add translation function in message
|
492 |
+
Wt_Import_Export_For_Woo_Basic_History::record_failure($export_id, 'Failed while uploading');
|
493 |
+
}
|
494 |
+
return $out;
|
495 |
+
}
|
496 |
+
|
497 |
+
|
498 |
+
/**
|
499 |
+
* Do the export process
|
500 |
+
*/
|
501 |
+
public function process_action($form_data, $step, $to_process, $file_name='', $export_id=0, $offset=0)
|
502 |
+
{
|
503 |
+
$out=array(
|
504 |
+
'response'=>false,
|
505 |
+
'new_offset'=>0,
|
506 |
+
'export_id'=>0,
|
507 |
+
'history_id'=>0, //same as that of export id
|
508 |
+
'total_records'=>0,
|
509 |
+
'finished'=>0,
|
510 |
+
'file_url'=>'',
|
511 |
+
'msg'=>'',
|
512 |
+
);
|
513 |
+
|
514 |
+
/* prepare form_data, If this was not first batch */
|
515 |
+
if($export_id>0)
|
516 |
+
{
|
517 |
+
//take history data by export_id
|
518 |
+
$export_data=Wt_Import_Export_For_Woo_Basic_History::get_history_entry_by_id($export_id);
|
519 |
+
if(is_null($export_data)) //no record found so it may be an error
|
520 |
+
{
|
521 |
+
return $out;
|
522 |
+
}
|
523 |
+
|
524 |
+
//processing form data
|
525 |
+
$form_data=(isset($export_data['data']) ? maybe_unserialize($export_data['data']) : array());
|
526 |
+
}
|
527 |
+
$this->to_export=$to_process;
|
528 |
+
$default_batch_count=$this->_get_default_batch_count($form_data);
|
529 |
+
$batch_count=$default_batch_count;
|
530 |
+
$file_as='csv';
|
531 |
+
$csv_delimiter=',';
|
532 |
+
$total_records=0;
|
533 |
+
if(isset($form_data['advanced_form_data']))
|
534 |
+
{
|
535 |
+
$batch_count=(isset($form_data['advanced_form_data']['wt_iew_batch_count']) ? $form_data['advanced_form_data']['wt_iew_batch_count'] : $batch_count);
|
536 |
+
$file_as=(isset($form_data['advanced_form_data']['wt_iew_file_as']) ? $form_data['advanced_form_data']['wt_iew_file_as'] : 'csv');
|
537 |
+
$csv_delimiter=(isset($form_data['advanced_form_data']['wt_iew_delimiter']) ? $form_data['advanced_form_data']['wt_iew_delimiter'] : ',');
|
538 |
+
$csv_delimiter=($csv_delimiter=="" ? ',' : $csv_delimiter);
|
539 |
+
}
|
540 |
+
$file_as=(isset($this->allowed_export_file_type[$file_as]) ? $file_as : 'csv');
|
541 |
+
|
542 |
+
|
543 |
+
$generated_file_name=$this->to_export.'_export_'.date('Y-m-d-h-i-s').'.'.$file_as;
|
544 |
+
|
545 |
+
if($export_id==0) //first batch then create a history entry
|
546 |
+
{
|
547 |
+
$file_name=($file_name=="" ? $generated_file_name : sanitize_file_name($file_name.'.'.$file_as));
|
548 |
+
$export_id=Wt_Import_Export_For_Woo_Basic_History::create_history_entry($file_name, $form_data, $this->to_export, $step);
|
549 |
+
$offset=0;
|
550 |
+
}else
|
551 |
+
{
|
552 |
+
//taking file name from export data
|
553 |
+
$file_name=(isset($export_data['file_name']) ? $export_data['file_name'] : $generated_file_name);
|
554 |
+
$total_records=(isset($export_data['total']) ? $export_data['total'] : 0);
|
555 |
+
}
|
556 |
+
|
557 |
+
/* setting history_id in Log section */
|
558 |
+
Wt_Import_Export_For_Woo_Basic_Log::$history_id=$export_id;
|
559 |
+
|
560 |
+
|
561 |
+
$file_path=$this->get_file_path($file_name);
|
562 |
+
if($file_path===false)
|
563 |
+
{
|
564 |
+
$msg='Unable to create backup directory. Please grant write permission for `wp-content` folder.';
|
565 |
+
|
566 |
+
//no need to add translation function in message
|
567 |
+
Wt_Import_Export_For_Woo_Basic_History::record_failure($export_id, $msg);
|
568 |
+
|
569 |
+
$out['msg']=__($msg);
|
570 |
+
return $out;
|
571 |
+
}
|
572 |
+
|
573 |
+
/* giving full data */
|
574 |
+
$form_data=apply_filters('wt_iew_export_full_form_data_basic', $form_data, $to_process, $step, $this->selected_template_data);
|
575 |
+
|
576 |
+
/* hook to get data from corresponding module. Eg: product, order */
|
577 |
+
$export_data=array(
|
578 |
+
'total'=>100,
|
579 |
+
'head_data'=>array("abc"=>"hd1", "bcd"=>"hd2", "cde"=>"hd3", "def"=>"hd4"),
|
580 |
+
'body_data'=>array(
|
581 |
+
array("abc"=>"Abc1", "bcd"=>"Bcd1", "cde"=>"Cde1", "def"=>"Def1"),
|
582 |
+
array("abc"=>"Abc2", "bcd"=>"Bcd2", "cde"=>"Cde2", "def"=>"Def2")
|
583 |
+
),
|
584 |
+
);
|
585 |
+
|
586 |
+
/* in scheduled export. The export method will not available so we need to take it from form_data */
|
587 |
+
$form_data_export_method=(isset($form_data['method_export_form_data']) && isset($form_data['method_export_form_data']['method_export']) ? $form_data['method_export_form_data']['method_export'] : $this->default_export_method);
|
588 |
+
$this->export_method=($this->export_method=="" ? $form_data_export_method : $this->export_method);
|
589 |
+
|
590 |
+
$export_data=apply_filters('wt_iew_exporter_do_export_basic', $export_data, $to_process, $step, $form_data, $this->selected_template_data, $this->export_method, $offset);
|
591 |
+
if($offset==0)
|
592 |
+
{
|
593 |
+
$total_records=intval(isset($export_data['total']) ? $export_data['total'] : 0);
|
594 |
+
}
|
595 |
+
$this->_update_history_after_export($export_id, $offset, $total_records, $export_data);
|
596 |
+
|
597 |
+
/* checking action is finshed */
|
598 |
+
$is_last_offset=false;
|
599 |
+
$new_offset=$offset+$batch_count; //increase the offset
|
600 |
+
if($new_offset>=$total_records) //finished
|
601 |
+
{
|
602 |
+
$is_last_offset=true;
|
603 |
+
}
|
604 |
+
|
605 |
+
/* no data from corresponding module */
|
606 |
+
if(!$export_data) //error !!!
|
607 |
+
{
|
608 |
+
//return $out;
|
609 |
+
}else
|
610 |
+
{
|
611 |
+
|
612 |
+
include_once WT_U_IEW_PLUGIN_PATH.'admin/classes/class-csvwriter.php';
|
613 |
+
$writer=new Wt_Import_Export_For_Woo_Basic_Csvwriter($file_path, $offset, $csv_delimiter);
|
614 |
+
|
615 |
+
|
616 |
+
/**
|
617 |
+
* Alter export data before writing to file.
|
618 |
+
* @param array $export_data data to export
|
619 |
+
* @param int $offset current offset
|
620 |
+
* @param boolean $is_last_offset is current offset is last one
|
621 |
+
* @param string $file_as file type to write Eg: XML, CSV
|
622 |
+
* @param string $to_export Post type
|
623 |
+
* @param string $csv_delimiter CSV delimiter. In case of CSV export
|
624 |
+
* @return array $export_data Altered export data
|
625 |
+
*/
|
626 |
+
$export_data=apply_filters('wt_iew_alter_export_data_basic', $export_data, $offset, $is_last_offset, $file_as, $this->to_export, $csv_delimiter);
|
627 |
+
|
628 |
+
$writer->write_to_file($export_data, $offset, $is_last_offset, $this->to_export);
|
629 |
+
}
|
630 |
+
|
631 |
+
/* updating output parameters */
|
632 |
+
$out['total_records']=$total_records;
|
633 |
+
$out['export_id']=$export_id;
|
634 |
+
$out['history_id']=$export_id;
|
635 |
+
$out['file_url']='';
|
636 |
+
$out['response']=true;
|
637 |
+
|
638 |
+
/* updating action is finshed */
|
639 |
+
if($is_last_offset) //finished
|
640 |
+
{
|
641 |
+
//check where to copy the files
|
642 |
+
$file_into='local';
|
643 |
+
if(isset($form_data['advanced_form_data']))
|
644 |
+
{
|
645 |
+
$file_into=(isset($form_data['advanced_form_data']['wt_iew_file_into']) ? $form_data['advanced_form_data']['wt_iew_file_into'] : 'local');
|
646 |
+
}
|
647 |
+
if('local' != $file_into) /* file not save to local. Initiate the choosed remote profile */
|
648 |
+
{
|
649 |
+
$out['finished']=2; //file created, next upload it
|
650 |
+
|
651 |
+
$out['msg']=sprintf(__('Uploading to %s'), $file_into);
|
652 |
+
}else
|
653 |
+
{
|
654 |
+
$out['file_url']=html_entity_decode($this->get_file_url($file_name));
|
655 |
+
$out['finished']=1; //finished
|
656 |
+
|
657 |
+
$out['msg']=__('Finished');
|
658 |
+
|
659 |
+
/* updating finished status */
|
660 |
+
$update_data=array(
|
661 |
+
'status'=>Wt_Import_Export_For_Woo_Basic_History::$status_arr['finished'],
|
662 |
+
'status_text'=>'Finished' //translation function not needed
|
663 |
+
);
|
664 |
+
$update_data_type=array(
|
665 |
+
'%d',
|
666 |
+
'%s',
|
667 |
+
);
|
668 |
+
Wt_Import_Export_For_Woo_Basic_History::update_history_entry($export_id,$update_data,$update_data_type);
|
669 |
+
}
|
670 |
+
|
671 |
+
}else
|
672 |
+
{
|
673 |
+
$out['new_offset']=$new_offset;
|
674 |
+
$out['msg']=sprintf(__('Exporting...(%d out of %d)'), $new_offset, $total_records);
|
675 |
+
}
|
676 |
+
return $out;
|
677 |
+
}
|
678 |
+
|
679 |
+
|
680 |
+
public static function get_file_path($file_name)
|
681 |
+
{
|
682 |
+
if(!is_dir(self::$export_dir))
|
683 |
+
{
|
684 |
+
if(!mkdir(self::$export_dir, 0700))
|
685 |
+
{
|
686 |
+
return false;
|
687 |
+
}else
|
688 |
+
{
|
689 |
+
$files_to_create=array('.htaccess' => 'deny from all', 'index.php'=>'<?php // Silence is golden');
|
690 |
+
foreach($files_to_create as $file=>$file_content)
|
691 |
+
{
|
692 |
+
if(!file_exists(self::$export_dir.'/'.$file))
|
693 |
+
{
|
694 |
+
$fh=@fopen(self::$export_dir.'/'.$file, "w");
|
695 |
+
if(is_resource($fh))
|
696 |
+
{
|
697 |
+
fwrite($fh, $file_content);
|
698 |
+
fclose($fh);
|
699 |
+
}
|
700 |
+
}
|
701 |
+
}
|
702 |
+
}
|
703 |
+
}
|
704 |
+
return self::$export_dir.'/'.$file_name;
|
705 |
+
}
|
706 |
+
|
707 |
+
/**
|
708 |
+
* Download file via a nonce URL
|
709 |
+
*/
|
710 |
+
public function download_file()
|
711 |
+
{
|
712 |
+
if(isset($_GET['wt_iew_export_download']))
|
713 |
+
{
|
714 |
+
if(Wt_Iew_Sh::check_write_access(WT_IEW_PLUGIN_ID_BASIC)) /* check nonce and role */
|
715 |
+
{
|
716 |
+
$file_name=(isset($_GET['file']) ? sanitize_file_name($_GET['file']) : '');
|
717 |
+
if($file_name!="")
|
718 |
+
{
|
719 |
+
$file_arr=explode(".", $file_name);
|
720 |
+
$file_ext=end($file_arr);
|
721 |
+
if(isset($this->allowed_export_file_type[$file_ext]) || $file_ext=='zip') /* Only allowed files. Zip file in image export */
|
722 |
+
{
|
723 |
+
$file_path=self::$export_dir.'/'.$file_name;
|
724 |
+
if(file_exists($file_path) && is_file($file_path)) /* check existence of file */
|
725 |
+
{
|
726 |
+
header('Pragma: public');
|
727 |
+
header('Expires: 0');
|
728 |
+
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
729 |
+
header('Cache-Control: private', false);
|
730 |
+
header('Content-Transfer-Encoding: binary');
|
731 |
+
header('Content-Disposition: attachment; filename="'.$file_name.'";');
|
732 |
+
header('Content-Description: File Transfer');
|
733 |
+
header('Content-Type: application/octet-stream');
|
734 |
+
//header('Content-Length: '.filesize($file_path));
|
735 |
+
|
736 |
+
$chunk_size=1024 * 1024;
|
737 |
+
$handle=@fopen($file_path, 'rb');
|
738 |
+
while(!feof($handle))
|
739 |
+
{
|
740 |
+
$buffer = fread($handle, $chunk_size);
|
741 |
+
echo $buffer;
|
742 |
+
ob_flush();
|
743 |
+
flush();
|
744 |
+
}
|
745 |
+
fclose($handle);
|
746 |
+
exit();
|
747 |
+
|
748 |
+
}
|
749 |
+
}
|
750 |
+
}
|
751 |
+
}
|
752 |
+
}
|
753 |
+
}
|
754 |
+
|
755 |
+
private function _update_history_after_export($export_id, $offset, $total_records, $export_data)
|
756 |
+
{
|
757 |
+
/* we need to update total record count on first batch */
|
758 |
+
if($offset==0)
|
759 |
+
{
|
760 |
+
$update_data=array(
|
761 |
+
'total'=>$total_records
|
762 |
+
);
|
763 |
+
}else
|
764 |
+
{
|
765 |
+
/* updating completed offset */
|
766 |
+
$update_data=array(
|
767 |
+
'offset'=>$offset
|
768 |
+
);
|
769 |
+
}
|
770 |
+
$update_data_type=array(
|
771 |
+
'%d'
|
772 |
+
);
|
773 |
+
Wt_Import_Export_For_Woo_Basic_History::update_history_entry($export_id, $update_data, $update_data_type);
|
774 |
+
}
|
775 |
+
|
776 |
+
private function _get_default_batch_count($form_data)
|
777 |
+
{
|
778 |
+
$default_batch_count=absint(apply_filters('wt_iew_exporter_alter_default_batch_count_basic', $this->default_batch_count, $this->to_export, $form_data));
|
779 |
+
$form_data=null;
|
780 |
+
unset($form_data);
|
781 |
+
return ($default_batch_count==0 ? $this->default_batch_count : $default_batch_count);
|
782 |
+
}
|
783 |
+
|
784 |
+
/**
|
785 |
+
* Generating downloadable URL for a file
|
786 |
+
*/
|
787 |
+
private function get_file_url($file_name)
|
788 |
+
{
|
789 |
+
return wp_nonce_url(admin_url('admin.php?wt_iew_export_download=true&file='.$file_name), WT_IEW_PLUGIN_ID_BASIC);
|
790 |
+
}
|
791 |
+
}
|
792 |
+
}
|
793 |
+
Wt_Import_Export_For_Woo_Basic::$loaded_modules['export']=new Wt_Import_Export_For_Woo_Basic_Export();
|
admin/modules/export/views/_export_advanced_page.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt_iew_export_main">
|
7 |
+
<p><?php echo $step_info['description']; ?></p>
|
8 |
+
<form class="wt_iew_export_advanced_form">
|
9 |
+
<table class="form-table wt-iew-form-table wt-iew-export-filter-table">
|
10 |
+
<?php
|
11 |
+
Wt_Import_Export_For_Woo_Basic_Common_Helper::field_generator($advanced_screen_fields, $advanced_form_data);
|
12 |
+
?>
|
13 |
+
</table>
|
14 |
+
</form>
|
15 |
+
</div>
|
16 |
+
<?php
|
17 |
+
|
18 |
+
$file_int_field_tr_arr=array();
|
19 |
+
$file_int_field_tr_arr=apply_filters('wt_iew_exporter_file_into_fields_row_id_basic', $file_int_field_tr_arr);
|
20 |
+
?>
|
21 |
+
<script type="text/javascript">
|
22 |
+
var file_int_field_tr_arr=<?php echo json_encode($file_int_field_tr_arr); ?>;
|
23 |
+
/* remote file modules can hook */
|
24 |
+
function wt_iew_set_file_into_fields(file_into)
|
25 |
+
{
|
26 |
+
/* first hide all */
|
27 |
+
if(file_int_field_tr_arr.length>0)
|
28 |
+
{
|
29 |
+
jQuery(file_int_field_tr_arr.join(', ')).hide();
|
30 |
+
}
|
31 |
+
// wt_iew_toggle_schedule_btn(0); //hide scheduler btn if exists
|
32 |
+
<?php
|
33 |
+
do_action('wt_iew_exporter_file_into_js_fn');
|
34 |
+
?>
|
35 |
+
}
|
36 |
+
<?php /*
|
37 |
+
function wt_iew_toggle_schedule_btn(state) /* show/hide cron button
|
38 |
+
{
|
39 |
+
<?php
|
40 |
+
do_action('wt_iew_toggle_schedule_btn');
|
41 |
+
?>
|
42 |
+
} */ ?>
|
43 |
+
|
44 |
+
/* custom action: other than export, save, update. Eg: schedule */
|
45 |
+
function wt_iew_custom_action_basic(ajx_dta, action, id)
|
46 |
+
{
|
47 |
+
ajx_dta['item_type']=ajx_dta['to_export'];
|
48 |
+
<?php
|
49 |
+
do_action('wt_iew_custom_action_basic');
|
50 |
+
?>
|
51 |
+
}
|
52 |
+
</script>
|
admin/modules/export/views/_export_filter_page.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt_iew_export_main">
|
7 |
+
<p><?php echo $step_inf['description']; ?></p>
|
8 |
+
<form class="wt_iew_export_filter_form">
|
9 |
+
<table class="form-table wt-iew-form-table wt-iew-export-filter-table">
|
10 |
+
<?php
|
11 |
+
Wt_Import_Export_For_Woo_Basic_Common_Helper::field_generator($filter_screen_fields, $filter_form_data);
|
12 |
+
?>
|
13 |
+
</table>
|
14 |
+
</form>
|
15 |
+
</div>
|
admin/modules/export/views/_export_footer.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt-iew-plugin-toolbar bottom">
|
7 |
+
<div style="float:left; padding-top:10px;" class="wt_iew_export_template_name"> </div>
|
8 |
+
<div style="float:right;">
|
9 |
+
<div style="float:right;">
|
10 |
+
<?php
|
11 |
+
foreach($this->step_btns as $btnk=>$btnv)
|
12 |
+
{
|
13 |
+
$css_class=(isset($btnv['class']) ? $btnv['class'] : '');
|
14 |
+
$action_type=(isset($btnv['action_type']) ? $btnv['action_type'] : 'non-step');
|
15 |
+
if($btnv['type']=='button')
|
16 |
+
{
|
17 |
+
?>
|
18 |
+
<button class="button button-primary wt_iew_export_action_btn <?php echo $css_class; ?>" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnv['key'];?>" type="submit">
|
19 |
+
<?php echo $btnv['text'];?>
|
20 |
+
</button>
|
21 |
+
<?php
|
22 |
+
|
23 |
+
}
|
24 |
+
elseif($btnv['type']=='dropdown_button')
|
25 |
+
{
|
26 |
+
$btn_arr=(isset($btnv['items']) && is_array($btnv['items']) ? $btnv['items'] : array());
|
27 |
+
?>
|
28 |
+
<button type="button" class="button button-primary wt_iew_drp_menu <?php echo $css_class; ?>" data-target="wt_iew_<?php echo $btnk; ?>_drp">
|
29 |
+
<?php echo $btnv['text'];?> <span class="dashicons dashicons-arrow-down" style="line-height: 28px;"></span>
|
30 |
+
</button>
|
31 |
+
<ul class="wt_iew_dropdown <?php echo $css_class; ?>" data-id="wt_iew_<?php echo $btnk; ?>_drp">
|
32 |
+
<?php
|
33 |
+
foreach($btn_arr as $btnkk => $btnvv)
|
34 |
+
{
|
35 |
+
$field_attr=(isset($btnvv['field_attr']) ? $btnvv['field_attr'] : '');
|
36 |
+
$action_type=(isset($btnvv['action_type']) ? $btnvv['action_type'] : 'non-step');
|
37 |
+
?>
|
38 |
+
<li class="wt_iew_export_action_btn" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnvv['key'];?>" <?php echo $field_attr;?> ><?php echo $btnvv['text'];?></li>
|
39 |
+
<?php
|
40 |
+
}
|
41 |
+
?>
|
42 |
+
</ul>
|
43 |
+
<?php
|
44 |
+
}
|
45 |
+
elseif($btnv['type']=='hidden_button')
|
46 |
+
{
|
47 |
+
?>
|
48 |
+
<button style="display:none;" class="button button-primary wt_iew_export_action_btn <?php echo $css_class; ?>" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnv['key'];?>" type="submit">
|
49 |
+
<?php echo $btnv['text'];?>
|
50 |
+
</button>
|
51 |
+
<?php
|
52 |
+
|
53 |
+
}
|
54 |
+
elseif($btnv['type']=='text')
|
55 |
+
{
|
56 |
+
?>
|
57 |
+
<span style="line-height:40px; font-weight:bold;" class="<?php echo $css_class; ?>"><?php echo $btnv['text'];?></span>
|
58 |
+
<?php
|
59 |
+
}
|
60 |
+
}
|
61 |
+
?>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
<span class="spinner" style="margin-top:11px;"></span>
|
65 |
+
</div>
|
admin/modules/export/views/_export_header.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt-iew-settings-header">
|
7 |
+
<h3>
|
8 |
+
<?php _e('Export'); ?><?php if($this->step!='post_type'){ ?> <span class="wt_iew_step_head_post_type_name"></span><?php } ?>: <?php echo $this->step_title; ?>
|
9 |
+
</h3>
|
10 |
+
<span class="wt_iew_step_info" title="<?php echo $this->step_summary; ?>">
|
11 |
+
<?php
|
12 |
+
echo $this->step_summary;
|
13 |
+
?>
|
14 |
+
</span>
|
15 |
+
</div>
|
admin/modules/export/views/_export_mapping_page.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt_iew_export_main">
|
7 |
+
<p><?php echo $step_info['description']; ?></p>
|
8 |
+
<div class="meta_mapping_box">
|
9 |
+
<div class="meta_mapping_box_hd wt_iew_noselect">
|
10 |
+
<span class="dashicons dashicons-arrow-down"></span>
|
11 |
+
<?php _e('Default fields');?>
|
12 |
+
<span class="meta_mapping_box_selected_count_box"><span class="meta_mapping_box_selected_count_box_num">0</span> <?php _e(' columns(s) selected'); ?></span>
|
13 |
+
</div>
|
14 |
+
<div style="clear:both;"></div>
|
15 |
+
<div class="meta_mapping_box_con" data-sortable="0" data-loaded="1" data-field-validated="0" data-key="" style="display:inline-block;">
|
16 |
+
<table class="wt-iew-mapping-tb wt-iew-exporter-default-mapping-tb">
|
17 |
+
<thead>
|
18 |
+
<tr>
|
19 |
+
<th>
|
20 |
+
<input type="checkbox" name="" class="wt_iew_mapping_checkbox_main">
|
21 |
+
</th>
|
22 |
+
<th width="35%"><?php _e('Column');?></th>
|
23 |
+
<th><?php _e('Column name');?></th>
|
24 |
+
</tr>
|
25 |
+
</thead>
|
26 |
+
<tbody>
|
27 |
+
<?php
|
28 |
+
$draggable_tooltip=__("Drag to rearrange the columns");
|
29 |
+
$tr_count=0;
|
30 |
+
foreach($form_data_mapping_fields as $key=>$val)
|
31 |
+
{
|
32 |
+
if(isset($mapping_fields[$key]))
|
33 |
+
{
|
34 |
+
$label=$mapping_fields[$key];
|
35 |
+
include "_export_mapping_tr_html.php";
|
36 |
+
unset($mapping_fields[$key]); //remove the field from default list
|
37 |
+
$tr_count++;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
if(count($mapping_fields)>0)
|
41 |
+
{
|
42 |
+
foreach($mapping_fields as $key=>$label)
|
43 |
+
{
|
44 |
+
$val=array($key, 1); //enable the field
|
45 |
+
include "_export_mapping_tr_html.php";
|
46 |
+
$tr_count++;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
if($tr_count==0)
|
50 |
+
{
|
51 |
+
?>
|
52 |
+
<tr>
|
53 |
+
<td colspan="3" style="text-align:center;">
|
54 |
+
<?php _e('No fields found.'); ?>
|
55 |
+
</td>
|
56 |
+
</tr>
|
57 |
+
<?php
|
58 |
+
}
|
59 |
+
?>
|
60 |
+
</tbody>
|
61 |
+
</table>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
<div style="clear:both;"></div>
|
65 |
+
<?php
|
66 |
+
if($this->mapping_enabled_fields)
|
67 |
+
{
|
68 |
+
foreach($this->mapping_enabled_fields as $mapping_enabled_field_key=>$mapping_enabled_field)
|
69 |
+
{
|
70 |
+
$mapping_enabled_field=(!is_array($mapping_enabled_field) ? array($mapping_enabled_field, 0) : $mapping_enabled_field);
|
71 |
+
|
72 |
+
if(count($form_data_mapping_enabled_fields)>0)
|
73 |
+
{
|
74 |
+
if(in_array($mapping_enabled_field_key, $form_data_mapping_enabled_fields))
|
75 |
+
{
|
76 |
+
$mapping_enabled_field[1]=1;
|
77 |
+
}else
|
78 |
+
{
|
79 |
+
$mapping_enabled_field[1]=0;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
?>
|
83 |
+
<div class="meta_mapping_box">
|
84 |
+
<div class="meta_mapping_box_hd wt_iew_noselect">
|
85 |
+
<span class="dashicons dashicons-arrow-right"></span>
|
86 |
+
<?php echo $mapping_enabled_field[0];?>
|
87 |
+
<span class="meta_mapping_box_selected_count_box"><span class="meta_mapping_box_selected_count_box_num">0</span> <?php _e(' columns(s) selected'); ?></span>
|
88 |
+
</div>
|
89 |
+
<div style="clear:both;"></div>
|
90 |
+
<div class="meta_mapping_box_con" data-sortable="0" data-loaded="0" data-field-validated="0" data-key="<?php echo $mapping_enabled_field_key;?>"></div>
|
91 |
+
</div>
|
92 |
+
<div style="clear:both;"></div>
|
93 |
+
<?php
|
94 |
+
}
|
95 |
+
}
|
96 |
+
?>
|
97 |
+
</div>
|
admin/modules/export/views/_export_mapping_tr_html.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
$checked=is_array($val) ? $val[1] : 0;
|
6 |
+
$val=(is_array($val) ? $val[0] : $val);
|
7 |
+
?>
|
8 |
+
<tr id="columns_<?php echo $key;?>">
|
9 |
+
<td>
|
10 |
+
<div class="wt_iew_sort_handle" title="<?php echo $draggable_tooltip;?>">
|
11 |
+
<img src="<?php echo WT_U_IEW_PLUGIN_URL.'assets/images/drag_icon.png'; ?>"/>
|
12 |
+
</div>
|
13 |
+
<input type="checkbox" name="columns_key[]" class="columns_key wt_iew_mapping_checkbox_sub" value="<?php echo $key;?>" <?php echo ($checked==1 ? 'checked' : ''); ?>></td>
|
14 |
+
<td>
|
15 |
+
<label class="wt_iew_mapping_column_label"><?php echo $label;?></label>
|
16 |
+
</td>
|
17 |
+
<td>
|
18 |
+
<input type="text" name="columns_val[]" class="columns_val" value="<?php echo $val;?>">
|
19 |
+
</td>
|
20 |
+
</tr>
|
admin/modules/export/views/_export_meta_step_page.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<table class="wt-iew-mapping-tb wt-iew-exporter-meta-mapping-tb" data-field-type="<?php echo $meta_mapping_screen_field_key; ?>">
|
7 |
+
<thead>
|
8 |
+
<tr>
|
9 |
+
<th>
|
10 |
+
<?php
|
11 |
+
$is_checked=(isset($meta_mapping_screen_field_val['checked']) && $meta_mapping_screen_field_val['checked']==1 ? 1 : 0);
|
12 |
+
$checked_attr=($is_checked==1 ? ' checked="checked"' : '');
|
13 |
+
?>
|
14 |
+
<input type="checkbox" name="" class="wt_iew_mapping_checkbox_main" <?php echo $checked_attr; ?>>
|
15 |
+
</th>
|
16 |
+
<th width="35%"><?php _e('Column');?></th>
|
17 |
+
<th><?php _e('Column name');?></th>
|
18 |
+
</tr>
|
19 |
+
</thead>
|
20 |
+
<tbody>
|
21 |
+
<?php
|
22 |
+
$tr_count=0;
|
23 |
+
|
24 |
+
if(isset($meta_mapping_screen_field_val['fields']) && is_array($meta_mapping_screen_field_val['fields']) && count($meta_mapping_screen_field_val['fields'])>0)
|
25 |
+
{
|
26 |
+
foreach($meta_mapping_screen_field_val['fields'] as $key=>$val)
|
27 |
+
{
|
28 |
+
$val=is_array($val) ? $val : array($val, 0);
|
29 |
+
$label=$val[0];
|
30 |
+
|
31 |
+
if(isset($current_meta_step_form_data[$key])) /* forma data/template data available */
|
32 |
+
{
|
33 |
+
$val=(is_array($current_meta_step_form_data[$key]) ? $current_meta_step_form_data[$key] : array($current_meta_step_form_data[$key], 1));
|
34 |
+
}else
|
35 |
+
{
|
36 |
+
$val[1]=$is_checked; //parent is checked
|
37 |
+
}
|
38 |
+
|
39 |
+
include "_export_mapping_tr_html.php";
|
40 |
+
$tr_count++;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
if($tr_count==0)
|
45 |
+
{
|
46 |
+
?>
|
47 |
+
<tr>
|
48 |
+
<td colspan="3" style="text-align:center;">
|
49 |
+
<?php _e('No fields found.'); ?>
|
50 |
+
</td>
|
51 |
+
</tr>
|
52 |
+
<?php
|
53 |
+
}
|
54 |
+
?>
|
55 |
+
</tbody>
|
56 |
+
</table>
|
admin/modules/export/views/_export_method_export_page.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt_iew_export_main">
|
7 |
+
<p><?php echo $step_info['description']; ?></p>
|
8 |
+
|
9 |
+
<div class="wt_iew_warn wt_iew_method_export_wrn" style="display:none;">
|
10 |
+
<?php _e('Please select an export method');?>
|
11 |
+
</div>
|
12 |
+
|
13 |
+
<div class="wt_iew_warn wt_iew_export_template_wrn" style="display:none;">
|
14 |
+
<?php _e('Please select an export template.');?>
|
15 |
+
</div>
|
16 |
+
|
17 |
+
<table class="form-table wt-iew-form-table">
|
18 |
+
<tr>
|
19 |
+
<th><label><?php _e('Select an export method');?></label></th>
|
20 |
+
<td colspan="2" style="width:75%;">
|
21 |
+
<div class="wt_iew_radio_block">
|
22 |
+
<?php
|
23 |
+
foreach($this->export_obj->export_methods as $key => $value)
|
24 |
+
{
|
25 |
+
?>
|
26 |
+
<p>
|
27 |
+
<input type="radio" value="<?php echo $key;?>" id="wt_iew_export_<?php echo $key;?>_export" name="wt_iew_export_method_export" <?php echo ($this->export_method==$key ? 'checked="checked"' : '');?>><b><label for="wt_iew_export_<?php echo $key;?>_export"><?php echo $value['title']; ?></label></b> <br />
|
28 |
+
<span><label for="wt_iew_export_<?php echo $key;?>_export"><?php echo $value['description']; ?></label></span>
|
29 |
+
</p>
|
30 |
+
<?php
|
31 |
+
}
|
32 |
+
?>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
</td>
|
36 |
+
</tr>
|
37 |
+
|
38 |
+
<!-- <tr class="wt-iew-export-method-options wt-iew-export-method-options-quick">
|
39 |
+
<th style="width:150px; text-align:left; vertical-align:top;"><label><?php _e('Include fields from the respective groups');?></label></th>
|
40 |
+
<td colspan="2" style="width:75%;">
|
41 |
+
<?php
|
42 |
+
foreach($this->mapping_enabled_fields as $mapping_enabled_field_key=>$mapping_enabled_field)
|
43 |
+
{
|
44 |
+
$mapping_enabled_field=(!is_array($mapping_enabled_field) ? array($mapping_enabled_field, 0) : $mapping_enabled_field);
|
45 |
+
|
46 |
+
if($this->rerun_id>0) /* check this is a rerun request */
|
47 |
+
{
|
48 |
+
if(in_array($mapping_enabled_field_key, $form_data_mapping_enabled))
|
49 |
+
{
|
50 |
+
$mapping_enabled_field[1]=1; //mark it as checked
|
51 |
+
}else
|
52 |
+
{
|
53 |
+
$mapping_enabled_field[1]=0; //mark it as unchecked
|
54 |
+
}
|
55 |
+
}
|
56 |
+
?>
|
57 |
+
<div class="wt_iew_checkbox" style="padding-left:0px;">
|
58 |
+
<input type="checkbox" id="wt_iew_<?php echo $mapping_enabled_field_key;?>" name="wt_iew_include_these_fields[]" value="<?php echo $mapping_enabled_field_key;?>" <?php echo ($mapping_enabled_field[1]==1 ? 'checked="checked"' : '');?> />
|
59 |
+
<label for="wt_iew_<?php echo $mapping_enabled_field_key;?>"><?php echo $mapping_enabled_field[0];?></label>
|
60 |
+
</div>
|
61 |
+
<?php
|
62 |
+
}
|
63 |
+
?>
|
64 |
+
<span class="wt-iew_form_help"><?php _e('Enabling any of these ensures that all the fields from the respective groups are included in your export.');?></span>
|
65 |
+
</td>
|
66 |
+
</tr>-->
|
67 |
+
|
68 |
+
|
69 |
+
<tr class="wt-iew-export-method-options wt-iew-export-method-options-template" style="display:none;">
|
70 |
+
<th><label><?php _e('Export template');?></label></th>
|
71 |
+
<td>
|
72 |
+
<select class="wt-iew-export-template-sele">
|
73 |
+
<option value="0">-- <?php _e('Select a template'); ?> --</option>
|
74 |
+
<?php
|
75 |
+
foreach($this->mapping_templates as $mapping_template)
|
76 |
+
{
|
77 |
+
?>
|
78 |
+
<option value="<?php echo $mapping_template['id'];?>" <?php echo ($form_data_export_template==$mapping_template['id'] ? ' selected="selected"' : ''); ?>>
|
79 |
+
<?php echo $mapping_template['name'];?>
|
80 |
+
</option>
|
81 |
+
<?php
|
82 |
+
}
|
83 |
+
?>
|
84 |
+
</select>
|
85 |
+
</td>
|
86 |
+
<td>
|
87 |
+
</td>
|
88 |
+
</tr>
|
89 |
+
</table>
|
90 |
+
</div>
|
admin/modules/export/views/_export_post_type_page.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt_iew_export_main">
|
7 |
+
<p><?php echo $step_info['description']; ?></p>
|
8 |
+
<div class="wt_iew_warn wt_iew_post_type_wrn" style="display:none;">
|
9 |
+
<?php _e('Please select a post type');?>
|
10 |
+
</div>
|
11 |
+
<table class="form-table wt-iew-form-table">
|
12 |
+
<tr>
|
13 |
+
<th><label><?php _e('What do you want to export ?'); ?></label></th>
|
14 |
+
<td>
|
15 |
+
<select name="wt_iew_export_post_type">
|
16 |
+
<option value="">-- <?php _e('Select post type'); ?> --</option>
|
17 |
+
<?php
|
18 |
+
foreach($post_types as $key=>$value)
|
19 |
+
{
|
20 |
+
?>
|
21 |
+
<option value="<?php echo $key;?>" <?php echo ($item_type==$key ? 'selected' : '');?>><?php echo $value;?></option>
|
22 |
+
<?php
|
23 |
+
}
|
24 |
+
?>
|
25 |
+
</select>
|
26 |
+
</td>
|
27 |
+
<td></td>
|
28 |
+
</tr>
|
29 |
+
</table>
|
30 |
+
</div>
|
admin/modules/export/views/main.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Main view file of export section
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
do_action('wt_iew_exporter_before_head');
|
15 |
+
?>
|
16 |
+
<style type="text/css">
|
17 |
+
.wt_iew_export_step{ display:none; }
|
18 |
+
.wt_iew_export_step_loader{ width:100%; height:400px; text-align:center; line-height:400px; font-size:14px; }
|
19 |
+
.wt_iew_export_step_main{ float:left; box-sizing:border-box; padding:15px; padding-bottom:0px; width:95%; margin:30px 2.5%; background:#fff; box-shadow:0px 2px 2px #ccc; border:solid 1px #efefef; }
|
20 |
+
.wt_iew_export_main{ padding:20px 0px; }
|
21 |
+
.wt_iew_file_ext_info_td{ vertical-align:top !important; }
|
22 |
+
.wt_iew_file_ext_info{ display:inline-block; margin-top:3px; }
|
23 |
+
</style>
|
24 |
+
<?php
|
25 |
+
Wt_Iew_IE_Basic_Helper::debug_panel($this->module_base);
|
26 |
+
?>
|
27 |
+
<?php include WT_U_IEW_PLUGIN_PATH."/admin/views/_save_template_popup.php"; ?>
|
28 |
+
<h2 class="wt_iew_page_hd"><?php _e('Export'); ?><span class="wt_iew_post_type_name"></span></h2>
|
29 |
+
|
30 |
+
<?php
|
31 |
+
if($requested_rerun_id>0 && $this->rerun_id==0)
|
32 |
+
{
|
33 |
+
?>
|
34 |
+
<div class="wt_iew_warn wt_iew_rerun_warn">
|
35 |
+
<?php _e('Unable to handle Re-Run request.');?>
|
36 |
+
</div>
|
37 |
+
<?php
|
38 |
+
}
|
39 |
+
?>
|
40 |
+
|
41 |
+
<div class="wt_iew_loader_info_box"></div>
|
42 |
+
<div class="wt_iew_overlayed_loader"></div>
|
43 |
+
<div class="wt_iew_export_step_main">
|
44 |
+
<?php
|
45 |
+
foreach($this->steps as $stepk=>$stepv)
|
46 |
+
{
|
47 |
+
?>
|
48 |
+
<div class="wt_iew_export_step wt_iew_export_step_<?php echo $stepk;?>" data-loaded="0"></div>
|
49 |
+
<?php
|
50 |
+
}
|
51 |
+
?>
|
52 |
+
</div>
|
53 |
+
<?php /*
|
54 |
+
<script type="text/javascript">
|
55 |
+
/* external modules can hook
|
56 |
+
function wt_iew_exporter_validate(action, action_type, is_previous_step)
|
57 |
+
{
|
58 |
+
var is_continue=true;
|
59 |
+
<?php
|
60 |
+
do_action('wt_iew_exporter_validate');
|
61 |
+
?>
|
62 |
+
return is_continue;
|
63 |
+
}
|
64 |
+
</script> */ ?>
|
admin/modules/history/assets/js/main.js
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var wt_iew_basic_history=(function( $ ) {
|
2 |
+
//'use strict';
|
3 |
+
var wt_iew_basic_history=
|
4 |
+
{
|
5 |
+
log_offset:0,
|
6 |
+
Set:function()
|
7 |
+
{
|
8 |
+
this.reg_delete();
|
9 |
+
this.reg_view_log();
|
10 |
+
this.reg_bulk_action();
|
11 |
+
},
|
12 |
+
reg_view_log:function()
|
13 |
+
{
|
14 |
+
jQuery('.wt_iew_view_log_btn').click(function(){
|
15 |
+
wt_iew_basic_history.show_log_popup();
|
16 |
+
var history_id=$(this).attr('data-history-id');
|
17 |
+
if(history_id>0)
|
18 |
+
{
|
19 |
+
wt_iew_basic_history.log_offset=0;
|
20 |
+
wt_iew_basic_history.load_page(history_id);
|
21 |
+
}else
|
22 |
+
{
|
23 |
+
var log_file=$(this).attr('data-log-file');
|
24 |
+
if(log_file!="")
|
25 |
+
{
|
26 |
+
wt_iew_basic_history.view_raw_log(log_file);
|
27 |
+
}
|
28 |
+
}
|
29 |
+
});
|
30 |
+
},
|
31 |
+
view_raw_log:function(log_file)
|
32 |
+
{
|
33 |
+
$('.wt_iew_log_container').html('<div class="wt_iew_log_loader">'+wt_iew_basic_params.msgs.loading+'</div>');
|
34 |
+
$.ajax({
|
35 |
+
url:wt_iew_basic_params.ajax_url,
|
36 |
+
data:{'action':'iew_history_ajax_basic', _wpnonce:wt_iew_basic_params.nonces.main, 'history_action':'view_log', 'log_file':log_file, 'data_type':'json'},
|
37 |
+
type:'post',
|
38 |
+
dataType:"json",
|
39 |
+
success:function(data)
|
40 |
+
{
|
41 |
+
if(data.status==1)
|
42 |
+
{
|
43 |
+
$('.wt_iew_log_container').html(data.html);
|
44 |
+
}else
|
45 |
+
{
|
46 |
+
$('.wt_iew_log_loader').html(wt_iew_basic_params.msgs.error);
|
47 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
48 |
+
}
|
49 |
+
},
|
50 |
+
error:function()
|
51 |
+
{
|
52 |
+
$('.wt_iew_log_loader').html(wt_iew_basic_params.msgs.error);
|
53 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
54 |
+
}
|
55 |
+
});
|
56 |
+
},
|
57 |
+
show_log_popup:function()
|
58 |
+
{
|
59 |
+
var pop_elm=$('.wt_iew_view_log');
|
60 |
+
var ww=$(window).width();
|
61 |
+
pop_w=(ww<1300 ? ww : 1300)-200;
|
62 |
+
pop_w=(pop_w<200 ? 200 : pop_w);
|
63 |
+
pop_elm.width(pop_w);
|
64 |
+
|
65 |
+
wh=$(window).height();
|
66 |
+
pop_h=(wh>=400 ? (wh-200) : wh);
|
67 |
+
$('.wt_iew_log_container').css({'max-height':pop_h+'px','overflow':'auto'});
|
68 |
+
wt_iew_popup.showPopup(pop_elm);
|
69 |
+
},
|
70 |
+
load_page:function(history_id)
|
71 |
+
{
|
72 |
+
var offset=wt_iew_basic_history.log_offset;
|
73 |
+
if(offset==0)
|
74 |
+
{
|
75 |
+
$('.wt_iew_log_container').html('<div class="wt_iew_log_loader">'+wt_iew_basic_params.msgs.loading+'</div>');
|
76 |
+
}else
|
77 |
+
{
|
78 |
+
$('.wt_iew_history_loadmore_btn').hide();
|
79 |
+
$('.wt_iew_history_loadmore_loading').show();
|
80 |
+
}
|
81 |
+
$.ajax({
|
82 |
+
url:wt_iew_basic_params.ajax_url,
|
83 |
+
data:{'action':'iew_history_ajax_basic', _wpnonce:wt_iew_basic_params.nonces.main, 'history_action':'view_log', 'offset': offset, 'history_id':history_id, 'data_type':'json'},
|
84 |
+
type:'post',
|
85 |
+
dataType:"json",
|
86 |
+
success:function(data)
|
87 |
+
{
|
88 |
+
$('.wt_iew_history_loadmore_btn').show();
|
89 |
+
$('.wt_iew_history_loadmore_loading').hide();
|
90 |
+
if(data.status==1)
|
91 |
+
{
|
92 |
+
wt_iew_basic_history.log_offset=data.offset;
|
93 |
+
if(offset==0)
|
94 |
+
{
|
95 |
+
$('.wt_iew_log_container').html(data.html);
|
96 |
+
}else
|
97 |
+
{
|
98 |
+
$('.log_view_tb_tbody').append(data.html);
|
99 |
+
}
|
100 |
+
if(data.finished)
|
101 |
+
{
|
102 |
+
$('.wt_iew_history_loadmore_btn').hide();
|
103 |
+
}else
|
104 |
+
{
|
105 |
+
if(offset==0)
|
106 |
+
{
|
107 |
+
$('.wt_iew_history_loadmore_btn').unbind('click').click(function(){
|
108 |
+
wt_iew_basic_history.load_page(history_id);
|
109 |
+
});
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}else
|
113 |
+
{
|
114 |
+
$('.wt_iew_log_loader').html(wt_iew_basic_params.msgs.error);
|
115 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
116 |
+
}
|
117 |
+
},
|
118 |
+
error:function()
|
119 |
+
{
|
120 |
+
$('.wt_iew_log_loader').html(wt_iew_basic_params.msgs.error);
|
121 |
+
$('.wt_iew_history_loadmore_btn').show();
|
122 |
+
$('.wt_iew_history_loadmore_loading').hide();
|
123 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
124 |
+
}
|
125 |
+
});
|
126 |
+
},
|
127 |
+
reg_delete:function()
|
128 |
+
{
|
129 |
+
jQuery('.wt_iew_delete_history, .wt_iew_delete_log').click(function(){
|
130 |
+
if(confirm(wt_iew_history_basic_params.msgs.sure))
|
131 |
+
{
|
132 |
+
window.location.href=jQuery(this).attr('data-href');
|
133 |
+
}
|
134 |
+
});
|
135 |
+
},
|
136 |
+
reg_bulk_action:function()
|
137 |
+
{
|
138 |
+
var checkbox_main=$('.wt_iew_history_checkbox_main');
|
139 |
+
var checkbox_sub=$('.wt_iew_history_checkbox_sub');
|
140 |
+
var tb=$('.history_list_tb');
|
141 |
+
if(tb.find('.wt_iew_history_checkbox_sub:checked').length==tb.find('.wt_iew_history_checkbox_sub').length)
|
142 |
+
{
|
143 |
+
checkbox_main.prop('checked',true);
|
144 |
+
}else
|
145 |
+
{
|
146 |
+
checkbox_main.prop('checked',false);
|
147 |
+
}
|
148 |
+
|
149 |
+
checkbox_main.unbind('click').click(function()
|
150 |
+
{
|
151 |
+
if($(this).is(':checked'))
|
152 |
+
{
|
153 |
+
checkbox_sub.prop('checked',true);
|
154 |
+
}else
|
155 |
+
{
|
156 |
+
checkbox_sub.prop('checked',false);
|
157 |
+
}
|
158 |
+
});
|
159 |
+
checkbox_sub.unbind('click').click(function()
|
160 |
+
{
|
161 |
+
if($(this).is(':checked') && $('.wt_iew_history_checkbox_sub:checked').length==checkbox_sub.length)
|
162 |
+
{
|
163 |
+
checkbox_main.prop('checked',true);
|
164 |
+
}else
|
165 |
+
{
|
166 |
+
checkbox_main.prop('checked',false);
|
167 |
+
}
|
168 |
+
});
|
169 |
+
|
170 |
+
$('.wt_iew_bulk_action_btn').click(function(){
|
171 |
+
if($('.wt_iew_history_checkbox_sub:checked').length>0 && $('.wt_iew_bulk_action option:selected').val()!="")
|
172 |
+
{
|
173 |
+
var cr_action=$('.wt_iew_bulk_action option:selected').val();
|
174 |
+
if(cr_action=='delete')
|
175 |
+
{
|
176 |
+
if(confirm(wt_iew_history_basic_params.msgs.sure))
|
177 |
+
{
|
178 |
+
var id_arr=new Array();
|
179 |
+
$('.wt_iew_history_checkbox_sub:checked').each(function(){
|
180 |
+
id_arr.push($(this).val());
|
181 |
+
});
|
182 |
+
var delete_url=wt_iew_history_basic_params.delete_url.replace('_history_id_', id_arr.join(','));
|
183 |
+
window.location.href=delete_url;
|
184 |
+
}
|
185 |
+
}
|
186 |
+
}
|
187 |
+
});
|
188 |
+
}
|
189 |
+
}
|
190 |
+
return wt_iew_basic_history;
|
191 |
+
|
192 |
+
})( jQuery );
|
193 |
+
|
194 |
+
jQuery(function() {
|
195 |
+
wt_iew_basic_history.Set();
|
196 |
+
});
|
admin/modules/history/history.php
ADDED
@@ -0,0 +1,849 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* History of import/Export
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_History')){
|
13 |
+
class Wt_Import_Export_For_Woo_Basic_History
|
14 |
+
{
|
15 |
+
public $module_id='';
|
16 |
+
public static $module_id_static='';
|
17 |
+
public $module_base='history';
|
18 |
+
public static $status_arr=array();
|
19 |
+
public static $status_label_arr=array();
|
20 |
+
public static $action_label_arr=array();
|
21 |
+
public $max_records=50;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
$this->module_id=Wt_Import_Export_For_Woo_Basic::get_module_id($this->module_base);
|
26 |
+
self::$module_id_static=$this->module_id;
|
27 |
+
|
28 |
+
self::$status_arr=array(
|
29 |
+
'pending'=>0, //running...
|
30 |
+
'finished'=>1, //completed
|
31 |
+
'failed'=>2, //failed
|
32 |
+
);
|
33 |
+
|
34 |
+
self::$status_label_arr=array(
|
35 |
+
0=>__('Running/Incomplete'),
|
36 |
+
1=>__('Finished'),
|
37 |
+
2=>__('Failed'),
|
38 |
+
);
|
39 |
+
|
40 |
+
self::$action_label_arr=array(
|
41 |
+
'export'=>__('Export'),
|
42 |
+
'import'=>__('Import'),
|
43 |
+
// 'export_image'=>__('Image Export'),
|
44 |
+
);
|
45 |
+
|
46 |
+
/* Admin menu for hostory listing */
|
47 |
+
add_filter('wt_iew_admin_menu_basic', array($this, 'add_admin_pages'), 10, 1);
|
48 |
+
|
49 |
+
/* advanced plugin settings */
|
50 |
+
add_filter('wt_iew_advanced_setting_fields_basic', array($this, 'advanced_setting_fields'));
|
51 |
+
|
52 |
+
/* main ajax hook. The callback function will decide which action is to execute. */
|
53 |
+
add_action('wp_ajax_iew_history_ajax_basic', array($this, 'ajax_main'), 11);
|
54 |
+
|
55 |
+
/* Hook to perform actions after advanced settings was updated */
|
56 |
+
add_action('wt_iew_after_advanced_setting_update_basic', array($this, 'after_advanced_setting_update'), 11);
|
57 |
+
|
58 |
+
/* Download log file via nonce URL */
|
59 |
+
add_action('admin_init', array($this, 'download_file'), 11);
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Adding admin menus
|
65 |
+
*/
|
66 |
+
public function add_admin_pages($menus)
|
67 |
+
{
|
68 |
+
$menus[$this->module_base]=array(
|
69 |
+
'submenu',
|
70 |
+
WT_IEW_PLUGIN_ID_BASIC,
|
71 |
+
__('History'),
|
72 |
+
__('History'),
|
73 |
+
'manage_options',
|
74 |
+
$this->module_id,
|
75 |
+
array($this, 'admin_settings_page')
|
76 |
+
);
|
77 |
+
$menus[$this->module_base.'_log']=array(
|
78 |
+
'submenu',
|
79 |
+
WT_IEW_PLUGIN_ID_BASIC,
|
80 |
+
__('Logs'),
|
81 |
+
__('Logs'),
|
82 |
+
'manage_options',
|
83 |
+
$this->module_id.'_log',
|
84 |
+
array($this, 'admin_log_page')
|
85 |
+
);
|
86 |
+
return $menus;
|
87 |
+
}
|
88 |
+
|
89 |
+
public function ajax_main()
|
90 |
+
{
|
91 |
+
if(Wt_Iew_Sh::check_write_access(WT_IEW_PLUGIN_ID_BASIC))
|
92 |
+
{
|
93 |
+
$allowed_ajax_actions=array('view_log');
|
94 |
+
|
95 |
+
$out=array(
|
96 |
+
'status'=>0,
|
97 |
+
'msg'=>__('Error'),
|
98 |
+
);
|
99 |
+
|
100 |
+
$history_action=Wt_Iew_Sh::sanitize_item($_POST['history_action'], 'text');
|
101 |
+
$data_type=Wt_Iew_Sh::sanitize_item($_POST['data_type'], 'text');
|
102 |
+
|
103 |
+
if(method_exists($this, $history_action) && in_array($history_action, $allowed_ajax_actions))
|
104 |
+
{
|
105 |
+
$out=$this->{$history_action}($out);
|
106 |
+
}
|
107 |
+
|
108 |
+
if($data_type=='json')
|
109 |
+
{
|
110 |
+
echo json_encode($out);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
exit();
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Ajax sub function to display logs
|
118 |
+
*
|
119 |
+
*/
|
120 |
+
private function view_log($out)
|
121 |
+
{
|
122 |
+
$history_id=(isset($_POST['history_id']) ? absint($_POST['history_id']) : 0);
|
123 |
+
$out['html']='';
|
124 |
+
|
125 |
+
if($history_id>0)
|
126 |
+
{
|
127 |
+
$offset=(isset($_POST['offset']) ? absint($_POST['offset']) : 0);
|
128 |
+
$out['offset']=$offset;
|
129 |
+
$out['history_id']=$history_id;
|
130 |
+
|
131 |
+
$history_item=$this->get_history_entry_by_id($history_id);
|
132 |
+
if($history_item) //history item exists
|
133 |
+
{
|
134 |
+
$action_type=$history_item['template_type'];
|
135 |
+
if($action_type=='import' && Wt_Import_Export_For_Woo_Admin_Basic::module_exists($action_type))
|
136 |
+
{
|
137 |
+
$action_module_obj=Wt_Import_Export_For_Woo_Basic::load_modules($action_type);
|
138 |
+
$log_file_name=$action_module_obj->get_log_file_name($history_item['id']);
|
139 |
+
$log_file_path=$action_module_obj->get_file_path($log_file_name);
|
140 |
+
if(file_exists($log_file_path))
|
141 |
+
{
|
142 |
+
include_once WT_U_IEW_PLUGIN_PATH.'admin/classes/class-logreader.php';
|
143 |
+
$reader=new Wt_Import_Export_For_Woo_Basic_Logreader();
|
144 |
+
$response=$reader->get_data_as_batch($log_file_path, $offset);
|
145 |
+
if($response['response'])
|
146 |
+
{
|
147 |
+
$log_list=$response['data_arr'];
|
148 |
+
$out['offset']=$response['offset'];
|
149 |
+
$out['status']=1;
|
150 |
+
$out['finished']=$response['finished'];
|
151 |
+
|
152 |
+
$is_finished=$response['finished'];
|
153 |
+
$new_offset=$response['offset'];
|
154 |
+
|
155 |
+
$show_item_details=false;
|
156 |
+
$item_type_module_obj=Wt_Import_Export_For_Woo_Basic::load_modules($history_item['item_type']);
|
157 |
+
if(!is_null($item_type_module_obj) && method_exists($item_type_module_obj, 'get_item_by_id'))
|
158 |
+
{
|
159 |
+
$show_item_details=true;
|
160 |
+
}
|
161 |
+
ob_start();
|
162 |
+
include plugin_dir_path(__FILE__).'views/_log_table.php';
|
163 |
+
$out['html']=ob_get_clean();
|
164 |
+
}
|
165 |
+
}
|
166 |
+
}
|
167 |
+
}
|
168 |
+
}else /* raw log viewing */
|
169 |
+
{
|
170 |
+
$log_file_name=(isset($_POST['log_file']) ? sanitize_text_field($_POST['log_file']) : '');
|
171 |
+
if($log_file_name!="")
|
172 |
+
{
|
173 |
+
$ext_arr=explode(".", $log_file_name);
|
174 |
+
$ext=end($ext_arr);
|
175 |
+
if($ext=='log')
|
176 |
+
{
|
177 |
+
$log_file_path=Wt_Import_Export_For_Woo_Basic_Log::get_file_path($log_file_name);
|
178 |
+
if(file_exists($log_file_path))
|
179 |
+
{
|
180 |
+
include_once WT_U_IEW_PLUGIN_PATH.'admin/classes/class-logreader.php';
|
181 |
+
$reader=new Wt_Import_Export_For_Woo_Basic_Logreader();
|
182 |
+
$response=$reader->get_full_data($log_file_path);
|
183 |
+
|
184 |
+
$out['status']=1;
|
185 |
+
$out['html']='<div class="wt_iew_raw_log">'.nl2br(esc_html__($response['data_str'])).'</div>';
|
186 |
+
}
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
}
|
191 |
+
return $out;
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Fields for advanced settings
|
196 |
+
*
|
197 |
+
*/
|
198 |
+
public function advanced_setting_fields($fields)
|
199 |
+
{
|
200 |
+
$fields['enable_history_auto_delete']=array(
|
201 |
+
'label'=>__("Enable history auto delete"),
|
202 |
+
'type'=>'radio',
|
203 |
+
'radio_fields'=>array(
|
204 |
+
1=>__('Yes'),
|
205 |
+
0=>__('No')
|
206 |
+
),
|
207 |
+
'value' =>1,
|
208 |
+
'field_name'=>'enable_history_auto_delete',
|
209 |
+
'help_text'=>__('Enable auto delete for records within the history section.'),
|
210 |
+
'validation_rule'=>array('type'=>'absint'),
|
211 |
+
'form_toggler'=>array(
|
212 |
+
'type'=>'parent',
|
213 |
+
'target'=>'wt_iew_enable_history_auto_delete',
|
214 |
+
),
|
215 |
+
);
|
216 |
+
|
217 |
+
$fields['auto_delete_history_count']=array(
|
218 |
+
'label'=>__("Maximum entries"),
|
219 |
+
'type'=>'number',
|
220 |
+
'value' =>100,
|
221 |
+
'attr' =>array(
|
222 |
+
'style'=>'width:30%;',
|
223 |
+
),
|
224 |
+
'field_name'=>'auto_delete_history_count',
|
225 |
+
'help_text'=>__('Indicates the maximum records to retain in history. Limit the number of records with status ‘Finished’. E.g if you input a count of 50 the system will retain only the most recent 50 number of records with status ‘Finished’. All other records of any other status e.g In Progress(that maybe active as a part of the cron operation) will not be impacted by this count.'),
|
226 |
+
'validation_rule'=>array('type'=>'absint'),
|
227 |
+
'form_toggler'=>array(
|
228 |
+
'type'=>'child',
|
229 |
+
'id'=>'wt_iew_enable_history_auto_delete',
|
230 |
+
'val'=>1,
|
231 |
+
),
|
232 |
+
);
|
233 |
+
|
234 |
+
return $fields;
|
235 |
+
}
|
236 |
+
|
237 |
+
public function admin_log_page($args)
|
238 |
+
{
|
239 |
+
/* delete action */
|
240 |
+
if(isset($_GET['wt_iew_delete_log']))
|
241 |
+
{
|
242 |
+
if(Wt_Iew_Sh::check_write_access(WT_IEW_PLUGIN_ID_BASIC))
|
243 |
+
{
|
244 |
+
$log_file_name=(isset($_GET['wt_iew_log_file']) ? sanitize_text_field($_GET['wt_iew_log_file']) : '');
|
245 |
+
if($log_file_name!="")
|
246 |
+
{
|
247 |
+
$ext_arr=explode(".", $log_file_name);
|
248 |
+
$ext=end($ext_arr);
|
249 |
+
if($ext=='log')
|
250 |
+
{
|
251 |
+
$log_file_path=Wt_Import_Export_For_Woo_Basic_Log::get_file_path($log_file_name);
|
252 |
+
if(file_exists($log_file_path) && is_file($log_file_path))
|
253 |
+
{
|
254 |
+
@unlink($log_file_path);
|
255 |
+
}
|
256 |
+
}
|
257 |
+
}
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
$delete_url_params['wt_iew_delete_log']=1;
|
262 |
+
$delete_url_params['wt_iew_log_file']='_log_file_';
|
263 |
+
$delete_url_params['page']=$this->module_id.'_log';
|
264 |
+
$delete_url=wp_nonce_url(admin_url('admin.php?'.http_build_query($delete_url_params)), WT_IEW_PLUGIN_ID_BASIC);
|
265 |
+
|
266 |
+
$download_url=wp_nonce_url(admin_url('admin.php?wt_iew_log_download=1&file=_log_file_'), WT_IEW_PLUGIN_ID_BASIC);
|
267 |
+
|
268 |
+
//enqueue script
|
269 |
+
if(isset($_GET['page']) && $_GET['page']==$this->module_id.'_log')
|
270 |
+
{
|
271 |
+
$this->enqueue_scripts($delete_url);
|
272 |
+
}
|
273 |
+
|
274 |
+
include plugin_dir_path(__FILE__).'views/settings.php';
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* History list page
|
279 |
+
*/
|
280 |
+
public function admin_settings_page($args)
|
281 |
+
{
|
282 |
+
global $wpdb;
|
283 |
+
|
284 |
+
/* delete action */
|
285 |
+
if(isset($_GET['wt_iew_delete_history']))
|
286 |
+
{
|
287 |
+
if(Wt_Iew_Sh::check_write_access(WT_IEW_PLUGIN_ID_BASIC))
|
288 |
+
{
|
289 |
+
$history_id_arr=isset($_GET['wt_iew_history_id']) ? explode(",", $_GET['wt_iew_history_id']) : array();
|
290 |
+
$history_id_arr=Wt_Iew_Sh::sanitize_item($history_id_arr, 'absint_arr');
|
291 |
+
if(count($history_id_arr)>0)
|
292 |
+
{
|
293 |
+
self::delete_history_by_id($history_id_arr);
|
294 |
+
}
|
295 |
+
}
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Lising page section
|
300 |
+
*/
|
301 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$history_tb;
|
302 |
+
|
303 |
+
$post_type_arr=self::get_disticnt_items('item_type');
|
304 |
+
$action_type_arr=self::get_disticnt_items('template_type');
|
305 |
+
$status_arr=self::get_disticnt_items('status');
|
306 |
+
|
307 |
+
$importer_post_types=apply_filters('wt_iew_importer_post_types_basic', array());
|
308 |
+
$exporter_post_types=apply_filters('wt_iew_exporter_post_types_basic', array());
|
309 |
+
$post_type_label_arr=array_merge($importer_post_types, $exporter_post_types);
|
310 |
+
|
311 |
+
|
312 |
+
/**
|
313 |
+
* Get history entries by Schedule ID
|
314 |
+
*/
|
315 |
+
$cron_id=(isset($_GET['wt_iew_cron_id']) ? absint($_GET['wt_iew_cron_id']) : 0);
|
316 |
+
$history_arr=array();
|
317 |
+
$list_by_cron=false;
|
318 |
+
if($cron_id>0)
|
319 |
+
{
|
320 |
+
$cron_module_obj=Wt_Import_Export_For_Woo_Basic::load_modules('cron');
|
321 |
+
if(!is_null($cron_module_obj))
|
322 |
+
{
|
323 |
+
$cron_data=$cron_module_obj->get_cron_by_id($cron_id);
|
324 |
+
if($cron_data)
|
325 |
+
{
|
326 |
+
$history_id_arr=($cron_data['history_id_list']!="" ? maybe_unserialize($cron_data['history_id_list']) : array());
|
327 |
+
$history_id_arr=(is_array($history_id_arr) ? $history_id_arr : array());
|
328 |
+
$list_by_cron=true;
|
329 |
+
}else
|
330 |
+
{
|
331 |
+
$cron_id=0; //invalid cron id
|
332 |
+
}
|
333 |
+
}else
|
334 |
+
{
|
335 |
+
$cron_id=0; //cron module not enabled
|
336 |
+
}
|
337 |
+
}
|
338 |
+
|
339 |
+
|
340 |
+
/**
|
341 |
+
* Filter by form fields
|
342 |
+
*/
|
343 |
+
$filter_by=array(
|
344 |
+
'item_type'=>array(
|
345 |
+
'label'=>__('Post type'),
|
346 |
+
'values'=>$post_type_arr,
|
347 |
+
'val_labels'=>$post_type_label_arr,
|
348 |
+
'val_type'=>'%s',
|
349 |
+
'selected_val'=>'',
|
350 |
+
),
|
351 |
+
'template_type'=>array(
|
352 |
+
'label'=>__('Action type'),
|
353 |
+
'values'=>$action_type_arr,
|
354 |
+
'val_labels'=>self::$action_label_arr,
|
355 |
+
'val_type'=>'%s',
|
356 |
+
'selected_val'=>'',
|
357 |
+
),
|
358 |
+
'status'=>array(
|
359 |
+
'label'=>__('Status'),
|
360 |
+
'values'=>$status_arr,
|
361 |
+
'val_labels'=>self::$status_label_arr,
|
362 |
+
'validation_rule'=>array('type'=>'absint'),
|
363 |
+
'val_type'=>'%d',
|
364 |
+
'selected_val'=>'',
|
365 |
+
),
|
366 |
+
);
|
367 |
+
|
368 |
+
if($list_by_cron) // no need of these filters in `cron by` listing
|
369 |
+
{
|
370 |
+
unset($filter_by['item_type']);
|
371 |
+
unset($filter_by['template_type']);
|
372 |
+
}
|
373 |
+
|
374 |
+
|
375 |
+
/**
|
376 |
+
* Order by field vals
|
377 |
+
*/
|
378 |
+
$order_by=array(
|
379 |
+
'date_desc'=>array('label'=>__('Date descending'), 'sql'=>'created_at DESC'),
|
380 |
+
'date_asc'=>array('label'=>__('Date ascending'), 'sql'=>'created_at ASC'),
|
381 |
+
);
|
382 |
+
|
383 |
+
/* just applying a text validation */
|
384 |
+
$conf_arr=isset($_GET['wt_iew_history']) ? Wt_Iew_Sh::sanitize_item($_GET['wt_iew_history'], 'text_arr') : array();
|
385 |
+
$url_params_allowed=array(); //this array will only include the allowed $_GET params. This will use in pagination section
|
386 |
+
|
387 |
+
/**
|
388 |
+
* Filter by block
|
389 |
+
*/
|
390 |
+
$where_qry_val_arr=array(); //sql query WHERE clause val array
|
391 |
+
$where_qry_format_arr=array(); //sql query WHERE clause val format array
|
392 |
+
if(isset($conf_arr['filter_by'])) /* filter by GET var exists */
|
393 |
+
{
|
394 |
+
$url_params_allowed['filter_by']=array();/* for pagination purpose */
|
395 |
+
|
396 |
+
$filter_by_conf=(is_array($conf_arr['filter_by']) ? $conf_arr['filter_by'] : array());
|
397 |
+
$filter_by_validation_rule=Wt_Import_Export_For_Woo_Basic_Common_Helper::extract_validation_rules($filter_by);
|
398 |
+
foreach ($filter_by as $filter_key => $filter_val)
|
399 |
+
{
|
400 |
+
if(isset($filter_by_conf[$filter_key]) && trim($filter_by_conf[$filter_key])!="") //current filter applied
|
401 |
+
{
|
402 |
+
$where_qry_format_arr[]=$filter_key.'='.$filter_val['val_type'];
|
403 |
+
$filter_by[$filter_key]['selected_val']=Wt_Iew_Sh::sanitize_data($filter_by_conf[$filter_key], $filter_key, $filter_by_validation_rule);
|
404 |
+
$where_qry_val_arr[]=$filter_by[$filter_key]['selected_val'];
|
405 |
+
|
406 |
+
$url_params_allowed['filter_by'][$filter_key]=$filter_by[$filter_key]['selected_val']; /* for pagination purpose */
|
407 |
+
}
|
408 |
+
}
|
409 |
+
}
|
410 |
+
|
411 |
+
/**
|
412 |
+
* Order by block
|
413 |
+
*/
|
414 |
+
$default_order_by=array_keys($order_by)[0];
|
415 |
+
$order_by_val=$default_order_by;
|
416 |
+
$order_qry_val_arr=array(); //sql query ORDER clause val array
|
417 |
+
if(isset($conf_arr['order_by'])) /* order by GET var exists */
|
418 |
+
{
|
419 |
+
$order_by_val=(is_array($conf_arr['order_by']) ? $default_order_by : $conf_arr['order_by']);
|
420 |
+
}
|
421 |
+
if(isset($order_by[$order_by_val]))
|
422 |
+
{
|
423 |
+
$order_qry_val_arr[]=$order_by[$order_by_val]['sql'];
|
424 |
+
$url_params_allowed['order_by']=$order_by_val; /* for pagination purpose */
|
425 |
+
}
|
426 |
+
|
427 |
+
/**
|
428 |
+
* Pagination block
|
429 |
+
*/
|
430 |
+
$max_data=(isset($conf_arr['max_data']) ? absint($conf_arr['max_data']) : $this->max_records);
|
431 |
+
$this->max_records=($max_data>0 ? $max_data : $this->max_records);
|
432 |
+
|
433 |
+
$offset=(isset($_GET['offset']) ? absint($_GET['offset']) : 0);
|
434 |
+
$url_params_allowed['max_data']=$this->max_records;
|
435 |
+
$pagination_url_params=array('wt_iew_history'=>$url_params_allowed, 'page'=>$this->module_id);
|
436 |
+
$offset_qry_str=" LIMIT $offset, ".$this->max_records;
|
437 |
+
$no_records=false;
|
438 |
+
|
439 |
+
if($list_by_cron) /* list by cron */
|
440 |
+
{
|
441 |
+
$pagination_url_params['wt_iew_cron_id']=$cron_id; /* adding cron id to URL params */
|
442 |
+
|
443 |
+
$total_history_ids=count($history_id_arr);
|
444 |
+
if($total_history_ids>0)
|
445 |
+
{
|
446 |
+
$where_qry_format_arr[]='id IN('.implode(",", array_fill(0, $total_history_ids, "%d")).")";
|
447 |
+
$where_qry_val_arr=array_merge($where_qry_val_arr, $history_id_arr);
|
448 |
+
|
449 |
+
}else //reset all where, order by queries
|
450 |
+
{
|
451 |
+
$where_qry_format_arr=array();
|
452 |
+
$where_qry_val_arr=array();
|
453 |
+
//$order_qry_val_arr=array();
|
454 |
+
$no_records=true;
|
455 |
+
}
|
456 |
+
}
|
457 |
+
|
458 |
+
$where_qry=(count($where_qry_format_arr)>0 ? ' WHERE '.implode(" AND ", $where_qry_format_arr) : '');
|
459 |
+
$orderby_qry=(count($order_qry_val_arr)>0 ? ' ORDER BY '.implode(", ", $order_qry_val_arr) : '');
|
460 |
+
|
461 |
+
/* prepare SQL */
|
462 |
+
$num_sql="SELECT COUNT(id) AS total_records FROM $tb $where_qry";
|
463 |
+
$list_sql="SELECT * FROM $tb $where_qry $orderby_qry ".$offset_qry_str;
|
464 |
+
|
465 |
+
if(count($where_qry_format_arr)>0)
|
466 |
+
{
|
467 |
+
$num_sql=$wpdb->prepare($num_sql, $where_qry_val_arr);
|
468 |
+
$list_sql=$wpdb->prepare($list_sql, $where_qry_val_arr);
|
469 |
+
}
|
470 |
+
|
471 |
+
if($no_records) /* in list_by cron, history IDs are not available */
|
472 |
+
{
|
473 |
+
$total_records=0;
|
474 |
+
$history_list=array();
|
475 |
+
}else
|
476 |
+
{
|
477 |
+
$total_records=$wpdb->get_row($num_sql, ARRAY_A);
|
478 |
+
$total_records=($total_records && isset($total_records['total_records']) ? $total_records['total_records'] : 0);
|
479 |
+
|
480 |
+
$history_list=$wpdb->get_results($list_sql, ARRAY_A);
|
481 |
+
$history_list=($history_list ? $history_list : array());
|
482 |
+
}
|
483 |
+
|
484 |
+
$delete_url_params=$pagination_url_params;
|
485 |
+
$delete_url_params['wt_iew_delete_history']=1;
|
486 |
+
$delete_url_params['wt_iew_history_id']='_history_id_';
|
487 |
+
$delete_url_params['offset']=$offset;
|
488 |
+
$delete_url=wp_nonce_url(admin_url('admin.php?'.http_build_query($delete_url_params)), WT_IEW_PLUGIN_ID_BASIC);
|
489 |
+
|
490 |
+
//enqueue script
|
491 |
+
if(isset($_GET['page']) && $_GET['page']==$this->module_id)
|
492 |
+
{
|
493 |
+
$this->enqueue_scripts($delete_url);
|
494 |
+
}
|
495 |
+
|
496 |
+
|
497 |
+
include plugin_dir_path(__FILE__).'views/settings.php';
|
498 |
+
}
|
499 |
+
|
500 |
+
private function enqueue_scripts($delete_url)
|
501 |
+
{
|
502 |
+
if(Wt_Import_Export_For_Woo_Basic_Common_Helper::wt_is_screen_allowed()){
|
503 |
+
wp_enqueue_script($this->module_id, plugin_dir_url(__FILE__).'assets/js/main.js', array('jquery'), WT_U_IEW_VERSION, false);
|
504 |
+
|
505 |
+
$params=array(
|
506 |
+
'delete_url'=>$delete_url,
|
507 |
+
'msgs'=>array(
|
508 |
+
'sure'=>__('Are you sure?'),
|
509 |
+
)
|
510 |
+
);
|
511 |
+
wp_localize_script($this->module_id, 'wt_iew_history_basic_params', $params);
|
512 |
+
}
|
513 |
+
}
|
514 |
+
|
515 |
+
public static function record_failure($history_id, $msg)
|
516 |
+
{
|
517 |
+
$update_data=array(
|
518 |
+
'status'=>self::$status_arr['failed'],
|
519 |
+
'status_text'=>$msg //no need to add translation function
|
520 |
+
);
|
521 |
+
$update_data_type=array(
|
522 |
+
'%d',
|
523 |
+
'%s',
|
524 |
+
);
|
525 |
+
self::update_history_entry($history_id, $update_data, $update_data_type);
|
526 |
+
}
|
527 |
+
|
528 |
+
/**
|
529 |
+
* Delete history entry from DB and also associated files (Export files only)
|
530 |
+
* @param array|int $id history entry IDs
|
531 |
+
*/
|
532 |
+
public static function delete_history_by_id($id)
|
533 |
+
{
|
534 |
+
global $wpdb;
|
535 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$history_tb;
|
536 |
+
if(is_array($id))
|
537 |
+
{
|
538 |
+
$where=" IN(".implode(",", array_fill(0, count($id), '%d')).")";
|
539 |
+
$where_data=$id;
|
540 |
+
}else
|
541 |
+
{
|
542 |
+
$where="=%d";
|
543 |
+
$where_data=array($id);
|
544 |
+
}
|
545 |
+
|
546 |
+
//first remove files associated with it. give argument as array then no need to check the result array type
|
547 |
+
$allowed_ext_arr=array('csv', 'xml'); //please update this array if new file types introduced
|
548 |
+
$list=self::get_history_entry_by_id($where_data);
|
549 |
+
if($list)
|
550 |
+
{
|
551 |
+
foreach($list as $listv)
|
552 |
+
{
|
553 |
+
if($listv['template_type']=='export') //history is for export action
|
554 |
+
{
|
555 |
+
if(Wt_Import_Export_For_Woo_Admin_Basic::module_exists('export'))
|
556 |
+
{
|
557 |
+
$ext_arr=explode('.', $listv['file_name']);
|
558 |
+
$ext=end($ext_arr);
|
559 |
+
if(in_array($ext, $allowed_ext_arr)) /* delete only allowed extensions */
|
560 |
+
{
|
561 |
+
$file_path=Wt_Import_Export_For_Woo_Basic_Export::get_file_path($listv['file_name']);
|
562 |
+
if($file_path && file_exists($file_path))
|
563 |
+
{
|
564 |
+
@unlink($file_path);
|
565 |
+
}
|
566 |
+
}
|
567 |
+
}
|
568 |
+
}elseif($listv['template_type']=='import')
|
569 |
+
{
|
570 |
+
$action_module_obj=Wt_Import_Export_For_Woo_Basic::load_modules('import');
|
571 |
+
|
572 |
+
$log_file_name=$action_module_obj->get_log_file_name($listv['id']);
|
573 |
+
$log_file_path=$action_module_obj->get_file_path($log_file_name);
|
574 |
+
if(file_exists($log_file_path))
|
575 |
+
{
|
576 |
+
@unlink($log_file_path);
|
577 |
+
}
|
578 |
+
}
|
579 |
+
}
|
580 |
+
}
|
581 |
+
|
582 |
+
|
583 |
+
$wpdb->query(
|
584 |
+
$wpdb->prepare("DELETE FROM $tb WHERE id".$where, $where_data)
|
585 |
+
);
|
586 |
+
}
|
587 |
+
|
588 |
+
public static function update_history_entry($history_id, $update_data, $update_data_type)
|
589 |
+
{
|
590 |
+
global $wpdb;
|
591 |
+
//updating the data
|
592 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$history_tb;
|
593 |
+
$update_where=array(
|
594 |
+
'id'=>$history_id
|
595 |
+
);
|
596 |
+
$update_where_type=array(
|
597 |
+
'%d'
|
598 |
+
);
|
599 |
+
if($wpdb->update($tb, $update_data, $update_where, $update_data_type, $update_where_type)!==false)
|
600 |
+
{
|
601 |
+
return true;
|
602 |
+
}
|
603 |
+
return false;
|
604 |
+
}
|
605 |
+
|
606 |
+
/**
|
607 |
+
* Mathod perform actions after advanced settings was updated
|
608 |
+
*
|
609 |
+
*/
|
610 |
+
public function after_advanced_setting_update($advanced_settings)
|
611 |
+
{
|
612 |
+
/* Check auto deletion enabled */
|
613 |
+
if(isset($advanced_settings['wt_iew_enable_history_auto_delete']) && $advanced_settings['wt_iew_enable_history_auto_delete']==1)
|
614 |
+
{
|
615 |
+
$record_count=(isset($advanced_settings['wt_iew_auto_delete_history_count']) ? absint($advanced_settings['wt_iew_auto_delete_history_count']) : 0);
|
616 |
+
if($record_count>0)
|
617 |
+
{
|
618 |
+
self::auto_delete_history_entry($record_count);
|
619 |
+
}
|
620 |
+
}
|
621 |
+
}
|
622 |
+
|
623 |
+
/**
|
624 |
+
* Check and delete history entry. If auto deletion enabled
|
625 |
+
*
|
626 |
+
*/
|
627 |
+
public static function auto_delete_history_entry($record_count=0)
|
628 |
+
{
|
629 |
+
if($record_count==0) /* this condition is for, some requests will come from create section or some from advanced settings section */
|
630 |
+
{
|
631 |
+
if(Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('enable_history_auto_delete')==1)
|
632 |
+
{
|
633 |
+
$record_count=absint(Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('auto_delete_history_count'));
|
634 |
+
}
|
635 |
+
}
|
636 |
+
if($record_count>=1)
|
637 |
+
{
|
638 |
+
global $wpdb;
|
639 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$history_tb;
|
640 |
+
|
641 |
+
$data=$wpdb->get_results("SELECT * FROM $tb WHERE status=".self::$status_arr['finished']." AND id<(SELECT id FROM $tb ORDER BY id DESC LIMIT ".($record_count-1).",1)", ARRAY_A);
|
642 |
+
|
643 |
+
if($data && is_array($data))
|
644 |
+
{
|
645 |
+
$id_arr=array_column($data, 'id');
|
646 |
+
self::delete_history_by_id($id_arr);
|
647 |
+
}
|
648 |
+
}
|
649 |
+
}
|
650 |
+
|
651 |
+
/**
|
652 |
+
* create a history entry before starting export/import
|
653 |
+
* @param $file_name String export/import file name
|
654 |
+
* @param $form_data Array export/import formdata
|
655 |
+
* @param $action String export or import
|
656 |
+
* @return $history_id Int DB id if success otherwise zero
|
657 |
+
*/
|
658 |
+
public static function create_history_entry($file_name, $form_data, $to_process, $action)
|
659 |
+
{
|
660 |
+
global $wpdb;
|
661 |
+
|
662 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$history_tb;
|
663 |
+
$insert_data=array(
|
664 |
+
'template_type'=>$action,
|
665 |
+
'item_type'=>$to_process, //item type Eg: product
|
666 |
+
'file_name'=>$file_name, //export/import file name
|
667 |
+
'created_at'=>time(), //craeted time
|
668 |
+
'data'=>maybe_serialize($form_data), //formadata
|
669 |
+
'status'=>self::$status_arr['pending'], //pending
|
670 |
+
'status_text'=>'Pending', //pending, No need to add translate function. we can add this on printing page
|
671 |
+
'offset'=>0, //current offset, its always 0 on start
|
672 |
+
'total'=>0, //total records, not available now
|
673 |
+
);
|
674 |
+
$insert_data_type=array(
|
675 |
+
'%s','%s','%s','%d','%s','%d','%d','%d'
|
676 |
+
);
|
677 |
+
|
678 |
+
$insert_response=$wpdb->insert($tb, $insert_data, $insert_data_type);
|
679 |
+
|
680 |
+
/* check for auto delete */
|
681 |
+
self::auto_delete_history_entry();
|
682 |
+
|
683 |
+
if($insert_response) //success
|
684 |
+
{
|
685 |
+
return $wpdb->insert_id;
|
686 |
+
}
|
687 |
+
return 0;
|
688 |
+
}
|
689 |
+
|
690 |
+
/**
|
691 |
+
* Get distinct column values from history table
|
692 |
+
* @param string $column table column name
|
693 |
+
* @return array array of distinct column values
|
694 |
+
*/
|
695 |
+
private static function get_disticnt_items($column)
|
696 |
+
{
|
697 |
+
global $wpdb;
|
698 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$history_tb;
|
699 |
+
$data=$wpdb->get_results("SELECT DISTINCT $column FROM $tb ORDER BY $column ASC", ARRAY_A);
|
700 |
+
$data=is_array($data) ? $data : array();
|
701 |
+
return array_column($data, $column);
|
702 |
+
}
|
703 |
+
|
704 |
+
/**
|
705 |
+
* Taking history entry by ID
|
706 |
+
*/
|
707 |
+
public static function get_history_entry_by_id($id)
|
708 |
+
{
|
709 |
+
global $wpdb;
|
710 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$history_tb;
|
711 |
+
if(is_array($id))
|
712 |
+
{
|
713 |
+
$where=" IN(".implode(",", array_fill(0, count($id), '%d')).")";
|
714 |
+
$where_data=$id;
|
715 |
+
}else
|
716 |
+
{
|
717 |
+
$where="=%d";
|
718 |
+
$where_data=array($id);
|
719 |
+
}
|
720 |
+
$qry=$wpdb->prepare("SELECT * FROM $tb WHERE id".$where, $where_data);
|
721 |
+
|
722 |
+
if(!is_array($id))
|
723 |
+
{
|
724 |
+
return $wpdb->get_row($qry, ARRAY_A);
|
725 |
+
}else
|
726 |
+
{
|
727 |
+
return $wpdb->get_results($qry, ARRAY_A);
|
728 |
+
}
|
729 |
+
}
|
730 |
+
|
731 |
+
|
732 |
+
/**
|
733 |
+
* Download log file via a nonce URL
|
734 |
+
*/
|
735 |
+
public function download_file()
|
736 |
+
{
|
737 |
+
if(isset($_GET['wt_iew_log_download']))
|
738 |
+
{
|
739 |
+
if(Wt_Iew_Sh::check_write_access(WT_IEW_PLUGIN_ID_BASIC)) /* check nonce and role */
|
740 |
+
{
|
741 |
+
$file_name=(isset($_GET['file']) ? sanitize_text_field($_GET['file']) : '');
|
742 |
+
if($file_name!="")
|
743 |
+
{
|
744 |
+
$file_arr=explode(".", $file_name);
|
745 |
+
$file_ext=end($file_arr);
|
746 |
+
if($file_ext=='log') /* Only allowed files. */
|
747 |
+
{
|
748 |
+
$file_path=Wt_Import_Export_For_Woo_Basic_Log::get_file_path($file_name);
|
749 |
+
if(file_exists($file_path) && is_file($file_path))
|
750 |
+
{
|
751 |
+
header('Pragma: public');
|
752 |
+
header('Expires: 0');
|
753 |
+
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
754 |
+
header('Cache-Control: private', false);
|
755 |
+
header('Content-Transfer-Encoding: binary');
|
756 |
+
header('Content-Disposition: attachment; filename="'.$file_name.'";');
|
757 |
+
header('Content-Description: File Transfer');
|
758 |
+
header('Content-Type: application/octet-stream');
|
759 |
+
//header('Content-Length: '.filesize($file_path));
|
760 |
+
|
761 |
+
$chunk_size=1024 * 1024;
|
762 |
+
$handle=@fopen($file_path, 'rb');
|
763 |
+
while(!feof($handle))
|
764 |
+
{
|
765 |
+
$buffer = fread($handle, $chunk_size);
|
766 |
+
echo $buffer;
|
767 |
+
ob_flush();
|
768 |
+
flush();
|
769 |
+
}
|
770 |
+
fclose($handle);
|
771 |
+
exit();
|
772 |
+
|
773 |
+
}
|
774 |
+
}
|
775 |
+
}
|
776 |
+
}
|
777 |
+
}
|
778 |
+
}
|
779 |
+
|
780 |
+
|
781 |
+
/**
|
782 |
+
*
|
783 |
+
* Generate pagination HTML
|
784 |
+
*/
|
785 |
+
public static function gen_pagination_html($total, $limit, $offset, $url, $url_params=array(), $mxnav=6)
|
786 |
+
{
|
787 |
+
if($total<=0){
|
788 |
+
return '';
|
789 |
+
}
|
790 |
+
/* taking current page */
|
791 |
+
$crpage=($offset+$limit)/$limit;
|
792 |
+
|
793 |
+
$limit=$limit<=0 ? 1 : $limit;
|
794 |
+
$ttpg=ceil($total/$limit);
|
795 |
+
if($ttpg<$crpage){
|
796 |
+
//return '';
|
797 |
+
}
|
798 |
+
|
799 |
+
//calculations
|
800 |
+
$mxnav=$ttpg<$mxnav ? $ttpg : $mxnav;
|
801 |
+
|
802 |
+
$mxnav_mid=floor($mxnav/2);
|
803 |
+
$pgstart=$mxnav_mid>=$crpage ? 1 : $crpage-$mxnav_mid;
|
804 |
+
$mxnav_mid+=$mxnav_mid>=$crpage ? ($mxnav_mid-$crpage) : 0; //adjusting other half with first half balance
|
805 |
+
$pgend=$crpage+$mxnav_mid;
|
806 |
+
if($pgend>$ttpg)
|
807 |
+
{
|
808 |
+
$pgend=$ttpg;
|
809 |
+
}
|
810 |
+
|
811 |
+
$html='<span class="wt_iew_pagination_total_info">'.$total.__(' record(s)').'</span>';
|
812 |
+
$url_params_string=http_build_query($url_params);
|
813 |
+
$url_params_string=$url_params_string!="" ? '&'.$url_params_string : '';
|
814 |
+
$url=(strpos($url, '?')!==false ? $url.'&' : $url.'?');
|
815 |
+
$href_attr=' href="'.$url.'offset={offset}'.$url_params_string.'"';
|
816 |
+
|
817 |
+
$prev_onclick='';
|
818 |
+
if($crpage>1)
|
819 |
+
{
|
820 |
+
$offset=(($crpage-2)*$limit);
|
821 |
+
$prev_onclick=str_replace('{offset}', $offset, $href_attr);
|
822 |
+
}
|
823 |
+
|
824 |
+
$html.='<a class="'.($crpage>1 ? 'wt_iew_page' : 'wt_iew_pagedisabled').'"'.$prev_onclick.'>‹</a>';
|
825 |
+
for($i=$pgstart; $i<=$pgend; $i++)
|
826 |
+
{
|
827 |
+
$page_offset='';
|
828 |
+
$onclick='';
|
829 |
+
$offset=($i*$limit)-$limit;
|
830 |
+
if($i!=$crpage)
|
831 |
+
{
|
832 |
+
$onclick=str_replace('{offset}', $offset, $href_attr);
|
833 |
+
}
|
834 |
+
$html.='<a class="'.($i==$crpage ? 'wt_iew_pageactive' : 'wt_iew_page').'" '.$onclick.'>'.$i.'</a>';
|
835 |
+
}
|
836 |
+
|
837 |
+
$next_onclick='';
|
838 |
+
if($crpage<$ttpg)
|
839 |
+
{
|
840 |
+
$offset=($crpage*$limit);
|
841 |
+
$next_onclick=str_replace('{offset}', $offset, $href_attr);
|
842 |
+
}
|
843 |
+
|
844 |
+
$html.='<a class="'.($crpage<$ttpg ? 'wt_iew_page' : 'wt_iew_pagedisabled').'"'.$next_onclick.'>›</a>';
|
845 |
+
return '<div class="wt_iew_pagination"><span>'.$html.'</div>';
|
846 |
+
}
|
847 |
+
}
|
848 |
+
}
|
849 |
+
Wt_Import_Export_For_Woo_Basic::$loaded_modules['history']=new Wt_Import_Export_For_Woo_Basic_History();
|
admin/modules/history/views/_history_list.php
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt_iew_history_page">
|
7 |
+
<h2 class="wp-heading-inline"><?php _e('Import/Export history');?></h2>
|
8 |
+
|
9 |
+
<div style="margin-bottom:25px;">
|
10 |
+
<?php _e('Lists the runs and the status corresponding to every import/export with options to re-run, view detailed log or delete entry.');?>
|
11 |
+
</div>
|
12 |
+
|
13 |
+
|
14 |
+
<div class="wt_iew_history_settings">
|
15 |
+
<form action="admin.php">
|
16 |
+
<input type="hidden" name="page" value="<?php echo $this->module_id;?>">
|
17 |
+
<?php
|
18 |
+
if(array_filter(array_column($filter_by, 'values')))
|
19 |
+
{
|
20 |
+
?>
|
21 |
+
<div class="wt_iew_history_settings_hd"><?php _e('Filter'); ?></div>
|
22 |
+
<div class="wt_iew_history_settings_form_group_box">
|
23 |
+
<?php
|
24 |
+
foreach ($filter_by as $filter_by_key => $filter_by_value)
|
25 |
+
{
|
26 |
+
if(count($filter_by_value['values'])>0)
|
27 |
+
{
|
28 |
+
?>
|
29 |
+
<div class="wt_iew_history_settings_form_group">
|
30 |
+
<label><?php echo $filter_by_value['label']; ?></label>
|
31 |
+
<select name="wt_iew_history[filter_by][<?php echo $filter_by_key;?>]" class="wt_iew_select">
|
32 |
+
<option value=""><?php _e('All'); ?></option>
|
33 |
+
<?php
|
34 |
+
$val_labels=$filter_by_value['val_labels'];
|
35 |
+
foreach($filter_by_value['values'] as $val)
|
36 |
+
{
|
37 |
+
?>
|
38 |
+
<option value="<?php echo $val;?>" <?php echo ($filter_by_value['selected_val']==$val ? 'selected="selected"' : '');?>><?php echo (isset($val_labels[$val]) ? $val_labels[$val] : $val);?></option>
|
39 |
+
<?php
|
40 |
+
}
|
41 |
+
?>
|
42 |
+
</select>
|
43 |
+
</div>
|
44 |
+
<?php
|
45 |
+
}
|
46 |
+
}
|
47 |
+
?>
|
48 |
+
</div>
|
49 |
+
<?php
|
50 |
+
}
|
51 |
+
?>
|
52 |
+
|
53 |
+
<div class="wt_iew_history_settings_form_group_box">
|
54 |
+
<div class="wt_iew_history_settings_form_group">
|
55 |
+
<label><?php _e('Sort by'); ?></label>
|
56 |
+
<select name="wt_iew_history[order_by]" class="wt_iew_select">
|
57 |
+
<?php
|
58 |
+
foreach ($order_by as $key => $value)
|
59 |
+
{
|
60 |
+
?>
|
61 |
+
<option value="<?php echo $key;?>" <?php echo ($order_by_val==$key ? 'selected="selected"' : '');?>><?php echo $value['label'];?></option>
|
62 |
+
<?php
|
63 |
+
}
|
64 |
+
?>
|
65 |
+
</select>
|
66 |
+
</div>
|
67 |
+
<div class="wt_iew_history_settings_form_group">
|
68 |
+
<label><?php _e('Max record/page'); ?></label>
|
69 |
+
<input type="text" name="wt_iew_history[max_data]" value="<?php echo $this->max_records;?>" class="wt_iew_text" style="width:50px;">
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
<div class="wt_iew_history_settings_form_group_box">
|
73 |
+
<input type="hidden" name="offset" value="0">
|
74 |
+
<?php
|
75 |
+
if($list_by_cron) /* list by cron */
|
76 |
+
{
|
77 |
+
?>
|
78 |
+
<input type="hidden" name="wt_iew_cron_id" value="<?php echo $cron_id;?>">
|
79 |
+
<?php
|
80 |
+
}
|
81 |
+
?>
|
82 |
+
<button class="button button-primary" type="submit" style="float:left;"><?php _e('Apply'); ?></button>
|
83 |
+
</div>
|
84 |
+
</form>
|
85 |
+
</div>
|
86 |
+
|
87 |
+
<div class="wt_iew_bulk_action_box">
|
88 |
+
<select class="wt_iew_bulk_action wt_iew_select">
|
89 |
+
<option value=""><?php _e('Bulk Actions'); ?></option>
|
90 |
+
<option value="delete"><?php _e('Delete'); ?></option>
|
91 |
+
</select>
|
92 |
+
<button class="button button-primary wt_iew_bulk_action_btn" type="button" style="float:left;"><?php _e('Apply'); ?></button>
|
93 |
+
</div>
|
94 |
+
<?php
|
95 |
+
echo self::gen_pagination_html($total_records, $this->max_records, $offset, 'admin.php', $pagination_url_params);
|
96 |
+
?>
|
97 |
+
<?php
|
98 |
+
if(isset($history_list) && is_array($history_list) && count($history_list)>0)
|
99 |
+
{
|
100 |
+
?>
|
101 |
+
<table class="wp-list-table widefat fixed striped history_list_tb">
|
102 |
+
<thead>
|
103 |
+
<tr>
|
104 |
+
<th width="100">
|
105 |
+
<input type="checkbox" name="" class="wt_iew_history_checkbox_main">
|
106 |
+
<?php _e("No."); ?>
|
107 |
+
</th>
|
108 |
+
<th><?php _e("Id"); ?></th>
|
109 |
+
<th><?php _e("Action type"); ?></th>
|
110 |
+
<th><?php _e("Post type"); ?></th>
|
111 |
+
<th><?php _e("Started at"); ?></th>
|
112 |
+
<th>
|
113 |
+
<?php _e("Status"); ?>
|
114 |
+
<span class="dashicons dashicons-editor-help wt-iew-tips"
|
115 |
+
data-wt-iew-tip="
|
116 |
+
<span class='wt_iew_tooltip_span'><?php echo sprintf(__('%sSuccess%s - Process completed successfully'), '<b>', '</b>');?></span><br />
|
117 |
+
<span class='wt_iew_tooltip_span'><?php echo sprintf(__('%sFailed%s - Failed process triggered due to connection/permission or similar issues(unable to establish FTP/DB connection, write permission issues etc.)'), '<b>', '</b>');?> </span><br />
|
118 |
+
<span class='wt_iew_tooltip_span'><?php echo sprintf(__('%sRunning/Incomplete%s - Process that are running currently or that may have been terminated unknowingly(e.g, closing a browser tab while in progress etc)'), '<b>', '</b>');?> </span>">
|
119 |
+
</span>
|
120 |
+
</th>
|
121 |
+
<th>
|
122 |
+
<?php _e("Actions"); ?>
|
123 |
+
<span class="dashicons dashicons-editor-help wt-iew-tips"
|
124 |
+
data-wt-iew-tip=" <span class='wt_iew_tooltip_span'><?php _e('Re-run will take the user to the respective screen depending on the corresponding action type and the user can initiate the process accordingly.');?></span>"></span>
|
125 |
+
</th>
|
126 |
+
</tr>
|
127 |
+
</thead>
|
128 |
+
<tbody>
|
129 |
+
<?php
|
130 |
+
$i=$offset;
|
131 |
+
foreach($history_list as $key =>$history_item)
|
132 |
+
{
|
133 |
+
$i++;
|
134 |
+
?>
|
135 |
+
<tr>
|
136 |
+
<th>
|
137 |
+
<input type="checkbox" value="<?php echo $history_item['id'];?>" name="history_id[]" class="wt_iew_history_checkbox_sub">
|
138 |
+
<?php echo $i;?>
|
139 |
+
</td>
|
140 |
+
<td><?php echo $history_item['id']; ?></td>
|
141 |
+
<td><?php echo ucfirst($history_item['template_type']); ?></td>
|
142 |
+
<td><?php echo ucfirst($history_item['item_type']); ?></td>
|
143 |
+
<td><?php echo date_i18n('Y-m-d h:i:s A', $history_item['created_at']); ?></td>
|
144 |
+
<td>
|
145 |
+
<?php
|
146 |
+
echo (isset(self::$status_label_arr[$history_item['status']]) ? self::$status_label_arr[$history_item['status']] : __('Unknown'));
|
147 |
+
?>
|
148 |
+
</td>
|
149 |
+
<td>
|
150 |
+
<a class="wt_iew_delete_history" data-href="<?php echo str_replace('_history_id_', $history_item['id'], $delete_url);?>"><?php _e('Delete'); ?></a>
|
151 |
+
<?php
|
152 |
+
$form_data=maybe_unserialize($history_item['data']);
|
153 |
+
$action_type=$history_item['template_type'];
|
154 |
+
if($form_data && is_array($form_data))
|
155 |
+
{
|
156 |
+
$to_process=(isset($form_data['post_type_form_data']) && isset($form_data['post_type_form_data']['item_type']) ? $form_data['post_type_form_data']['item_type'] : '');
|
157 |
+
if($to_process!="")
|
158 |
+
{
|
159 |
+
if(Wt_Import_Export_For_Woo_Admin_Basic::module_exists($action_type))
|
160 |
+
{
|
161 |
+
$action_module_id=Wt_Import_Export_For_Woo_Basic::get_module_id($action_type);
|
162 |
+
$url=admin_url('admin.php?page='.$action_module_id.'&wt_iew_rerun='.$history_item['id']);
|
163 |
+
?>
|
164 |
+
| <a href="<?php echo $url;?>" target="_blank"><?php _e("Re-Run");?></a>
|
165 |
+
<?php
|
166 |
+
}
|
167 |
+
}
|
168 |
+
}
|
169 |
+
if($action_type=='import' && Wt_Import_Export_For_Woo_Admin_Basic::module_exists($action_type))
|
170 |
+
{
|
171 |
+
$action_module_obj=Wt_Import_Export_For_Woo_Basic::load_modules($action_type);
|
172 |
+
$log_file_name=$action_module_obj->get_log_file_name($history_item['id']);
|
173 |
+
$log_file_path=$action_module_obj->get_file_path($log_file_name);
|
174 |
+
if(file_exists($log_file_path))
|
175 |
+
{
|
176 |
+
?>
|
177 |
+
| <a class="wt_iew_view_log_btn" data-history-id="<?php echo $history_item['id'];?>"><?php _e("View log");?></a>
|
178 |
+
<?php
|
179 |
+
}
|
180 |
+
}
|
181 |
+
?>
|
182 |
+
</td>
|
183 |
+
</tr>
|
184 |
+
<?php
|
185 |
+
}
|
186 |
+
?>
|
187 |
+
</tbody>
|
188 |
+
</table>
|
189 |
+
<?php
|
190 |
+
echo self::gen_pagination_html($total_records, $this->max_records, $offset, 'admin.php', $pagination_url_params);
|
191 |
+
}else
|
192 |
+
{
|
193 |
+
?>
|
194 |
+
<h4 class="wt_iew_history_no_records"><?php _e("No records found."); ?></h4>
|
195 |
+
<?php
|
196 |
+
}
|
197 |
+
?>
|
198 |
+
</div>
|
admin/modules/history/views/_log_list.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die;
|
4 |
+
}
|
5 |
+
/* delete after redirect */
|
6 |
+
if(isset($_GET['wt_iew_delete_log']))
|
7 |
+
{
|
8 |
+
?>
|
9 |
+
<script type="text/javascript">
|
10 |
+
window.location.href='<?php echo admin_url('admin.php?page='.$this->module_id.'_log'); ?>';
|
11 |
+
</script>
|
12 |
+
<?php
|
13 |
+
}
|
14 |
+
?>
|
15 |
+
<div class="wt_iew_history_page">
|
16 |
+
<h2 class="wp-heading-inline"><?php _e('Logs');?></h2>
|
17 |
+
<p>
|
18 |
+
<?php _e('Lists developer logs mostly required for debugging purposes. Options to view detailed logs are available along with delete and download(that can be shared with the support team in case of issues).');?>
|
19 |
+
</p>
|
20 |
+
|
21 |
+
<?php
|
22 |
+
$log_path=Wt_Import_Export_For_Woo_Basic_Log::$log_dir;
|
23 |
+
$log_files = glob($log_path.'/*'.'.log');
|
24 |
+
if(is_array($log_files) && count($log_files)>0)
|
25 |
+
{
|
26 |
+
foreach ($log_files as $key => $value) {
|
27 |
+
$date_time = str_replace('.log','',substr($value, strrpos($value, '_') + 1));
|
28 |
+
$d = DateTime::createFromFormat('Y-m-d H i s A', $date_time);
|
29 |
+
if ($d == false) {
|
30 |
+
$index = $date_time;
|
31 |
+
} else {
|
32 |
+
$index = $d->getTimestamp();
|
33 |
+
}
|
34 |
+
$indexed_log_files[$index] = $value;
|
35 |
+
}
|
36 |
+
krsort($indexed_log_files);
|
37 |
+
$log_files = $indexed_log_files;
|
38 |
+
|
39 |
+
?>
|
40 |
+
<table class="wp-list-table widefat fixed striped history_list_tb log_list_tb">
|
41 |
+
<thead>
|
42 |
+
<tr>
|
43 |
+
<th class="log_file_name_col"><?php _e("File"); ?></th>
|
44 |
+
<th><?php _e("Actions"); ?></th>
|
45 |
+
</tr>
|
46 |
+
</thead>
|
47 |
+
<tbody>
|
48 |
+
<?php
|
49 |
+
foreach($log_files as $log_file)
|
50 |
+
{
|
51 |
+
$file_name=basename($log_file);
|
52 |
+
?>
|
53 |
+
<tr>
|
54 |
+
<td class="log_file_name_col"><a class="wt_iew_view_log_btn" data-log-file="<?php echo $file_name;?>"><?php echo $file_name; ?></a></td>
|
55 |
+
<td>
|
56 |
+
<a class="wt_iew_delete_log" data-href="<?php echo str_replace('_log_file_', $file_name, $delete_url);?>"><?php _e('Delete'); ?></a>
|
57 |
+
| <a class="wt_iew_view_log_btn" data-log-file="<?php echo $file_name;?>"><?php _e("View");?></a>
|
58 |
+
| <a class="wt_iew_download_log_btn" href="<?php echo str_replace('_log_file_', $file_name, $download_url);?>"><?php _e("Download");?></a>
|
59 |
+
</td>
|
60 |
+
</tr>
|
61 |
+
<?php
|
62 |
+
}
|
63 |
+
?>
|
64 |
+
</tbody>
|
65 |
+
</table>
|
66 |
+
<?php
|
67 |
+
}else
|
68 |
+
{
|
69 |
+
?>
|
70 |
+
<h4 class="wt_iew_history_no_records"><?php _e("No logs found."); ?></h4>
|
71 |
+
<?php
|
72 |
+
}
|
73 |
+
?>
|
74 |
+
</div>
|
admin/modules/history/views/_log_table.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Log table view file
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
if(isset($log_list) && is_array($log_list) && count($log_list)>0)
|
13 |
+
{
|
14 |
+
if($offset==0)
|
15 |
+
{
|
16 |
+
?>
|
17 |
+
<table class="wp-list-table widefat fixed striped log_view_tb" style="margin-bottom:25px;">
|
18 |
+
<thead>
|
19 |
+
<tr>
|
20 |
+
<th style="width:100px;"><?php _e("Row No."); ?></th>
|
21 |
+
<th><?php _e("Status"); ?></th>
|
22 |
+
<th><?php _e("Message"); ?></th>
|
23 |
+
<th><?php _e("Item"); ?></th>
|
24 |
+
</tr>
|
25 |
+
</thead>
|
26 |
+
<tbody class="log_view_tb_tbody">
|
27 |
+
<?php
|
28 |
+
}
|
29 |
+
foreach($log_list as $key =>$log_item)
|
30 |
+
{
|
31 |
+
?>
|
32 |
+
<tr>
|
33 |
+
<td><?php echo absint($log_item['row']); ?></td>
|
34 |
+
<td><?php echo ($log_item['status'] ? __('Success') : __('Failed/Skipped') ); ?></td>
|
35 |
+
<td><?php esc_html_e($log_item['message']); ?></td>
|
36 |
+
<td>
|
37 |
+
<?php
|
38 |
+
if($show_item_details)
|
39 |
+
{
|
40 |
+
$item_data=$item_type_module_obj->get_item_by_id($log_item['post_id']);
|
41 |
+
if($item_data && isset($item_data['title']))
|
42 |
+
{
|
43 |
+
if(isset($item_data['edit_url']))
|
44 |
+
{
|
45 |
+
echo '<a href="'.$item_data['edit_url'].'" target="_blank">'.$item_data['title'].'</a>';
|
46 |
+
}else
|
47 |
+
{
|
48 |
+
echo $item_data['title'];
|
49 |
+
}
|
50 |
+
}else
|
51 |
+
{
|
52 |
+
echo $log_item['post_id'];
|
53 |
+
}
|
54 |
+
}else
|
55 |
+
{
|
56 |
+
echo $log_item['post_id'];
|
57 |
+
}
|
58 |
+
?>
|
59 |
+
</td>
|
60 |
+
</tr>
|
61 |
+
<?php
|
62 |
+
}
|
63 |
+
if($offset==0)
|
64 |
+
{
|
65 |
+
?>
|
66 |
+
</tbody>
|
67 |
+
</table>
|
68 |
+
<h4 style="margin-top:0px;">
|
69 |
+
<a class="wt_iew_history_loadmore_btn button button-primary"> <?php _e("Load more."); ?></a>
|
70 |
+
<span class="wt_iew_history_loadmore_loading" style="display:none;"><?php _e("Loading...."); ?></span>
|
71 |
+
</h4>
|
72 |
+
<?php
|
73 |
+
}
|
74 |
+
}else
|
75 |
+
{
|
76 |
+
?>
|
77 |
+
<h4 style="margin-bottom:55px;"><?php _e("No records found."); ?> </h4>
|
78 |
+
<?php
|
79 |
+
}
|
80 |
+
?>
|
admin/modules/history/views/settings.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<style type="text/css">
|
7 |
+
.wt_iew_history_page{ padding:15px; }
|
8 |
+
.history_list_tb td, .history_list_tb th{ text-align:center; }
|
9 |
+
.history_list_tb tr th:first-child{ text-align:left; }
|
10 |
+
.wt_iew_delete_history, .wt_iew_delete_log{ cursor:pointer; }
|
11 |
+
.wt_iew_history_settings{ float:left; width:100%; padding:15px; background:#fff; border:solid 1px #ccd0d4; box-sizing:border-box; margin-bottom:15px; }
|
12 |
+
.wt_iew_history_settings_hd{ float:left; width:100%; font-weight:bold; font-size:13px; }
|
13 |
+
.wt_iew_history_settings_form_group_box{ float:left; width:100%; box-sizing:border-box; padding:10px; padding-bottom:0px; height:auto; font-size:12px; }
|
14 |
+
.wt_iew_history_settings_form_group{ float:left; width:auto; margin-right:3%; min-width:200px;}
|
15 |
+
.wt_iew_history_settings_form_group label{ font-size:12px; font-weight:bold; }
|
16 |
+
.wt_iew_history_settings_form_group select, .wt_iew_history_settings_form_group input[type="text"]{ height:20px; }
|
17 |
+
.wt_iew_history_no_records{float:left; width:100%; margin-bottom:55px; margin-top:20px; text-align:center; background:#fff; padding:15px 0px; border:solid 1px #ccd0d4;}
|
18 |
+
.wt_iew_bulk_action_box{ float:left; width:auto; margin:10px 0px; }
|
19 |
+
select.wt_iew_bulk_action{ float:left; width:auto; height:20px; margin-right:10px; }
|
20 |
+
.wt_iew_view_log_btn{ cursor:pointer; }
|
21 |
+
.wt_iew_view_log{ }
|
22 |
+
.wt_iew_log_loader{ width:100%; height:200px; text-align:center; line-height:150px; font-size:14px; font-style:italic; }
|
23 |
+
.wt_iew_log_container{ padding:25px; }
|
24 |
+
.wt_iew_raw_log{ text-align:left; font-size:14px; }
|
25 |
+
.log_view_tb th, .log_view_tb td{ text-align:center; }
|
26 |
+
.log_list_tb .log_file_name_col{ text-align:left; }
|
27 |
+
</style>
|
28 |
+
<div class="wt_iew_view_log wt_iew_popup">
|
29 |
+
<div class="wt_iew_popup_hd">
|
30 |
+
<span style="line-height:40px;" class="dashicons dashicons-media-text"></span>
|
31 |
+
<span class="wt_iew_popup_hd_label"><?php _e('View log');?></span>
|
32 |
+
<div class="wt_iew_popup_close">X</div>
|
33 |
+
</div>
|
34 |
+
<div class="wt_iew_log_container">
|
35 |
+
|
36 |
+
</div>
|
37 |
+
</div>
|
38 |
+
<?php
|
39 |
+
if(isset($_GET['page']) && $_GET['page']==$this->module_id.'_log')
|
40 |
+
{
|
41 |
+
include plugin_dir_path(__FILE__)."/_log_list.php";
|
42 |
+
}else
|
43 |
+
{
|
44 |
+
include plugin_dir_path(__FILE__)."/_history_list.php";
|
45 |
+
}
|
46 |
+
?>
|
admin/modules/import/assets/js/main.js
ADDED
@@ -0,0 +1,1450 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var wt_iew_basic_import=(function( $ ) {
|
2 |
+
//'use strict';
|
3 |
+
var wt_iew_basic_import=
|
4 |
+
{
|
5 |
+
ajax_data:{},
|
6 |
+
selected_template:0,
|
7 |
+
selected_template_name:'',
|
8 |
+
to_import:'',
|
9 |
+
to_import_title:'',
|
10 |
+
import_method:'',
|
11 |
+
current_step:'',
|
12 |
+
loaded_status_arr:{'loaded':1, 'loading':2, 'not_loaded':0},
|
13 |
+
page_overlay:false,
|
14 |
+
step_keys:[],
|
15 |
+
form_data:{},
|
16 |
+
is_valid_file:false,
|
17 |
+
temp_import_file:'',
|
18 |
+
file_from:'',
|
19 |
+
blocked_action:'', /* the current action will be blocked if file validation is not done. After the successful validation the blocked action will be executed */
|
20 |
+
local_import_file:'',
|
21 |
+
url_import_file:'',
|
22 |
+
on_rerun:false,
|
23 |
+
rerun_id:0,
|
24 |
+
import_delimiter:',',
|
25 |
+
Set:function()
|
26 |
+
{
|
27 |
+
this.step_keys=Object.keys(wt_iew_import_basic_params.steps);
|
28 |
+
if(this.on_rerun)
|
29 |
+
{
|
30 |
+
this.rerun();
|
31 |
+
}else
|
32 |
+
{
|
33 |
+
var first_step=this.step_keys[0];
|
34 |
+
this.load_steps([first_step], first_step);
|
35 |
+
this.show_step_page(first_step, false); /* just to show a loading */
|
36 |
+
}
|
37 |
+
},
|
38 |
+
rerun:function()
|
39 |
+
{
|
40 |
+
var last_step=this.step_keys[this.step_keys.length-1];
|
41 |
+
this.load_steps(this.step_keys, last_step);
|
42 |
+
this.show_step_page(last_step, false); /* just to show a loading */
|
43 |
+
},
|
44 |
+
filter_loaded_steps:function(steps)
|
45 |
+
{
|
46 |
+
var filtered_steps=new Array();
|
47 |
+
$.each(steps, function(step_ind, step){
|
48 |
+
if(wt_iew_basic_import.get_page_dom_object(step).attr('data-loaded')!=wt_iew_basic_import.loaded_status_arr['loaded'])
|
49 |
+
{
|
50 |
+
filtered_steps.push(step);
|
51 |
+
}
|
52 |
+
});
|
53 |
+
return filtered_steps;
|
54 |
+
},
|
55 |
+
load_steps:function(steps, step_to_show)
|
56 |
+
{
|
57 |
+
steps=this.filter_loaded_steps(steps);
|
58 |
+
if(steps.length==0){ return; }
|
59 |
+
this.prepare_ajax_data('get_steps', 'json');
|
60 |
+
this.ajax_data.steps=steps;
|
61 |
+
if(this.on_rerun)
|
62 |
+
{
|
63 |
+
this.ajax_data.rerun_id=this.rerun_id;
|
64 |
+
}
|
65 |
+
this.set_step_loading_status(steps, 'loading');
|
66 |
+
this.set_ajax_page_loader(steps, 'loading');
|
67 |
+
$.ajax({
|
68 |
+
type: 'POST',
|
69 |
+
url:wt_iew_basic_params.ajax_url,
|
70 |
+
data:this.ajax_data,
|
71 |
+
dataType:'json',
|
72 |
+
success:function(data)
|
73 |
+
{
|
74 |
+
if(data!=null && data.status==1)
|
75 |
+
{
|
76 |
+
wt_iew_basic_import.set_step_page(data);
|
77 |
+
wt_iew_basic_import.set_step_loading_status(steps, 'loaded');
|
78 |
+
if(step_to_show)
|
79 |
+
{
|
80 |
+
wt_iew_basic_import.show_step_page(step_to_show, true);
|
81 |
+
}
|
82 |
+
if(wt_iew_basic_import.on_rerun)
|
83 |
+
{
|
84 |
+
wt_iew_basic_import.load_meta_mapping_fields();
|
85 |
+
wt_iew_basic_import.set_validate_file_info(); /* this will prevent revalidation of files */
|
86 |
+
wt_iew_basic_import.on_rerun=false;
|
87 |
+
wt_iew_basic_import.rerun_id=0;
|
88 |
+
}
|
89 |
+
}else
|
90 |
+
{
|
91 |
+
wt_iew_basic_import.set_step_loading_status(steps, 'not_loaded');
|
92 |
+
wt_iew_basic_import.set_ajax_page_loader(steps, 'error');
|
93 |
+
}
|
94 |
+
wt_iew_basic_import.remove_ajax_page_loader();
|
95 |
+
},
|
96 |
+
error:function()
|
97 |
+
{
|
98 |
+
wt_iew_basic_import.set_step_loading_status(steps, 'not_loaded');
|
99 |
+
wt_iew_basic_import.remove_ajax_page_loader();
|
100 |
+
wt_iew_basic_import.set_ajax_page_loader(steps, 'error');
|
101 |
+
}
|
102 |
+
});
|
103 |
+
},
|
104 |
+
load_meta_mapping_fields:function()
|
105 |
+
{
|
106 |
+
this.prepare_ajax_data('get_meta_mapping_fields', 'json');
|
107 |
+
this.ajax_data['file_head_meta']=JSON.stringify(wt_iew_file_head_remaining_meta);
|
108 |
+
$('.meta_mapping_box_con[data-loaded="0"]').html('<div class="wt_iew_import_step_loader">'+wt_iew_basic_params.msgs.loading+'</div>');
|
109 |
+
$.ajax({
|
110 |
+
type: 'POST',
|
111 |
+
url:wt_iew_basic_params.ajax_url,
|
112 |
+
data:this.ajax_data,
|
113 |
+
dataType:'json',
|
114 |
+
success:function(data)
|
115 |
+
{
|
116 |
+
if(data.status==1)
|
117 |
+
{
|
118 |
+
$.each(data.meta_html, function(meta_id, meta_content){
|
119 |
+
$('.meta_mapping_box_con[data-key="'+meta_id+'"]').html(meta_content).attr('data-loaded', 1);
|
120 |
+
});
|
121 |
+
wt_iew_basic_import.enable_sortable();
|
122 |
+
wt_iew_basic_import.reg_mapping_field_bulk_action();
|
123 |
+
wt_iew_popover.Set();
|
124 |
+
}else
|
125 |
+
{
|
126 |
+
$('.meta_mapping_box_con[data-loaded="0"]').html('<div class="wt_iew_import_step_loader">'+wt_iew_basic_params.msgs.error+'</div>');
|
127 |
+
}
|
128 |
+
},
|
129 |
+
error:function()
|
130 |
+
{
|
131 |
+
$('.meta_mapping_box_con[data-loaded="0"]').html('<div class="wt_iew_import_step_loader">'+wt_iew_basic_params.msgs.loading+'</div>');
|
132 |
+
}
|
133 |
+
});
|
134 |
+
},
|
135 |
+
console_formdata:function()
|
136 |
+
{
|
137 |
+
console.log(this.form_data);
|
138 |
+
},
|
139 |
+
refresh_step:function(no_overlay)
|
140 |
+
{
|
141 |
+
/* if popover is opened */
|
142 |
+
wt_iew_popover.closePop();
|
143 |
+
|
144 |
+
if(!no_overlay){
|
145 |
+
this.page_overlay=true;
|
146 |
+
}
|
147 |
+
this.reset_step_loaded_state([this.current_step]);
|
148 |
+
this.load_steps([this.current_step], this.current_step);
|
149 |
+
},
|
150 |
+
get_need_to_reload_steps:function()
|
151 |
+
{
|
152 |
+
var rest_steps=this.step_keys.slice(0);
|
153 |
+
/* remove first and second steps */
|
154 |
+
rest_steps.shift();
|
155 |
+
rest_steps.shift();
|
156 |
+
return rest_steps;
|
157 |
+
},
|
158 |
+
load_pending_steps:function(no_overlay, show_step)
|
159 |
+
{
|
160 |
+
if(!no_overlay){
|
161 |
+
this.page_overlay=true;
|
162 |
+
}
|
163 |
+
if(!show_step)
|
164 |
+
{
|
165 |
+
show_step=this.current_step;
|
166 |
+
}
|
167 |
+
this.load_steps(this.get_need_to_reload_steps(), show_step);
|
168 |
+
},
|
169 |
+
get_page_dom_object:function(step)
|
170 |
+
{
|
171 |
+
return $('.wt_iew_import_step_'+step);
|
172 |
+
},
|
173 |
+
remove_ajax_page_loader:function()
|
174 |
+
{
|
175 |
+
this.hide_import_info_box();
|
176 |
+
$('.wt_iew_overlayed_loader').hide();
|
177 |
+
$('.spinner').css({'visibility':'hidden'});
|
178 |
+
this.page_overlay=false;
|
179 |
+
},
|
180 |
+
set_ajax_page_loader:function(steps, msg_type)
|
181 |
+
{
|
182 |
+
if(this.page_overlay)
|
183 |
+
{
|
184 |
+
var h=parseInt($('.wt_iew_import_step_main').outerHeight());
|
185 |
+
var w=parseInt($('.wt_iew_import_step_main').outerWidth());
|
186 |
+
$('.wt_iew_overlayed_loader').show().css({'height':h,'width':w,'margin-top':'30px','margin-left':'30px'});
|
187 |
+
$('.spinner').css({'visibility':'visible'});
|
188 |
+
}else
|
189 |
+
{
|
190 |
+
var msg='';
|
191 |
+
if(msg_type=='loading')
|
192 |
+
{
|
193 |
+
msg=wt_iew_basic_params.msgs.loading;
|
194 |
+
}else if(msg_type=='error')
|
195 |
+
{
|
196 |
+
msg=wt_iew_basic_params.msgs.error;
|
197 |
+
}
|
198 |
+
$.each(steps, function(step_ind, step){
|
199 |
+
wt_iew_basic_import.get_page_dom_object(step).html('<div class="wt_iew_import_step_loader">'+msg+'</div>');
|
200 |
+
});
|
201 |
+
}
|
202 |
+
},
|
203 |
+
hide_import_info_box:function()
|
204 |
+
{
|
205 |
+
$('.wt_iew_loader_info_box').hide();
|
206 |
+
},
|
207 |
+
set_import_progress_info:function(msg)
|
208 |
+
{
|
209 |
+
$('.wt_iew_loader_info_box').show().html(msg);
|
210 |
+
},
|
211 |
+
nonstep_actions:function(action)
|
212 |
+
{
|
213 |
+
this.prepare_ajax_data(action, 'json');
|
214 |
+
if(action=='save_template' || action=='save_template_as' || action=='update_template')
|
215 |
+
{
|
216 |
+
$('.wt_iew_template_name_wrn').hide();
|
217 |
+
var pop_elm=$('.wt_iew_template_name');
|
218 |
+
var popup_label=pop_elm.attr('data-save-label');
|
219 |
+
if(action=='save_template_as')
|
220 |
+
{
|
221 |
+
var popup_label=pop_elm.attr('data-saveas-label');
|
222 |
+
}
|
223 |
+
pop_elm.find('.wt_iew_popup_hd_label, .wt_iew_template_create_btn').text(popup_label);
|
224 |
+
wt_iew_popup.showPopup(pop_elm);
|
225 |
+
$('[name="wt_iew_template_name_field"]').val(this.selected_template_name).focus();
|
226 |
+
|
227 |
+
$('.wt_iew_template_create_btn').unbind('click').click(function(){
|
228 |
+
var name=$.trim($('.wt_iew_template_name_field').val());
|
229 |
+
if(name=='')
|
230 |
+
{
|
231 |
+
$('.wt_iew_template_name_wrn').show();
|
232 |
+
$('.wt_iew_template_name_field').focus();
|
233 |
+
}else
|
234 |
+
{
|
235 |
+
$('.wt_iew_template_name_wrn').hide();
|
236 |
+
wt_iew_popup.hidePopup();
|
237 |
+
|
238 |
+
wt_iew_basic_import.prepare_form_data();
|
239 |
+
wt_iew_basic_import.ajax_data['template_name']=name;
|
240 |
+
wt_iew_basic_import.ajax_data['form_data']=wt_iew_basic_import.form_data;
|
241 |
+
wt_iew_basic_import.do_nonstep_action(action);
|
242 |
+
}
|
243 |
+
});
|
244 |
+
}else if(action=='validate_file' || action=='download')
|
245 |
+
{
|
246 |
+
this.prepare_form_data();
|
247 |
+
this.ajax_data['form_data']=this.form_data;
|
248 |
+
this.do_nonstep_action(action);
|
249 |
+
}else
|
250 |
+
{
|
251 |
+
/* custom action section for other modules */
|
252 |
+
this.prepare_form_data();
|
253 |
+
this.ajax_data['form_data']=this.form_data;
|
254 |
+
wt_iew_custom_action_basic(this.ajax_data, action, this.selected_template);
|
255 |
+
}
|
256 |
+
},
|
257 |
+
do_nonstep_action:function(action)
|
258 |
+
{
|
259 |
+
this.page_overlay=true;
|
260 |
+
this.set_ajax_page_loader();
|
261 |
+
|
262 |
+
if(action=='download')
|
263 |
+
{
|
264 |
+
wt_iew_basic_import.set_import_progress_info(wt_iew_import_basic_params.msgs.processing_file);
|
265 |
+
}
|
266 |
+
$.ajax({
|
267 |
+
type: 'POST',
|
268 |
+
url:wt_iew_basic_params.ajax_url,
|
269 |
+
data:this.ajax_data,
|
270 |
+
dataType:'json',
|
271 |
+
success:function(data)
|
272 |
+
{
|
273 |
+
wt_iew_basic_import.remove_ajax_page_loader();
|
274 |
+
if(wt_iew_basic_import.is_object(data) && data.hasOwnProperty('status'))
|
275 |
+
{
|
276 |
+
if(data.status==1)
|
277 |
+
{
|
278 |
+
if(action=='save_template' || action=='save_template_as' || action=='update_template')
|
279 |
+
{
|
280 |
+
wt_iew_basic_import.selected_template=data.id;
|
281 |
+
wt_iew_basic_import.selected_template_name=data.name;
|
282 |
+
wt_iew_notify_msg.success(wt_iew_basic_params.msgs.success);
|
283 |
+
|
284 |
+
}else if(action=='import')
|
285 |
+
{
|
286 |
+
if(data.finished==1)
|
287 |
+
{
|
288 |
+
wt_iew_basic_import.temp_import_file='';
|
289 |
+
wt_iew_notify_msg.success(wt_iew_basic_params.msgs.success);
|
290 |
+
wt_iew_basic_import.set_import_progress_info(data.msg);
|
291 |
+
}
|
292 |
+
else
|
293 |
+
{
|
294 |
+
wt_iew_basic_import.set_import_progress_info(data.msg);
|
295 |
+
wt_iew_basic_import.ajax_data['offset']=data.new_offset;
|
296 |
+
wt_iew_basic_import.ajax_data['import_id']=data.import_id;
|
297 |
+
wt_iew_basic_import.ajax_data['total_records']=data.total_records;
|
298 |
+
wt_iew_basic_import.ajax_data['offset_count']=data.offset_count;
|
299 |
+
|
300 |
+
wt_iew_basic_import.ajax_data['total_success']=data.total_success;
|
301 |
+
wt_iew_basic_import.ajax_data['total_failed']=data.total_failed;
|
302 |
+
wt_iew_basic_import.do_nonstep_action(action);
|
303 |
+
}
|
304 |
+
}else if(action=='download')
|
305 |
+
{
|
306 |
+
wt_iew_basic_import.set_import_progress_info(data.msg);
|
307 |
+
wt_iew_basic_import.ajax_data['import_id']=data.import_id;
|
308 |
+
wt_iew_basic_import.ajax_data['total_records']=data.total_records;
|
309 |
+
if(data.finished==3)/* finished file processing */
|
310 |
+
{
|
311 |
+
wt_iew_basic_import.ajax_data['offset']=0;
|
312 |
+
wt_iew_basic_import.ajax_data['offset_count']=0;
|
313 |
+
wt_iew_basic_import.ajax_data['import_action']='import';
|
314 |
+
wt_iew_basic_import.ajax_data['temp_import_file']=data.temp_import_file;
|
315 |
+
wt_iew_basic_import.temp_import_file=data.temp_import_file;
|
316 |
+
wt_iew_basic_import.do_nonstep_action('import');
|
317 |
+
}else
|
318 |
+
{
|
319 |
+
wt_iew_basic_import.ajax_data['offset']=data.new_offset;
|
320 |
+
wt_iew_basic_import.ajax_data['import_action']='download';
|
321 |
+
wt_iew_basic_import.do_nonstep_action('download');
|
322 |
+
}
|
323 |
+
}
|
324 |
+
else if(action=='validate_file')
|
325 |
+
{
|
326 |
+
wt_iew_basic_import.is_valid_file=true;
|
327 |
+
|
328 |
+
/* set meta step status to not loaded */
|
329 |
+
wt_iew_basic_import.reset_meta_step_loaded_state();
|
330 |
+
|
331 |
+
wt_iew_basic_import.temp_import_file=data.file_name;
|
332 |
+
wt_iew_basic_import.set_validate_file_info();
|
333 |
+
if(wt_iew_basic_import.blocked_action!='') /* pending action exists */
|
334 |
+
{
|
335 |
+
if(wt_iew_basic_import.is_step(wt_iew_basic_import.blocked_action))
|
336 |
+
{
|
337 |
+
/* load all pending steps, and show the next step (Blocked action) */
|
338 |
+
wt_iew_basic_import.load_pending_steps(false, wt_iew_basic_import.blocked_action);
|
339 |
+
|
340 |
+
}else /* may be import(download) */
|
341 |
+
{
|
342 |
+
wt_iew_basic_import.nonstep_actions(wt_iew_basic_import.blocked_action);
|
343 |
+
}
|
344 |
+
|
345 |
+
/* clear the blocked action */
|
346 |
+
wt_iew_basic_import.blocked_action='';
|
347 |
+
}
|
348 |
+
}else
|
349 |
+
{
|
350 |
+
|
351 |
+
}
|
352 |
+
}else
|
353 |
+
{
|
354 |
+
if(data.msg!="")
|
355 |
+
{
|
356 |
+
wt_iew_notify_msg.error(data.msg);
|
357 |
+
}else
|
358 |
+
{
|
359 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
360 |
+
}
|
361 |
+
}
|
362 |
+
}else
|
363 |
+
{
|
364 |
+
wt_iew_basic_import.temp_import_file='';
|
365 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
366 |
+
}
|
367 |
+
},
|
368 |
+
error:function()
|
369 |
+
{
|
370 |
+
wt_iew_basic_import.temp_import_file='';
|
371 |
+
wt_iew_basic_import.remove_ajax_page_loader();
|
372 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
373 |
+
}
|
374 |
+
});
|
375 |
+
},
|
376 |
+
reg_button_actions:function()
|
377 |
+
{
|
378 |
+
$('.wt_iew_import_action_btn').unbind('click').click(function(e){
|
379 |
+
e.preventDefault();
|
380 |
+
|
381 |
+
wt_iew_basic_import.remove_ajax_page_loader(); /* remove any loader that are open */
|
382 |
+
|
383 |
+
var action=$(this).attr('data-action');
|
384 |
+
var action_type=$(this).attr('data-action-type');
|
385 |
+
var is_previous_step=wt_iew_basic_import.is_previous_step(action);
|
386 |
+
if(!wt_iew_importer_validate_basic(action, action_type, is_previous_step))
|
387 |
+
{
|
388 |
+
return false;
|
389 |
+
}
|
390 |
+
|
391 |
+
/* validation section */
|
392 |
+
if(!wt_iew_basic_import.form_validation(action))
|
393 |
+
{
|
394 |
+
return false;
|
395 |
+
}
|
396 |
+
|
397 |
+
/* if popover is opened */
|
398 |
+
wt_iew_popover.closePop();
|
399 |
+
|
400 |
+
/* this method will check current step is import method step and file is validated */
|
401 |
+
if(!wt_iew_basic_import.validate_file(action, action_type))
|
402 |
+
{
|
403 |
+
return false;
|
404 |
+
}
|
405 |
+
|
406 |
+
if(action_type=='step')
|
407 |
+
{
|
408 |
+
wt_iew_basic_import.change_step(action);
|
409 |
+
}else
|
410 |
+
{
|
411 |
+
wt_iew_basic_import.nonstep_actions(action);
|
412 |
+
}
|
413 |
+
});
|
414 |
+
},
|
415 |
+
get_file_from:function()
|
416 |
+
{
|
417 |
+
if(jQuery('select[name="wt_iew_file_from"]').length>0) /* select box */
|
418 |
+
{
|
419 |
+
var file_from=jQuery('[name="wt_iew_file_from"]').val();
|
420 |
+
}else
|
421 |
+
{
|
422 |
+
var file_from=jQuery('[name="wt_iew_file_from"]:checked').val();
|
423 |
+
}
|
424 |
+
return file_from;
|
425 |
+
},
|
426 |
+
set_validate_file_info:function()
|
427 |
+
{
|
428 |
+
var file_from=this.get_file_from();
|
429 |
+
|
430 |
+
if(file_from=='local')
|
431 |
+
{
|
432 |
+
this.local_import_file=$('[name="wt_iew_local_file"]').val();
|
433 |
+
|
434 |
+
}else if(file_from=='url')
|
435 |
+
{
|
436 |
+
this.url_import_file=$('[name="wt_iew_url_file"]').val();
|
437 |
+
|
438 |
+
}else
|
439 |
+
{
|
440 |
+
wt_iew_set_validate_file_info(file_from);
|
441 |
+
}
|
442 |
+
},
|
443 |
+
validate_file:function(action, action_type)
|
444 |
+
{
|
445 |
+
if(this.current_step=='method_import')
|
446 |
+
{
|
447 |
+
/* check any revalidation needed for input file */
|
448 |
+
var file_from=this.get_file_from();
|
449 |
+
if(file_from=='local')
|
450 |
+
{
|
451 |
+
if(this.local_import_file!=$('[name="wt_iew_local_file"]').val())
|
452 |
+
{
|
453 |
+
this.is_valid_file=false;
|
454 |
+
}else
|
455 |
+
{
|
456 |
+
this.is_valid_file=true;
|
457 |
+
}
|
458 |
+
}else if(file_from=='url')
|
459 |
+
{
|
460 |
+
if(this.url_import_file!=$('[name="wt_iew_url_file"]').val())
|
461 |
+
{
|
462 |
+
this.is_valid_file=false;
|
463 |
+
}else
|
464 |
+
{
|
465 |
+
this.is_valid_file=true;
|
466 |
+
}
|
467 |
+
}else
|
468 |
+
{
|
469 |
+
/* revalidation check of other remote adapters will done on form validation hook */
|
470 |
+
}
|
471 |
+
}
|
472 |
+
|
473 |
+
if(this.current_step=='method_import' && !this.is_valid_file) /* method import page, then check file validation is done. */
|
474 |
+
{
|
475 |
+
if(action_type=='step' && this.is_previous_step(action)) /* step action and previous step */
|
476 |
+
{
|
477 |
+
return true;
|
478 |
+
}
|
479 |
+
|
480 |
+
/* store the current action to a variable. After successful validation of the file the stopped action will resumed */
|
481 |
+
this.blocked_action=action;
|
482 |
+
|
483 |
+
this.set_import_progress_info(wt_iew_import_basic_params.msgs.validating_file);
|
484 |
+
this.nonstep_actions('validate_file'); /* download/upload the file and validate it. */
|
485 |
+
return false;
|
486 |
+
}else
|
487 |
+
{
|
488 |
+
return true;
|
489 |
+
}
|
490 |
+
},
|
491 |
+
form_validation:function(step_to_go)
|
492 |
+
{
|
493 |
+
if(this.current_step=='post_type')
|
494 |
+
{
|
495 |
+
if(this.to_import=='')
|
496 |
+
{
|
497 |
+
$('.wt_iew_post_type_wrn').show();
|
498 |
+
return false;
|
499 |
+
}
|
500 |
+
}else if(this.current_step=='method_import') /* method import page */
|
501 |
+
{
|
502 |
+
if(this.import_method=='template' && this.selected_template==0 && !this.is_previous_step(step_to_go))
|
503 |
+
{
|
504 |
+
wt_iew_notify_msg.error(wt_iew_import_basic_params.msgs.select_an_import_template);
|
505 |
+
return false;
|
506 |
+
}
|
507 |
+
if((this.import_method=='new' || this.import_method=='quick') && !this.is_previous_step(step_to_go))
|
508 |
+
{
|
509 |
+
if(this.file_from=='')
|
510 |
+
{
|
511 |
+
wt_iew_notify_msg.error(wt_iew_import_basic_params.msgs.choose_import_from);
|
512 |
+
return false;
|
513 |
+
}else
|
514 |
+
{
|
515 |
+
if(this.file_from=='local' && $.trim($('[name="wt_iew_local_file"]').val())=='')
|
516 |
+
{
|
517 |
+
wt_iew_notify_msg.error(wt_iew_import_basic_params.msgs.choose_a_file);
|
518 |
+
return false;
|
519 |
+
}
|
520 |
+
else if(this.file_from=='url' && $.trim($('[name="wt_iew_url_file"]').val())=='')
|
521 |
+
{
|
522 |
+
wt_iew_notify_msg.error(wt_iew_import_basic_params.msgs.choose_a_file);
|
523 |
+
return false;
|
524 |
+
}
|
525 |
+
}
|
526 |
+
}
|
527 |
+
}else if(this.current_step=='advanced')
|
528 |
+
{
|
529 |
+
|
530 |
+
}
|
531 |
+
return true;
|
532 |
+
},
|
533 |
+
change_step:function(step_to_go)
|
534 |
+
{
|
535 |
+
/* setting fromdata */
|
536 |
+
this.prepare_form_data();
|
537 |
+
|
538 |
+
/* step changing section */
|
539 |
+
this.show_step_page(step_to_go, true);
|
540 |
+
},
|
541 |
+
reset_form_data:function()
|
542 |
+
{
|
543 |
+
this.form_data={};
|
544 |
+
this.selected_template=0;
|
545 |
+
this.selected_template_name='';
|
546 |
+
this.import_method='';
|
547 |
+
this.is_valid_file=false;
|
548 |
+
this.local_import_file='';
|
549 |
+
this.url_import_file='';
|
550 |
+
wt_iew_importer_reset_form_data_basic();
|
551 |
+
|
552 |
+
/* reset loaded state */
|
553 |
+
this.reset_step_loaded_state(this.get_need_to_reload_steps());
|
554 |
+
},
|
555 |
+
reset_step_loaded_state:function(steps)
|
556 |
+
{
|
557 |
+
this.set_step_loading_status(steps, 'not_loaded');
|
558 |
+
},
|
559 |
+
reset_meta_step_loaded_state:function()
|
560 |
+
{
|
561 |
+
var rest_steps=this.get_need_to_reload_steps();
|
562 |
+
var meta_step=rest_steps.shift();
|
563 |
+
this.reset_step_loaded_state([meta_step]);
|
564 |
+
},
|
565 |
+
prepare_form_data:function()
|
566 |
+
{
|
567 |
+
if(this.current_step=='post_type')
|
568 |
+
{
|
569 |
+
this.form_data['post_type_form_data']=JSON.stringify({'item_type':wt_iew_basic_import.to_import});
|
570 |
+
}
|
571 |
+
else if(this.current_step=='mapping')
|
572 |
+
{
|
573 |
+
|
574 |
+
/**
|
575 |
+
* Default mapping fields
|
576 |
+
*/
|
577 |
+
var mapping_form_data={};
|
578 |
+
var mapping_fields={};
|
579 |
+
var mapping_selected_fields={}; /* this value is only for backend processing */
|
580 |
+
|
581 |
+
$('.wt-iew-importer-default-mapping-tb tbody tr').each(function(){
|
582 |
+
|
583 |
+
var columns_key=$(this).find('.columns_key').val();
|
584 |
+
var columns_val=$(this).find('.columns_val').val();
|
585 |
+
|
586 |
+
var enabled=($(this).find('.columns_key').is(':checked') ? 1 : 0);
|
587 |
+
var type=$(this).find('.columns_val').attr('data-type');
|
588 |
+
mapping_fields[columns_key]=[columns_val, enabled, type];
|
589 |
+
if(enabled==1)
|
590 |
+
{
|
591 |
+
mapping_selected_fields[columns_key]=columns_val;
|
592 |
+
}
|
593 |
+
|
594 |
+
});
|
595 |
+
|
596 |
+
mapping_form_data={'mapping_fields':mapping_fields, 'mapping_selected_fields':mapping_selected_fields};
|
597 |
+
this.form_data['mapping_form_data']=JSON.stringify(mapping_form_data);
|
598 |
+
|
599 |
+
|
600 |
+
|
601 |
+
/**
|
602 |
+
* meta mapping fields
|
603 |
+
*/
|
604 |
+
var meta_step_form_data={};
|
605 |
+
var mapping_fields={};
|
606 |
+
var mapping_selected_fields={}; /* this value is only for backend processing */
|
607 |
+
|
608 |
+
$('.wt-iew-importer-meta-mapping-tb').each(function(){
|
609 |
+
var mapping_key=$(this).attr('data-field-type');
|
610 |
+
mapping_fields[mapping_key]={};
|
611 |
+
mapping_selected_fields[mapping_key]={};
|
612 |
+
|
613 |
+
$(this).find('tbody tr').each(function(){
|
614 |
+
if($(this).find('.columns_key').length>0 && $(this).find('.columns_val').length>0)
|
615 |
+
{
|
616 |
+
var columns_key=$(this).find('.columns_key').val();
|
617 |
+
var columns_val=$(this).find('.columns_val').val();
|
618 |
+
|
619 |
+
var enabled=($(this).find('.columns_key').is(':checked') ? 1 : 0);
|
620 |
+
var type=$(this).find('.columns_val').attr('data-type');
|
621 |
+
mapping_fields[mapping_key][columns_key]=[columns_val, enabled, type];
|
622 |
+
if(enabled==1)
|
623 |
+
{
|
624 |
+
mapping_selected_fields[mapping_key][columns_key]=columns_val;
|
625 |
+
}
|
626 |
+
}
|
627 |
+
});
|
628 |
+
});
|
629 |
+
|
630 |
+
meta_step_form_data={'mapping_fields':mapping_fields, 'mapping_selected_fields':mapping_selected_fields};
|
631 |
+
this.form_data['meta_step_form_data']=JSON.stringify(meta_step_form_data);
|
632 |
+
|
633 |
+
}
|
634 |
+
else
|
635 |
+
{
|
636 |
+
var current_form_data={};
|
637 |
+
if(this.current_step=='method_import')
|
638 |
+
{
|
639 |
+
current_form_data={'method_import' : wt_iew_basic_import.import_method, 'selected_template':this.selected_template};
|
640 |
+
}
|
641 |
+
if($('.wt_iew_import_'+this.current_step+'_form').length>0) /* may be user hit the back button */
|
642 |
+
{
|
643 |
+
var form_data=$('.wt_iew_import_'+this.current_step+'_form').serializeArray();
|
644 |
+
$.each(form_data, function(){
|
645 |
+
|
646 |
+
if(current_form_data[this.name])
|
647 |
+
{
|
648 |
+
if(!current_form_data[this.name].push)
|
649 |
+
{
|
650 |
+
current_form_data[this.name] = [current_form_data[this.name]];
|
651 |
+
}
|
652 |
+
current_form_data[this.name].push(this.value || '');
|
653 |
+
}else
|
654 |
+
{
|
655 |
+
current_form_data[this.name] = this.value || '';
|
656 |
+
}
|
657 |
+
|
658 |
+
});
|
659 |
+
|
660 |
+
this.form_data[this.current_step+'_form_data']=JSON.stringify(current_form_data);
|
661 |
+
}
|
662 |
+
}
|
663 |
+
|
664 |
+
/* we are resetting formdata on second step. If user not going to first step then post type formdata will be empty. */
|
665 |
+
if(this.current_step!='post_type')
|
666 |
+
{
|
667 |
+
this.form_data['post_type_form_data']=JSON.stringify({'item_type':wt_iew_basic_import.to_import});
|
668 |
+
}
|
669 |
+
|
670 |
+
},
|
671 |
+
is_multi_select:function(name)
|
672 |
+
{
|
673 |
+
var elm=$('[name="'+name+'"]');
|
674 |
+
if(elm.prop("tagName").toLowerCase()=='select' && this.has_attr(elm,'multiple'))
|
675 |
+
{
|
676 |
+
return true;
|
677 |
+
}else
|
678 |
+
{
|
679 |
+
return false;
|
680 |
+
}
|
681 |
+
},
|
682 |
+
has_attr:function(elm,attr_name)
|
683 |
+
{
|
684 |
+
var attr = elm.attr(attr_name);
|
685 |
+
if(typeof attr!==typeof undefined && attr!==false)
|
686 |
+
{
|
687 |
+
return true;
|
688 |
+
}else
|
689 |
+
{
|
690 |
+
return false;
|
691 |
+
}
|
692 |
+
},
|
693 |
+
is_step:function(step_key)
|
694 |
+
{
|
695 |
+
return wt_iew_import_basic_params.steps.hasOwnProperty(step_key) ? true : false;
|
696 |
+
},
|
697 |
+
is_previous_step:function(step_key)
|
698 |
+
{
|
699 |
+
if(this.is_step(step_key))
|
700 |
+
{
|
701 |
+
if(this.step_keys.indexOf(step_key)<this.step_keys.indexOf(this.current_step))
|
702 |
+
{
|
703 |
+
return true;
|
704 |
+
}
|
705 |
+
}
|
706 |
+
return false;
|
707 |
+
},
|
708 |
+
is_step_loaded:function(step)
|
709 |
+
{
|
710 |
+
if(this.get_page_dom_object(step).length==0){ return true; } /* block infinite loop, if element is not available */
|
711 |
+
return (this.get_page_dom_object(step).attr('data-loaded')==this.loaded_status_arr['loaded']);
|
712 |
+
},
|
713 |
+
set_step_loading_status:function(steps, status)
|
714 |
+
{
|
715 |
+
$.each(steps, function(step_ind, step){
|
716 |
+
wt_iew_basic_import.get_page_dom_object(step).attr('data-loaded', wt_iew_basic_import.loaded_status_arr[status]);
|
717 |
+
});
|
718 |
+
},
|
719 |
+
show_step_page:function(step, force_check_loaded)
|
720 |
+
{
|
721 |
+
$('.wt_iew_import_step').hide();
|
722 |
+
this.get_page_dom_object(step).show();
|
723 |
+
this.current_step=step;
|
724 |
+
if(force_check_loaded)
|
725 |
+
{
|
726 |
+
if(this.is_step_loaded(step))
|
727 |
+
{
|
728 |
+
this.current_step_actions();
|
729 |
+
}else
|
730 |
+
{
|
731 |
+
this.refresh_step(true);
|
732 |
+
}
|
733 |
+
}else
|
734 |
+
{
|
735 |
+
this.current_step_actions();
|
736 |
+
}
|
737 |
+
wt_iew_form_toggler.runToggler();
|
738 |
+
},
|
739 |
+
current_step_actions:function() /* current page actions after page is visible */
|
740 |
+
{
|
741 |
+
if(this.current_step=='method_import')
|
742 |
+
{
|
743 |
+
wt_iew_file_attacher.Set();
|
744 |
+
wt_iew_form_toggler.runToggler();
|
745 |
+
}
|
746 |
+
else if(this.current_step=='advanced')
|
747 |
+
{
|
748 |
+
wt_iew_form_toggler.runToggler();
|
749 |
+
wt_field_group.Set();
|
750 |
+
}
|
751 |
+
else if(this.current_step=='mapping')
|
752 |
+
{
|
753 |
+
wt_iew_popover.Set();
|
754 |
+
|
755 |
+
if($('.meta_mapping_box_con').length>0)
|
756 |
+
{
|
757 |
+
if($('.meta_mapping_box_con[data-loaded="0"]').length>0)
|
758 |
+
{
|
759 |
+
this.load_meta_mapping_fields();
|
760 |
+
}
|
761 |
+
}
|
762 |
+
}
|
763 |
+
},
|
764 |
+
show_post_type_name:function()
|
765 |
+
{
|
766 |
+
if(this.to_import!="" && this.to_import_title=='')
|
767 |
+
{
|
768 |
+
$('[name="wt_iew_import_post_type"]').val(this.to_import);
|
769 |
+
this.to_import_title=$('[name="wt_iew_import_post_type"] option:selected').text();
|
770 |
+
}
|
771 |
+
$('.wt_iew_step_head_post_type_name').html(this.to_import_title);
|
772 |
+
},
|
773 |
+
page_actions:function(step)
|
774 |
+
{
|
775 |
+
if(step=='post_type') /* post type page */
|
776 |
+
{
|
777 |
+
$('[name="wt_iew_import_post_type"]').unbind('change').change(function(){
|
778 |
+
wt_iew_basic_import.to_import=$(this).val();
|
779 |
+
wt_iew_basic_import.to_import_title='';
|
780 |
+
wt_iew_basic_import.reset_form_data();
|
781 |
+
$('.wt_iew_post_type_name').html('');
|
782 |
+
if(wt_iew_basic_import.to_import=='')
|
783 |
+
{
|
784 |
+
$('.wt_iew_post_type_wrn').show();
|
785 |
+
}else
|
786 |
+
{
|
787 |
+
$('.wt_iew_post_type_wrn').hide();
|
788 |
+
var post_type_name=$('[name="wt_iew_import_post_type"] option:selected').text();
|
789 |
+
/* $('.wt_iew_post_type_name').html(': '+post_type_name); */
|
790 |
+
wt_iew_basic_import.to_import_title=post_type_name;
|
791 |
+
|
792 |
+
/* load second step */
|
793 |
+
wt_iew_basic_import.set_step_loading_status([wt_iew_basic_import.step_keys[1]], 'not_loaded'); /* resetting status for force refresh */
|
794 |
+
wt_iew_basic_import.load_steps([wt_iew_basic_import.step_keys[1]]);
|
795 |
+
}
|
796 |
+
});
|
797 |
+
}
|
798 |
+
else if(step=='method_import') /* method import page */
|
799 |
+
{
|
800 |
+
this.import_method=$('[name="wt_iew_import_method_import"]:checked').val();
|
801 |
+
this.toggle_import_method_options();
|
802 |
+
|
803 |
+
$('[name="wt_iew_import_method_import"]').unbind('click').click(function(){
|
804 |
+
var vl=$(this).val();
|
805 |
+
if(wt_iew_basic_import.import_method==vl)
|
806 |
+
{
|
807 |
+
return false;
|
808 |
+
}
|
809 |
+
wt_iew_basic_import.reset_form_data();
|
810 |
+
wt_iew_basic_import.import_method=vl;
|
811 |
+
wt_iew_basic_import.refresh_step();
|
812 |
+
});
|
813 |
+
|
814 |
+
$('.wt-iew-import-template-sele').unbind('change').change(function(){
|
815 |
+
wt_iew_basic_import.selected_template=$(this).val();
|
816 |
+
wt_iew_basic_import.is_valid_file=false;
|
817 |
+
if(wt_iew_basic_import.selected_template==0)
|
818 |
+
{
|
819 |
+
wt_iew_notify_msg.error(wt_iew_import_basic_params.msgs.select_an_import_template);
|
820 |
+
}else
|
821 |
+
{
|
822 |
+
/* reset step loaded sataus */
|
823 |
+
wt_iew_basic_import.reset_step_loaded_state(wt_iew_basic_import.get_need_to_reload_steps());
|
824 |
+
|
825 |
+
wt_iew_basic_import.selected_template_name=$.trim($('.wt-iew-import-template-sele option:selected').text());
|
826 |
+
wt_iew_basic_import.refresh_step();
|
827 |
+
}
|
828 |
+
});
|
829 |
+
|
830 |
+
|
831 |
+
/* callback for external adapters */
|
832 |
+
if($('select[name="wt_iew_file_from"]').length>0) /* multiple adapter exists so select box */
|
833 |
+
{
|
834 |
+
this.file_from=$('[name="wt_iew_file_from"]').val();
|
835 |
+
$('[name="wt_iew_file_from"]').unbind('change').on('change',function(){
|
836 |
+
wt_iew_basic_import.file_from=$(this).val();
|
837 |
+
wt_iew_basic_import.is_valid_file=false;
|
838 |
+
wt_iew_set_file_from_fields(wt_iew_basic_import.file_from);
|
839 |
+
});
|
840 |
+
}else /* radio button */
|
841 |
+
{
|
842 |
+
this.file_from=$('[name="wt_iew_file_from"]:checked').val();
|
843 |
+
$('[name="wt_iew_file_from"]').on('click',function(){
|
844 |
+
wt_iew_basic_import.file_from=$('[name="wt_iew_file_from"]:checked').val();
|
845 |
+
wt_iew_basic_import.is_valid_file=false;
|
846 |
+
wt_iew_set_file_from_fields(wt_iew_basic_import.file_from);
|
847 |
+
});
|
848 |
+
}
|
849 |
+
wt_iew_set_file_from_fields(wt_iew_basic_import.file_from);
|
850 |
+
|
851 |
+
/* CSV delimiter form toggler. Custom and preset delimiter */
|
852 |
+
wt_iew_custom_and_preset.delimiter_toggler();
|
853 |
+
|
854 |
+
/* Input date format form toggler. Custom and preset date format */
|
855 |
+
wt_iew_custom_and_preset.date_format_toggler();
|
856 |
+
|
857 |
+
wt_iew_dropzone.init('wt_iew_local_file_dropzone');
|
858 |
+
}
|
859 |
+
else if(step=='mapping') /* mapping page */
|
860 |
+
{
|
861 |
+
this.enable_sortable();
|
862 |
+
this.mapping_box_accordian();
|
863 |
+
this.reg_mapping_field_bulk_action();
|
864 |
+
wt_iew_popover.Set();
|
865 |
+
}
|
866 |
+
else if(step=='advanced')
|
867 |
+
{
|
868 |
+
|
869 |
+
}
|
870 |
+
|
871 |
+
/* common events */
|
872 |
+
if($('.wt_iew_datepicker').length>0)
|
873 |
+
{
|
874 |
+
$('.wt_iew_datepicker').datepicker();
|
875 |
+
}
|
876 |
+
wt_field_group.Set();
|
877 |
+
wt_iew_form_toggler.Set();
|
878 |
+
wt_iew_conditional_help_text.Set(this.get_page_dom_object(step));
|
879 |
+
},
|
880 |
+
enable_sortable:function()
|
881 |
+
{
|
882 |
+
$('.meta_mapping_box_con[data-sortable="0"]').each(function(){
|
883 |
+
var tb=$(this).find(".wt-iew-mapping-tb tbody");
|
884 |
+
if(tb.length>0)
|
885 |
+
{
|
886 |
+
tb.sortable({
|
887 |
+
handle: ".wt_iew_sort_handle",
|
888 |
+
placeholder: "wt-iew-sortable-placeholder",
|
889 |
+
forcePlaceholderSize: true,
|
890 |
+
revert:true
|
891 |
+
});
|
892 |
+
$(this).attr('data-sortable', 1);
|
893 |
+
}
|
894 |
+
});
|
895 |
+
},
|
896 |
+
toggle_import_method_options:function()
|
897 |
+
{
|
898 |
+
$('.wt-iew-import-method-options').hide();
|
899 |
+
$('.wt-iew-import-method-options-'+this.import_method).show();
|
900 |
+
},
|
901 |
+
mapping_box_accordian:function()
|
902 |
+
{
|
903 |
+
$('.meta_mapping_box_hd').unbind('click').click(function()
|
904 |
+
{
|
905 |
+
/* if popover is opened */
|
906 |
+
wt_iew_popover.closePop();
|
907 |
+
|
908 |
+
var c_dv=$(this).parents('.meta_mapping_box').find('.meta_mapping_box_con');
|
909 |
+
if(c_dv.is(':visible'))
|
910 |
+
{
|
911 |
+
c_dv.hide();
|
912 |
+
$(this).find('.dashicons').removeClass('dashicons-arrow-down').addClass('dashicons-arrow-right');
|
913 |
+
}else
|
914 |
+
{
|
915 |
+
c_dv.show();
|
916 |
+
c_dv.find(".wt-iew-mapping-tb tbody tr td").each(function(){
|
917 |
+
$(this).css({'width':$(this).width()});
|
918 |
+
});
|
919 |
+
$(this).find('.dashicons').removeClass('dashicons-arrow-right').addClass('dashicons-arrow-down');
|
920 |
+
}
|
921 |
+
});
|
922 |
+
},
|
923 |
+
mapping_fields_selected_count:function(tb_elm)
|
924 |
+
{
|
925 |
+
tb_elm.parents('.meta_mapping_box').find('.meta_mapping_box_selected_count_box_num').text(tb_elm.find('.wt_iew_mapping_checkbox_sub:checked').length);
|
926 |
+
},
|
927 |
+
reg_mapping_field_bulk_action:function()
|
928 |
+
{
|
929 |
+
$('.wt_iew_mapping_checkbox_main').each(function()
|
930 |
+
{
|
931 |
+
var tb=$(this).parents('.wt-iew-mapping-tb');
|
932 |
+
if(tb.find('.wt_iew_mapping_checkbox_sub:checked').length==tb.find('.wt_iew_mapping_checkbox_sub').length)
|
933 |
+
{
|
934 |
+
tb.find('.wt_iew_mapping_checkbox_main').prop('checked',true);
|
935 |
+
}else
|
936 |
+
{
|
937 |
+
tb.find('.wt_iew_mapping_checkbox_main').prop('checked',false);
|
938 |
+
}
|
939 |
+
wt_iew_basic_import.mapping_fields_selected_count(tb);
|
940 |
+
});
|
941 |
+
|
942 |
+
$('.wt_iew_mapping_checkbox_main').unbind('click').click(function()
|
943 |
+
{
|
944 |
+
var tb=$(this).parents('.wt-iew-mapping-tb');
|
945 |
+
if($(this).is(':checked'))
|
946 |
+
{
|
947 |
+
tb.find('.wt_iew_mapping_checkbox_sub').prop('checked',true);
|
948 |
+
}else
|
949 |
+
{
|
950 |
+
tb.find('.wt_iew_mapping_checkbox_sub').prop('checked',false);
|
951 |
+
}
|
952 |
+
wt_iew_basic_import.mapping_fields_selected_count(tb);
|
953 |
+
});
|
954 |
+
$('.wt_iew_mapping_checkbox_sub').unbind('click').click(function()
|
955 |
+
{
|
956 |
+
var tb=$(this).parents('.wt-iew-mapping-tb');
|
957 |
+
if($(this).is(':checked') && tb.find('.wt_iew_mapping_checkbox_sub:checked').length==tb.find('.wt_iew_mapping_checkbox_sub').length)
|
958 |
+
{
|
959 |
+
tb.find('.wt_iew_mapping_checkbox_main').prop('checked',true);
|
960 |
+
}else
|
961 |
+
{
|
962 |
+
tb.find('.wt_iew_mapping_checkbox_main').prop('checked',false);
|
963 |
+
}
|
964 |
+
wt_iew_basic_import.mapping_fields_selected_count(tb);
|
965 |
+
});
|
966 |
+
},
|
967 |
+
set_step_page:function(data)
|
968 |
+
{
|
969 |
+
page_html=data.page_html;
|
970 |
+
$.each(page_html, function(step_id, page_content){
|
971 |
+
wt_iew_basic_import.get_page_dom_object(step_id).html(page_content);
|
972 |
+
wt_iew_basic_import.page_actions(step_id);
|
973 |
+
|
974 |
+
if(step_id=='method_import' && (wt_iew_basic_import.selected_template>0 || wt_iew_basic_import.on_rerun))
|
975 |
+
{
|
976 |
+
wt_iew_basic_import.form_data=data.template_data;
|
977 |
+
|
978 |
+
if(wt_iew_basic_import.on_rerun)
|
979 |
+
{
|
980 |
+
if($('.wt-iew-import-template-sele').val()==0)
|
981 |
+
{
|
982 |
+
wt_iew_basic_import.selected_template=0;
|
983 |
+
wt_iew_basic_import.selected_template_name='';
|
984 |
+
}else
|
985 |
+
{
|
986 |
+
wt_iew_basic_import.selected_template=$('.wt-iew-import-template-sele').val();
|
987 |
+
wt_iew_basic_import.selected_template_name=$.trim($('.wt-iew-import-template-sele option:selected').text());
|
988 |
+
}
|
989 |
+
}
|
990 |
+
}
|
991 |
+
wt_iew_basic_import.show_post_type_name();
|
992 |
+
});
|
993 |
+
this.reg_button_actions();
|
994 |
+
},
|
995 |
+
prepare_ajax_data:function(action, data_type)
|
996 |
+
{
|
997 |
+
this.ajax_data = {
|
998 |
+
'_wpnonce': wt_iew_basic_params.nonces.main,
|
999 |
+
'action': "iew_import_ajax_basic",
|
1000 |
+
'import_action': action,
|
1001 |
+
'selected_template': this.selected_template,
|
1002 |
+
'to_import': this.to_import,
|
1003 |
+
'data_type': data_type,
|
1004 |
+
'import_method': this.import_method,
|
1005 |
+
'temp_import_file': this.temp_import_file,
|
1006 |
+
};
|
1007 |
+
|
1008 |
+
if($('[name="wt_iew_delimiter"]').length>0){
|
1009 |
+
this.import_delimiter = $('[name="wt_iew_delimiter"]').val();
|
1010 |
+
this.ajax_data['delimiter'] = this.import_delimiter;
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
},
|
1014 |
+
mapping_field_editor:function()
|
1015 |
+
{
|
1016 |
+
mapping_field_editor.Set();
|
1017 |
+
},
|
1018 |
+
mapping_field_editor_validate_column_val:function(vl)
|
1019 |
+
{
|
1020 |
+
return mapping_field_editor.validate_column_val(vl);
|
1021 |
+
},
|
1022 |
+
mapping_field_editor_output_preview:function()
|
1023 |
+
{
|
1024 |
+
mapping_field_editor.output_preview();
|
1025 |
+
},
|
1026 |
+
is_object:function(obj)
|
1027 |
+
{
|
1028 |
+
return obj !== undefined && obj !== null && obj.constructor == Object;
|
1029 |
+
}
|
1030 |
+
}
|
1031 |
+
|
1032 |
+
var mapping_field_editor=
|
1033 |
+
{
|
1034 |
+
text_area_pos:null,
|
1035 |
+
popover:null,
|
1036 |
+
Set:function()
|
1037 |
+
{
|
1038 |
+
this.popover=$('.wt_iew_popover-content');
|
1039 |
+
this.add_fields();
|
1040 |
+
|
1041 |
+
this.popover.find('.wt_iew_mapping_field_editor_expression').unbind('keyup').on('keyup', function(){
|
1042 |
+
mapping_field_editor.text_area_pos=$(this).getCursorPosition();
|
1043 |
+
mapping_field_editor.output_preview();
|
1044 |
+
});
|
1045 |
+
|
1046 |
+
this.search_column();
|
1047 |
+
},
|
1048 |
+
validate_columns:function()
|
1049 |
+
{
|
1050 |
+
$('.meta_mapping_box_con[data-field-validated="0"]').each(function(){
|
1051 |
+
var tb=$(this).find('.wt-iew-mapping-tb');
|
1052 |
+
if($(this).find('.wt-iew-mapping-tb').length>0)
|
1053 |
+
{
|
1054 |
+
$(this).attr({'data-field-validated':1});
|
1055 |
+
tb.find('.columns_val').each(function(){
|
1056 |
+
var vl=$.trim($(this).val());
|
1057 |
+
if(vl!="")
|
1058 |
+
{
|
1059 |
+
var html_vl=mapping_field_editor.validate_column_val(vl);
|
1060 |
+
$(this).siblings('[data-wt_iew_popover="1"]').html(html_vl);
|
1061 |
+
}
|
1062 |
+
});
|
1063 |
+
}
|
1064 |
+
});
|
1065 |
+
},
|
1066 |
+
validate_column_val:function(str)
|
1067 |
+
{
|
1068 |
+
const regex = /\{([^}]+)\}/g;
|
1069 |
+
let m;
|
1070 |
+
var out=str;
|
1071 |
+
while ((m = regex.exec(str)) !== null)
|
1072 |
+
{
|
1073 |
+
/* This is necessary to avoid infinite loops with zero-width matches */
|
1074 |
+
if (m.index === regex.lastIndex) {
|
1075 |
+
regex.lastIndex++;
|
1076 |
+
}
|
1077 |
+
/* The result can be accessed through the `m`-variable. */
|
1078 |
+
m.forEach((match, groupIndex) => {
|
1079 |
+
|
1080 |
+
/* check date format matching */
|
1081 |
+
var match_arr=match.split('@');
|
1082 |
+
if(match_arr.length==2)/* date format matched */
|
1083 |
+
{
|
1084 |
+
match=match_arr[0];
|
1085 |
+
}
|
1086 |
+
|
1087 |
+
if(!wt_iew_file_head_default.hasOwnProperty(match) && !wt_iew_file_head_meta.hasOwnProperty(match))
|
1088 |
+
{
|
1089 |
+
out=out.replace('{'+match+'}', '<span class="wt_iew_invalid_mapping_field">{'+match+'}</span>');
|
1090 |
+
}
|
1091 |
+
});
|
1092 |
+
}
|
1093 |
+
return out;
|
1094 |
+
},
|
1095 |
+
add_fields:function()
|
1096 |
+
{
|
1097 |
+
this.popover.find('.wt_iew_mapping_field_selector li').unbind('click').click(function(){
|
1098 |
+
var vl=' {'+$(this).attr('data-val')+'} ';
|
1099 |
+
var exp_vl=mapping_field_editor.popover.find('.wt_iew_mapping_field_editor_expression').val();
|
1100 |
+
if(mapping_field_editor.text_area_pos!==null)
|
1101 |
+
{
|
1102 |
+
var new_vl=exp_vl.substr(0, mapping_field_editor.text_area_pos)+vl+exp_vl.substr(mapping_field_editor.text_area_pos);
|
1103 |
+
}else
|
1104 |
+
{
|
1105 |
+
var new_vl=exp_vl+vl;
|
1106 |
+
}
|
1107 |
+
mapping_field_editor.popover.find('.wt_iew_mapping_field_editor_expression').val(new_vl);
|
1108 |
+
mapping_field_editor.output_preview();
|
1109 |
+
})
|
1110 |
+
},
|
1111 |
+
search_column:function()
|
1112 |
+
{
|
1113 |
+
/* my template search */
|
1114 |
+
this.popover.find('.wt_iew_mapping_field_editor_column_search').unbind('keyup').on('keyup',function(){
|
1115 |
+
var vl=$.trim($(this).val());
|
1116 |
+
if(vl!="")
|
1117 |
+
{
|
1118 |
+
vl=vl.toLowerCase();
|
1119 |
+
mapping_field_editor.popover.find('.wt_iew_mapping_field_selector li').hide();
|
1120 |
+
var kk=mapping_field_editor.popover.find('.wt_iew_mapping_field_selector li').filter(function(){
|
1121 |
+
var name=$(this).attr('data-val');
|
1122 |
+
name=name.toLowerCase();
|
1123 |
+
if(name.search(vl)!=-1)
|
1124 |
+
{
|
1125 |
+
return true;
|
1126 |
+
}else
|
1127 |
+
{
|
1128 |
+
return false;
|
1129 |
+
}
|
1130 |
+
});
|
1131 |
+
kk.show();
|
1132 |
+
if(mapping_field_editor.popover.find('.wt_iew_mapping_field_selector li:visible').length==0)
|
1133 |
+
{
|
1134 |
+
mapping_field_editor.popover.find('.wt_iew_mapping_field_selector_no_column').show();
|
1135 |
+
}else
|
1136 |
+
{
|
1137 |
+
mapping_field_editor.popover.find('.wt_iew_mapping_field_selector_no_column').hide();
|
1138 |
+
}
|
1139 |
+
}else
|
1140 |
+
{
|
1141 |
+
mapping_field_editor.popover.find('.wt_iew_mapping_field_selector li').show();
|
1142 |
+
}
|
1143 |
+
});
|
1144 |
+
mapping_field_editor.popover.find('.wt_iew_mapping_field_selector_no_column').hide();
|
1145 |
+
},
|
1146 |
+
output_preview:function()
|
1147 |
+
{
|
1148 |
+
this.popover.find('.wt_iew_mapping_field_editor_er').html('');
|
1149 |
+
const str = this.popover.find('.wt_iew_mapping_field_editor_expression').val();
|
1150 |
+
var out='';
|
1151 |
+
out=this.add_sample_data(str);
|
1152 |
+
out=this.do_arithmetic(out);
|
1153 |
+
this.popover.find('.wt_iew_mapping_field_editor_sample').html(out);
|
1154 |
+
},
|
1155 |
+
add_sample_data:function(str)
|
1156 |
+
{
|
1157 |
+
const regex = /\{([^}]+)\}/g;
|
1158 |
+
|
1159 |
+
let m;
|
1160 |
+
var out=str;
|
1161 |
+
|
1162 |
+
while ((m = regex.exec(str)) !== null) {
|
1163 |
+
/* This is necessary to avoid infinite loops with zero-width matches */
|
1164 |
+
if (m.index === regex.lastIndex) {
|
1165 |
+
regex.lastIndex++;
|
1166 |
+
}
|
1167 |
+
/* The result can be accessed through the `m`-variable. */
|
1168 |
+
m.forEach((match, groupIndex) => {
|
1169 |
+
|
1170 |
+
/* check date format matching */
|
1171 |
+
var match_arr=match.split('@');
|
1172 |
+
if(match_arr.length==2)/* date format matched */
|
1173 |
+
{
|
1174 |
+
match=match_arr[0];
|
1175 |
+
}
|
1176 |
+
|
1177 |
+
var sample_vl=' '; /* do not set default value as empty string */
|
1178 |
+
if(wt_iew_file_head_default.hasOwnProperty(match))
|
1179 |
+
{
|
1180 |
+
var sample_vl=$.trim(wt_iew_file_head_default[match]);
|
1181 |
+
}
|
1182 |
+
else if(wt_iew_file_head_meta.hasOwnProperty(match))
|
1183 |
+
{
|
1184 |
+
var sample_vl=$.trim(wt_iew_file_head_meta[match]);
|
1185 |
+
}
|
1186 |
+
|
1187 |
+
if(match_arr.length==2)/* date format matched */
|
1188 |
+
{
|
1189 |
+
match=match_arr.join('@');
|
1190 |
+
if(sample_vl!="")
|
1191 |
+
{
|
1192 |
+
sample_vl=mapping_field_editor.format_date(sample_vl);
|
1193 |
+
}
|
1194 |
+
}
|
1195 |
+
|
1196 |
+
sample_vl=(sample_vl!="" ? sample_vl : '<span class="wt_iew_no_sample_mapping_data">'+match+'</span>');
|
1197 |
+
out=out.replace('{'+match+'}', sample_vl);
|
1198 |
+
});
|
1199 |
+
}
|
1200 |
+
return out;
|
1201 |
+
},
|
1202 |
+
add_zero:function(i)
|
1203 |
+
{
|
1204 |
+
if(i<10)
|
1205 |
+
{
|
1206 |
+
i="0"+i;
|
1207 |
+
}
|
1208 |
+
return i;
|
1209 |
+
},
|
1210 |
+
format_date:function(date_string)
|
1211 |
+
{
|
1212 |
+
var d = new Date(date_string);
|
1213 |
+
if(d instanceof Date && !isNaN(d))
|
1214 |
+
{
|
1215 |
+
date_string=d.getFullYear()+'-'+this.add_zero(d.getMonth()+1)+'-'+this.add_zero(d.getDate())+' '+this.add_zero(d.getHours())+':'+this.add_zero(d.getMinutes())+':'+this.add_zero(d.getSeconds());
|
1216 |
+
}
|
1217 |
+
return date_string;
|
1218 |
+
},
|
1219 |
+
do_arithmetic:function(str)
|
1220 |
+
{
|
1221 |
+
const regex_arith = /\[([0-9()+\-*/. ]+)\]/g;
|
1222 |
+
let m;
|
1223 |
+
var out=str;
|
1224 |
+
while ((m = regex_arith.exec(str)) !== null) {
|
1225 |
+
/* This is necessary to avoid infinite loops with zero-width matches */
|
1226 |
+
if (m.index === regex_arith.lastIndex) {
|
1227 |
+
regex_arith.lastIndex++;
|
1228 |
+
}
|
1229 |
+
try{
|
1230 |
+
eqn='('+m[1]+')';
|
1231 |
+
eval("var eqn_eval = " + eqn.toLowerCase());
|
1232 |
+
out=out.replace(m[0], eqn_eval);
|
1233 |
+
} catch(e) {
|
1234 |
+
mapping_field_editor.popover.find('.wt_iew_mapping_field_editor_er').html(e);
|
1235 |
+
return false;
|
1236 |
+
}
|
1237 |
+
}
|
1238 |
+
return out;
|
1239 |
+
}
|
1240 |
+
}
|
1241 |
+
|
1242 |
+
return wt_iew_basic_import;
|
1243 |
+
})( jQuery );
|
1244 |
+
|
1245 |
+
(function ($, undefined) {
|
1246 |
+
$.fn.getCursorPosition = function() {
|
1247 |
+
var el = $(this).get(0);
|
1248 |
+
var pos = 0;
|
1249 |
+
if('selectionStart' in el) {
|
1250 |
+
pos = el.selectionStart;
|
1251 |
+
} else if('selection' in document) {
|
1252 |
+
el.focus();
|
1253 |
+
var Sel = document.selection.createRange();
|
1254 |
+
var SelLength = document.selection.createRange().text.length;
|
1255 |
+
Sel.moveStart('character', -el.value.length);
|
1256 |
+
pos = Sel.text.length - SelLength;
|
1257 |
+
}
|
1258 |
+
return pos;
|
1259 |
+
}
|
1260 |
+
})(jQuery);
|
1261 |
+
|
1262 |
+
/**
|
1263 |
+
* Dropzone initaiting section
|
1264 |
+
* More info at [www.dropzonejs.com](http://www.dropzonejs.com)
|
1265 |
+
*/
|
1266 |
+
var wt_iew_dropzone=
|
1267 |
+
{
|
1268 |
+
elm:null,
|
1269 |
+
old_file:false,
|
1270 |
+
Set:function()
|
1271 |
+
{
|
1272 |
+
if(typeof Dropzone==='undefined'){
|
1273 |
+
return false;
|
1274 |
+
}
|
1275 |
+
Dropzone.autoDiscover = false;
|
1276 |
+
},
|
1277 |
+
init:function(elm_id)
|
1278 |
+
{
|
1279 |
+
if(typeof Dropzone==='undefined'){
|
1280 |
+
return false;
|
1281 |
+
}
|
1282 |
+
this.elm=jQuery("#"+elm_id);
|
1283 |
+
|
1284 |
+
var ajax_data={
|
1285 |
+
'_wpnonce': wt_iew_basic_params.nonces.main,
|
1286 |
+
'action': "iew_import_ajax_basic",
|
1287 |
+
'import_action': 'upload_import_file',
|
1288 |
+
'data_type': 'json',
|
1289 |
+
'file_url': '',
|
1290 |
+
};
|
1291 |
+
var drop_zone_obj = new Dropzone(
|
1292 |
+
"#"+elm_id, {
|
1293 |
+
url:wt_iew_basic_params.ajax_url,
|
1294 |
+
createImageThumbnails:false,
|
1295 |
+
acceptedFiles:wt_iew_import_basic_params.allowed_import_file_type_mime.join(", "),
|
1296 |
+
paramName:'wt_iew_import_file',
|
1297 |
+
dictDefaultMessage:wt_iew_import_basic_params.msgs.drop_upload,
|
1298 |
+
dictInvalidFileType:wt_iew_import_basic_params.msgs.invalid_file,
|
1299 |
+
dictResponseError:wt_iew_import_basic_params.msgs.server_error,
|
1300 |
+
params:ajax_data,
|
1301 |
+
uploadMultiple:false,
|
1302 |
+
parallelUploads:1,
|
1303 |
+
maxFiles:1,
|
1304 |
+
maxFilesize:wt_iew_import_basic_params.max_import_file_size,
|
1305 |
+
previewTemplate:"<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-upload-info\"></div> \n <div class=\"dz-details\">\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n </div>",
|
1306 |
+
}
|
1307 |
+
);
|
1308 |
+
|
1309 |
+
drop_zone_obj.on("addedfile", function(file) {
|
1310 |
+
jQuery(".dz-upload-info").html(wt_iew_import_basic_params.msgs.uploading);
|
1311 |
+
jQuery(".dz-message").css({'margin-top':'85px'});
|
1312 |
+
|
1313 |
+
var dropzone_target=wt_iew_dropzone.elm.attr('wt_iew_dropzone_target');
|
1314 |
+
var dropzone_target_elm=jQuery(dropzone_target);
|
1315 |
+
if(dropzone_target_elm.length>0)
|
1316 |
+
{
|
1317 |
+
var file_url=dropzone_target_elm.val();
|
1318 |
+
if(file_url!="")
|
1319 |
+
{
|
1320 |
+
drop_zone_obj.options.params['file_url']=file_url; /* this is to remove the already uploaded file */
|
1321 |
+
}
|
1322 |
+
}
|
1323 |
+
|
1324 |
+
});
|
1325 |
+
|
1326 |
+
drop_zone_obj.on("dragstart", function(file) {
|
1327 |
+
wt_iew_dropzone.elm.addClass('wt_drag_start');
|
1328 |
+
});
|
1329 |
+
|
1330 |
+
drop_zone_obj.on("dragover", function(file) {
|
1331 |
+
wt_iew_dropzone.elm.addClass('wt_drag_start');
|
1332 |
+
});
|
1333 |
+
|
1334 |
+
drop_zone_obj.on("dragleave", function(file) {
|
1335 |
+
wt_iew_dropzone.elm.removeClass('wt_drag_start');
|
1336 |
+
});
|
1337 |
+
|
1338 |
+
drop_zone_obj.on("drop", function(file) {
|
1339 |
+
wt_iew_dropzone.elm.removeClass('wt_drag_start');
|
1340 |
+
});
|
1341 |
+
|
1342 |
+
drop_zone_obj.on("dragend", function(file) {
|
1343 |
+
wt_iew_dropzone.elm.removeClass('wt_drag_start');
|
1344 |
+
});
|
1345 |
+
|
1346 |
+
drop_zone_obj.on("fallback", function(file) {
|
1347 |
+
wt_iew_dropzone.elm.html(wt_iew_import_basic_params.msgs.outdated);
|
1348 |
+
return null;
|
1349 |
+
});
|
1350 |
+
drop_zone_obj.on("error", function(file, message) {
|
1351 |
+
drop_zone_obj.removeFile(file);
|
1352 |
+
wt_iew_notify_msg.error(message);
|
1353 |
+
});
|
1354 |
+
|
1355 |
+
drop_zone_obj.on("success", function(file, response) {
|
1356 |
+
|
1357 |
+
var file_name=file.name;
|
1358 |
+
|
1359 |
+
/* remove file obj */
|
1360 |
+
drop_zone_obj.removeFile(file);
|
1361 |
+
|
1362 |
+
/* register file deleting event */
|
1363 |
+
wt_iew_dropzone.remove_file();
|
1364 |
+
|
1365 |
+
if(wt_iew_dropzone.isJson(response))
|
1366 |
+
{
|
1367 |
+
response=JSON.parse(response);
|
1368 |
+
if(response.status==1)
|
1369 |
+
{
|
1370 |
+
jQuery(".wt_iew_dz_file_success").html(wt_iew_import_basic_params.msgs.upload_done);
|
1371 |
+
jQuery(".wt_iew_dz_remove_link").html(wt_iew_import_basic_params.msgs.remove);
|
1372 |
+
jQuery(".wt_iew_dz_file_name").html(file_name);
|
1373 |
+
jQuery(".dz-message").css({'margin-top':'60px'});
|
1374 |
+
|
1375 |
+
var dropzone_target=wt_iew_dropzone.elm.attr('wt_iew_dropzone_target');
|
1376 |
+
var dropzone_target_elm=jQuery(dropzone_target);
|
1377 |
+
if(dropzone_target_elm.length>0)
|
1378 |
+
{
|
1379 |
+
dropzone_target_elm.val(response.url);
|
1380 |
+
|
1381 |
+
}
|
1382 |
+
}else
|
1383 |
+
{
|
1384 |
+
wt_iew_notify_msg.error(response.msg);
|
1385 |
+
}
|
1386 |
+
}else
|
1387 |
+
{
|
1388 |
+
wt_iew_notify_msg.error(wt_iew_basic_params.msgs.error);
|
1389 |
+
}
|
1390 |
+
});
|
1391 |
+
},
|
1392 |
+
remove_file:function()
|
1393 |
+
{
|
1394 |
+
jQuery('.wt_iew_dz_remove_link').unbind('click').click(function(e){
|
1395 |
+
e.stopPropagation();
|
1396 |
+
|
1397 |
+
var dropzone_target=wt_iew_dropzone.elm.attr('wt_iew_dropzone_target');
|
1398 |
+
var dropzone_target_elm=jQuery(dropzone_target);
|
1399 |
+
if(dropzone_target_elm.length>0)
|
1400 |
+
{
|
1401 |
+
var file_url=dropzone_target_elm.val();
|
1402 |
+
if(file_url!="")
|
1403 |
+
{
|
1404 |
+
dropzone_target_elm.val('');
|
1405 |
+
jQuery(".wt_iew_dz_file_success, .wt_iew_dz_remove_link, .wt_iew_dz_file_name").html('');
|
1406 |
+
jQuery(".dz-message").css({'margin-top':'85px'});
|
1407 |
+
|
1408 |
+
jQuery.ajax({
|
1409 |
+
type: 'POST',
|
1410 |
+
url:wt_iew_basic_params.ajax_url,
|
1411 |
+
data:{
|
1412 |
+
'_wpnonce': wt_iew_basic_params.nonces.main,
|
1413 |
+
'action': "iew_import_ajax_basic",
|
1414 |
+
'import_action': 'delete_import_file',
|
1415 |
+
'data_type': 'json',
|
1416 |
+
'file_url':file_url,
|
1417 |
+
},
|
1418 |
+
dataType:'json'
|
1419 |
+
|
1420 |
+
});
|
1421 |
+
}
|
1422 |
+
}
|
1423 |
+
});
|
1424 |
+
},
|
1425 |
+
isJson:function(str)
|
1426 |
+
{
|
1427 |
+
try {
|
1428 |
+
JSON.parse(str);
|
1429 |
+
} catch (e) {
|
1430 |
+
return false;
|
1431 |
+
}
|
1432 |
+
return true;
|
1433 |
+
}
|
1434 |
+
}
|
1435 |
+
wt_iew_dropzone.Set();
|
1436 |
+
|
1437 |
+
|
1438 |
+
jQuery(function() {
|
1439 |
+
|
1440 |
+
if(wt_iew_import_basic_params.rerun_id>0)
|
1441 |
+
{
|
1442 |
+
wt_iew_basic_import.to_import=wt_iew_import_basic_params.to_import;
|
1443 |
+
wt_iew_basic_import.import_method=wt_iew_import_basic_params.import_method;
|
1444 |
+
wt_iew_basic_import.rerun_id=wt_iew_import_basic_params.rerun_id;
|
1445 |
+
wt_iew_basic_import.on_rerun=true;
|
1446 |
+
wt_iew_basic_import.is_valid_file=true;
|
1447 |
+
wt_iew_basic_import.temp_import_file=wt_iew_import_basic_params.temp_import_file;
|
1448 |
+
}
|
1449 |
+
wt_iew_basic_import.Set();
|
1450 |
+
});
|
admin/modules/import/classes/class-import-ajax.php
ADDED
@@ -0,0 +1,1191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Ajax section of the Import module
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Import_Ajax')){
|
14 |
+
class Wt_Import_Export_For_Woo_Basic_Import_Ajax
|
15 |
+
{
|
16 |
+
public $step='';
|
17 |
+
public $steps=array();
|
18 |
+
public $step_btns=array();
|
19 |
+
public $import_method='';
|
20 |
+
public $to_import='';
|
21 |
+
|
22 |
+
protected $step_title='';
|
23 |
+
protected $step_keys=array();
|
24 |
+
protected $current_step_index=0;
|
25 |
+
protected $current_step_number=1;
|
26 |
+
protected $last_page=false;
|
27 |
+
protected $total_steps=0;
|
28 |
+
protected $step_summary='';
|
29 |
+
protected $step_description='';
|
30 |
+
protected $mapping_enabled_fields=array();
|
31 |
+
protected $mapping_templates=array();
|
32 |
+
protected $selected_template=0;
|
33 |
+
protected $selected_template_form_data=array();
|
34 |
+
protected $import_obj=null;
|
35 |
+
protected $field_group_prefixes=array();
|
36 |
+
protected $rerun_id=0;
|
37 |
+
|
38 |
+
public function __construct($import_obj, $to_import, $steps, $import_method, $selected_template, $rerun_id)
|
39 |
+
{
|
40 |
+
$this->import_obj=$import_obj;
|
41 |
+
$this->to_import=$to_import;
|
42 |
+
$this->steps=$steps;
|
43 |
+
$this->import_method=$import_method;
|
44 |
+
$this->selected_template=$selected_template;
|
45 |
+
$this->rerun_id=$rerun_id;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* This array is to group the fields in the input file that are not in the default list.
|
49 |
+
*/
|
50 |
+
$this->field_group_prefixes=array(
|
51 |
+
'taxonomies'=>array('tax'),
|
52 |
+
'meta'=>array('meta'),
|
53 |
+
'attributes'=>array('attribute', 'attribute_data', 'attribute_default', 'meta:attribute'),
|
54 |
+
'hidden_meta'=>array('meta:_'),
|
55 |
+
);
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Ajax main function to retrive steps HTML
|
60 |
+
*/
|
61 |
+
public function get_steps($out)
|
62 |
+
{
|
63 |
+
//sleep(3);
|
64 |
+
$steps=(is_array($_POST['steps']) ? $_POST['steps'] : array($_POST['steps']));
|
65 |
+
$steps=Wt_Iew_Sh::sanitize_item($steps, 'text_arr');
|
66 |
+
$page_html=array();
|
67 |
+
|
68 |
+
if($this->selected_template>0) /* taking selected tamplate formdata */
|
69 |
+
{
|
70 |
+
$this->get_template_form_data($this->selected_template);
|
71 |
+
|
72 |
+
}elseif($this->rerun_id>0)
|
73 |
+
{
|
74 |
+
$this->selected_template_form_data=$this->import_obj->form_data;
|
75 |
+
}
|
76 |
+
|
77 |
+
foreach($steps as $step)
|
78 |
+
{
|
79 |
+
$method_name=$step.'_page';
|
80 |
+
if(method_exists($this, $method_name))
|
81 |
+
{
|
82 |
+
$page_html[$step]=$this->{$method_name}();
|
83 |
+
|
84 |
+
if($step=='method_import' && ($this->selected_template>0 || $this->rerun_id>0))
|
85 |
+
{
|
86 |
+
$out['template_data']=$this->selected_template_form_data;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
$out['status']=1;
|
91 |
+
$out['page_html']=$page_html;
|
92 |
+
return $out;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Delete uploaded import file
|
97 |
+
*
|
98 |
+
*/
|
99 |
+
public function delete_import_file($out)
|
100 |
+
{
|
101 |
+
$file_url=(isset($_POST['file_url']) ? esc_url_raw($_POST['file_url']) : '');
|
102 |
+
$out['file_url']=$file_url;
|
103 |
+
if($file_url!="" && $this->import_obj->delete_import_file($file_url))
|
104 |
+
{
|
105 |
+
$out['status']=1;
|
106 |
+
$out['msg']='';
|
107 |
+
}
|
108 |
+
return $out;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Upload import file (Drag and drop upload)
|
113 |
+
*
|
114 |
+
*/
|
115 |
+
public function upload_import_file($out)
|
116 |
+
{
|
117 |
+
if(isset($_FILES['wt_iew_import_file']))
|
118 |
+
{
|
119 |
+
|
120 |
+
$is_file_type_allowed=false;
|
121 |
+
if(!in_array($_FILES['wt_iew_import_file']['type'], $this->import_obj->allowed_import_file_type_mime)) /* Not allowed file type. [Bug fix for Windows OS]Then verify it again with file extension */
|
122 |
+
{
|
123 |
+
$ext=pathinfo($_FILES['wt_iew_import_file']['name'], PATHINFO_EXTENSION);
|
124 |
+
if(isset($this->import_obj->allowed_import_file_type_mime[$ext])) /* extension exists. */
|
125 |
+
{
|
126 |
+
$is_file_type_allowed=true;
|
127 |
+
}
|
128 |
+
}else
|
129 |
+
{
|
130 |
+
$is_file_type_allowed=true;
|
131 |
+
}
|
132 |
+
|
133 |
+
if($is_file_type_allowed) /* Allowed file type */
|
134 |
+
{
|
135 |
+
|
136 |
+
@set_time_limit(3600); // 1 hour
|
137 |
+
|
138 |
+
$max_bytes=($this->import_obj->max_import_file_size*1000000); //convert to bytes
|
139 |
+
if($max_bytes>=$_FILES['wt_iew_import_file']['size'])
|
140 |
+
{
|
141 |
+
$file_name='local_file_'.time().'_'.sanitize_file_name($_FILES['wt_iew_import_file']['name']); //sanitize the file name, add a timestamp prefix to avoid conflict
|
142 |
+
$file_path=$this->import_obj->get_file_path($file_name);
|
143 |
+
if(@move_uploaded_file($_FILES['wt_iew_import_file']['tmp_name'], $file_path))
|
144 |
+
{
|
145 |
+
$out['msg']='';
|
146 |
+
$out['status']=1;
|
147 |
+
$out['url']=$this->import_obj->get_file_url($file_name);
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Check old file exists, and delete it
|
151 |
+
*/
|
152 |
+
$file_url=(isset($_POST['file_url']) ? esc_url_raw($_POST['file_url']) : '');
|
153 |
+
if($file_url!="")
|
154 |
+
{
|
155 |
+
$this->import_obj->delete_import_file($file_url);
|
156 |
+
}
|
157 |
+
}else
|
158 |
+
{
|
159 |
+
$out['msg']=__('Unable to upload file. Please check write permission of your `wp-content` folder.');
|
160 |
+
}
|
161 |
+
}else
|
162 |
+
{
|
163 |
+
$out['msg']=sprintf(__('File size exceeds the limit. %dMB max'), $this->import_obj->max_import_file_size);
|
164 |
+
}
|
165 |
+
}else
|
166 |
+
{
|
167 |
+
$out['msg']=sprintf(__('Invalid file type. Only %s are allowed.'), implode(", ", array_values($this->import_obj->allowed_import_file_type)));
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
return $out;
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Ajax hook to download the input file as temp file and validate its extension.
|
176 |
+
*/
|
177 |
+
public function validate_file($out)
|
178 |
+
{
|
179 |
+
/* process form data */
|
180 |
+
$form_data=(isset($_POST['form_data']) ? Wt_Import_Export_For_Woo_Basic_Common_Helper::process_formdata(maybe_unserialize(($_POST['form_data']))) : array());
|
181 |
+
$response=$this->import_obj->download_remote_file($form_data);
|
182 |
+
|
183 |
+
if($response['response']) /* temp file created. Then delete old temp file if exists */
|
184 |
+
{
|
185 |
+
$temp_import_file=(isset($_POST['temp_import_file']) ? sanitize_file_name($_POST['temp_import_file']) : '');
|
186 |
+
if($temp_import_file!="")
|
187 |
+
{
|
188 |
+
$file_path=$this->import_obj->get_file_path($temp_import_file);
|
189 |
+
if(file_exists($file_path))
|
190 |
+
{
|
191 |
+
@unlink($file_path);
|
192 |
+
}
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
$out['status']=($response['response'] ? 1 : 0);
|
197 |
+
$out['msg']=($response['msg']!="" ? $response['msg'] : $out['msg']);
|
198 |
+
$out['file_name']=(isset($response['file_name']) ? $response['file_name'] : '');
|
199 |
+
|
200 |
+
return $out;
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Ajax function to retrive meta step data
|
205 |
+
*/
|
206 |
+
public function get_meta_mapping_fields($out)
|
207 |
+
{
|
208 |
+
if($this->selected_template>0) /* taking selected tamplate formdata */
|
209 |
+
{
|
210 |
+
$this->get_template_form_data($this->selected_template);
|
211 |
+
|
212 |
+
}elseif($this->rerun_id>0)
|
213 |
+
{
|
214 |
+
$this->selected_template_form_data=$this->import_obj->form_data;
|
215 |
+
}
|
216 |
+
|
217 |
+
/* This is the sample data from input file */
|
218 |
+
$file_heading_meta_fields=(isset($_POST['file_head_meta']) ? json_decode(stripslashes($_POST['file_head_meta']), true) : array());
|
219 |
+
|
220 |
+
//taking current page form data
|
221 |
+
$meta_step_form_data=(isset($this->selected_template_form_data['meta_step_form_data']) ? $this->selected_template_form_data['meta_step_form_data'] : array());
|
222 |
+
|
223 |
+
/* formdata/template data of fields in mapping page */
|
224 |
+
$form_data_meta_mapping_fields=isset($meta_step_form_data['mapping_fields']) ? $meta_step_form_data['mapping_fields'] : array();
|
225 |
+
|
226 |
+
|
227 |
+
$meta_mapping_screen_fields=$this->_get_meta_mapping_screen_fields($form_data_meta_mapping_fields);
|
228 |
+
|
229 |
+
$draggable_tooltip=__("Drag to rearrange the columns");
|
230 |
+
$module_url=plugin_dir_url(dirname(__FILE__));
|
231 |
+
|
232 |
+
|
233 |
+
/* preparing meta fields. */
|
234 |
+
$prepared_meta_fields=array();
|
235 |
+
if($meta_mapping_screen_fields && is_array($meta_mapping_screen_fields))
|
236 |
+
{
|
237 |
+
/* loop through mapping fields */
|
238 |
+
foreach($meta_mapping_screen_fields as $meta_mapping_screen_field_key=>$meta_mapping_screen_field_val)
|
239 |
+
{
|
240 |
+
/* decalaring an empty array*/
|
241 |
+
$temp_arr=array();
|
242 |
+
|
243 |
+
/* current field group(tax, meta) formdata */
|
244 |
+
$current_meta_step_form_data=(isset($form_data_meta_mapping_fields[$meta_mapping_screen_field_key]) ? $form_data_meta_mapping_fields[$meta_mapping_screen_field_key] : array());
|
245 |
+
|
246 |
+
/* default field list from post type module */
|
247 |
+
$mapping_fields=((isset($meta_mapping_screen_field_val['fields']) && is_array($meta_mapping_screen_field_val['fields'])) ? $meta_mapping_screen_field_val['fields'] : array());
|
248 |
+
|
249 |
+
/* loop through form data */
|
250 |
+
foreach($current_meta_step_form_data as $key=>$val_arr) /* looping the template form data */
|
251 |
+
{
|
252 |
+
$val=$val_arr[0]; /* normal column val */
|
253 |
+
$checked=$val_arr[1]; /* import this column? */
|
254 |
+
|
255 |
+
if(isset($mapping_fields[$key])) /* found in default field list */
|
256 |
+
{
|
257 |
+
$label=(isset($mapping_fields[$key]['title']) ? $mapping_fields[$key]['title'] : '');
|
258 |
+
$description=(isset($mapping_fields[$key]['description']) ? $mapping_fields[$key]['title'] : '');
|
259 |
+
$type=(isset($mapping_fields[$key]['type']) ? $mapping_fields[$key]['type'] : '');
|
260 |
+
unset($mapping_fields[$key]); //remove the field from default list
|
261 |
+
|
262 |
+
if(isset($file_heading_meta_fields[$key])) /* also found in file heading list */
|
263 |
+
{
|
264 |
+
unset($file_heading_meta_fields[$key]); //remove the field from file heading list
|
265 |
+
}
|
266 |
+
$temp_arr[$key]=array('label'=>$label, 'description'=>$description, 'val'=>$val, 'checked'=>$checked, 'type'=>$type);
|
267 |
+
}
|
268 |
+
elseif(isset($file_heading_meta_fields[$key])) /* found in file heading list */
|
269 |
+
{
|
270 |
+
$label=$key;
|
271 |
+
$description=$this->prepare_field_description($key);
|
272 |
+
$type='';
|
273 |
+
unset($file_heading_meta_fields[$key]); //remove the field from file heading list
|
274 |
+
$temp_arr[$key]=array('label'=>$label, 'description'=>$description, 'val'=>$val, 'checked'=>$checked, 'type'=>$type);
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
/* loop through mapping fields */
|
279 |
+
if(count($mapping_fields)>0)
|
280 |
+
{
|
281 |
+
foreach($mapping_fields as $key=>$val_arr)
|
282 |
+
{
|
283 |
+
$label=(isset($val_arr['title']) ? $val_arr['title'] : '');
|
284 |
+
$description=(isset($val_arr['description']) ? $val_arr['description'] : '');
|
285 |
+
$type=(isset($val_arr['type']) ? $val_arr['type'] : '');
|
286 |
+
$val='';
|
287 |
+
$checked=0; /* import this column? */
|
288 |
+
if(isset($file_heading_meta_fields[$key]))
|
289 |
+
{
|
290 |
+
$checked=1; /* import this column? */
|
291 |
+
$val='{'.$key.'}';
|
292 |
+
unset($file_heading_meta_fields[$key]); //remove the field from file heading list
|
293 |
+
}
|
294 |
+
$temp_arr[$key]=array('label'=>$label, 'description'=>$description, 'val'=>$val, 'checked'=>$checked, 'type'=>$type);
|
295 |
+
}
|
296 |
+
}
|
297 |
+
|
298 |
+
if(count($file_heading_meta_fields)>0)
|
299 |
+
{
|
300 |
+
$current_field_group_prefix_arr=(isset($this->field_group_prefixes[$meta_mapping_screen_field_key]) ? $this->field_group_prefixes[$meta_mapping_screen_field_key] : array());
|
301 |
+
foreach($file_heading_meta_fields as $key=>$sample_val)
|
302 |
+
{
|
303 |
+
$is_include=$this->_is_include_meta_in_this_group($current_field_group_prefix_arr, $key);
|
304 |
+
if($is_include==1)
|
305 |
+
{
|
306 |
+
$label=Wt_Iew_Sh::sanitize_item($key);
|
307 |
+
$description=$this->prepare_field_description($key);
|
308 |
+
$type='';
|
309 |
+
$val='{'.$key.'}';
|
310 |
+
$checked=1; /* import this column? */
|
311 |
+
unset($file_heading_meta_fields[$key]); //remove the field from file heading list
|
312 |
+
$temp_arr[$key]=array('label'=>$label, 'description'=>$description, 'val'=>$val, 'checked'=>$checked, 'type'=>$type);
|
313 |
+
}
|
314 |
+
}
|
315 |
+
}
|
316 |
+
|
317 |
+
/* adding value to main array */
|
318 |
+
$prepared_meta_fields[$meta_mapping_screen_field_key]=array('fields'=>$temp_arr, 'checked'=>(isset($meta_mapping_screen_field_val['checked']) && $meta_mapping_screen_field_val['checked']==1 ? 1 : 0) );
|
319 |
+
}
|
320 |
+
|
321 |
+
/* if any columns that not in the above list */
|
322 |
+
if(count($file_heading_meta_fields)>0)
|
323 |
+
{
|
324 |
+
//do something
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
/* prepare HTML for meta mapping step */
|
329 |
+
$meta_html=array();
|
330 |
+
|
331 |
+
/* loop through prepared meta fields */
|
332 |
+
foreach($prepared_meta_fields as $meta_mapping_screen_field_key=>$meta_mapping_screen_field_val)
|
333 |
+
{
|
334 |
+
ob_start();
|
335 |
+
include dirname(plugin_dir_path(__FILE__)).'/views/_import_meta_step_page.php';
|
336 |
+
$meta_html[$meta_mapping_screen_field_key]=ob_get_clean();
|
337 |
+
}
|
338 |
+
|
339 |
+
$out['status']=1;
|
340 |
+
$out['meta_html']=$meta_html;
|
341 |
+
return $out;
|
342 |
+
}
|
343 |
+
|
344 |
+
public function save_template($out)
|
345 |
+
{
|
346 |
+
return $this->do_save_template('save', $out);
|
347 |
+
}
|
348 |
+
|
349 |
+
public function save_template_as($out)
|
350 |
+
{
|
351 |
+
return $this->do_save_template('save_as', $out);
|
352 |
+
}
|
353 |
+
|
354 |
+
public function update_template($out)
|
355 |
+
{
|
356 |
+
return $this->do_save_template('update', $out);
|
357 |
+
}
|
358 |
+
|
359 |
+
/**
|
360 |
+
* Download the input file and create history entry.
|
361 |
+
* This is the primary step before Import
|
362 |
+
* On XML import the file will be converted to CSV (Batch processing)
|
363 |
+
*/
|
364 |
+
public function download($out)
|
365 |
+
{
|
366 |
+
$this->import_obj->temp_import_file=(isset($_POST['temp_import_file']) ? sanitize_file_name($_POST['temp_import_file']) : '');
|
367 |
+
|
368 |
+
$offset=(isset($_POST['offset']) ? floatval($_POST['offset']) : 0);
|
369 |
+
$import_id=(isset($_POST['import_id']) ? intval($_POST['import_id']) : 0);
|
370 |
+
$import_method=(isset($_POST['import_method']) ? sanitize_text_field($_POST['import_method']) : $this->import_obj->default_import_method);
|
371 |
+
|
372 |
+
if($offset==0)
|
373 |
+
{
|
374 |
+
/* process form data */
|
375 |
+
$form_data=(isset($_POST['form_data']) ? Wt_Import_Export_For_Woo_Basic_Common_Helper::process_formdata(maybe_unserialize(($_POST['form_data']))) : array());
|
376 |
+
|
377 |
+
//sanitize form data
|
378 |
+
$form_data=Wt_Iew_IE_Basic_Helper::sanitize_formdata($form_data, $this->import_obj);
|
379 |
+
}else
|
380 |
+
{
|
381 |
+
/* no need to process the formdata steps other than first */
|
382 |
+
$form_data=array();
|
383 |
+
}
|
384 |
+
|
385 |
+
$out=$this->import_obj->process_download($form_data, 'download', $this->to_import, $import_id, $offset);
|
386 |
+
if($out['response']===true)
|
387 |
+
{
|
388 |
+
$import_id=$out['import_id'];
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Prepare default mapping data for quick import
|
392 |
+
* After preparing update the Formdata in history table
|
393 |
+
*/
|
394 |
+
if($import_method=='quick' && $import_id>0 && $out['finished']==3)
|
395 |
+
{
|
396 |
+
$this->_prepare_for_quick($import_id);
|
397 |
+
}
|
398 |
+
|
399 |
+
|
400 |
+
$out['status']=1;
|
401 |
+
}else
|
402 |
+
{
|
403 |
+
$out['status']=0;
|
404 |
+
}
|
405 |
+
return $out;
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Process the import
|
410 |
+
*
|
411 |
+
* @return array
|
412 |
+
*/
|
413 |
+
public function import($out)
|
414 |
+
{
|
415 |
+
$offset=(isset($_POST['offset']) ? floatval($_POST['offset']) : 0);
|
416 |
+
$import_id=(isset($_POST['import_id']) ? intval($_POST['import_id']) : 0);
|
417 |
+
|
418 |
+
/* no need to send formdata. It will take from history table by `process_action` method */
|
419 |
+
$form_data=array();
|
420 |
+
|
421 |
+
/* do the export process */
|
422 |
+
$out=$this->import_obj->process_action($form_data, 'import', $this->to_import, '', $import_id, $offset);
|
423 |
+
if($out['response']===true)
|
424 |
+
{
|
425 |
+
$out['status']=1;
|
426 |
+
}else
|
427 |
+
{
|
428 |
+
$out['status']=0;
|
429 |
+
}
|
430 |
+
return $out;
|
431 |
+
}
|
432 |
+
|
433 |
+
/**
|
434 |
+
* Save/Update template (Ajax sub function)
|
435 |
+
* @param boolean $is_update is update existing template or save as new
|
436 |
+
* @return array response status, name, id
|
437 |
+
*/
|
438 |
+
public function do_save_template($step, $out)
|
439 |
+
{
|
440 |
+
$is_update=($step=='update' ? true : false);
|
441 |
+
|
442 |
+
/* take template name from post data, if not then create from time stamp */
|
443 |
+
$template_name=(isset($_POST['template_name']) ? sanitize_text_field($_POST['template_name']) : date('d-M-Y h:i:s A'));
|
444 |
+
|
445 |
+
$out['name']=$template_name;
|
446 |
+
$out['id']=0;
|
447 |
+
$out['status']=1;
|
448 |
+
|
449 |
+
if($this->to_import!='')
|
450 |
+
{
|
451 |
+
global $wpdb;
|
452 |
+
|
453 |
+
/* checking: just saved and again click the button so shift the action as update */
|
454 |
+
if($step=='save' && $this->selected_template>0)
|
455 |
+
{
|
456 |
+
$is_update=true;
|
457 |
+
}
|
458 |
+
|
459 |
+
/* checking template with same name exists */
|
460 |
+
$template_data=$this->get_mapping_template_by_name($template_name);
|
461 |
+
if($template_data)
|
462 |
+
{
|
463 |
+
$is_throw_warn=false;
|
464 |
+
if($is_update)
|
465 |
+
{
|
466 |
+
if($template_data['id']!=$this->selected_template)
|
467 |
+
{
|
468 |
+
$is_throw_warn=true;
|
469 |
+
}
|
470 |
+
}else
|
471 |
+
{
|
472 |
+
$is_throw_warn=true;
|
473 |
+
}
|
474 |
+
|
475 |
+
if($is_throw_warn)
|
476 |
+
{
|
477 |
+
$out['status']=0;
|
478 |
+
if($step=='save_as')
|
479 |
+
{
|
480 |
+
$out['msg']=__('Please enter a different name');
|
481 |
+
}else
|
482 |
+
{
|
483 |
+
$out['msg']=__('Template with same name already exists');
|
484 |
+
}
|
485 |
+
return $out;
|
486 |
+
}
|
487 |
+
}
|
488 |
+
|
489 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$template_tb;
|
490 |
+
|
491 |
+
/* process form data */
|
492 |
+
$form_data=(isset($_POST['form_data']) ? Wt_Import_Export_For_Woo_Basic_Common_Helper::process_formdata(maybe_unserialize(($_POST['form_data']))) : array());
|
493 |
+
|
494 |
+
//sanitize form data
|
495 |
+
$form_data=Wt_Iew_IE_Basic_Helper::sanitize_formdata($form_data, $this->import_obj);
|
496 |
+
|
497 |
+
/* upadte the template */
|
498 |
+
if($is_update)
|
499 |
+
{
|
500 |
+
|
501 |
+
$update_data=array(
|
502 |
+
'data'=>maybe_serialize($form_data),
|
503 |
+
'name'=>$template_name, //may be a rename
|
504 |
+
);
|
505 |
+
$update_data_type=array(
|
506 |
+
'%s',
|
507 |
+
'%s'
|
508 |
+
);
|
509 |
+
$update_where=array(
|
510 |
+
'id'=>$this->selected_template
|
511 |
+
);
|
512 |
+
$update_where_type=array(
|
513 |
+
'%d'
|
514 |
+
);
|
515 |
+
if($wpdb->update($tb, $update_data, $update_where, $update_data_type, $update_where_type)!==false)
|
516 |
+
{
|
517 |
+
$out['id']=$this->selected_template;
|
518 |
+
$out['name']=$template_name;
|
519 |
+
return $out;
|
520 |
+
}
|
521 |
+
}else
|
522 |
+
{
|
523 |
+
$insert_data=array(
|
524 |
+
'template_type'=>'import',
|
525 |
+
'item_type'=>$this->to_import,
|
526 |
+
'name'=>$template_name,
|
527 |
+
'data'=>maybe_serialize($form_data),
|
528 |
+
);
|
529 |
+
$insert_data_type=array(
|
530 |
+
'%s','%s','%s','%s'
|
531 |
+
);
|
532 |
+
if($wpdb->insert($tb, $insert_data, $insert_data_type)) //success
|
533 |
+
{
|
534 |
+
$out['id']=$wpdb->insert_id;
|
535 |
+
return $out;
|
536 |
+
}
|
537 |
+
}
|
538 |
+
}
|
539 |
+
$out['status']=0;
|
540 |
+
return $out;
|
541 |
+
}
|
542 |
+
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Step 1 (Ajax sub function)
|
546 |
+
* Built in steps, post type choosing page
|
547 |
+
*/
|
548 |
+
public function post_type_page()
|
549 |
+
{
|
550 |
+
$post_types=apply_filters('wt_iew_importer_post_types_basic', array());
|
551 |
+
$post_types=(!is_array($post_types) ? array() : $post_types);
|
552 |
+
$this->step='post_type';
|
553 |
+
|
554 |
+
$this->prepare_step_summary();
|
555 |
+
$this->prepare_footer_button_list();
|
556 |
+
|
557 |
+
ob_start();
|
558 |
+
$this->prepare_step_header_html();
|
559 |
+
include_once dirname(plugin_dir_path(__FILE__)).'/views/_import_post_type_page.php';
|
560 |
+
$this->prepare_step_footer_html();
|
561 |
+
return ob_get_clean();
|
562 |
+
}
|
563 |
+
|
564 |
+
/**
|
565 |
+
* Step 2 (Ajax sub function)
|
566 |
+
* Built in steps, import method choosing page
|
567 |
+
*/
|
568 |
+
public function method_import_page()
|
569 |
+
{
|
570 |
+
$this->step='method_import';
|
571 |
+
if($this->to_import!="")
|
572 |
+
{
|
573 |
+
/* setting a default import method */
|
574 |
+
$this->import_method=($this->import_method=='' ? $this->import_obj->default_import_method : $this->import_method);
|
575 |
+
$this->import_obj->import_method=$this->import_method;
|
576 |
+
$this->steps=$this->import_obj->get_steps();
|
577 |
+
|
578 |
+
$this->prepare_step_summary();
|
579 |
+
$this->prepare_footer_button_list();
|
580 |
+
|
581 |
+
//taking current page form data
|
582 |
+
$method_import_form_data=(isset($this->selected_template_form_data['method_import_form_data']) ? $this->selected_template_form_data['method_import_form_data'] : array());
|
583 |
+
|
584 |
+
$method_import_screen_fields=$this->import_obj->get_method_import_screen_fields($method_import_form_data);
|
585 |
+
|
586 |
+
|
587 |
+
$form_data_import_template=$this->selected_template;
|
588 |
+
if($this->rerun_id>0)
|
589 |
+
{
|
590 |
+
if(isset($method_import_form_data['selected_template']))
|
591 |
+
{
|
592 |
+
/* do not set this value to `$this->selected_template` */
|
593 |
+
$form_data_import_template=$method_import_form_data['selected_template'];
|
594 |
+
}
|
595 |
+
}
|
596 |
+
|
597 |
+
/* meta field list for quick import */
|
598 |
+
$this->get_mapping_templates();
|
599 |
+
|
600 |
+
ob_start();
|
601 |
+
$this->prepare_step_header_html();
|
602 |
+
include_once dirname(plugin_dir_path(__FILE__)).'/views/_import_method_import_page.php';
|
603 |
+
$this->prepare_step_footer_html();
|
604 |
+
return ob_get_clean();
|
605 |
+
}else
|
606 |
+
{
|
607 |
+
return '';
|
608 |
+
}
|
609 |
+
}
|
610 |
+
|
611 |
+
/**
|
612 |
+
* Step 3 (Ajax sub function)
|
613 |
+
* Built in steps, Import mapping page
|
614 |
+
*/
|
615 |
+
public function mapping_page()
|
616 |
+
{
|
617 |
+
$this->step='mapping';
|
618 |
+
if($this->to_import!="")
|
619 |
+
{
|
620 |
+
$this->prepare_step_summary();
|
621 |
+
$this->prepare_footer_button_list();
|
622 |
+
|
623 |
+
|
624 |
+
$temp_import_file=(isset($_POST['temp_import_file']) ? sanitize_file_name($_POST['temp_import_file']) : '');
|
625 |
+
$file_path=$this->import_obj->get_file_path($temp_import_file);
|
626 |
+
if($temp_import_file!="" && file_exists($file_path))
|
627 |
+
{
|
628 |
+
$ext_arr=explode('.', $temp_import_file);
|
629 |
+
$ext= strtolower(end($ext_arr));
|
630 |
+
if(isset($this->import_obj->allowed_import_file_type[$ext])) /* file type is in allowed list */
|
631 |
+
{
|
632 |
+
|
633 |
+
include_once WT_U_IEW_PLUGIN_PATH.'admin/classes/class-csvreader.php';
|
634 |
+
$delimiter=(isset($_POST['delimiter']) ? ($_POST['delimiter']) : ','); //no sanitization
|
635 |
+
$reader=new Wt_Import_Export_For_Woo_Basic_Csvreader($delimiter);
|
636 |
+
|
637 |
+
|
638 |
+
/* take first two rows in csv and in xml takes column keys and a sample data */
|
639 |
+
$sample_data=$reader->get_sample_data($file_path, true);
|
640 |
+
|
641 |
+
$file_heading_data=$this->process_file_heading_data($sample_data);
|
642 |
+
$file_heading_default_fields=$file_heading_data['default'];
|
643 |
+
$file_heading_meta_fields=$file_heading_data['meta'];
|
644 |
+
|
645 |
+
|
646 |
+
//taking current page form data
|
647 |
+
$mapping_form_data=(isset($this->selected_template_form_data['mapping_form_data']) ? $this->selected_template_form_data['mapping_form_data'] : array());
|
648 |
+
|
649 |
+
/* formdata/template data of fields in mapping page */
|
650 |
+
$form_data_mapping_fields=isset($mapping_form_data['mapping_fields']) ? $mapping_form_data['mapping_fields'] : array();
|
651 |
+
|
652 |
+
/**
|
653 |
+
* default mapping page fields
|
654 |
+
* Format: 'field_key'=>array('title'=>'', 'description'=>'')
|
655 |
+
*/
|
656 |
+
$mapping_fields=array();
|
657 |
+
$mapping_fields=apply_filters('wt_iew_importer_alter_mapping_fields_basic', $mapping_fields, $this->to_import, $form_data_mapping_fields);
|
658 |
+
|
659 |
+
/* meta fields list */
|
660 |
+
$this->get_mapping_enabled_fields();
|
661 |
+
|
662 |
+
/* mapping enabled meta fields */
|
663 |
+
$form_data_mapping_enabled_fields=(isset($mapping_form_data['mapping_enabled_fields']) ? $mapping_form_data['mapping_enabled_fields'] : array());
|
664 |
+
}
|
665 |
+
}
|
666 |
+
|
667 |
+
ob_start();
|
668 |
+
$this->prepare_step_header_html();
|
669 |
+
include_once dirname(plugin_dir_path(__FILE__)).'/views/_import_mapping_page.php';
|
670 |
+
$this->prepare_step_footer_html();
|
671 |
+
return ob_get_clean();
|
672 |
+
|
673 |
+
}else
|
674 |
+
{
|
675 |
+
return '';
|
676 |
+
}
|
677 |
+
}
|
678 |
+
|
679 |
+
/**
|
680 |
+
* Step 4 (Ajax sub function)
|
681 |
+
* Built in steps, Advanced settings page
|
682 |
+
*/
|
683 |
+
public function advanced_page()
|
684 |
+
{
|
685 |
+
$this->step='advanced';
|
686 |
+
if($this->to_import!="")
|
687 |
+
{
|
688 |
+
$this->prepare_step_summary();
|
689 |
+
$this->prepare_footer_button_list();
|
690 |
+
|
691 |
+
//taking current page form data
|
692 |
+
$advanced_form_data=(isset($this->selected_template_form_data['advanced_form_data']) ? $this->selected_template_form_data['advanced_form_data'] : array());
|
693 |
+
|
694 |
+
$advanced_screen_fields=$this->import_obj->get_advanced_screen_fields($advanced_form_data);
|
695 |
+
|
696 |
+
ob_start();
|
697 |
+
$this->prepare_step_header_html();
|
698 |
+
include_once dirname(plugin_dir_path(__FILE__)).'/views/_import_advanced_page.php';
|
699 |
+
$this->prepare_step_footer_html();
|
700 |
+
return ob_get_clean();
|
701 |
+
|
702 |
+
}else
|
703 |
+
{
|
704 |
+
return '';
|
705 |
+
}
|
706 |
+
}
|
707 |
+
|
708 |
+
/**
|
709 |
+
* Prepare description for mapping step fields
|
710 |
+
*/
|
711 |
+
protected function prepare_field_description($key)
|
712 |
+
{
|
713 |
+
$out='';
|
714 |
+
if(strpos($key, 'tax:')!==false) /* taxonomy */
|
715 |
+
{
|
716 |
+
$column=trim(str_replace('tax:', '', $key));
|
717 |
+
if(substr($column, 0, 3)!== 'pa_')
|
718 |
+
{
|
719 |
+
$out=__('Product taxonomies');
|
720 |
+
}else
|
721 |
+
{
|
722 |
+
$out=__('New taxonomy: ').$column;
|
723 |
+
}
|
724 |
+
}
|
725 |
+
elseif(strpos($key, 'meta:')!==false) /* meta */
|
726 |
+
{
|
727 |
+
$column=trim(str_replace('meta:', '', $key));
|
728 |
+
$out=__('Custom Field: ').$column;
|
729 |
+
}
|
730 |
+
elseif(strpos($key, 'attribute:')!==false) /* attribute */
|
731 |
+
{
|
732 |
+
$column=trim(str_replace('attribute:', '', $key));
|
733 |
+
if(substr($column, 0, 3)== 'pa_')
|
734 |
+
{
|
735 |
+
$out=__('Taxonomy attributes');
|
736 |
+
}else
|
737 |
+
{
|
738 |
+
$out=__('New attribute: ').$column;
|
739 |
+
}
|
740 |
+
}
|
741 |
+
elseif(strpos($key, 'attribute_data:')!==false) /* attribute data */
|
742 |
+
{
|
743 |
+
$column=trim(str_replace('attribute_data:', '', $key));
|
744 |
+
$out=__('Attribute data: ').$column;
|
745 |
+
}
|
746 |
+
elseif(strpos($key, 'attribute_default:')!==false) /* attribute default */
|
747 |
+
{
|
748 |
+
$column=trim(str_replace('attribute_default:', '', $key));
|
749 |
+
$out=__('Attribute default value: ').$column;
|
750 |
+
}
|
751 |
+
return $out;
|
752 |
+
}
|
753 |
+
|
754 |
+
/**
|
755 |
+
* split default mapping fields and meta mapping fields
|
756 |
+
*/
|
757 |
+
protected function process_file_heading_data($arr)
|
758 |
+
{
|
759 |
+
$default=array();
|
760 |
+
$meta=array();
|
761 |
+
foreach($arr as $key=>$v)
|
762 |
+
{
|
763 |
+
if(is_array($v))
|
764 |
+
{
|
765 |
+
$meta=array_merge($meta, $v);
|
766 |
+
}else
|
767 |
+
{
|
768 |
+
$default[$key]=$v;
|
769 |
+
}
|
770 |
+
}
|
771 |
+
return array('default'=>$default, 'meta'=>$meta);
|
772 |
+
}
|
773 |
+
|
774 |
+
/**
|
775 |
+
* Get template form data
|
776 |
+
*/
|
777 |
+
protected function get_template_form_data($id)
|
778 |
+
{
|
779 |
+
$template_data=$this->get_mapping_template_by_id($id);
|
780 |
+
if($template_data)
|
781 |
+
{
|
782 |
+
$decoded_form_data=Wt_Import_Export_For_Woo_Basic_Common_Helper::process_formdata(maybe_unserialize($template_data['data']));
|
783 |
+
$this->selected_template_form_data=(!is_array($decoded_form_data) ? array() : $decoded_form_data);
|
784 |
+
}
|
785 |
+
}
|
786 |
+
|
787 |
+
|
788 |
+
/**
|
789 |
+
* Taking mapping template by Name
|
790 |
+
*/
|
791 |
+
protected function get_mapping_template_by_name($name)
|
792 |
+
{
|
793 |
+
global $wpdb;
|
794 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$template_tb;
|
795 |
+
$qry=$wpdb->prepare("SELECT * FROM $tb WHERE template_type=%s AND item_type=%s AND name=%s",array('import', $this->to_import, $name));
|
796 |
+
return $wpdb->get_row($qry, ARRAY_A);
|
797 |
+
}
|
798 |
+
|
799 |
+
|
800 |
+
/**
|
801 |
+
* Taking mapping template by ID
|
802 |
+
*/
|
803 |
+
protected function get_mapping_template_by_id($id)
|
804 |
+
{
|
805 |
+
global $wpdb;
|
806 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$template_tb;
|
807 |
+
$qry=$wpdb->prepare("SELECT * FROM $tb WHERE template_type=%s AND item_type=%s AND id=%d",array('import', $this->to_import, $id));
|
808 |
+
return $wpdb->get_row($qry, ARRAY_A);
|
809 |
+
}
|
810 |
+
|
811 |
+
/**
|
812 |
+
* Taking all mapping templates
|
813 |
+
*/
|
814 |
+
protected function get_mapping_templates()
|
815 |
+
{
|
816 |
+
if($this->to_import=='')
|
817 |
+
{
|
818 |
+
return;
|
819 |
+
}
|
820 |
+
global $wpdb;
|
821 |
+
$tb=$wpdb->prefix.Wt_Import_Export_For_Woo_Basic::$template_tb;
|
822 |
+
$val=$wpdb->get_results("SELECT * FROM $tb WHERE template_type='import' AND item_type='".$this->to_import."' ORDER BY id DESC", ARRAY_A);
|
823 |
+
|
824 |
+
//add a filter here for modules to alter the data
|
825 |
+
$this->mapping_templates=($val ? $val : array());
|
826 |
+
}
|
827 |
+
|
828 |
+
|
829 |
+
/**
|
830 |
+
* Get meta field list for mapping page
|
831 |
+
*
|
832 |
+
*/
|
833 |
+
protected function get_mapping_enabled_fields()
|
834 |
+
{
|
835 |
+
$mapping_enabled_fields=array(
|
836 |
+
|
837 |
+
);
|
838 |
+
$this->mapping_enabled_fields=apply_filters('wt_iew_importer_alter_mapping_enabled_fields_basic', $mapping_enabled_fields, $this->to_import, array());
|
839 |
+
}
|
840 |
+
|
841 |
+
protected function prepare_step_summary()
|
842 |
+
{
|
843 |
+
$this->step_title=$this->steps[$this->step]['title'];
|
844 |
+
$this->step_keys=array_keys($this->steps);
|
845 |
+
$this->current_step_index=array_search($this->step, $this->step_keys);
|
846 |
+
$this->current_step_number=$this->current_step_index+1;
|
847 |
+
$this->last_page=(!isset($this->step_keys[$this->current_step_index+1]) ? true : false);
|
848 |
+
$this->total_steps=count($this->step_keys);
|
849 |
+
$this->step_summary=__(sprintf("Step %d of %d", $this->current_step_number, $this->total_steps));
|
850 |
+
$this->step_description=$this->steps[$this->step]['description'];
|
851 |
+
}
|
852 |
+
|
853 |
+
protected function prepare_step_header_html()
|
854 |
+
{
|
855 |
+
include dirname(plugin_dir_path(__FILE__)).'/views/_import_header.php';
|
856 |
+
}
|
857 |
+
|
858 |
+
protected function prepare_step_footer_html()
|
859 |
+
{
|
860 |
+
include dirname(plugin_dir_path(__FILE__)).'/views/_import_footer.php';
|
861 |
+
}
|
862 |
+
|
863 |
+
protected function prepare_footer_button_list()
|
864 |
+
{
|
865 |
+
$out=array();
|
866 |
+
$step_keys=$this->step_keys;
|
867 |
+
$current_index=$this->current_step_index;
|
868 |
+
$last_page=$this->last_page;
|
869 |
+
if($current_index!==false) /* step exists */
|
870 |
+
{
|
871 |
+
if($current_index>0) //add back button
|
872 |
+
{
|
873 |
+
$out['back']=array(
|
874 |
+
'type'=>'button',
|
875 |
+
'action_type'=>'step',
|
876 |
+
'key'=>$step_keys[$current_index-1],
|
877 |
+
'text'=>'<span class="dashicons dashicons-arrow-left-alt2" style="line-height:27px;"></span> '.__('Back'),
|
878 |
+
);
|
879 |
+
}
|
880 |
+
|
881 |
+
if(isset($step_keys[$current_index+1])) /* not last step */
|
882 |
+
{
|
883 |
+
$next_number=$current_index+2;
|
884 |
+
$next_key=$step_keys[$current_index+1];
|
885 |
+
$next_title=$this->steps[$next_key]['title'];
|
886 |
+
$out['next']=array(
|
887 |
+
'type'=>'button',
|
888 |
+
'action_type'=>'step',
|
889 |
+
'key'=>$next_key,
|
890 |
+
'text'=>__('Step').' '.$next_number.': '.$next_title.' <span class="dashicons dashicons-arrow-right-alt2" style="line-height:27px;"></span>',
|
891 |
+
);
|
892 |
+
|
893 |
+
if($this->import_method=='quick' || $this->import_method=='template') //Quick Or Template method
|
894 |
+
{
|
895 |
+
$out['or']=array(
|
896 |
+
'type'=>'text',
|
897 |
+
'text'=>__('Or'),
|
898 |
+
);
|
899 |
+
}
|
900 |
+
|
901 |
+
}else
|
902 |
+
{
|
903 |
+
$last_page=true;
|
904 |
+
}
|
905 |
+
|
906 |
+
if($this->import_method=='quick' || $this->import_method=='template' || $last_page) //template method, or last page, or quick import
|
907 |
+
{
|
908 |
+
if($last_page && $this->import_method!='quick') //last page and not quick import
|
909 |
+
{
|
910 |
+
if($this->import_method=='template')
|
911 |
+
{
|
912 |
+
$out['save']=array(
|
913 |
+
'key'=>'save',
|
914 |
+
'icon'=>'',
|
915 |
+
'type'=>'dropdown_button',
|
916 |
+
'text'=>__('Save template'),
|
917 |
+
'items'=>array(
|
918 |
+
'update'=>array(
|
919 |
+
'key'=>'update_template',
|
920 |
+
'text'=>__('Save'), //no prompt
|
921 |
+
),
|
922 |
+
'save'=>array(
|
923 |
+
'key'=>'save_template_as',
|
924 |
+
'text'=>__('Save As'), //prompt for name
|
925 |
+
)
|
926 |
+
)
|
927 |
+
);
|
928 |
+
}else
|
929 |
+
{
|
930 |
+
$out['save']=array(
|
931 |
+
'key'=>'save_template',
|
932 |
+
'icon'=>'',
|
933 |
+
'type'=>'button',
|
934 |
+
'text'=>__('Save template'), //prompt for name
|
935 |
+
);
|
936 |
+
}
|
937 |
+
}
|
938 |
+
$out['download']=array(
|
939 |
+
'key'=>'download', /* first step of import must be download the input file */
|
940 |
+
'class'=>'iew_import_btn',
|
941 |
+
'icon'=>'',
|
942 |
+
'type'=>'button',
|
943 |
+
'text'=>__('Import'),
|
944 |
+
);
|
945 |
+
}
|
946 |
+
}
|
947 |
+
$this->step_btns=apply_filters('wt_iew_importer_alter_footer_btns_basic', $out, $this->step, $this->steps);
|
948 |
+
}
|
949 |
+
|
950 |
+
/**
|
951 |
+
* Prepare default mapping data for quick import
|
952 |
+
* After preparing update the Formdata in history table
|
953 |
+
*/
|
954 |
+
protected function _prepare_for_quick($import_id)
|
955 |
+
{
|
956 |
+
//take history data by import_id
|
957 |
+
$import_data=Wt_Import_Export_For_Woo_Basic_History::get_history_entry_by_id($import_id);
|
958 |
+
|
959 |
+
//processing form data
|
960 |
+
$form_data=(isset($import_data['data']) ? maybe_unserialize($import_data['data']) : array());
|
961 |
+
|
962 |
+
|
963 |
+
$ext_arr=explode('.', $this->import_obj->temp_import_file);
|
964 |
+
|
965 |
+
include_once WT_U_IEW_PLUGIN_PATH.'admin/classes/class-csvreader.php';
|
966 |
+
$delimiter=(isset($form_data['method_import_form_data']['wt_iew_delimiter']) ? ($form_data['method_import_form_data']['wt_iew_delimiter']) : ',');
|
967 |
+
$reader=new Wt_Import_Export_For_Woo_Basic_Csvreader($delimiter);
|
968 |
+
|
969 |
+
|
970 |
+
$file_path=$this->import_obj->get_file_path($this->import_obj->temp_import_file);
|
971 |
+
|
972 |
+
/* take first two rows in csv and in xml takes column keys and a sample data */
|
973 |
+
$sample_data=$reader->get_sample_data($file_path, true);
|
974 |
+
|
975 |
+
$file_heading_data=$this->process_file_heading_data($sample_data);
|
976 |
+
$file_heading_default_fields=$file_heading_data['default'];
|
977 |
+
$file_heading_meta_fields=$file_heading_data['meta'];
|
978 |
+
|
979 |
+
|
980 |
+
/**
|
981 |
+
* Default mapping fields
|
982 |
+
* Format: 'field_key'=>array('title'=>'', 'description'=>'')
|
983 |
+
*/
|
984 |
+
$mapping_fields=array();
|
985 |
+
$mapping_fields=apply_filters('wt_iew_importer_alter_mapping_fields_basic', $mapping_fields, $this->to_import, array());
|
986 |
+
|
987 |
+
$array_keys_file_heading_default_fields = array_keys($file_heading_default_fields);
|
988 |
+
$mapping_form_data=array('mapping_fields'=>array(), 'mapping_selected_fields'=>array());
|
989 |
+
$allowed_field_types=array('start_with', 'end_with', 'contain');
|
990 |
+
|
991 |
+
foreach($mapping_fields as $key=>$val_arr)
|
992 |
+
{
|
993 |
+
$val='';
|
994 |
+
$checked=0; /* import this column? */
|
995 |
+
$type=(isset($val_arr['type']) ? $val_arr['type'] : '');
|
996 |
+
// if(isset($file_heading_default_fields[$key]))
|
997 |
+
if($case_key = preg_grep("/^$key$/i", $array_keys_file_heading_default_fields)) //preg_grep used escape from case sensitive check.
|
998 |
+
{
|
999 |
+
$checked=1; /* import this column? */
|
1000 |
+
// $val='{'.$key.'}';
|
1001 |
+
$val='{'.array_shift($case_key).'}'; // preg_grep give an array with actual index and value
|
1002 |
+
unset($file_heading_default_fields[$key]); //remove the field from file heading list
|
1003 |
+
}
|
1004 |
+
elseif(isset($file_heading_meta_fields[$key])) /* some meta items will show inside default field list, Eg: yoast */
|
1005 |
+
{
|
1006 |
+
$checked=1; /* import this column? */
|
1007 |
+
$val='{'.$key.'}';
|
1008 |
+
unset($file_heading_meta_fields[$key]); //remove the field from file heading list
|
1009 |
+
}else
|
1010 |
+
{
|
1011 |
+
$field_type=(isset($val_arr['field_type']) ? $val_arr['field_type'] : '');
|
1012 |
+
if($field_type!="" && in_array($field_type, $allowed_field_types)) // it may be a different field type
|
1013 |
+
{
|
1014 |
+
foreach ($file_heading_default_fields as $def_key => $def_val)
|
1015 |
+
{
|
1016 |
+
$matched=false;
|
1017 |
+
if($field_type=='start_with' && strpos($def_key, $key)===0)
|
1018 |
+
{
|
1019 |
+
$matched=true;
|
1020 |
+
}
|
1021 |
+
elseif($field_type=='ends_with' && strrpos($def_key, $key)===(strlen($def_key) - strlen($key)))
|
1022 |
+
{
|
1023 |
+
$matched=true;
|
1024 |
+
}
|
1025 |
+
elseif($field_type=='contains' && strpos($def_key, $key)!==false)
|
1026 |
+
{
|
1027 |
+
$matched=true;
|
1028 |
+
}
|
1029 |
+
if($matched)
|
1030 |
+
{
|
1031 |
+
$val='{'.$def_key.'}';
|
1032 |
+
unset($file_heading_default_fields[$def_key]); //remove the field from file heading list
|
1033 |
+
$mapping_form_data['mapping_selected_fields'][$def_key]=$val;
|
1034 |
+
$mapping_form_data['mapping_fields'][$def_key]=array($val, 1, $type); //value, enabled, type
|
1035 |
+
}
|
1036 |
+
}
|
1037 |
+
}else /* unmatched keys */
|
1038 |
+
{
|
1039 |
+
$checked=0;
|
1040 |
+
$val='';
|
1041 |
+
}
|
1042 |
+
}
|
1043 |
+
if($checked==1)
|
1044 |
+
{
|
1045 |
+
$mapping_form_data['mapping_selected_fields'][$key]=$val;
|
1046 |
+
$mapping_form_data['mapping_fields'][$key]=array($val, 1, $type); //value, enabled, type
|
1047 |
+
}
|
1048 |
+
}
|
1049 |
+
|
1050 |
+
/**
|
1051 |
+
* Meta mapping fields
|
1052 |
+
*
|
1053 |
+
*/
|
1054 |
+
$meta_mapping_screen_fields=$this->_get_meta_mapping_screen_fields($form_data_meta_mapping_fields);
|
1055 |
+
|
1056 |
+
/* preparing meta fields. */
|
1057 |
+
$meta_mapping_form_data=array('mapping_fields'=>array(), 'mapping_selected_fields'=>array());
|
1058 |
+
if($meta_mapping_screen_fields && is_array($meta_mapping_screen_fields))
|
1059 |
+
{
|
1060 |
+
/* loop through mapping fields */
|
1061 |
+
foreach($meta_mapping_screen_fields as $meta_mapping_screen_field_key=>$meta_mapping_screen_field_val)
|
1062 |
+
{
|
1063 |
+
/* decalaring an empty array*/
|
1064 |
+
$temp_arr=array();
|
1065 |
+
$temp_fields_arr=array(); /* this is to store mapping field other details */
|
1066 |
+
|
1067 |
+
/* default field list from post type module */
|
1068 |
+
$mapping_fields=((isset($meta_mapping_screen_field_val['fields']) && is_array($meta_mapping_screen_field_val['fields'])) ? $meta_mapping_screen_field_val['fields'] : array());
|
1069 |
+
|
1070 |
+
/* loop through mapping fields */
|
1071 |
+
if(count($mapping_fields)>0)
|
1072 |
+
{
|
1073 |
+
foreach($mapping_fields as $key=>$val_arr)
|
1074 |
+
{
|
1075 |
+
$val='';
|
1076 |
+
$checked=0; /* import this column? */
|
1077 |
+
$type=(isset($val_arr['type']) ? $val_arr['type'] : '');
|
1078 |
+
|
1079 |
+
if(isset($file_heading_meta_fields[$key]))
|
1080 |
+
{
|
1081 |
+
$checked=1; /* import this column? */
|
1082 |
+
$val='{'.$key.'}';
|
1083 |
+
unset($file_heading_meta_fields[$key]); //remove the field from file heading list
|
1084 |
+
}
|
1085 |
+
if($checked==1)
|
1086 |
+
{
|
1087 |
+
$temp_arr[$key]=$val;
|
1088 |
+
$temp_fields_arr[$key]=array($val, 1, $type);
|
1089 |
+
}
|
1090 |
+
}
|
1091 |
+
}
|
1092 |
+
if(count($file_heading_meta_fields)>0)
|
1093 |
+
{
|
1094 |
+
$current_field_group_prefix_arr=(isset($this->field_group_prefixes[$meta_mapping_screen_field_key]) ? $this->field_group_prefixes[$meta_mapping_screen_field_key] : array());
|
1095 |
+
foreach($file_heading_meta_fields as $key=>$sample_val)
|
1096 |
+
{
|
1097 |
+
$is_include=$this->_is_include_meta_in_this_group($current_field_group_prefix_arr, $key);
|
1098 |
+
if($is_include==1)
|
1099 |
+
{
|
1100 |
+
$val='{'.$key.'}';
|
1101 |
+
$checked=1; /* import this column? */
|
1102 |
+
unset($file_heading_meta_fields[$key]); //remove the field from file heading list
|
1103 |
+
$temp_arr[$key]=$val;
|
1104 |
+
$temp_fields_arr[$key]=array($val, 1, '');
|
1105 |
+
}
|
1106 |
+
}
|
1107 |
+
}
|
1108 |
+
|
1109 |
+
/* adding value to main array */
|
1110 |
+
$meta_mapping_form_data['mapping_selected_fields'][$meta_mapping_screen_field_key]=$temp_arr;
|
1111 |
+
$meta_mapping_form_data['mapping_fields'][$meta_mapping_screen_field_key]=$temp_fields_arr;
|
1112 |
+
$mapping_fields=$temp_arr=$temp_fields_arr=null;
|
1113 |
+
unset($temp_arr, $temp_fields_arr, $mapping_fields);
|
1114 |
+
}
|
1115 |
+
|
1116 |
+
/* if any columns that not in the above list */
|
1117 |
+
if(count($file_heading_meta_fields)>0)
|
1118 |
+
{
|
1119 |
+
//do something
|
1120 |
+
}
|
1121 |
+
}
|
1122 |
+
|
1123 |
+
/**
|
1124 |
+
* update form data with prepared mapping form data
|
1125 |
+
*/
|
1126 |
+
$form_data['mapping_form_data']=$mapping_form_data;
|
1127 |
+
$form_data['meta_step_form_data']=$meta_mapping_form_data;
|
1128 |
+
|
1129 |
+
|
1130 |
+
$update_data=array(
|
1131 |
+
'data'=>maybe_serialize($form_data), //formadata
|
1132 |
+
);
|
1133 |
+
$update_data_type=array(
|
1134 |
+
'%s',
|
1135 |
+
);
|
1136 |
+
Wt_Import_Export_For_Woo_Basic_History::update_history_entry($import_id, $update_data, $update_data_type);
|
1137 |
+
|
1138 |
+
$mapping_form_data=$meta_mapping_form_data=$form_data=null;
|
1139 |
+
unset($mapping_form_data, $meta_mapping_form_data, $form_data);
|
1140 |
+
}
|
1141 |
+
|
1142 |
+
protected function _get_meta_mapping_screen_fields($form_data_meta_mapping_fields)
|
1143 |
+
{
|
1144 |
+
$this->get_mapping_enabled_fields();
|
1145 |
+
$meta_mapping_screen_fields=array();
|
1146 |
+
foreach($this->mapping_enabled_fields as $field_key=>$field_vl)
|
1147 |
+
{
|
1148 |
+
$field_vl=(!is_array($field_vl) ? array($field_vl, 0) : $field_vl);
|
1149 |
+
$meta_mapping_screen_fields[$field_key]=array(
|
1150 |
+
'title'=>'',
|
1151 |
+
'checked'=>$field_vl[1],
|
1152 |
+
'fields'=>array(),
|
1153 |
+
);
|
1154 |
+
}
|
1155 |
+
|
1156 |
+
/**
|
1157 |
+
* default mapping page fields
|
1158 |
+
* Format: 'field_key'=>array('title'=>'', 'description'=>'')
|
1159 |
+
*/
|
1160 |
+
return apply_filters('wt_iew_importer_alter_meta_mapping_fields_basic', $meta_mapping_screen_fields, $this->to_import, $form_data_meta_mapping_fields);
|
1161 |
+
}
|
1162 |
+
|
1163 |
+
protected function _is_include_meta_in_this_group($current_field_group_prefix_arr, $key)
|
1164 |
+
{
|
1165 |
+
$is_include=0;
|
1166 |
+
foreach ($current_field_group_prefix_arr as $_prefix)
|
1167 |
+
{
|
1168 |
+
if(strpos($key, $_prefix)===0) /* find as first occurrence */
|
1169 |
+
{
|
1170 |
+
if($_prefix=='meta') /* avoid conflict with hidden meta */
|
1171 |
+
{
|
1172 |
+
$name=str_replace('meta:', '', $key);
|
1173 |
+
if(substr($name, 0, 1)!='_') /* not hidden meta */
|
1174 |
+
{
|
1175 |
+
if(strpos($name, 'attribute')!==0) /* its not meta attribute */
|
1176 |
+
{
|
1177 |
+
$is_include=1;
|
1178 |
+
break;
|
1179 |
+
}
|
1180 |
+
}
|
1181 |
+
}else
|
1182 |
+
{
|
1183 |
+
$is_include=1;
|
1184 |
+
break;
|
1185 |
+
}
|
1186 |
+
}
|
1187 |
+
}
|
1188 |
+
return $is_include;
|
1189 |
+
}
|
1190 |
+
}
|
1191 |
+
}
|
admin/modules/import/import.php
ADDED
@@ -0,0 +1,1279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Import section of the plugin
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Import')){
|
14 |
+
class Wt_Import_Export_For_Woo_Basic_Import
|
15 |
+
{
|
16 |
+
public $module_id='';
|
17 |
+
public static $module_id_static='';
|
18 |
+
public $module_base='import';
|
19 |
+
|
20 |
+
public static $import_dir=WP_CONTENT_DIR.'/webtoffee_import';
|
21 |
+
public static $import_dir_name='/webtoffee_import';
|
22 |
+
public $steps=array();
|
23 |
+
public $allowed_import_file_type=array();
|
24 |
+
public $max_import_file_size=10; //in MB
|
25 |
+
|
26 |
+
private $to_import_id='';
|
27 |
+
private $to_import='';
|
28 |
+
private $rerun_id=0;
|
29 |
+
public $import_method='';
|
30 |
+
public $import_methods=array();
|
31 |
+
public $selected_template=0;
|
32 |
+
public $default_batch_count=0; /* configure this value in `advanced_setting_fields` method */
|
33 |
+
public $selected_template_data=array();
|
34 |
+
public $default_import_method=''; /* configure this value in `advanced_setting_fields` method */
|
35 |
+
public $form_data=array();
|
36 |
+
public $temp_import_file='';
|
37 |
+
private $to_process='';
|
38 |
+
|
39 |
+
public function __construct()
|
40 |
+
{
|
41 |
+
$this->module_id=Wt_Import_Export_For_Woo_Basic::get_module_id($this->module_base);
|
42 |
+
self::$module_id_static=$this->module_id;
|
43 |
+
|
44 |
+
$this->max_import_file_size=wp_max_upload_size()/1000000; //in MB
|
45 |
+
|
46 |
+
/* allowed file types */
|
47 |
+
$this->allowed_import_file_type=array(
|
48 |
+
'csv'=>__('CSV'),
|
49 |
+
|
50 |
+
);
|
51 |
+
$this->allowed_import_file_type_mime=array(
|
52 |
+
'csv'=>'text/csv',
|
53 |
+
|
54 |
+
);
|
55 |
+
|
56 |
+
/* default step list */
|
57 |
+
$this->steps=array(
|
58 |
+
'post_type'=>array(
|
59 |
+
'title'=>__('Select post type'),
|
60 |
+
'description'=>__('Import the respective post type from a CSV. As a first step you need to choose the post type to start the import.'),
|
61 |
+
),
|
62 |
+
'method_import'=>array(
|
63 |
+
'title'=>__('Select import method'),
|
64 |
+
'description'=>__('Choose from the options below to continue with your import: quick import, based on a pre-saved template or a new import with advanced options.'),
|
65 |
+
),
|
66 |
+
'mapping'=>array(
|
67 |
+
'title'=>__('Map and reorder import columns'),
|
68 |
+
'description'=>__('Map the standard columns with your CSV column names.'),
|
69 |
+
),
|
70 |
+
'advanced'=>array(
|
71 |
+
'title'=>__('Advanced options/Batch import'),
|
72 |
+
'description'=>__('Use advanced options from below to decide on the delimiter options, updates to existing products, batch import count or schedule an import. You can also save the template file for future imports.'),
|
73 |
+
),
|
74 |
+
);
|
75 |
+
|
76 |
+
$this->import_methods=array(
|
77 |
+
'quick'=>array('title'=>__('Quick import'), 'description'=> __('Quick import only imports the fields from the input file that conforms to the specific column headers as required by the plugin. You do not get to selectively filter the columns with this option. Use this option primarily when your input file was exported using the same plugin.')),
|
78 |
+
'template'=>array('title'=>__('Pre-saved template'), 'description'=> __('Using a pre-saved template retains the previous filter criteria and other column specifications as per the chosen file and imports data accordingly. You can also edit this file in the process and import accordingly or import straightaway.')),
|
79 |
+
'new'=>array('title'=>__('New import'), 'description'=> __('A new import will take you through the entire process of filtering/column selection/advanced options that may be required for your import. You can also save this file as a template for future use.')),
|
80 |
+
);
|
81 |
+
|
82 |
+
/* advanced plugin settings */
|
83 |
+
add_filter('wt_iew_advanced_setting_fields_basic', array($this, 'advanced_setting_fields'));
|
84 |
+
|
85 |
+
/* setting default values this method must be below of advanced setting filter */
|
86 |
+
$this->get_defaults();
|
87 |
+
|
88 |
+
/* main ajax hook. The callback function will decide which is to execute. */
|
89 |
+
add_action('wp_ajax_iew_import_ajax_basic', array($this, 'ajax_main'), 11);
|
90 |
+
|
91 |
+
/* Admin menu for import */
|
92 |
+
add_filter('wt_iew_admin_menu_basic', array($this, 'add_admin_pages'), 10, 1);
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
public function get_defaults()
|
97 |
+
{
|
98 |
+
$this->default_import_method= Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('default_import_method');
|
99 |
+
$this->default_batch_count=Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('default_import_batch');
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Fields for advanced settings
|
104 |
+
*
|
105 |
+
*/
|
106 |
+
public function advanced_setting_fields($fields)
|
107 |
+
{
|
108 |
+
$fields['enable_import_log']=array(
|
109 |
+
'label'=>__("Save Import log"),
|
110 |
+
'type'=>'radio',
|
111 |
+
'radio_fields'=>array(
|
112 |
+
1=>__('Yes'),
|
113 |
+
0=>__('No')
|
114 |
+
),
|
115 |
+
'value' =>0,
|
116 |
+
'field_name'=>'enable_import_log',
|
117 |
+
'help_text'=>__('Save import log as text file and make it available in the history section.'),
|
118 |
+
'validation_rule'=>array('type'=>'absint'),
|
119 |
+
);
|
120 |
+
$import_methods=array_map(function($vl){ return $vl['title']; }, $this->import_methods);
|
121 |
+
$fields['default_import_method']=array(
|
122 |
+
'label'=>__("Default Import method"),
|
123 |
+
'type'=>'select',
|
124 |
+
'sele_vals'=>$import_methods,
|
125 |
+
'value' =>'new',
|
126 |
+
'field_name'=>'default_import_method',
|
127 |
+
'help_text'=>__('Select the default method of import.'),
|
128 |
+
);
|
129 |
+
$fields['default_import_batch']=array(
|
130 |
+
'label'=>__("Default Import batch count"),
|
131 |
+
'type'=>'number',
|
132 |
+
'value' =>100, /* If altering then please also change batch count field help text section */
|
133 |
+
'field_name'=>'default_import_batch',
|
134 |
+
'help_text'=>__('Provide the default count for the records to be imported in a batch.'),
|
135 |
+
'validation_rule'=>array('type'=>'absint'),
|
136 |
+
);
|
137 |
+
return $fields;
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Fields for Import advanced step
|
142 |
+
*/
|
143 |
+
public function get_advanced_screen_fields($advanced_form_data)
|
144 |
+
{
|
145 |
+
$advanced_screen_fields=array(
|
146 |
+
|
147 |
+
|
148 |
+
'batch_count'=>array(
|
149 |
+
'label'=>__("Import in batches of"),
|
150 |
+
'type'=>'text',
|
151 |
+
'value'=>$this->default_batch_count,
|
152 |
+
'field_name'=>'batch_count',
|
153 |
+
'help_text'=>sprintf(__('The number of records that the server will process for every iteration within the configured timeout interval. If the import fails you can lower this number accordingly and try again. Defaulted to %d records.'), 100),
|
154 |
+
'validation_rule'=>array('type'=>'absint'),
|
155 |
+
)
|
156 |
+
);
|
157 |
+
|
158 |
+
/* taking advanced fields from post type modules */
|
159 |
+
$advanced_screen_fields=apply_filters('wt_iew_importer_alter_advanced_fields_basic', $advanced_screen_fields, $this->to_import, $advanced_form_data);
|
160 |
+
return $advanced_screen_fields;
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Fields for Import method step
|
165 |
+
*/
|
166 |
+
public function get_method_import_screen_fields($method_import_form_data)
|
167 |
+
{
|
168 |
+
$file_from_arr=array(
|
169 |
+
'local'=>__('Local'),
|
170 |
+
|
171 |
+
);
|
172 |
+
|
173 |
+
/* taking available remote adapters */
|
174 |
+
$remote_adapter_names=array();
|
175 |
+
$remote_adapter_names=apply_filters('wt_iew_importer_remote_adapter_names_basic', $remote_adapter_names);
|
176 |
+
if($remote_adapter_names && is_array($remote_adapter_names))
|
177 |
+
{
|
178 |
+
foreach($remote_adapter_names as $remote_adapter_key => $remote_adapter_vl)
|
179 |
+
{
|
180 |
+
$file_from_arr[$remote_adapter_key]=$remote_adapter_vl;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
//prepare file from field type based on remote type adapters
|
185 |
+
$file_from_field_arr=array(
|
186 |
+
'label'=>__("Choose file for Import"),
|
187 |
+
'type'=>'select',
|
188 |
+
'tr_class'=>'wt-iew-import-method-options wt-iew-import-method-options-quick wt-iew-import-method-options-new',
|
189 |
+
'sele_vals'=>$file_from_arr,
|
190 |
+
'field_name'=>'file_from',
|
191 |
+
'default_value'=>'local',
|
192 |
+
'form_toggler'=>array(
|
193 |
+
'type'=>'parent',
|
194 |
+
'target'=>'wt_iew_file_from'
|
195 |
+
)
|
196 |
+
);
|
197 |
+
|
198 |
+
|
199 |
+
$method_import_screen_fields=array(
|
200 |
+
'file_from'=>$file_from_field_arr,
|
201 |
+
'local_file'=>array(
|
202 |
+
'label'=>__("Select a file"),
|
203 |
+
'type'=>'dropzone',
|
204 |
+
'merge_left'=>true,
|
205 |
+
'merge_right'=>true,
|
206 |
+
'tr_id'=>'local_file_tr',
|
207 |
+
'tr_class'=>$file_from_field_arr['tr_class'], //add tr class from parent.Because we need to toggle the tr when parent tr toggles.
|
208 |
+
'field_name'=>'local_file',
|
209 |
+
'html_id'=>'local_file',
|
210 |
+
'form_toggler'=>array(
|
211 |
+
'type'=>'child',
|
212 |
+
'id'=>'wt_iew_file_from',
|
213 |
+
'val'=>'local',
|
214 |
+
),
|
215 |
+
),
|
216 |
+
|
217 |
+
);
|
218 |
+
|
219 |
+
/* taking import_method fields from other modules */
|
220 |
+
$method_import_screen_fields=apply_filters('wt_iew_importer_alter_method_import_fields_basic', $method_import_screen_fields, $this->to_import, $method_import_form_data);
|
221 |
+
|
222 |
+
|
223 |
+
$method_import_screen_fields['delimiter']=array(
|
224 |
+
'label'=>__("Delimiter"),
|
225 |
+
'type'=>'select',
|
226 |
+
'value'=>",",
|
227 |
+
'css_class'=>"wt_iew_delimiter_preset",
|
228 |
+
'tr_id'=>'delimiter_tr',
|
229 |
+
'tr_class'=>$file_from_field_arr['tr_class'], //add tr class from parent.Because we need to toggle the tr when parent tr toggles.
|
230 |
+
'field_name'=>'delimiter_preset',
|
231 |
+
'sele_vals'=>Wt_Iew_IE_Basic_Helper::_get_csv_delimiters(),
|
232 |
+
'help_text'=>__('Only applicable for CSV imports in order to separate the columns in the CSV file. Takes comma(,) by default.'),
|
233 |
+
'validation_rule'=>array('type'=>'skip'),
|
234 |
+
'after_form_field'=>'<input type="text" class="wt_iew_custom_delimiter" name="wt_iew_delimiter" value="," />',
|
235 |
+
);
|
236 |
+
|
237 |
+
|
238 |
+
|
239 |
+
return $method_import_screen_fields;
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Adding admin menus
|
244 |
+
*/
|
245 |
+
public function add_admin_pages($menus)
|
246 |
+
{
|
247 |
+
$first = array_slice($menus, 0, 3, true);
|
248 |
+
$last=array_slice($menus, 3, (count($menus)-1), true);
|
249 |
+
|
250 |
+
$menu=array(
|
251 |
+
$this->module_base=>array(
|
252 |
+
'submenu',
|
253 |
+
WT_IEW_PLUGIN_ID_BASIC,
|
254 |
+
__('Import'),
|
255 |
+
__('Import'),
|
256 |
+
'manage_options',
|
257 |
+
$this->module_id,
|
258 |
+
array($this, 'admin_settings_page')
|
259 |
+
)
|
260 |
+
);
|
261 |
+
|
262 |
+
$menus=array_merge($first, $menu, $last);
|
263 |
+
return $menus;
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Import page
|
268 |
+
*/
|
269 |
+
public function admin_settings_page()
|
270 |
+
{
|
271 |
+
/**
|
272 |
+
* Check it is a rerun call
|
273 |
+
*/
|
274 |
+
$requested_rerun_id=(isset($_GET['wt_iew_rerun']) ? absint($_GET['wt_iew_rerun']) : 0);
|
275 |
+
$this->_process_rerun($requested_rerun_id);
|
276 |
+
|
277 |
+
if($this->rerun_id>0) /* this is a rerun request. Then validate the file */
|
278 |
+
{
|
279 |
+
$response=$this->download_remote_file($this->form_data);
|
280 |
+
if($response['response']) /* temp file created. */
|
281 |
+
{
|
282 |
+
$this->temp_import_file=$response['file_name'];
|
283 |
+
|
284 |
+
/* delete temp files other than the current temp file of same rerun id, if exists */
|
285 |
+
$file_path=$this->get_file_path();
|
286 |
+
$temp_files = glob($file_path.'/rerun_'.$this->rerun_id.'_*');
|
287 |
+
if(count($temp_files)>1) /* Other than the current temp file */
|
288 |
+
{
|
289 |
+
foreach($temp_files as $key => $temp_file)
|
290 |
+
{
|
291 |
+
if(basename($temp_file)!=$this->temp_import_file)
|
292 |
+
{
|
293 |
+
@unlink($temp_file); //delete it
|
294 |
+
}
|
295 |
+
}
|
296 |
+
}
|
297 |
+
|
298 |
+
}else /* unable to create temp file, then abort the rerun request */
|
299 |
+
{
|
300 |
+
$this->rerun_id=0;
|
301 |
+
$this->form_data=array();
|
302 |
+
}
|
303 |
+
}
|
304 |
+
$this->enqueue_assets();
|
305 |
+
include plugin_dir_path(__FILE__).'views/main.php';
|
306 |
+
}
|
307 |
+
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Validating and Processing rerun action
|
311 |
+
*/
|
312 |
+
protected function _process_rerun($rerun_id)
|
313 |
+
{
|
314 |
+
if($rerun_id>0)
|
315 |
+
{
|
316 |
+
/* check the history module is available */
|
317 |
+
$history_module_obj=Wt_Import_Export_For_Woo_Basic::load_modules('history');
|
318 |
+
if(!is_null($history_module_obj))
|
319 |
+
{
|
320 |
+
/* check the history entry is for import and also has form_data */
|
321 |
+
$history_data=$history_module_obj->get_history_entry_by_id($rerun_id);
|
322 |
+
if($history_data && $history_data['template_type']==$this->module_base)
|
323 |
+
{
|
324 |
+
$form_data=maybe_unserialize($history_data['data']);
|
325 |
+
if($form_data && is_array($form_data))
|
326 |
+
{
|
327 |
+
$this->to_import=(isset($form_data['post_type_form_data']) && isset($form_data['post_type_form_data']['item_type']) ? $form_data['post_type_form_data']['item_type'] : '');
|
328 |
+
if($this->to_import!="")
|
329 |
+
{
|
330 |
+
$this->import_method=(isset($form_data['method_import_form_data']) && isset($form_data['method_import_form_data']['method_import']) && $form_data['method_import_form_data']['method_import']!="" ? $form_data['method_import_form_data']['method_import'] : $this->default_import_method);
|
331 |
+
$this->rerun_id=$rerun_id;
|
332 |
+
$this->form_data=$form_data;
|
333 |
+
//process steps based on the import method in the history entry
|
334 |
+
$this->get_steps();
|
335 |
+
|
336 |
+
return true;
|
337 |
+
}
|
338 |
+
}
|
339 |
+
}
|
340 |
+
}
|
341 |
+
}
|
342 |
+
return false;
|
343 |
+
}
|
344 |
+
|
345 |
+
protected function enqueue_assets()
|
346 |
+
{
|
347 |
+
if(Wt_Import_Export_For_Woo_Basic_Common_Helper::wt_is_screen_allowed()){
|
348 |
+
/* adding dropzone JS */
|
349 |
+
wp_enqueue_script(WT_IEW_PLUGIN_ID_BASIC.'-dropzone', WT_U_IEW_PLUGIN_URL.'admin/js/dropzone.min.js', array('jquery'), WT_U_IEW_VERSION);
|
350 |
+
|
351 |
+
wp_enqueue_script($this->module_id, plugin_dir_url(__FILE__).'assets/js/main.js', array('jquery', 'jquery-ui-sortable', 'jquery-ui-datepicker'), WT_U_IEW_VERSION);
|
352 |
+
wp_enqueue_style('jquery-ui-datepicker');
|
353 |
+
//wp_enqueue_media();
|
354 |
+
|
355 |
+
wp_enqueue_style(WT_IEW_PLUGIN_ID_BASIC.'-jquery-ui', WT_U_IEW_PLUGIN_URL.'admin/css/jquery-ui.css', array(), WT_U_IEW_VERSION, 'all');
|
356 |
+
|
357 |
+
$file_extensions=array_keys($this->allowed_import_file_type_mime);
|
358 |
+
$file_extensions=array_map(function($vl){
|
359 |
+
return '.'.$vl;
|
360 |
+
}, $file_extensions);
|
361 |
+
|
362 |
+
$params=array(
|
363 |
+
'item_type'=>'',
|
364 |
+
'steps'=>$this->steps,
|
365 |
+
'rerun_id'=>$this->rerun_id,
|
366 |
+
'to_import'=>$this->to_import,
|
367 |
+
'import_method'=>$this->import_method,
|
368 |
+
'temp_import_file'=>$this->temp_import_file,
|
369 |
+
'allowed_import_file_type_mime'=>$file_extensions,
|
370 |
+
'max_import_file_size'=>$this->max_import_file_size,
|
371 |
+
'msgs'=>array(
|
372 |
+
'choosed_template'=>__('Choosed template: '),
|
373 |
+
'choose_import_method'=>__('Please select an import method.'),
|
374 |
+
'choose_template'=>__('Please select an import template.'),
|
375 |
+
'step'=>__('Step'),
|
376 |
+
'choose_ftp_profile'=>__('Please select an FTP profile.'),
|
377 |
+
'choose_import_from'=>__('Please choose import from.'),
|
378 |
+
'choose_a_file'=>__('Please choose an import file.'),
|
379 |
+
'select_an_import_template'=>__('Please select an import template.'),
|
380 |
+
'validating_file'=>__('Creating temp file and validating.'),
|
381 |
+
'processing_file'=>__('Processing input file...'),
|
382 |
+
'column_not_in_the_list'=>__('This column is not present in the import list. Please tick the checkbox to include.'),
|
383 |
+
'uploading'=>__('Uploading...'),
|
384 |
+
'outdated'=>__('You are using an outdated browser. Please upgarde your browser.'),
|
385 |
+
'server_error'=>__('An error occured.'),
|
386 |
+
'invalid_file'=>sprintf(__('Invalid file type. Only %s are allowed'), implode(", ", array_values($this->allowed_import_file_type))),
|
387 |
+
'drop_upload'=>__('Drop files here or click to upload'),
|
388 |
+
'upload_done'=>sprintf(__('%s Done.'), '<span class="dashicons dashicons-yes-alt" style="color:#3fa847;"></span>'),
|
389 |
+
'remove'=>__('Remove'),
|
390 |
+
),
|
391 |
+
);
|
392 |
+
wp_localize_script($this->module_id, 'wt_iew_import_basic_params', $params);
|
393 |
+
|
394 |
+
$this->add_select2_lib(); //adding select2 JS, It checks the availibility of woocommerce
|
395 |
+
}
|
396 |
+
}
|
397 |
+
|
398 |
+
/**
|
399 |
+
*
|
400 |
+
* Enqueue select2 library, if woocommerce available use that
|
401 |
+
*/
|
402 |
+
protected function add_select2_lib()
|
403 |
+
{
|
404 |
+
/* enqueue scripts */
|
405 |
+
if(!function_exists('is_plugin_active'))
|
406 |
+
{
|
407 |
+
include_once(ABSPATH.'wp-admin/includes/plugin.php');
|
408 |
+
}
|
409 |
+
if(is_plugin_active('woocommerce/woocommerce.php'))
|
410 |
+
{
|
411 |
+
wp_enqueue_script('wc-enhanced-select');
|
412 |
+
wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url().'/assets/css/admin.css');
|
413 |
+
}else
|
414 |
+
{
|
415 |
+
wp_enqueue_style(WT_IEW_PLUGIN_ID_BASIC.'-select2', WT_U_IEW_PLUGIN_URL. 'admin/css/select2.css', array(), WT_U_IEW_VERSION, 'all' );
|
416 |
+
wp_enqueue_script(WT_IEW_PLUGIN_ID_BASIC.'-select2', WT_U_IEW_PLUGIN_URL.'admin/js/select2.js', array('jquery'), WT_U_IEW_VERSION, false );
|
417 |
+
}
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* Get steps
|
422 |
+
*
|
423 |
+
*/
|
424 |
+
public function get_steps()
|
425 |
+
{
|
426 |
+
if($this->import_method=='quick') /* if quick import then remove some steps */
|
427 |
+
{
|
428 |
+
$out=array(
|
429 |
+
'post_type'=>$this->steps['post_type'],
|
430 |
+
'method_import'=>$this->steps['method_import'],
|
431 |
+
'advanced'=>$this->steps['advanced'],
|
432 |
+
);
|
433 |
+
$this->steps=$out;
|
434 |
+
}
|
435 |
+
$this->steps=apply_filters('wt_iew_importer_steps_basic', $this->steps, $this->to_import);
|
436 |
+
return $this->steps;
|
437 |
+
}
|
438 |
+
|
439 |
+
/**
|
440 |
+
* Download and save file into web server
|
441 |
+
*
|
442 |
+
*/
|
443 |
+
public function download_remote_file($form_data)
|
444 |
+
{
|
445 |
+
$out=array(
|
446 |
+
'response'=>false,
|
447 |
+
'file_name'=>'',
|
448 |
+
'msg'=>'',
|
449 |
+
);
|
450 |
+
|
451 |
+
$method_import_form_data=(isset($form_data['method_import_form_data']) ? $form_data['method_import_form_data'] : array());
|
452 |
+
$file_from=(isset($method_import_form_data['wt_iew_file_from']) ? Wt_Iew_Sh::sanitize_item($method_import_form_data['wt_iew_file_from']) : '');
|
453 |
+
|
454 |
+
if($file_from=="")
|
455 |
+
{
|
456 |
+
return $out;
|
457 |
+
}
|
458 |
+
if($file_from=='local' || $file_from=='url')
|
459 |
+
{
|
460 |
+
if($file_from=='local')
|
461 |
+
{
|
462 |
+
$file_url=(isset($method_import_form_data['wt_iew_local_file']) ? Wt_Iew_Sh::sanitize_item($method_import_form_data['wt_iew_local_file'], 'url') : '');
|
463 |
+
$local_file_path=Wt_Iew_IE_Basic_Helper::_get_local_file_path($file_url);
|
464 |
+
if(!$local_file_path) /* no local file found */
|
465 |
+
{
|
466 |
+
$file_url='';
|
467 |
+
}
|
468 |
+
}else
|
469 |
+
{
|
470 |
+
$file_url=(isset($method_import_form_data['wt_iew_url_file']) ? Wt_Iew_Sh::sanitize_item($method_import_form_data['wt_iew_url_file'], 'url') : '');
|
471 |
+
}
|
472 |
+
|
473 |
+
if($file_url!="") /* file URL not empty */
|
474 |
+
{
|
475 |
+
if($this->is_extension_allowed($file_url)) /* file type is in allowed list */
|
476 |
+
{
|
477 |
+
$ext_arr=explode('.', $file_url);
|
478 |
+
$ext=end($ext_arr);
|
479 |
+
|
480 |
+
$file_name=$this->get_temp_file_name($ext);
|
481 |
+
$file_path=$this->get_file_path($file_name);
|
482 |
+
if($file_path)
|
483 |
+
{
|
484 |
+
if($file_from=='local')
|
485 |
+
{
|
486 |
+
if(@copy($local_file_path, $file_path))
|
487 |
+
{
|
488 |
+
$out=array(
|
489 |
+
'response'=>true,
|
490 |
+
'file_name'=>$file_name,
|
491 |
+
'msg'=>'',
|
492 |
+
);
|
493 |
+
}else
|
494 |
+
{
|
495 |
+
$out['msg']=__('Unable to create temp file.');
|
496 |
+
}
|
497 |
+
}else
|
498 |
+
{
|
499 |
+
$file_data=$this->remote_get($file_url);
|
500 |
+
|
501 |
+
if(!is_wp_error($file_data) && wp_remote_retrieve_response_code($file_data)==200)
|
502 |
+
{
|
503 |
+
$file_data=wp_remote_retrieve_body($file_data);
|
504 |
+
if(@file_put_contents($file_path, $file_data))
|
505 |
+
{
|
506 |
+
$out=array(
|
507 |
+
'response'=>true,
|
508 |
+
'file_name'=>$file_name,
|
509 |
+
'msg'=>'',
|
510 |
+
);
|
511 |
+
}else
|
512 |
+
{
|
513 |
+
$out['msg']=__('Unable to create temp file.');
|
514 |
+
}
|
515 |
+
}else
|
516 |
+
{
|
517 |
+
$out['msg']=__('Unable to fetch file data.');
|
518 |
+
}
|
519 |
+
}
|
520 |
+
}else
|
521 |
+
{
|
522 |
+
$out['msg']=__('Unable to create temp directory.');
|
523 |
+
}
|
524 |
+
}else
|
525 |
+
{
|
526 |
+
$out['msg']=__('File type not allowed.');
|
527 |
+
}
|
528 |
+
}else
|
529 |
+
{
|
530 |
+
$out['msg']=__('File not found.');
|
531 |
+
}
|
532 |
+
}else
|
533 |
+
{
|
534 |
+
$out['response']=true;
|
535 |
+
$out=apply_filters('wt_iew_validate_file_basic', $out, $file_from, $method_import_form_data);
|
536 |
+
|
537 |
+
if(is_array($out) && isset($out['response']) && $out['response']) /* a form validation hook for remote modules */
|
538 |
+
{
|
539 |
+
$remote_adapter=Wt_Import_Export_For_Woo_Basic::get_remote_adapters('import', $file_from);
|
540 |
+
|
541 |
+
if(is_null($remote_adapter)) /* adapter object not found */
|
542 |
+
{
|
543 |
+
$msg=sprintf('Unable to initailize %s', $file_from);
|
544 |
+
$out['msg']=__($msg);
|
545 |
+
$out['response']=false;
|
546 |
+
}else
|
547 |
+
{
|
548 |
+
/* download the file */
|
549 |
+
$out = $remote_adapter->download($method_import_form_data, $out, $this);
|
550 |
+
}
|
551 |
+
}
|
552 |
+
}
|
553 |
+
if($out['response']!==false)
|
554 |
+
{
|
555 |
+
$file_path=self::get_file_path($out['file_name']);
|
556 |
+
/**
|
557 |
+
* Filter to modify the import file before processing.
|
558 |
+
* @param string $file_name name of the file
|
559 |
+
* @param string $file_path path of the file
|
560 |
+
* @return string $file_name name of the new altered file
|
561 |
+
*/
|
562 |
+
$out['file_name']=apply_filters('wt_iew_alter_import_file_basic', $out['file_name'], $file_path);
|
563 |
+
}
|
564 |
+
|
565 |
+
return $out;
|
566 |
+
}
|
567 |
+
|
568 |
+
public function remote_get($target_url)
|
569 |
+
{
|
570 |
+
global $wp_version;
|
571 |
+
|
572 |
+
$def_args = array(
|
573 |
+
'timeout' => 5,
|
574 |
+
'redirection' => 5,
|
575 |
+
'httpversion' => '1.0',
|
576 |
+
'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url(),
|
577 |
+
'blocking' => true,
|
578 |
+
'headers' => array(),
|
579 |
+
'cookies' => array(),
|
580 |
+
'body' => null,
|
581 |
+
'compress' => false,
|
582 |
+
'decompress' => true,
|
583 |
+
'sslverify' => false,
|
584 |
+
'stream' => false,
|
585 |
+
'filename' => null
|
586 |
+
);
|
587 |
+
return wp_remote_get($target_url, $def_args);
|
588 |
+
}
|
589 |
+
|
590 |
+
public function get_log_file_name($history_id)
|
591 |
+
{
|
592 |
+
return 'log_'.$history_id.'.log';
|
593 |
+
}
|
594 |
+
|
595 |
+
public function get_temp_file_name($ext)
|
596 |
+
{
|
597 |
+
/* adding rerun prefix is to easily identify rerun temp files */
|
598 |
+
$rerun_prefix=($this->rerun_id>0 ? 'rerun_'.$this->rerun_id.'_' : '');
|
599 |
+
return $rerun_prefix.'temp_'.$this->to_import.'_'.time().'.'.$ext;
|
600 |
+
}
|
601 |
+
|
602 |
+
/**
|
603 |
+
* Get given file url.
|
604 |
+
* If file name is empty then URL will return
|
605 |
+
*/
|
606 |
+
public static function get_file_url($file_name="")
|
607 |
+
{
|
608 |
+
return WP_CONTENT_URL.self::$import_dir_name.'/'.$file_name;
|
609 |
+
}
|
610 |
+
|
611 |
+
/**
|
612 |
+
* Checks the file extension is in allowed list
|
613 |
+
* @param string File name/ URL
|
614 |
+
* @return boolean
|
615 |
+
*/
|
616 |
+
public function is_extension_allowed($file_url)
|
617 |
+
{
|
618 |
+
$ext_arr=explode('.', $file_url);
|
619 |
+
$ext=strtolower(end($ext_arr));
|
620 |
+
if(isset($this->allowed_import_file_type[$ext])) /* file type is in allowed list */
|
621 |
+
{
|
622 |
+
return true;
|
623 |
+
}
|
624 |
+
return false;
|
625 |
+
}
|
626 |
+
|
627 |
+
/**
|
628 |
+
* Delete import file
|
629 |
+
* @param string File path/ URL
|
630 |
+
* @return boolean
|
631 |
+
*/
|
632 |
+
public function delete_import_file($file_url)
|
633 |
+
{
|
634 |
+
$file_path_arr=explode("/", $file_url);
|
635 |
+
$file_name=end($file_path_arr);
|
636 |
+
$file_path=$this->get_file_path($file_name);
|
637 |
+
if(file_exists($file_path))
|
638 |
+
{
|
639 |
+
if($this->is_extension_allowed($file_url))/* file type is in allowed list */
|
640 |
+
{
|
641 |
+
@unlink($file_path);
|
642 |
+
return true;
|
643 |
+
}
|
644 |
+
}
|
645 |
+
return false;
|
646 |
+
}
|
647 |
+
|
648 |
+
/**
|
649 |
+
* Get given temp file path.
|
650 |
+
* If file name is empty then file path will return
|
651 |
+
*/
|
652 |
+
public static function get_file_path($file_name="")
|
653 |
+
{
|
654 |
+
if(!is_dir(self::$import_dir))
|
655 |
+
{
|
656 |
+
if(!mkdir(self::$import_dir, 0700))
|
657 |
+
{
|
658 |
+
return false;
|
659 |
+
}else
|
660 |
+
{
|
661 |
+
$files_to_create=array('.htaccess' => 'deny from all', 'index.php'=>'<?php // Silence is golden');
|
662 |
+
foreach($files_to_create as $file=>$file_content)
|
663 |
+
{
|
664 |
+
if(!file_exists(self::$import_dir.'/'.$file))
|
665 |
+
{
|
666 |
+
$fh=@fopen(self::$import_dir.'/'.$file, "w");
|
667 |
+
if(is_resource($fh))
|
668 |
+
{
|
669 |
+
fwrite($fh, $file_content);
|
670 |
+
fclose($fh);
|
671 |
+
}
|
672 |
+
}
|
673 |
+
}
|
674 |
+
}
|
675 |
+
}
|
676 |
+
return self::$import_dir.'/'.$file_name;
|
677 |
+
}
|
678 |
+
|
679 |
+
/**
|
680 |
+
* Download and create a temp file. And create a history entry
|
681 |
+
* @param string $step the action to perform, here 'download'
|
682 |
+
*
|
683 |
+
* @return array
|
684 |
+
*/
|
685 |
+
public function process_download($form_data, $step, $to_process, $import_id=0, $offset=0)
|
686 |
+
{
|
687 |
+
$out=array(
|
688 |
+
'response'=>false,
|
689 |
+
'new_offset'=>0,
|
690 |
+
'import_id'=>0,
|
691 |
+
'history_id'=>0, //same as that of import id
|
692 |
+
'total_records'=>0,
|
693 |
+
'finished'=>0,
|
694 |
+
'msg'=>'',
|
695 |
+
);
|
696 |
+
$this->to_import=$to_process;
|
697 |
+
|
698 |
+
if($import_id>0)
|
699 |
+
{
|
700 |
+
//take history data by import_id
|
701 |
+
$import_data=Wt_Import_Export_For_Woo_Basic_History::get_history_entry_by_id($import_id);
|
702 |
+
if(is_null($import_data)) //no record found so it may be an error
|
703 |
+
{
|
704 |
+
return $out;
|
705 |
+
}else
|
706 |
+
{
|
707 |
+
$file_name=(isset($import_data['file_name']) ? $import_data['file_name'] : '');
|
708 |
+
$file_path=$this->get_file_path($file_name);
|
709 |
+
if($file_path && file_exists($file_path))
|
710 |
+
{
|
711 |
+
$this->temp_import_file=$file_name;
|
712 |
+
}else
|
713 |
+
{
|
714 |
+
$msg='Error occurred while processing the file';
|
715 |
+
Wt_Import_Export_For_Woo_Basic_History::record_failure($import_id, $msg);
|
716 |
+
$out['msg']=__($msg);
|
717 |
+
return $out;
|
718 |
+
}
|
719 |
+
}
|
720 |
+
}else
|
721 |
+
{
|
722 |
+
if($offset==0)
|
723 |
+
{
|
724 |
+
if($this->temp_import_file!="") /* its a non schedule import */
|
725 |
+
{
|
726 |
+
$file_path=$this->get_file_path($this->temp_import_file);
|
727 |
+
if($file_path && file_exists($file_path))
|
728 |
+
{
|
729 |
+
if($this->is_extension_allowed($this->temp_import_file)) /* file type is in allowed list */
|
730 |
+
{
|
731 |
+
$import_id=Wt_Import_Export_For_Woo_Basic_History::create_history_entry('', $form_data, $to_process, 'import');
|
732 |
+
}else
|
733 |
+
{
|
734 |
+
return $out;
|
735 |
+
}
|
736 |
+
}else
|
737 |
+
{
|
738 |
+
$out['msg']=__('Temp file missing.');
|
739 |
+
return $out;
|
740 |
+
}
|
741 |
+
}else /* in scheduled import need to prepare the temp file */
|
742 |
+
{
|
743 |
+
$import_id=Wt_Import_Export_For_Woo_Basic_History::create_history_entry('', $form_data, $to_process, 'import');
|
744 |
+
$response=$this->download_remote_file($form_data);
|
745 |
+
|
746 |
+
if(!$response['response']) /* not validated successfully */
|
747 |
+
{
|
748 |
+
Wt_Import_Export_For_Woo_Basic_History::record_failure($import_id, $response['msg']);
|
749 |
+
$out['msg']=$response['msg'];
|
750 |
+
return $out;
|
751 |
+
}else
|
752 |
+
{
|
753 |
+
$file_path=$this->get_file_path($response['file_name']);
|
754 |
+
$this->temp_import_file=$response['file_name'];
|
755 |
+
}
|
756 |
+
}
|
757 |
+
}
|
758 |
+
}
|
759 |
+
|
760 |
+
/**
|
761 |
+
* In XML import we need to convert the file into CSV before processing
|
762 |
+
* It may be a batched processing for larger files
|
763 |
+
*/
|
764 |
+
$ext_arr=explode('.', $this->temp_import_file);
|
765 |
+
|
766 |
+
$out=$this->_set_import_file_processing_finished($file_path, $import_id);
|
767 |
+
|
768 |
+
return $out;
|
769 |
+
}
|
770 |
+
|
771 |
+
/**
|
772 |
+
* If the file type is not CSV (Eg: XML) Then the delimiter must be ",".
|
773 |
+
* Because we are converting XML to CSV
|
774 |
+
*
|
775 |
+
*/
|
776 |
+
protected function _set_csv_delimiter($form_data, $import_id)
|
777 |
+
{
|
778 |
+
$form_data['method_import_form_data']['wt_iew_delimiter']=",";
|
779 |
+
|
780 |
+
$update_data=array(
|
781 |
+
'data'=>maybe_serialize($form_data), //formadata
|
782 |
+
);
|
783 |
+
$update_data_type=array(
|
784 |
+
'%s',
|
785 |
+
);
|
786 |
+
Wt_Import_Export_For_Woo_Basic_History::update_history_entry($import_id, $update_data, $update_data_type);
|
787 |
+
|
788 |
+
return $form_data;
|
789 |
+
}
|
790 |
+
|
791 |
+
protected function _set_import_file_processing_finished($file_path, $import_id)
|
792 |
+
{
|
793 |
+
/* update total records, temp file name in history table */
|
794 |
+
$total_records=filesize($file_path); /* in this case we cannot count number of rows */
|
795 |
+
$update_data=array(
|
796 |
+
'total'=>$total_records,
|
797 |
+
'file_name'=>$this->temp_import_file,
|
798 |
+
);
|
799 |
+
$update_data_type=array(
|
800 |
+
'%d',
|
801 |
+
'%s',
|
802 |
+
);
|
803 |
+
Wt_Import_Export_For_Woo_Basic_History::update_history_entry($import_id, $update_data, $update_data_type);
|
804 |
+
|
805 |
+
return array(
|
806 |
+
'response'=>true,
|
807 |
+
'finished'=>3,
|
808 |
+
'import_id'=>$import_id,
|
809 |
+
'history_id'=>$import_id, //same as that of import id
|
810 |
+
'total_records'=>$total_records,
|
811 |
+
'temp_import_file'=>$this->temp_import_file,
|
812 |
+
'msg'=>sprintf(__('Importing...(%d done)'), 0),
|
813 |
+
);
|
814 |
+
}
|
815 |
+
|
816 |
+
|
817 |
+
/**
|
818 |
+
* Do the import process
|
819 |
+
*/
|
820 |
+
public function process_action($form_data, $step, $to_process, $file_name='', $import_id=0, $offset=0)
|
821 |
+
{
|
822 |
+
$out=array(
|
823 |
+
'response'=>false,
|
824 |
+
'new_offset'=>0,
|
825 |
+
'import_id'=>0,
|
826 |
+
'history_id'=>0, //same as that of import id
|
827 |
+
'total_records'=>0,
|
828 |
+
'offset_count'=>0,
|
829 |
+
'finished'=>0,
|
830 |
+
'msg'=>'',
|
831 |
+
'total_success'=>0,
|
832 |
+
'total_failed'=>0,
|
833 |
+
);
|
834 |
+
|
835 |
+
$this->to_import=$to_process;
|
836 |
+
$this->to_process=$to_process;
|
837 |
+
|
838 |
+
/* prepare formdata, If this was not first batch */
|
839 |
+
if($import_id>0)
|
840 |
+
{
|
841 |
+
//take history data by import_id
|
842 |
+
$import_data=Wt_Import_Export_For_Woo_Basic_History::get_history_entry_by_id($import_id);
|
843 |
+
if(is_null($import_data)) //no record found so it may be an error
|
844 |
+
{
|
845 |
+
return $out;
|
846 |
+
}
|
847 |
+
|
848 |
+
//processing form data
|
849 |
+
$form_data=(isset($import_data['data']) ? maybe_unserialize($import_data['data']) : array());
|
850 |
+
|
851 |
+
}
|
852 |
+
else // No import id so it may be an error
|
853 |
+
{
|
854 |
+
return $out;
|
855 |
+
}
|
856 |
+
|
857 |
+
/* setting history_id in Log section */
|
858 |
+
Wt_Import_Export_For_Woo_Basic_Log::$history_id=$import_id;
|
859 |
+
|
860 |
+
$file_name=(isset($import_data['file_name']) ? $import_data['file_name'] : '');
|
861 |
+
$file_path=$this->get_file_path($file_name);
|
862 |
+
if($file_path)
|
863 |
+
{
|
864 |
+
if(!file_exists($file_path))
|
865 |
+
{
|
866 |
+
$msg='Temp file missing';
|
867 |
+
//no need to add translation function in message
|
868 |
+
Wt_Import_Export_For_Woo_Basic_History::record_failure($import_id, $msg);
|
869 |
+
$out['msg']=__($msg);
|
870 |
+
return $out;
|
871 |
+
}
|
872 |
+
}else
|
873 |
+
{
|
874 |
+
$msg='Temp file missing';
|
875 |
+
//no need to add translation function in message
|
876 |
+
Wt_Import_Export_For_Woo_Basic_History::record_failure($import_id, $msg);
|
877 |
+
$out['msg']=__($msg);
|
878 |
+
return $out;
|
879 |
+
}
|
880 |
+
|
881 |
+
$default_batch_count=absint(apply_filters('wt_iew_importer_alter_default_batch_count_basic', $this->default_batch_count, $to_process, $form_data));
|
882 |
+
$default_batch_count=($default_batch_count==0 ? $this->default_batch_count : $default_batch_count);
|
883 |
+
|
884 |
+
$batch_count=$default_batch_count;
|
885 |
+
$csv_delimiter=',';
|
886 |
+
$total_records=(isset($import_data['total']) ? $import_data['total'] : 0);
|
887 |
+
$file_ext_arr=explode('.', $file_name);
|
888 |
+
$file_type= strtolower(end($file_ext_arr));
|
889 |
+
$file_type=(isset($this->allowed_import_file_type[$file_type]) ? $file_type : 'csv');
|
890 |
+
|
891 |
+
if(isset($form_data['advanced_form_data']))
|
892 |
+
{
|
893 |
+
$batch_count=(isset($form_data['advanced_form_data']['wt_iew_batch_count']) ? $form_data['advanced_form_data']['wt_iew_batch_count'] : $batch_count);
|
894 |
+
}
|
895 |
+
if(isset($form_data['method_import_form_data']) && $file_type=='csv')
|
896 |
+
{
|
897 |
+
$csv_delimiter=(isset($form_data['method_import_form_data']['wt_iew_delimiter']) ? $form_data['method_import_form_data']['wt_iew_delimiter'] : $csv_delimiter);
|
898 |
+
$csv_delimiter=($csv_delimiter=="" ? ',' : $csv_delimiter);
|
899 |
+
}
|
900 |
+
|
901 |
+
|
902 |
+
|
903 |
+
include_once WT_U_IEW_PLUGIN_PATH.'admin/classes/class-csvreader.php';
|
904 |
+
$reader=new Wt_Import_Export_For_Woo_Basic_Csvreader($csv_delimiter);
|
905 |
+
|
906 |
+
|
907 |
+
/* important: prepare deafult mapping formdata for quick import */
|
908 |
+
$input_data=$reader->get_data_as_batch($file_path, $offset, $batch_count, $this, $form_data);
|
909 |
+
|
910 |
+
|
911 |
+
if(!$input_data || !is_array($input_data))
|
912 |
+
{
|
913 |
+
$msg='Unable to process the file';
|
914 |
+
//no need to add translation function in message
|
915 |
+
Wt_Import_Export_For_Woo_Basic_History::record_failure($import_id, $msg);
|
916 |
+
$out['msg']=__($msg);
|
917 |
+
return $out;
|
918 |
+
}
|
919 |
+
|
920 |
+
/* checking action is finshed */
|
921 |
+
$is_last_offset=false;
|
922 |
+
$new_offset=$input_data['offset']; //increase the offset
|
923 |
+
if($new_offset>=$total_records) //finished
|
924 |
+
{
|
925 |
+
$is_last_offset=true;
|
926 |
+
}
|
927 |
+
|
928 |
+
/**
|
929 |
+
* In case of non schedule import. Offset row count.
|
930 |
+
* The real internal offset is in bytes, This offset is total row processed.
|
931 |
+
*/
|
932 |
+
$offset_count=(isset($_POST['offset_count']) ? absint($_POST['offset_count']) : 0);
|
933 |
+
|
934 |
+
/* giving full data */
|
935 |
+
$form_data=apply_filters('wt_iew_import_full_form_data_basic', $form_data, $to_process, $step, $this->selected_template_data);
|
936 |
+
|
937 |
+
/* in scheduled import. The import method will not available so we need to take it from formdata */
|
938 |
+
$formdata_import_method=(isset($formdata['method_import_form_data']) && isset($formdata['method_import_form_data']['method_import']) ? $formdata['method_import_form_data']['method_import'] : 'quick');
|
939 |
+
$this->import_method=($this->import_method=="" ? $formdata_import_method : $this->import_method);
|
940 |
+
|
941 |
+
/**
|
942 |
+
* Import response format
|
943 |
+
*/
|
944 |
+
$import_response=array(
|
945 |
+
'total_success'=>$batch_count,
|
946 |
+
'total_failed'=>0,
|
947 |
+
'log_data'=>array(
|
948 |
+
array('row'=>$offset_count, 'message'=>'', 'status'=>true, 'post_id'=>''),
|
949 |
+
),
|
950 |
+
);
|
951 |
+
|
952 |
+
$import_response=apply_filters('wt_iew_importer_do_import_basic', $input_data['data_arr'], $to_process, $step, $form_data, $this->selected_template_data, $this->import_method, $offset_count, $is_last_offset);
|
953 |
+
|
954 |
+
/**
|
955 |
+
* Writing import log to file
|
956 |
+
*/
|
957 |
+
if(!empty($import_response) && is_array($import_response) && Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings('enable_import_log')==1)
|
958 |
+
{
|
959 |
+
$log_writer=new Wt_Import_Export_For_Woo_Basic_Logwriter();
|
960 |
+
$log_file_name=$this->get_log_file_name($import_id);
|
961 |
+
$log_file_path=$this->get_file_path($log_file_name);
|
962 |
+
$log_data=(isset($import_response['log_data']) && is_array($import_response['log_data']) ? $import_response['log_data'] : array());
|
963 |
+
$log_writer->write_import_log($log_data, $log_file_path);
|
964 |
+
}
|
965 |
+
|
966 |
+
|
967 |
+
/* updating completed offset */
|
968 |
+
$update_data=array(
|
969 |
+
'offset'=>$offset
|
970 |
+
);
|
971 |
+
$update_data_type=array(
|
972 |
+
'%d'
|
973 |
+
);
|
974 |
+
Wt_Import_Export_For_Woo_Basic_History::update_history_entry($import_id, $update_data, $update_data_type);
|
975 |
+
|
976 |
+
|
977 |
+
/* updating output parameters */
|
978 |
+
$out['total_records']=$total_records;
|
979 |
+
$out['import_id']=$import_id;
|
980 |
+
$out['history_id']=$import_id;
|
981 |
+
$out['response']=true;
|
982 |
+
|
983 |
+
/* In case of non schedule import. total success, totla failed count */
|
984 |
+
$total_success=(isset($_POST['total_success']) ? absint($_POST['total_success']) : 0);
|
985 |
+
$total_failed=(isset($_POST['total_failed']) ? absint($_POST['total_failed']) : 0);
|
986 |
+
|
987 |
+
$out['total_success']=(isset($import_response['total_success']) ? $import_response['total_success'] : 0)+$total_success;
|
988 |
+
$out['total_failed']=(isset($import_response['total_failed']) ? $import_response['total_failed'] : 0)+$total_failed;
|
989 |
+
|
990 |
+
/* updating action is finshed */
|
991 |
+
if($is_last_offset) //finished
|
992 |
+
{
|
993 |
+
/* delete the temp file */
|
994 |
+
@unlink($file_path);
|
995 |
+
|
996 |
+
$log_summary_msg=$this->generate_log_summary($out, $is_last_offset);
|
997 |
+
|
998 |
+
$out['finished']=1; //finished
|
999 |
+
$out['msg']=$log_summary_msg;
|
1000 |
+
|
1001 |
+
/* updating finished status */
|
1002 |
+
$update_data=array(
|
1003 |
+
'status'=>Wt_Import_Export_For_Woo_Basic_History::$status_arr['finished'],
|
1004 |
+
'status_text'=>'Finished' //translation function not needed
|
1005 |
+
);
|
1006 |
+
$update_data_type=array(
|
1007 |
+
'%d',
|
1008 |
+
'%s',
|
1009 |
+
);
|
1010 |
+
Wt_Import_Export_For_Woo_Basic_History::update_history_entry($import_id, $update_data, $update_data_type);
|
1011 |
+
}else
|
1012 |
+
{
|
1013 |
+
$rows_processed=$input_data['rows_processed'];
|
1014 |
+
$total_processed=$rows_processed+$offset_count;
|
1015 |
+
|
1016 |
+
$out['offset_count']=$total_processed;
|
1017 |
+
$out['new_offset']=$new_offset;
|
1018 |
+
|
1019 |
+
$log_summary_msg=$this->generate_log_summary($out, $is_last_offset);
|
1020 |
+
|
1021 |
+
$out['msg']=$log_summary_msg;
|
1022 |
+
}
|
1023 |
+
|
1024 |
+
return $out;
|
1025 |
+
}
|
1026 |
+
|
1027 |
+
protected function generate_log_summary($data, $is_last_offset)
|
1028 |
+
{
|
1029 |
+
if($is_last_offset)
|
1030 |
+
{
|
1031 |
+
$msg='<span class="wt_iew_info_box_title">'.__('Finished').'</span>';
|
1032 |
+
}else
|
1033 |
+
{
|
1034 |
+
$msg='<span class="wt_iew_info_box_title">'.sprintf(__('Importing...(%d done)'), $data['offset_count']).'</span>';
|
1035 |
+
}
|
1036 |
+
$msg.='<br />'.__('Total success: ').$data['total_success'].'<br />'.__('Total failed: ').$data['total_failed'];
|
1037 |
+
if($is_last_offset)
|
1038 |
+
{
|
1039 |
+
$msg.='<span class="wt_iew_info_box_finished_text">';
|
1040 |
+
if(Wt_Import_Export_For_Woo_Admin_Basic::module_exists('history'))
|
1041 |
+
{
|
1042 |
+
$history_module_id=Wt_Import_Export_For_Woo_Basic::get_module_id('history');
|
1043 |
+
$history_page_url=admin_url('admin.php?page='.$history_module_id);
|
1044 |
+
$msg.='<br />'.sprintf(__('View detailed log from %s History %s section'), '<a href="'.$history_page_url.'" target="_blank">', '</a>');
|
1045 |
+
}
|
1046 |
+
$msg.='<br /><a class="button button-secondary" style="margin-top:5px;" onclick="wt_iew_basic_import.hide_import_info_box();">'.__('Close').'</a></span>';
|
1047 |
+
}
|
1048 |
+
return $msg;
|
1049 |
+
}
|
1050 |
+
|
1051 |
+
/**
|
1052 |
+
* Main ajax hook to handle all import related requests
|
1053 |
+
*/
|
1054 |
+
public function ajax_main()
|
1055 |
+
{
|
1056 |
+
include_once plugin_dir_path(__FILE__).'classes/class-import-ajax.php';
|
1057 |
+
if(Wt_Iew_Sh::check_write_access(WT_IEW_PLUGIN_ID_BASIC))
|
1058 |
+
{
|
1059 |
+
/**
|
1060 |
+
* Check it is a rerun call
|
1061 |
+
*/
|
1062 |
+
if(!$this->_process_rerun((isset($_POST['rerun_id']) ? absint($_POST['rerun_id']) : 0)))
|
1063 |
+
{
|
1064 |
+
$this->import_method=(isset($_POST['import_method']) ? Wt_Iew_Sh::sanitize_item($_POST['import_method'], 'text') : '');
|
1065 |
+
$this->to_import=(isset($_POST['to_import']) ? Wt_Iew_Sh::sanitize_item($_POST['to_import'], 'text') : '');
|
1066 |
+
$this->selected_template=(isset($_POST['selected_template']) ? Wt_Iew_Sh::sanitize_item($_POST['selected_template'], 'int') : 0);
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
$this->get_steps();
|
1070 |
+
|
1071 |
+
$ajax_obj=new Wt_Import_Export_For_Woo_Basic_Import_Ajax($this, $this->to_import, $this->steps, $this->import_method, $this->selected_template, $this->rerun_id);
|
1072 |
+
|
1073 |
+
$import_action=Wt_Iew_Sh::sanitize_item($_POST['import_action'], 'text');
|
1074 |
+
$data_type=Wt_Iew_Sh::sanitize_item($_POST['data_type'], 'text');
|
1075 |
+
|
1076 |
+
$allowed_ajax_actions=array('get_steps', 'validate_file', 'get_meta_mapping_fields', 'save_template', 'save_template_as', 'update_template', 'download', 'import', 'upload_import_file', 'delete_import_file');
|
1077 |
+
|
1078 |
+
$out=array(
|
1079 |
+
'status'=>0,
|
1080 |
+
'msg'=>__('Error'),
|
1081 |
+
);
|
1082 |
+
|
1083 |
+
if(method_exists($ajax_obj, $import_action) && in_array($import_action, $allowed_ajax_actions))
|
1084 |
+
{
|
1085 |
+
$out=$ajax_obj->{$import_action}($out);
|
1086 |
+
}
|
1087 |
+
|
1088 |
+
if($data_type=='json')
|
1089 |
+
{
|
1090 |
+
echo json_encode($out);
|
1091 |
+
}
|
1092 |
+
}
|
1093 |
+
exit();
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
public function process_column_val($input_file_data_row, $form_data)
|
1097 |
+
{
|
1098 |
+
$out=array(
|
1099 |
+
'mapping_fields'=>array(),
|
1100 |
+
'meta_mapping_fields'=>array()
|
1101 |
+
);
|
1102 |
+
|
1103 |
+
/**
|
1104 |
+
* Default columns
|
1105 |
+
*/
|
1106 |
+
$mapping_form_data=(isset($form_data['mapping_form_data']) ? $form_data['mapping_form_data'] : array());
|
1107 |
+
$mapping_selected_fields=(isset($mapping_form_data['mapping_selected_fields']) ? $mapping_form_data['mapping_selected_fields'] : array());
|
1108 |
+
$mapping_fields=(isset($mapping_form_data['mapping_fields']) ? $mapping_form_data['mapping_fields'] : array());
|
1109 |
+
|
1110 |
+
/**
|
1111 |
+
* Input date format.
|
1112 |
+
* This will be taken as the global date format for all date fields in the input file.
|
1113 |
+
* If date format is specified in the evaluation section. Then this value will be overriden.
|
1114 |
+
*/
|
1115 |
+
$method_import_form_data=(isset($form_data['method_import_form_data']) ? $form_data['method_import_form_data'] : array());
|
1116 |
+
$input_date_format=(isset($method_import_form_data['wt_iew_date_format']) ? $method_import_form_data['wt_iew_date_format'] : '');
|
1117 |
+
|
1118 |
+
foreach ($mapping_selected_fields as $key => $value)
|
1119 |
+
{
|
1120 |
+
$out['mapping_fields'][$key]=$this->evaluate_data($key, $value, $input_file_data_row, $mapping_fields, $input_date_format);
|
1121 |
+
}
|
1122 |
+
$mapping_form_data=$mapping_fields=$mapping_selected_fields=null;
|
1123 |
+
unset($mapping_form_data, $mapping_fields, $mapping_selected_fields);
|
1124 |
+
|
1125 |
+
/**
|
1126 |
+
* Meta columns
|
1127 |
+
*/
|
1128 |
+
$meta_step_form_data=(isset($form_data['meta_step_form_data']) ? $form_data['meta_step_form_data'] : array());
|
1129 |
+
$mapping_selected_fields=(isset($meta_step_form_data['mapping_selected_fields']) ? $meta_step_form_data['mapping_selected_fields'] : array());
|
1130 |
+
$mapping_fields=(isset($meta_step_form_data['mapping_fields']) ? $meta_step_form_data['mapping_fields'] : array());
|
1131 |
+
foreach ($mapping_selected_fields as $meta_key => $meta_val_arr)
|
1132 |
+
{
|
1133 |
+
$out['meta_mapping_fields'][$meta_key]=array();
|
1134 |
+
$meta_fields_arr=(isset($mapping_fields[$meta_key]) ? $mapping_fields[$meta_key] : array());
|
1135 |
+
foreach ($meta_val_arr as $key => $value)
|
1136 |
+
{
|
1137 |
+
$out['meta_mapping_fields'][$meta_key][$key]=$this->evaluate_data($key, $value, $input_file_data_row, $meta_fields_arr, $input_date_format);
|
1138 |
+
}
|
1139 |
+
}
|
1140 |
+
$meta_step_form_data=$mapping_fields=$mapping_selected_fields=$input_file_data_row=$form_data=null;
|
1141 |
+
unset($meta_step_form_data, $mapping_fields, $mapping_selected_fields, $input_file_data_row, $form_data);
|
1142 |
+
|
1143 |
+
return $out;
|
1144 |
+
}
|
1145 |
+
protected function evaluate_data($key, $value, $data_row, $mapping_fields, $input_date_format)
|
1146 |
+
{
|
1147 |
+
$value=$this->add_input_file_data($key, $value, $data_row, $mapping_fields, $input_date_format);
|
1148 |
+
$value=$this->do_arithmetic($value);
|
1149 |
+
$data_row=null;
|
1150 |
+
unset($data_row);
|
1151 |
+
return $value;
|
1152 |
+
}
|
1153 |
+
protected function do_arithmetic($str)
|
1154 |
+
{
|
1155 |
+
$re = '/\[([0-9()+\-*\/. ]+)\]/m';
|
1156 |
+
$matches=array();
|
1157 |
+
$find=array();
|
1158 |
+
$replace=array();
|
1159 |
+
if(preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0))
|
1160 |
+
{
|
1161 |
+
foreach ($matches as $key => $value)
|
1162 |
+
{
|
1163 |
+
if(is_array($value) && count($value)>1)
|
1164 |
+
{
|
1165 |
+
$synatx=$this->validate_syntax($value[1]);
|
1166 |
+
if($synatx)
|
1167 |
+
{
|
1168 |
+
$replace[]=eval('return '.$synatx.';');
|
1169 |
+
}else
|
1170 |
+
{
|
1171 |
+
$replace[]='';
|
1172 |
+
}
|
1173 |
+
$find[]=$value[0];
|
1174 |
+
unset($synatx);
|
1175 |
+
}
|
1176 |
+
}
|
1177 |
+
}
|
1178 |
+
return str_replace($find, $replace, $str);
|
1179 |
+
}
|
1180 |
+
protected function validate_syntax($val)
|
1181 |
+
{
|
1182 |
+
$open_bracket=substr_count($val, '(');
|
1183 |
+
$close_bracket=substr_count($val, ')');
|
1184 |
+
if($close_bracket!=$open_bracket)
|
1185 |
+
{
|
1186 |
+
return false; //invalid
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
//remove whitespaces
|
1190 |
+
$val=str_replace(' ', '', $val);
|
1191 |
+
$re_after='/\b[\+|*|\-|\/]([^0-9\+\-\(])/m';
|
1192 |
+
$re_before='/([^0-9\+\-\)])[\+|*|\-|\/]/m';
|
1193 |
+
|
1194 |
+
$match_after=array();
|
1195 |
+
$match_before=array();
|
1196 |
+
if(preg_match_all($re_after, $val, $match_after, PREG_SET_ORDER, 0) || preg_match_all($re_before, $val, $match_before, PREG_SET_ORDER, 0))
|
1197 |
+
{
|
1198 |
+
return false; //invalid
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
unset($match_after, $match_before, $re_after, $re_before);
|
1202 |
+
|
1203 |
+
/* process + and - symbols */
|
1204 |
+
$val=preg_replace(array('/\+{2,}/m', '/\-{2,}/m'), array('+', '- -'), $val);
|
1205 |
+
|
1206 |
+
return $val;
|
1207 |
+
}
|
1208 |
+
protected function add_input_file_data($key, $str, $data_row, $mapping_fields, $input_date_format)
|
1209 |
+
{
|
1210 |
+
$re = '/\{([^}]+)\}/m';
|
1211 |
+
$matches=array();
|
1212 |
+
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
|
1213 |
+
$find=array();
|
1214 |
+
$replace=array();
|
1215 |
+
foreach ($matches as $key => $value)
|
1216 |
+
{
|
1217 |
+
if(is_array($value) && count($value)>1)
|
1218 |
+
{
|
1219 |
+
$data_key=trim($value[1]);
|
1220 |
+
|
1221 |
+
/* Check for date formatting */
|
1222 |
+
$data_key_arr=explode("@", $data_key);
|
1223 |
+
$data_format='';
|
1224 |
+
if(count($data_key_arr)==2) /* date format field given while on import */
|
1225 |
+
{
|
1226 |
+
$data_key=$data_key_arr[0]; //first value is the field key
|
1227 |
+
$data_format=$data_key_arr[1]; //second value will be the format
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
/* Pre-defined date field */
|
1231 |
+
if(isset($mapping_fields[$data_key]) && isset($mapping_fields[$data_key][2]) && $mapping_fields[$data_key][2]='date')
|
1232 |
+
{
|
1233 |
+
/**
|
1234 |
+
* Always give preference to evaluation section
|
1235 |
+
* If not specified in evaluation section. Use default format
|
1236 |
+
*/
|
1237 |
+
if($data_format=="")
|
1238 |
+
{
|
1239 |
+
$data_format=$input_date_format;
|
1240 |
+
}
|
1241 |
+
}
|
1242 |
+
|
1243 |
+
$output_val='';
|
1244 |
+
if(isset($data_row[$data_key]))
|
1245 |
+
{
|
1246 |
+
// $output_val=sanitize_text_field($data_row[$data_key]); sanitize_text_field stripping html content
|
1247 |
+
$output_val=($data_row[$data_key]);
|
1248 |
+
}
|
1249 |
+
|
1250 |
+
/**
|
1251 |
+
* This is a date field
|
1252 |
+
*/
|
1253 |
+
if(trim($data_format)!="" && trim($output_val)!="")
|
1254 |
+
{
|
1255 |
+
if(version_compare(PHP_VERSION, '5.6.0', '>='))
|
1256 |
+
{
|
1257 |
+
$date_obj=DateTime::createFromFormat($data_format, $output_val);
|
1258 |
+
if($date_obj)
|
1259 |
+
{
|
1260 |
+
$output_val=$date->format('Y-m-d H:i:s');
|
1261 |
+
}
|
1262 |
+
}else
|
1263 |
+
{
|
1264 |
+
$output_val=date("Y-m-d H:i:s", strtotime(trim(str_replace('/', '-', str_replace('-', '', $output_val)))));
|
1265 |
+
}
|
1266 |
+
}
|
1267 |
+
|
1268 |
+
$replace[]=$output_val;
|
1269 |
+
$find[]=$value[0];
|
1270 |
+
unset($data_key);
|
1271 |
+
}
|
1272 |
+
}
|
1273 |
+
$data_row=null;
|
1274 |
+
unset($data_row);
|
1275 |
+
return str_replace($find, $replace, $str);
|
1276 |
+
}
|
1277 |
+
}
|
1278 |
+
}
|
1279 |
+
Wt_Import_Export_For_Woo_Basic::$loaded_modules['import']=new Wt_Import_Export_For_Woo_Basic_Import();
|
admin/modules/import/views/_import_advanced_page.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt_iew_import_main">
|
7 |
+
<p><?php echo $this->step_description;?></p>
|
8 |
+
<form class="wt_iew_import_advanced_form">
|
9 |
+
<table class="form-table wt-iew-form-table">
|
10 |
+
<?php
|
11 |
+
Wt_Import_Export_For_Woo_Basic_Common_Helper::field_generator($advanced_screen_fields, $advanced_form_data);
|
12 |
+
?>
|
13 |
+
</table>
|
14 |
+
</form>
|
15 |
+
</div>
|
16 |
+
<script type="text/javascript">
|
17 |
+
/* custom action: other than import, save, update. Eg: schedule */
|
18 |
+
function wt_iew_custom_action_basic(ajx_dta, action, id)
|
19 |
+
{
|
20 |
+
ajx_dta['item_type']=ajx_dta['to_import'];
|
21 |
+
<?php
|
22 |
+
do_action('wt_iew_custom_action_basic');
|
23 |
+
?>
|
24 |
+
}
|
25 |
+
</script>
|
admin/modules/import/views/_import_footer.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt-iew-plugin-toolbar bottom">
|
7 |
+
<div style="float:left; padding-top:10px;" class="wt_iew_import_template_name"> </div>
|
8 |
+
<div style="float:right;">
|
9 |
+
<div style="float:right;">
|
10 |
+
<?php
|
11 |
+
foreach($this->step_btns as $btnk=>$btnv)
|
12 |
+
{
|
13 |
+
$css_class=(isset($btnv['class']) ? $btnv['class'] : '');
|
14 |
+
$action_type=(isset($btnv['action_type']) ? $btnv['action_type'] : 'non-step');
|
15 |
+
if($btnv['type']=='button')
|
16 |
+
{
|
17 |
+
?>
|
18 |
+
<button class="button button-primary wt_iew_import_action_btn <?php echo $css_class; ?>" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnv['key'];?>" type="submit">
|
19 |
+
<?php echo $btnv['text'];?>
|
20 |
+
</button>
|
21 |
+
<?php
|
22 |
+
|
23 |
+
}
|
24 |
+
elseif($btnv['type']=='dropdown_button')
|
25 |
+
{
|
26 |
+
$btn_arr=(isset($btnv['items']) && is_array($btnv['items']) ? $btnv['items'] : array());
|
27 |
+
?>
|
28 |
+
<button type="button" class="button button-primary wt_iew_drp_menu <?php echo $css_class; ?>" data-target="wt_iew_<?php echo $btnk; ?>_drp">
|
29 |
+
<?php echo $btnv['text'];?> <span class="dashicons dashicons-arrow-down" style="line-height: 28px;"></span>
|
30 |
+
</button>
|
31 |
+
<ul class="wt_iew_dropdown <?php echo $css_class; ?>" data-id="wt_iew_<?php echo $btnk; ?>_drp">
|
32 |
+
<?php
|
33 |
+
foreach($btn_arr as $btnkk => $btnvv)
|
34 |
+
{
|
35 |
+
$field_attr=(isset($btnvv['field_attr']) ? $btnvv['field_attr'] : '');
|
36 |
+
$action_type=(isset($btnvv['action_type']) ? $btnvv['action_type'] : 'non-step');
|
37 |
+
?>
|
38 |
+
<li class="wt_iew_import_action_btn" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnvv['key'];?>" <?php echo $field_attr;?> ><?php echo $btnvv['text'];?></li>
|
39 |
+
<?php
|
40 |
+
}
|
41 |
+
?>
|
42 |
+
</ul>
|
43 |
+
<?php
|
44 |
+
}
|
45 |
+
elseif($btnv['type']=='hidden_button')
|
46 |
+
{
|
47 |
+
?>
|
48 |
+
<button style="display:none;" class="button button-primary wt_iew_import_action_btn <?php echo $css_class; ?>" data-action-type="<?php echo $action_type; ?>" data-action="<?php echo $btnv['key'];?>" type="submit">
|
49 |
+
<?php echo $btnv['text'];?>
|
50 |
+
</button>
|
51 |
+
<?php
|
52 |
+
|
53 |
+
}
|
54 |
+
elseif($btnv['type']=='text')
|
55 |
+
{
|
56 |
+
?>
|
57 |
+
<span style="line-height:40px; font-weight:bold;" class="<?php echo $css_class; ?>"><?php echo $btnv['text'];?></span>
|
58 |
+
<?php
|
59 |
+
}
|
60 |
+
}
|
61 |
+
?>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
<span class="spinner" style="margin-top:11px;"></span>
|
65 |
+
</div>
|
admin/modules/import/views/_import_header.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt-iew-settings-header">
|
7 |
+
<h3>
|
8 |
+
<?php _e('Import'); ?><?php if($this->step!='post_type'){ ?> <span class="wt_iew_step_head_post_type_name"></span><?php } ?>: <?php echo $this->step_title; ?>
|
9 |
+
</h3>
|
10 |
+
<span class="wt_iew_step_info" title="<?php echo $this->step_summary; ?>">
|
11 |
+
<?php /* step count summary */
|
12 |
+
echo $this->step_summary;
|
13 |
+
?>
|
14 |
+
</span>
|
15 |
+
</div>
|
admin/modules/import/views/_import_mapping_page.php
ADDED
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<?php
|
7 |
+
$click_to_use=__('Click to use');
|
8 |
+
?>
|
9 |
+
<script type="text/javascript">
|
10 |
+
var wt_iew_file_head_default=<?php echo json_encode($file_heading_default_fields);?>;
|
11 |
+
var wt_iew_file_head_meta=<?php echo json_encode($file_heading_meta_fields);?>;
|
12 |
+
</script>
|
13 |
+
|
14 |
+
<!-- Mapping field editor popup -->
|
15 |
+
<div class="wt_iew_mapping_field_editor_container" data-title="<?php _e('Set value for column:');?> <span class='wt_iew_target_column'></span>" data-module="import">
|
16 |
+
<div class="wt_iew_mapping_field_editor">
|
17 |
+
<p class="wt_iew_mapping_field_editor_info" style="margin-bottom:5px;"><?php _e('Select and map any column from the input file or compute values with expressions.'); ?></p>
|
18 |
+
|
19 |
+
<label><?php _e('Expression');?></label>
|
20 |
+
<p class="wt_iew_mapping_field_editor_info">
|
21 |
+
<?php _e('Any of the operators +*/-()&@ or string constants can be used along with the attributes to manipulate the respective value.'); ?>
|
22 |
+
<br />
|
23 |
+
<?php echo sprintf(__('Enclose the operations within square brackets. e.g. if you want to increase the stock quantity of %sall imported products%s by 5 units during import simply use [{_stock}+5].'), '<b>', '</b>');?>
|
24 |
+
</p>
|
25 |
+
<p class="wt_iew_mapping_field_editor_er"></p>
|
26 |
+
<div class="wt_iew_mapping_field_editor_box">
|
27 |
+
<textarea class="wt_iew_mapping_field_editor_expression"></textarea>
|
28 |
+
</div>
|
29 |
+
|
30 |
+
<label><?php _e('Input file columns');?></label>
|
31 |
+
<div class="wt_iew_mapping_field_editor_box">
|
32 |
+
<input type="text" class="wt_iew_mapping_field_editor_column_search" placeholder="<?php _e('Type here to search');?>">
|
33 |
+
<div class="wt_iew_mapping_field_selector_box">
|
34 |
+
<ul class="wt_iew_mapping_field_selector">
|
35 |
+
<?php
|
36 |
+
foreach ($file_heading_default_fields as $key => $value)
|
37 |
+
{
|
38 |
+
?>
|
39 |
+
<li title="<?php echo $click_to_use;?>" data-val="<?php echo $key;?>"><?php echo $key;?></li>
|
40 |
+
<?php
|
41 |
+
}
|
42 |
+
foreach ($file_heading_meta_fields as $key => $value)
|
43 |
+
{
|
44 |
+
?>
|
45 |
+
<li title="<?php echo $click_to_use;?>" data-val="<?php echo $key;?>"><?php echo $key;?></li>
|
46 |
+
<?php
|
47 |
+
}
|
48 |
+
?>
|
49 |
+
</ul>
|
50 |
+
<div class="wt_iew_mapping_field_selector_no_column"><?php _e('No column found.');?></div>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
|
54 |
+
<label><?php _e('Output');?></label>
|
55 |
+
<p class="wt_iew_mapping_field_editor_info">
|
56 |
+
<?php _e('Sample value based on first record from input file. Columns that have no values in the input file may cause syntax errors if used in an expression as above.'); ?>
|
57 |
+
</p>
|
58 |
+
<div class="wt_iew_mapping_field_editor_box" style="max-height:80px; overflow:auto; margin-bottom:0px; border:dashed 1px #ccc; padding:5px;">
|
59 |
+
<div class="wt_iew_mapping_field_editor_sample"></div>
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
<!-- Mapping field editor popup -->
|
64 |
+
|
65 |
+
<div class="wt_iew_import_main">
|
66 |
+
<p><?php echo $this->step_description;?></p>
|
67 |
+
|
68 |
+
<p class="wt_iew_info_box wt_iew_info">
|
69 |
+
<?php _e('Columns are mapped automatically only if a matching header name is found in the input file. If not the value is left blank.');?>
|
70 |
+
<br />
|
71 |
+
<?php _e('If your input file header does not have exact names or if you need to edit the existing mapping you can simply click on the respective value fields corresponding to each row. Furthermore you can also assign expressions based on the existing input file columns.');?>
|
72 |
+
</p>
|
73 |
+
|
74 |
+
<div class="meta_mapping_box">
|
75 |
+
<div class="meta_mapping_box_hd wt_iew_noselect">
|
76 |
+
<span class="dashicons dashicons-arrow-down"></span>
|
77 |
+
<?php _e('Default fields');?>
|
78 |
+
<span class="meta_mapping_box_selected_count_box"><span class="meta_mapping_box_selected_count_box_num">0</span> <?php _e(' columns(s) selected'); ?></span>
|
79 |
+
</div>
|
80 |
+
<div style="clear:both;"></div>
|
81 |
+
<div class="meta_mapping_box_con" data-sortable="0" data-loaded="1" data-field-validated="0" data-key="" style="display:inline-block;">
|
82 |
+
<table class="wt-iew-mapping-tb wt-iew-importer-default-mapping-tb">
|
83 |
+
<thead>
|
84 |
+
<tr>
|
85 |
+
<th>
|
86 |
+
<input type="checkbox" name="" class="wt_iew_mapping_checkbox_main">
|
87 |
+
</th>
|
88 |
+
<th width="35%"><?php _e('Column');?></th>
|
89 |
+
<th><?php _e('Column name');?></th>
|
90 |
+
</tr>
|
91 |
+
</thead>
|
92 |
+
<tbody>
|
93 |
+
<?php
|
94 |
+
$draggable_tooltip=__("Drag to rearrange the columns");
|
95 |
+
$tr_count=0;
|
96 |
+
foreach($form_data_mapping_fields as $key=>$val_arr) /* looping the template form data */
|
97 |
+
{
|
98 |
+
$val=$val_arr[0]; /* normal column val */
|
99 |
+
$checked=$val_arr[1]; /* import this column? */
|
100 |
+
|
101 |
+
if(isset($mapping_fields[$key])) /* found in default field list */
|
102 |
+
{
|
103 |
+
$label=(isset($mapping_fields[$key]['title']) ? $mapping_fields[$key]['title'] : '');
|
104 |
+
$description=(isset($mapping_fields[$key]['description']) ? $mapping_fields[$key]['description'] : '');
|
105 |
+
$type=(isset($mapping_fields[$key]['type']) ? $mapping_fields[$key]['type'] : '');
|
106 |
+
unset($mapping_fields[$key]); //remove the field from default list
|
107 |
+
|
108 |
+
if(isset($file_heading_default_fields[$key])) /* also found in file heading list */
|
109 |
+
{
|
110 |
+
unset($file_heading_default_fields[$key]); //remove the field from file heading list
|
111 |
+
}
|
112 |
+
|
113 |
+
include "_import_mapping_tr_html.php";
|
114 |
+
$tr_count++;
|
115 |
+
}
|
116 |
+
elseif(isset($file_heading_default_fields[$key])) /* found in file heading list */
|
117 |
+
{
|
118 |
+
$label=$key;
|
119 |
+
$description=$key;
|
120 |
+
$type='';
|
121 |
+
unset($file_heading_default_fields[$key]); //remove the field from file heading list
|
122 |
+
include "_import_mapping_tr_html.php";
|
123 |
+
$tr_count++;
|
124 |
+
}
|
125 |
+
elseif(isset($file_heading_meta_fields[$key])) /* some meta items will show inside default field list, Eg: yoast */
|
126 |
+
{
|
127 |
+
$label=$key;
|
128 |
+
$description=$key;
|
129 |
+
$type='';
|
130 |
+
unset($file_heading_meta_fields[$key]); //remove the field from file heading list
|
131 |
+
include "_import_mapping_tr_html.php";
|
132 |
+
$tr_count++;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* ####Important####
|
138 |
+
* The similar code also done in Default mapping preparation step for quick import.
|
139 |
+
* If any updates done please update there also
|
140 |
+
* Method _prepare_for_quick in import ajax class
|
141 |
+
*/
|
142 |
+
|
143 |
+
if(count($mapping_fields)>0)
|
144 |
+
{
|
145 |
+
$array_keys_file_heading_default_fields = array_keys($file_heading_default_fields);
|
146 |
+
$allowed_field_types=array('start_with', 'end_with', 'contain');
|
147 |
+
foreach($mapping_fields as $key=>$val_arr)
|
148 |
+
{
|
149 |
+
$label=(isset($val_arr['title']) ? $val_arr['title'] : '');
|
150 |
+
$description=(isset($val_arr['description']) ? $val_arr['description'] : '');
|
151 |
+
$type=(isset($val_arr['type']) ? $val_arr['type'] : '');
|
152 |
+
$val='';
|
153 |
+
$checked=0; /* import this column? */
|
154 |
+
// if(isset($file_heading_default_fields[$key]))
|
155 |
+
if($case_key = preg_grep("/^$key$/i", $array_keys_file_heading_default_fields)) //preg_grep used escape from case sensitive check.
|
156 |
+
{
|
157 |
+
$checked=1; /* import this column? */
|
158 |
+
// $val='{'.$key.'}';
|
159 |
+
$val='{'.array_shift($case_key).'}'; // preg_grep give an array with actual index and value
|
160 |
+
unset($file_heading_default_fields[$key]); //remove the field from file heading list
|
161 |
+
unset($array_keys_file_heading_default_fields[$key]);
|
162 |
+
include "_import_mapping_tr_html.php";
|
163 |
+
$tr_count++;
|
164 |
+
}
|
165 |
+
elseif(isset($file_heading_meta_fields[$key])) /* some meta items will show inside default field list, Eg: yoast */
|
166 |
+
{
|
167 |
+
$checked=1; /* import this column? */
|
168 |
+
$val='{'.$key.'}';
|
169 |
+
unset($file_heading_meta_fields[$key]); //remove the field from file heading list
|
170 |
+
include "_import_mapping_tr_html.php";
|
171 |
+
$tr_count++;
|
172 |
+
}else
|
173 |
+
{
|
174 |
+
|
175 |
+
$field_type=(isset($val_arr['field_type']) ? $val_arr['field_type'] : '');
|
176 |
+
if($field_type!="" && in_array($field_type, $allowed_field_types)) // it may be a different field type
|
177 |
+
{
|
178 |
+
foreach ($file_heading_default_fields as $def_key => $def_val)
|
179 |
+
{
|
180 |
+
$matched=false;
|
181 |
+
if($field_type=='start_with' && strpos($def_key, $key)===0)
|
182 |
+
{
|
183 |
+
$matched=true;
|
184 |
+
}
|
185 |
+
elseif($field_type=='ends_with' && strrpos($def_key, $key)===(strlen($def_key) - strlen($key)))
|
186 |
+
{
|
187 |
+
$matched=true;
|
188 |
+
}
|
189 |
+
elseif($field_type=='contains' && strpos($def_key, $key)!==false)
|
190 |
+
{
|
191 |
+
$matched=true;
|
192 |
+
}
|
193 |
+
if($matched)
|
194 |
+
{
|
195 |
+
$checked=1; // import this column?
|
196 |
+
$val='{'.$def_key.'}';
|
197 |
+
$label=$def_key;
|
198 |
+
$key_backup=$key;
|
199 |
+
$key=$def_key;
|
200 |
+
unset($file_heading_default_fields[$def_key]); //remove the field from file heading list
|
201 |
+
include "_import_mapping_tr_html.php";
|
202 |
+
$tr_count++;
|
203 |
+
$key=$key_backup;
|
204 |
+
}
|
205 |
+
}
|
206 |
+
}else /* unmatched keys */
|
207 |
+
{
|
208 |
+
$checked=0; /* import this column? */
|
209 |
+
$val='';
|
210 |
+
include "_import_mapping_tr_html.php";
|
211 |
+
$tr_count++;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
}
|
215 |
+
}
|
216 |
+
if(count($file_heading_default_fields)>0) /* show the remaining items */
|
217 |
+
{
|
218 |
+
/*
|
219 |
+
foreach($file_heading_default_fields as $key=>$sample_val)
|
220 |
+
{
|
221 |
+
$label=$key;
|
222 |
+
$description=$key;
|
223 |
+
$val='{'.$key.'}';
|
224 |
+
$checked=1;
|
225 |
+
include "_import_mapping_tr_html.php";
|
226 |
+
$tr_count++;
|
227 |
+
}
|
228 |
+
*/
|
229 |
+
}
|
230 |
+
if($tr_count==0)
|
231 |
+
{
|
232 |
+
?>
|
233 |
+
<tr>
|
234 |
+
<td colspan="3" style="text-align:center;">
|
235 |
+
<?php _e('No fields found.'); ?>
|
236 |
+
</td>
|
237 |
+
</tr>
|
238 |
+
<?php
|
239 |
+
}
|
240 |
+
?>
|
241 |
+
</tbody>
|
242 |
+
</table>
|
243 |
+
</div>
|
244 |
+
</div>
|
245 |
+
<div style="clear:both;"></div>
|
246 |
+
|
247 |
+
<?php
|
248 |
+
if($this->mapping_enabled_fields)
|
249 |
+
{
|
250 |
+
foreach($this->mapping_enabled_fields as $mapping_enabled_field_key=>$mapping_enabled_field)
|
251 |
+
{
|
252 |
+
$mapping_enabled_field=(!is_array($mapping_enabled_field) ? array($mapping_enabled_field, 0) : $mapping_enabled_field);
|
253 |
+
|
254 |
+
if(count($form_data_mapping_enabled_fields)>0)
|
255 |
+
{
|
256 |
+
if(in_array($mapping_enabled_field_key, $form_data_mapping_enabled_fields))
|
257 |
+
{
|
258 |
+
$mapping_enabled_field[1]=1;
|
259 |
+
}else
|
260 |
+
{
|
261 |
+
$mapping_enabled_field[1]=0;
|
262 |
+
}
|
263 |
+
}
|
264 |
+
?>
|
265 |
+
<div class="meta_mapping_box">
|
266 |
+
<div class="meta_mapping_box_hd wt_iew_noselect">
|
267 |
+
<span class="dashicons dashicons-arrow-right"></span>
|
268 |
+
<?php echo $mapping_enabled_field[0];?>
|
269 |
+
<span class="meta_mapping_box_selected_count_box"><span class="meta_mapping_box_selected_count_box_num">0</span> <?php _e(' columns(s) selected'); ?></span>
|
270 |
+
</div>
|
271 |
+
<div style="clear:both;"></div>
|
272 |
+
<div class="meta_mapping_box_con" data-sortable="0" data-loaded="0" data-field-validated="0" data-key="<?php echo $mapping_enabled_field_key;?>"></div>
|
273 |
+
</div>
|
274 |
+
<div style="clear:both;"></div>
|
275 |
+
<?php
|
276 |
+
}
|
277 |
+
}
|
278 |
+
?>
|
279 |
+
</div>
|
280 |
+
<script type="text/javascript">
|
281 |
+
var wt_iew_file_head_remaining_meta=<?php echo json_encode($file_heading_meta_fields);?>;
|
282 |
+
</script>
|
admin/modules/import/views/_import_mapping_tr_html.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<tr id="columns_<?php echo $key;?>">
|
7 |
+
<td>
|
8 |
+
<div class="wt_iew_sort_handle" title="<?php echo $draggable_tooltip;?>">
|
9 |
+
<img src="<?php echo WT_U_IEW_PLUGIN_URL.'assets/images/drag_icon.png'; ?>"/>
|
10 |
+
</div>
|
11 |
+
<input type="checkbox" name="columns_key[]" class="columns_key wt_iew_mapping_checkbox_sub" value="<?php echo $key;?>" <?php echo ($checked==1 ? 'checked' : ''); ?>>
|
12 |
+
</td>
|
13 |
+
<td>
|
14 |
+
<label class="wt_iew_mapping_column_label"><?php echo $label;?></label>
|
15 |
+
</td>
|
16 |
+
<td>
|
17 |
+
<input type="hidden" name="columns_val[]" class="columns_val" value="<?php echo $val;?>" data-type="<?php echo $type;?>">
|
18 |
+
<span data-wt_iew_popover="1" data-title="" data-content-container=".wt_iew_mapping_field_editor_container" class="wt_iew_mapping_field_val"><?php echo $val;?></span>
|
19 |
+
</td>
|
20 |
+
</tr>
|
admin/modules/import/views/_import_meta_step_page.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<table class="wt-iew-mapping-tb wt-iew-importer-meta-mapping-tb" data-field-type="<?php echo $meta_mapping_screen_field_key; ?>">
|
7 |
+
<thead>
|
8 |
+
<tr>
|
9 |
+
<th>
|
10 |
+
<?php
|
11 |
+
$is_checked=$meta_mapping_screen_field_val['checked'];
|
12 |
+
$checked_attr=($is_checked==1 ? ' checked="checked"' : '');
|
13 |
+
?>
|
14 |
+
<input type="checkbox" name="" class="wt_iew_mapping_checkbox_main" <?php echo $checked_attr; ?>>
|
15 |
+
</th>
|
16 |
+
<th width="35%"><?php _e('Column');?></th>
|
17 |
+
<th><?php _e('Column name');?></th>
|
18 |
+
</tr>
|
19 |
+
</thead>
|
20 |
+
<tbody>
|
21 |
+
<?php
|
22 |
+
$tr_count=0;
|
23 |
+
|
24 |
+
foreach($meta_mapping_screen_field_val['fields'] as $key=>$val_arr)
|
25 |
+
{
|
26 |
+
extract($val_arr);
|
27 |
+
include "_import_mapping_tr_html.php";
|
28 |
+
$tr_count++;
|
29 |
+
}
|
30 |
+
|
31 |
+
if($tr_count==0)
|
32 |
+
{
|
33 |
+
?>
|
34 |
+
<tr>
|
35 |
+
<td colspan="3" style="text-align:center;">
|
36 |
+
<?php _e('No fields found.'); ?>
|
37 |
+
</td>
|
38 |
+
</tr>
|
39 |
+
<?php
|
40 |
+
}
|
41 |
+
?>
|
42 |
+
</tbody>
|
43 |
+
</table>
|
admin/modules/import/views/_import_method_import_page.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt_iew_import_main">
|
7 |
+
<p><?php echo $this->step_description;?></p>
|
8 |
+
<div class="wt_iew_warn wt_iew_method_import_wrn" style="display:none;">
|
9 |
+
<?php _e('Please select an import template.');?>
|
10 |
+
</div>
|
11 |
+
<table class="form-table wt-iew-form-table">
|
12 |
+
<tr>
|
13 |
+
<th><label><?php _e('Import method');?></label></th>
|
14 |
+
<td colspan="2" style="width:75%;">
|
15 |
+
<div class="wt_iew_radio_block">
|
16 |
+
<?php
|
17 |
+
foreach($this->import_obj->import_methods as $key => $value)
|
18 |
+
{
|
19 |
+
?>
|
20 |
+
<p>
|
21 |
+
<input type="radio" value="<?php echo $key;?>" id="wt_iew_import_<?php echo $key;?>_import" name="wt_iew_import_method_import" <?php echo ($this->import_method==$key ? 'checked="checked"' : '');?>><b><label for="wt_iew_import_<?php echo $key;?>_import"><?php echo $value['title']; ?></label></b> <br />
|
22 |
+
<span><label for="wt_iew_import_<?php echo $key;?>_import"><?php echo $value['description']; ?></label></span>
|
23 |
+
</p>
|
24 |
+
<?php
|
25 |
+
}
|
26 |
+
?>
|
27 |
+
</div>
|
28 |
+
</td>
|
29 |
+
</tr>
|
30 |
+
|
31 |
+
<tr class="wt-iew-import-method-options wt-iew-import-method-options-template" style="display:none;">
|
32 |
+
<th><label><?php _e('Import template');?></label></th>
|
33 |
+
<td>
|
34 |
+
<select class="wt-iew-import-template-sele">
|
35 |
+
<option value="0">-- <?php _e('Select a template'); ?> --</option>
|
36 |
+
<?php
|
37 |
+
foreach($this->mapping_templates as $mapping_template)
|
38 |
+
{
|
39 |
+
?>
|
40 |
+
<option value="<?php echo $mapping_template['id'];?>" <?php echo ($form_data_import_template==$mapping_template['id'] ? ' selected="selected"' : ''); ?>>
|
41 |
+
<?php echo $mapping_template['name'];?>
|
42 |
+
</option>
|
43 |
+
<?php
|
44 |
+
}
|
45 |
+
?>
|
46 |
+
</select>
|
47 |
+
</td>
|
48 |
+
<td>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
</table>
|
52 |
+
<form class="wt_iew_import_method_import_form">
|
53 |
+
<table class="form-table wt-iew-form-table">
|
54 |
+
<?php
|
55 |
+
Wt_Import_Export_For_Woo_Basic_Common_Helper::field_generator($method_import_screen_fields, $method_import_form_data);
|
56 |
+
?>
|
57 |
+
</table>
|
58 |
+
</form>
|
59 |
+
</div>
|
60 |
+
<script type="text/javascript">
|
61 |
+
/* remote file modules can hook */
|
62 |
+
function wt_iew_set_file_from_fields(file_from)
|
63 |
+
{
|
64 |
+
<?php
|
65 |
+
do_action('wt_iew_importer_file_from_js_fn');
|
66 |
+
?>
|
67 |
+
}
|
68 |
+
|
69 |
+
function wt_iew_set_validate_file_info(file_from)
|
70 |
+
{
|
71 |
+
<?php
|
72 |
+
do_action('wt_iew_importer_set_validate_file_info');
|
73 |
+
?>
|
74 |
+
}
|
75 |
+
</script>
|
admin/modules/import/views/_import_post_type_page.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt_iew_import_main">
|
7 |
+
<p><?php echo $this->step_description;?></p>
|
8 |
+
<div class="wt_iew_warn wt_iew_post_type_wrn" style="display:none;">
|
9 |
+
<?php _e('Please select a post type');?>
|
10 |
+
</div>
|
11 |
+
<table class="form-table wt-iew-form-table">
|
12 |
+
<tr>
|
13 |
+
<th><label><?php _e('What do you want to import'); ?></label></th>
|
14 |
+
<td>
|
15 |
+
<select name="wt_iew_import_post_type">
|
16 |
+
<option value="">-- <?php _e('Select post type'); ?> --</option>
|
17 |
+
<?php
|
18 |
+
foreach($post_types as $key=>$value)
|
19 |
+
{
|
20 |
+
?>
|
21 |
+
<option value="<?php echo $key;?>" <?php echo ($item_type==$key ? 'selected' : '');?>><?php echo $value;?></option>
|
22 |
+
<?php
|
23 |
+
}
|
24 |
+
?>
|
25 |
+
</select>
|
26 |
+
</td>
|
27 |
+
<td></td>
|
28 |
+
</tr>
|
29 |
+
</table>
|
30 |
+
</div>
|
admin/modules/import/views/main.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Main view file of import section
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<?php
|
14 |
+
do_action('wt_iew_importer_before_head');
|
15 |
+
?>
|
16 |
+
<style type="text/css">
|
17 |
+
.wt_iew_import_step{ display:none; }
|
18 |
+
.wt_iew_import_step_loader{ width:100%; height:400px; text-align:center; line-height:400px; font-size:14px; }
|
19 |
+
.wt_iew_import_step_main{ float:left; box-sizing:border-box; padding:15px; padding-bottom:0px; width:95%; margin:30px 2.5%; background:#fff; box-shadow:0px 2px 2px #ccc; border:solid 1px #efefef; }
|
20 |
+
.wt_iew_import_main{ padding:20px 0px; }
|
21 |
+
select[name=wt_iew_file_from]{visibility: hidden;}
|
22 |
+
</style>
|
23 |
+
<?php
|
24 |
+
Wt_Iew_IE_Basic_Helper::debug_panel($this->module_base);
|
25 |
+
?>
|
26 |
+
<?php include WT_U_IEW_PLUGIN_PATH."/admin/views/_save_template_popup.php"; ?>
|
27 |
+
|
28 |
+
<h2 class="wt_iew_page_hd"><?php _e('Import'); ?><span class="wt_iew_post_type_name"></span></h2>
|
29 |
+
|
30 |
+
<?php
|
31 |
+
if($requested_rerun_id>0 && $this->rerun_id==0)
|
32 |
+
{
|
33 |
+
?>
|
34 |
+
<div class="wt_iew_warn wt_iew_rerun_warn">
|
35 |
+
<?php _e('Unable to handle Re-Run request.');?>
|
36 |
+
</div>
|
37 |
+
<?php
|
38 |
+
}
|
39 |
+
?>
|
40 |
+
|
41 |
+
<div class="wt_iew_loader_info_box"></div>
|
42 |
+
<div class="wt_iew_overlayed_loader"></div>
|
43 |
+
|
44 |
+
<div class="wt_iew_import_step_main">
|
45 |
+
<?php
|
46 |
+
foreach($this->steps as $stepk=>$stepv)
|
47 |
+
{
|
48 |
+
?>
|
49 |
+
<div class="wt_iew_import_step wt_iew_import_step_<?php echo $stepk;?>" data-loaded="0"></div>
|
50 |
+
<?php
|
51 |
+
}
|
52 |
+
?>
|
53 |
+
</div>
|
54 |
+
<script type="text/javascript">
|
55 |
+
/* external modules can hook */
|
56 |
+
function wt_iew_importer_validate_basic(action, action_type, is_previous_step)
|
57 |
+
{
|
58 |
+
var is_continue=true;
|
59 |
+
<?php
|
60 |
+
do_action('wt_iew_importer_validate_basic');
|
61 |
+
?>
|
62 |
+
return is_continue;
|
63 |
+
}
|
64 |
+
function wt_iew_importer_reset_form_data_basic()
|
65 |
+
{
|
66 |
+
<?php
|
67 |
+
do_action('wt_iew_importer_reset_form_data_basic');
|
68 |
+
?>
|
69 |
+
}
|
70 |
+
</script>
|
admin/modules/user/data/data-user-columns.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
$columns = array(
|
8 |
+
'ID' => 'ID',
|
9 |
+
'customer_id' => 'customer_id',
|
10 |
+
'user_login' => 'user_login',
|
11 |
+
'user_pass' => 'user_pass',
|
12 |
+
'user_nicename' => 'user_nicename',
|
13 |
+
'user_email' => 'user_email',
|
14 |
+
'user_url' => 'user_url',
|
15 |
+
'user_registered' => 'user_registered',
|
16 |
+
'display_name' => 'display_name',
|
17 |
+
'first_name' => 'first_name',
|
18 |
+
'last_name' => 'last_name',
|
19 |
+
'user_status' => 'user_status',
|
20 |
+
'roles' => 'roles'
|
21 |
+
);
|
22 |
+
// default meta
|
23 |
+
$columns['nickname'] = 'nickname';
|
24 |
+
$columns['first_name'] = 'first_name';
|
25 |
+
$columns['last_name'] = 'last_name';
|
26 |
+
$columns['description'] = 'description';
|
27 |
+
$columns['rich_editing'] = 'rich_editing';
|
28 |
+
$columns['syntax_highlighting'] = 'syntax_highlighting';
|
29 |
+
$columns['admin_color'] = 'admin_color';
|
30 |
+
$columns['use_ssl'] = 'use_ssl';
|
31 |
+
$columns['show_admin_bar_front'] = 'show_admin_bar_front';
|
32 |
+
$columns['locale'] = 'locale';
|
33 |
+
$columns['wp_user_level'] = 'wp_user_level';
|
34 |
+
$columns['dismissed_wp_pointers'] = 'dismissed_wp_pointers';
|
35 |
+
$columns['last_update'] = 'last_update';
|
36 |
+
|
37 |
+
|
38 |
+
if (!function_exists( 'is_plugin_active' ) )
|
39 |
+
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
|
40 |
+
|
41 |
+
if( is_plugin_active( 'woocommerce/woocommerce.php' ) ):
|
42 |
+
|
43 |
+
$columns['billing_first_name'] = 'billing_first_name';
|
44 |
+
$columns['billing_last_name'] = 'billing_last_name';
|
45 |
+
$columns['billing_company'] = 'billing_company';
|
46 |
+
$columns['billing_email'] = 'billing_email';
|
47 |
+
$columns['billing_phone'] = 'billing_phone';
|
48 |
+
$columns['billing_address_1'] = 'billing_address_1';
|
49 |
+
$columns['billing_address_2'] = 'billing_address_2';
|
50 |
+
$columns['billing_postcode'] = 'billing_postcode';
|
51 |
+
$columns['billing_city'] = 'billing_city';
|
52 |
+
$columns['billing_state'] = 'billing_state';
|
53 |
+
$columns['billing_country'] = 'billing_country';
|
54 |
+
$columns['shipping_first_name'] = 'shipping_first_name';
|
55 |
+
$columns['shipping_last_name'] = 'shipping_last_name';
|
56 |
+
$columns['shipping_company'] = 'shipping_company';
|
57 |
+
$columns['shipping_address_1'] = 'shipping_address_1';
|
58 |
+
$columns['shipping_address_2'] = 'shipping_address_2';
|
59 |
+
$columns['shipping_postcode'] = 'shipping_postcode';
|
60 |
+
$columns['shipping_city'] = 'shipping_city';
|
61 |
+
$columns['shipping_state'] = 'shipping_state';
|
62 |
+
$columns['shipping_country'] = 'shipping_country';
|
63 |
+
|
64 |
+
endif;
|
65 |
+
|
66 |
+
/*
|
67 |
+
global $wpdb;
|
68 |
+
|
69 |
+
$meta_keys = $wpdb->get_col("SELECT distinct(meta_key) FROM $wpdb->usermeta");
|
70 |
+
|
71 |
+
foreach ($meta_keys as $meta_key) {
|
72 |
+
if (empty($columns[$meta_key])) {
|
73 |
+
$columns['meta:'.$meta_key] = 'meta:'.$meta_key; // adding an extra prefix for identifying meta while import process
|
74 |
+
}
|
75 |
+
}
|
76 |
+
*/
|
77 |
+
return apply_filters('hf_csv_customer_post_columns', $columns);
|
admin/modules/user/data/data/data-wf-reserved-fields-pair.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
|
6 |
+
$columns = array(
|
7 |
+
'ID' => array('title'=>'ID','description'=>'Customer/User ID'),
|
8 |
+
'customer_id' => array('title'=>'Customer ID','description'=>'Customer ID'),
|
9 |
+
'user_login' => array('title'=>'User Login','description'=>'User Login'),
|
10 |
+
'user_pass' => array('title'=>'user_pass','description'=>'user_pass'),
|
11 |
+
'user_nicename' => array('title'=>'user_nicename','description'=>'user_nicename'),
|
12 |
+
'user_email' => array('title'=>'user_email','description'=>'user_email'),
|
13 |
+
'user_url' => array('title'=>'user_url','description'=>'user_url'),
|
14 |
+
'user_registered' => array('title'=>'user_registered','description'=>'user_registered'),
|
15 |
+
'display_name' => array('title'=>'display_name','description'=>'display_name'),
|
16 |
+
'first_name' => array('title'=>'first_name','description'=>'first_name'),
|
17 |
+
'last_name' => array('title'=>'last_name','description'=>'last_name'),
|
18 |
+
'user_status' => array('title'=>'user_status','description'=>'user_status'),
|
19 |
+
'roles' => array('title'=>'roles','description'=>'roles'),
|
20 |
+
);
|
21 |
+
|
22 |
+
// default meta
|
23 |
+
$columns['nickname'] = array('title'=>'nickname','description'=>'');
|
24 |
+
$columns['first_name'] = array('title'=>'first_name','description'=>'');
|
25 |
+
$columns['last_name'] = array('title'=>'last_name','description'=>'');
|
26 |
+
$columns['description'] = array('title'=>'description','description'=>'');
|
27 |
+
$columns['rich_editing'] = array('title'=>'rich_editing','description'=>'');
|
28 |
+
$columns['syntax_highlighting'] = array('title'=>'syntax_highlighting','description'=>'');
|
29 |
+
$columns['admin_color'] = array('title'=>'admin_color','description'=>'');
|
30 |
+
$columns['use_ssl'] = array('title'=>'use_ssl','description'=>'');
|
31 |
+
$columns['show_admin_bar_front'] = array('title'=>'show_admin_bar_front','description'=>'');
|
32 |
+
$columns['locale'] = array('title'=>'locale','description'=>'');
|
33 |
+
$columns['wp_user_level'] = array('title'=>'wp_user_level','description'=>'');
|
34 |
+
$columns['dismissed_wp_pointers'] = array('title'=>'dismissed_wp_pointers','description'=>'');
|
35 |
+
$columns['last_update'] = array('title'=>'last_update','description'=>'');
|
36 |
+
|
37 |
+
|
38 |
+
if( is_plugin_active( 'woocommerce/woocommerce.php' ) ):
|
39 |
+
|
40 |
+
$columns['billing_first_name'] = array('title'=>'billing_first_name','description'=>'');
|
41 |
+
$columns['billing_last_name'] = array('title'=>'billing_last_name','description'=>'');
|
42 |
+
$columns['billing_company'] = array('title'=>'billing_company','description'=>'');
|
43 |
+
$columns['billing_email'] = array('title'=>'billing_email','description'=>'');
|
44 |
+
$columns['billing_phone'] = array('title'=>'billing_phone','description'=>'');
|
45 |
+
$columns['billing_address_1'] = array('title'=>'billing_address_1','description'=>'');
|
46 |
+
$columns['billing_address_2'] = array('title'=>'billing_address_2','description'=>'');
|
47 |
+
$columns['billing_postcode'] = array('title'=>'billing_postcode','description'=>'');
|
48 |
+
$columns['billing_city'] = array('title'=>'billing_city','description'=>'');
|
49 |
+
$columns['billing_state'] = array('title'=>'billing_state','description'=>'');
|
50 |
+
$columns['billing_country'] = array('title'=>'billing_country','description'=>'');
|
51 |
+
$columns['shipping_first_name'] = array('title'=>'shipping_first_name','description'=>'');
|
52 |
+
$columns['shipping_last_name'] = array('title'=>'shipping_last_name','description'=>'');
|
53 |
+
$columns['shipping_company'] = array('title'=>'shipping_company','description'=>'');
|
54 |
+
$columns['shipping_address_1'] = array('title'=>'shipping_address_1','description'=>'');
|
55 |
+
$columns['shipping_address_2'] = array('title'=>'shipping_address_2','description'=>'');
|
56 |
+
$columns['shipping_postcode'] = array('title'=>'shipping_postcode','description'=>'');
|
57 |
+
$columns['shipping_city'] = array('title'=>'shipping_city','description'=>'');
|
58 |
+
$columns['shipping_state'] = array('title'=>'shipping_state','description'=>'');
|
59 |
+
$columns['shipping_country'] = array('title'=>'shipping_country','description'=>'');
|
60 |
+
|
61 |
+
endif;
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
//global $wpdb;
|
67 |
+
//
|
68 |
+
//$meta_keys = $wpdb->get_col("SELECT distinct(meta_key) FROM $wpdb->usermeta WHERE meta_key NOT IN ('wp_capabilities')");
|
69 |
+
//
|
70 |
+
//foreach ($meta_keys as $meta_key) {
|
71 |
+
// if (empty($columns[$meta_key])) {
|
72 |
+
// $columns['meta:'.$meta_key] = array('title'=>'meta:'.$meta_key,'description'=>'');
|
73 |
+
// }
|
74 |
+
//}
|
75 |
+
return apply_filters('hf_csv_customer_import_columns', $columns);
|
admin/modules/user/export/export.php
ADDED
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('WPINC')) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
if(!class_exists('Wt_Import_Export_For_Woo_basic_User_Export')){
|
8 |
+
class Wt_Import_Export_For_Woo_basic_User_Export {
|
9 |
+
|
10 |
+
public $parent_module = null;
|
11 |
+
|
12 |
+
public function __construct($parent_object) {
|
13 |
+
|
14 |
+
$this->parent_module = $parent_object;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function prepare_header() {
|
18 |
+
|
19 |
+
$export_columns = $this->parent_module->get_selected_column_names();
|
20 |
+
|
21 |
+
return apply_filters('hf_csv_customer_post_columns', $export_columns);
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Prepare data that will be exported.
|
26 |
+
*/
|
27 |
+
public function prepare_data_to_export($form_data, $batch_offset) {
|
28 |
+
|
29 |
+
|
30 |
+
$export_user_roles = !empty($form_data['filter_form_data']['wt_iew_roles']) ? $form_data['filter_form_data']['wt_iew_roles'] : array();
|
31 |
+
$export_sortby = !empty($form_data['filter_form_data']['wt_iew_sort_columns']) ? $form_data['filter_form_data']['wt_iew_sort_columns'] : array('user_login');
|
32 |
+
$export_sort_order = !empty($form_data['filter_form_data']['wt_iew_order_by']) ? $form_data['filter_form_data']['wt_iew_order_by'] : 'ASC';
|
33 |
+
$user_ids = !empty($form_data['filter_form_data']['wt_iew_email']) ? $form_data['filter_form_data']['wt_iew_email'] : array(); // user email fields return user ids
|
34 |
+
$export_start_date = !empty($form_data['filter_form_data']['wt_iew_date_from']) ? $form_data['filter_form_data']['wt_iew_date_from'] : '';
|
35 |
+
$export_end_date = !empty($form_data['filter_form_data']['wt_iew_date_to']) ? $form_data['filter_form_data']['wt_iew_date_to'] : '';
|
36 |
+
|
37 |
+
$v_export_guest_user = (!empty($form_data['advanced_form_data']['wt_iew_export_guest_user']) && $form_data['advanced_form_data']['wt_iew_export_guest_user'] == 'Yes') ? true : false;
|
38 |
+
|
39 |
+
|
40 |
+
$export_limit = !empty($form_data['filter_form_data']['wt_iew_limit']) ? intval($form_data['filter_form_data']['wt_iew_limit']) : 999999999; //user limit
|
41 |
+
$current_offset = !empty($form_data['filter_form_data']['wt_iew_offset']) ? intval($form_data['filter_form_data']['wt_iew_offset']) : 0; //user offset
|
42 |
+
$batch_count = !empty($form_data['advanced_form_data']['wt_iew_batch_count']) ? $form_data['advanced_form_data']['wt_iew_batch_count'] : 10;
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
$real_offset = ($current_offset + $batch_offset);
|
47 |
+
|
48 |
+
if($batch_count<=$export_limit)
|
49 |
+
{
|
50 |
+
if(($batch_offset+$batch_count)>$export_limit) //last offset
|
51 |
+
{
|
52 |
+
$limit=$export_limit-$batch_offset;
|
53 |
+
}else
|
54 |
+
{
|
55 |
+
$limit=$batch_count;
|
56 |
+
}
|
57 |
+
}else
|
58 |
+
{
|
59 |
+
$limit=$export_limit;
|
60 |
+
}
|
61 |
+
|
62 |
+
$data_array = array();
|
63 |
+
if ($batch_offset < $export_limit)
|
64 |
+
{
|
65 |
+
|
66 |
+
$sortby_check = array_intersect($export_sortby, array('ID', 'user_registered', 'user_email', 'user_login', 'user_nicename'));
|
67 |
+
if (empty($sortby_check)) {
|
68 |
+
$wt_export_sortby = $export_sortby[0];
|
69 |
+
$args = array(
|
70 |
+
'fields' => 'ID', // exclude standard wp_users fields from get_users query -> get Only ID##
|
71 |
+
'role__in' => $export_user_roles, //An array of role names. Matched users must have at least one of these roles. Default empty array.
|
72 |
+
'number' => $limit,
|
73 |
+
'offset' => $real_offset,
|
74 |
+
'orderby' => 'meta_value',
|
75 |
+
'meta_key' => $wt_export_sortby,
|
76 |
+
'order' => $export_sort_order,
|
77 |
+
'date_query' => array(
|
78 |
+
array(
|
79 |
+
'after' => $export_start_date,
|
80 |
+
'before' => $export_end_date,
|
81 |
+
'inclusive' => true
|
82 |
+
)),
|
83 |
+
);
|
84 |
+
} else {
|
85 |
+
|
86 |
+
$args = array(
|
87 |
+
'fields' => 'ID', // exclude standard wp_users fields from get_users query -> get Only ID##
|
88 |
+
'role__in' => $export_user_roles, //An array of role names. Matched users must have at least one of these roles. Default empty array.
|
89 |
+
'number' => $limit,
|
90 |
+
'offset' => $real_offset,
|
91 |
+
'orderby' => $export_sortby,
|
92 |
+
'order' => $export_sort_order,
|
93 |
+
'date_query' => array(
|
94 |
+
array(
|
95 |
+
'after' => $export_start_date,
|
96 |
+
'before' => $export_end_date,
|
97 |
+
'inclusive' => true
|
98 |
+
)),
|
99 |
+
);
|
100 |
+
}
|
101 |
+
if (!empty($user_ids)) {
|
102 |
+
$args['include'] = $user_ids;
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
$users = get_users($args);
|
107 |
+
|
108 |
+
/**
|
109 |
+
* taking total records
|
110 |
+
*/
|
111 |
+
$total_records=0;
|
112 |
+
if($batch_offset==0) //first batch
|
113 |
+
{
|
114 |
+
$total_item_args=$args;
|
115 |
+
$total_item_args['fields'] = 'ids';
|
116 |
+
$total_item_args['number']=$export_limit; //user given limit
|
117 |
+
$total_item_args['offset']=$current_offset; //user given offset
|
118 |
+
$total_record_count = get_users($total_item_args);
|
119 |
+
$total_records=count($total_record_count);
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
+
// Loop users
|
124 |
+
foreach ($users as $user) {
|
125 |
+
$data = self::get_customers_csv_row($user);
|
126 |
+
$data_array[] = apply_filters('hf_customer_csv_exclude_admin', $data);
|
127 |
+
}
|
128 |
+
|
129 |
+
if ($v_export_guest_user) {
|
130 |
+
$query_args = array(
|
131 |
+
'fields' => 'ids',
|
132 |
+
'post_type' => 'shop_order',
|
133 |
+
'post_status' => 'any',
|
134 |
+
'posts_per_page' => -1,
|
135 |
+
);
|
136 |
+
$query_args['meta_query'] = array(array(
|
137 |
+
'key' => '_customer_user',
|
138 |
+
'value' => 0,
|
139 |
+
'compare' => '',
|
140 |
+
));
|
141 |
+
$query = new WP_Query($query_args);
|
142 |
+
$order_ids = $query->posts;
|
143 |
+
foreach ($order_ids as $order_id) {
|
144 |
+
$order = new WC_Order($order_id);
|
145 |
+
$user = get_user_by('email', $order->get_billing_email());
|
146 |
+
if (!isset($user->ID)) {
|
147 |
+
$data = self::get_guest_customers_csv_row($order);
|
148 |
+
$data_array[] = apply_filters('hf_customer_csv_exclude_admin', $data);
|
149 |
+
}
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
$return['total'] = $total_records;
|
154 |
+
$return['data'] = $data_array;
|
155 |
+
return $return;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
public function get_customers_csv_row($id) {
|
160 |
+
$csv_columns = $this->parent_module->get_selected_column_names();
|
161 |
+
|
162 |
+
$user = get_user_by('id', $id);
|
163 |
+
|
164 |
+
$customer_data = array();
|
165 |
+
foreach ($csv_columns as $key => $value) {
|
166 |
+
|
167 |
+
$key = trim(str_replace('meta:', '', $key));
|
168 |
+
if ($key == 'roles') {
|
169 |
+
$user_roles = (!empty($user->roles)) ? $user->roles : array();
|
170 |
+
$customer_data['roles'] = implode(', ', $user_roles);
|
171 |
+
continue;
|
172 |
+
}
|
173 |
+
if ($key == 'customer_id') {
|
174 |
+
$customer_data[$key] = !empty($user->ID) ? maybe_serialize($user->ID) : '';
|
175 |
+
continue;
|
176 |
+
}
|
177 |
+
if($key == 'wp_user_level'){
|
178 |
+
$customer_data['wp_user_level'] = (!empty($user->wp_user_level)) ? $user->wp_user_level : 0;
|
179 |
+
continue;
|
180 |
+
}
|
181 |
+
|
182 |
+
$customer_data[$key] = !empty($user->{$key}) ? maybe_serialize($user->{$key}) : '';
|
183 |
+
}
|
184 |
+
/*
|
185 |
+
* CSV Customer Export Row.
|
186 |
+
* Filter the individual row data for the customer export
|
187 |
+
* @since 3.0
|
188 |
+
* @param array $customer_data
|
189 |
+
*/
|
190 |
+
return apply_filters('hf_customer_csv_export_data', $customer_data, $csv_columns);
|
191 |
+
}
|
192 |
+
|
193 |
+
public function get_guest_customers_csv_row($order) {
|
194 |
+
$customer_data = array();
|
195 |
+
$csv_columns = $this->parent_module->get_selected_column_names();
|
196 |
+
$key_array = array('billing_first_name', 'billing_last_name', 'billing_company', 'billing_email', 'billing_phone', 'billing_address_1', 'billing_address_2', 'billing_postcode', 'billing_city', 'billing_state', 'billing_country', 'shipping_first_name', 'shipping_last_name', 'shipping_company', 'shipping_address_1', 'shipping_address_2', 'shipping_postcode', 'shipping_city', 'shipping_state', 'shipping_country', 'shipping_method');
|
197 |
+
foreach ($csv_columns as $key) {
|
198 |
+
if (in_array($key, $key_array)) {
|
199 |
+
if ($key == 'user_email') {
|
200 |
+
$customer_data[$key] = $order->get_billing_email();
|
201 |
+
continue;
|
202 |
+
}
|
203 |
+
$method_name = "get_{$key}";
|
204 |
+
$data = $order->$method_name();
|
205 |
+
if (!empty($data)) {
|
206 |
+
$data = maybe_serialize($order->$method_name());
|
207 |
+
} else {
|
208 |
+
$data = '';
|
209 |
+
}
|
210 |
+
$customer_data[$key] = $data;
|
211 |
+
} else {
|
212 |
+
$customer_data[$key] = '';
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
/*
|
217 |
+
* CSV Guest Customer Export Row.
|
218 |
+
* Filter the individual row data for the Guest customer export
|
219 |
+
* @since 3.0
|
220 |
+
* @param array $customer_data
|
221 |
+
*/
|
222 |
+
return apply_filters('hf_customer_csv_export_data', $customer_data, $csv_columns);
|
223 |
+
}
|
224 |
+
|
225 |
+
}
|
226 |
+
}
|
admin/modules/user/import/import.php
ADDED
@@ -0,0 +1,698 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('WPINC')) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
if(!class_exists('Wt_Import_Export_For_Woo_basic_User_Import')){
|
8 |
+
class Wt_Import_Export_For_Woo_basic_User_Import {
|
9 |
+
|
10 |
+
public $parent_module = null;
|
11 |
+
public $parsed_data = array();
|
12 |
+
|
13 |
+
|
14 |
+
var $merge;
|
15 |
+
var $skip_new;
|
16 |
+
var $use_sku;
|
17 |
+
var $cmd_type;
|
18 |
+
var $merge_empty_cells;
|
19 |
+
var $delete_existing;
|
20 |
+
var $new_id = array();
|
21 |
+
var $parent_data = '';
|
22 |
+
var $csv_last_start = '';
|
23 |
+
|
24 |
+
var $processed_posts = array();
|
25 |
+
var $post_orphans = array();
|
26 |
+
var $attachments = array();
|
27 |
+
var $upsell_skus = array();
|
28 |
+
var $crosssell_skus = array();
|
29 |
+
|
30 |
+
public $merge_with = 'id';
|
31 |
+
public $found_action = 'skip';
|
32 |
+
public $id_conflict = 'skip';
|
33 |
+
|
34 |
+
public $is_user_exist = false;
|
35 |
+
|
36 |
+
// Results
|
37 |
+
var $import_results = array();
|
38 |
+
|
39 |
+
|
40 |
+
var $row;
|
41 |
+
var $post_defaults; // Default post data
|
42 |
+
var $postmeta_defaults; // default post meta
|
43 |
+
var $postmeta_allowed; // post meta validation
|
44 |
+
|
45 |
+
public function __construct($parent_object) {
|
46 |
+
|
47 |
+
$this->parent_module = $parent_object;
|
48 |
+
|
49 |
+
|
50 |
+
$this->user_fields = include( dirname(__FILE__) . '/../exporter/data/data-wf-post-columns.php' );
|
51 |
+
$this->user_base_fields = array(
|
52 |
+
'ID' => 'ID',
|
53 |
+
'customer_id' => 'customer_id',
|
54 |
+
'user_login' => 'user_login',
|
55 |
+
'user_pass' => 'user_pass',
|
56 |
+
'user_nicename' => 'user_nicename',
|
57 |
+
'user_email' => 'user_email',
|
58 |
+
'user_url' => 'user_url',
|
59 |
+
'user_registered' => 'user_registered',
|
60 |
+
'display_name' => 'display_name',
|
61 |
+
'first_name' => 'first_name',
|
62 |
+
'last_name' => 'last_name',
|
63 |
+
'user_status' => 'user_status',
|
64 |
+
'roles' => 'roles'
|
65 |
+
);
|
66 |
+
|
67 |
+
global $wpdb;
|
68 |
+
$meta_keys = $wpdb->get_col("SELECT distinct(meta_key) FROM $wpdb->usermeta");
|
69 |
+
|
70 |
+
foreach ($meta_keys as $meta_key) {
|
71 |
+
|
72 |
+
$this->user_meta_fields[$meta_key] = $meta_key;
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
}
|
78 |
+
|
79 |
+
public function hf_log_data_change($content = 'review-csv-import', $data = '') {
|
80 |
+
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->parent_module->module_base, 'import', $data);
|
81 |
+
}
|
82 |
+
|
83 |
+
public function prepare_data_to_import($import_data,$form_data, $batch_offset, $is_last_batch){
|
84 |
+
|
85 |
+
$this->skip_new = !empty($form_data['advanced_form_data']['wt_iew_skip_new']) ? 1 : 0;
|
86 |
+
$this->merge_with = !empty($form_data['advanced_form_data']['wt_iew_merge_with']) ? $form_data['advanced_form_data']['wt_iew_merge_with'] : 'id';
|
87 |
+
$this->found_action = !empty($form_data['advanced_form_data']['wt_iew_found_action']) ? $form_data['advanced_form_data']['wt_iew_found_action'] : 'skip';
|
88 |
+
$this->use_same_password = !empty($form_data['advanced_form_data']['wt_iew_use_same_password']) ? 1 : 0;
|
89 |
+
$this->merge_empty_cells = !empty($form_data['advanced_form_data']['wt_iew_merge_empty_cells']) ? 1 : 0;
|
90 |
+
$this->send_mail = !empty($form_data['advanced_form_data']['wt_iew_send_mail']) ? 1 : 0;
|
91 |
+
$this->delete_existing = !empty($form_data['advanced_form_data']['wt_iew_delete_products']) ? 1 : 0;
|
92 |
+
|
93 |
+
wp_defer_term_counting(true);
|
94 |
+
wp_defer_comment_counting(true);
|
95 |
+
wp_suspend_cache_invalidation(true);
|
96 |
+
|
97 |
+
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->parent_module->module_base, 'import', "Preparing for import.");
|
98 |
+
|
99 |
+
$success = 0;
|
100 |
+
$failed = 0;
|
101 |
+
$msg = 'User imported successfully.';
|
102 |
+
foreach ($import_data as $key => $data) {
|
103 |
+
$row = $batch_offset+$key+1;
|
104 |
+
|
105 |
+
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->parent_module->module_base, 'import', "Row :$row - Parsing item.");
|
106 |
+
$parsed_data = $this->parse_users($data);
|
107 |
+
|
108 |
+
if (!is_wp_error($parsed_data)){
|
109 |
+
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->parent_module->module_base, 'import', "Row :$row - Processing item.");
|
110 |
+
|
111 |
+
$result = $this->process_users($parsed_data,$data);
|
112 |
+
|
113 |
+
if(!is_wp_error($result)){
|
114 |
+
if($this->is_user_exist){
|
115 |
+
$msg = 'User updated successfully.';
|
116 |
+
}
|
117 |
+
$this->import_results[$row] = array('row'=>$row, 'message'=>$msg, 'status'=>true, 'post_id'=>$result['id']);
|
118 |
+
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->parent_module->module_base, 'import', "Row :$row - ".$msg);
|
119 |
+
$success++;
|
120 |
+
}else{
|
121 |
+
$this->import_results[$row] = array('row'=>$row, 'message'=>$result->get_error_message(), 'status'=>false, 'post_id'=>'');
|
122 |
+
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->parent_module->module_base, 'import', "Row :$row - Processing failed. Reason: ".$result->get_error_message());
|
123 |
+
$failed++;
|
124 |
+
}
|
125 |
+
}else{
|
126 |
+
$this->import_results[$row] = array('row'=>$row, 'message'=>$parsed_data->get_error_message(), 'status'=>false, 'post_id'=>'');
|
127 |
+
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->parent_module->module_base, 'import', "Row :$row - Parsing failed. Reason: ".$parsed_data->get_error_message());
|
128 |
+
$failed++;
|
129 |
+
}
|
130 |
+
unset($data, $parsed_data);
|
131 |
+
}
|
132 |
+
wp_suspend_cache_invalidation(false);
|
133 |
+
wp_defer_term_counting(false);
|
134 |
+
wp_defer_comment_counting(false);
|
135 |
+
|
136 |
+
$import_response=array(
|
137 |
+
'total_success'=>$success,
|
138 |
+
'total_failed'=>$failed,
|
139 |
+
'log_data'=>$this->import_results,
|
140 |
+
);
|
141 |
+
|
142 |
+
return $import_response;
|
143 |
+
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Parse users
|
148 |
+
* @param array $item
|
149 |
+
* @return array
|
150 |
+
*/
|
151 |
+
public function parse_users( $data ) {
|
152 |
+
try{
|
153 |
+
$data = apply_filters('wt_user_importer_pre_parse_data', $data);
|
154 |
+
$item = $data['mapping_fields'];
|
155 |
+
foreach ($data['meta_mapping_fields'] as $value) {
|
156 |
+
$item = array_merge($item,$value);
|
157 |
+
}
|
158 |
+
global $wpdb;
|
159 |
+
|
160 |
+
$this->is_user_exist = false;
|
161 |
+
$this->merge = false;
|
162 |
+
|
163 |
+
$id = $user_id = isset($item['ID']) && !empty($item['ID']) ? absint($item['ID']) : 0;
|
164 |
+
$id_found_with_id = '';
|
165 |
+
if($id && 'id' == $this->merge_with){
|
166 |
+
$id_found_with_id = get_userdata($id);
|
167 |
+
if ($id_found_with_id) {
|
168 |
+
$this->is_user_exist = true;
|
169 |
+
$user_id = $id;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
$email = isset($item['user_email']) && '' != $item['user_email'] ? $item['user_email'] : '';
|
174 |
+
$id_found_with_email = '';
|
175 |
+
if(!empty($email) && 'email' == $this->merge_with){
|
176 |
+
|
177 |
+
if (is_email($email) && false !== email_exists($email)) {
|
178 |
+
$id_found_with_email = email_exists($email);
|
179 |
+
$this->is_user_exist = true;
|
180 |
+
$user_id = $id_found_with_email;
|
181 |
+
}
|
182 |
+
|
183 |
+
}
|
184 |
+
|
185 |
+
$username = isset($item['user_login']) && '' != $item['user_login'] ? $item['user_login'] : '';
|
186 |
+
$id_found_with_username = '';
|
187 |
+
if(!empty($username) && 'username' == $this->merge_with){
|
188 |
+
|
189 |
+
if (false !== username_exists($username)) {
|
190 |
+
$id_found_with_username = username_exists($username);
|
191 |
+
$this->is_user_exist = true;
|
192 |
+
$user_id = $id_found_with_username;
|
193 |
+
|
194 |
+
|
195 |
+
}
|
196 |
+
|
197 |
+
}
|
198 |
+
|
199 |
+
if($this->is_user_exist){
|
200 |
+
if('skip' == $this->found_action){
|
201 |
+
if($id && $id_found_with_id ){
|
202 |
+
throw new Exception(sprintf('User with same ID already exists. ID: %d',$id ));
|
203 |
+
}elseif($email && $id_found_with_email ){
|
204 |
+
throw new Exception(sprintf('User with same Email already exists. Email: %s',$email ));
|
205 |
+
}elseif($username && $id_found_with_username ){
|
206 |
+
throw new Exception(sprintf('User with same Username already exists. Username: %s',$username ));
|
207 |
+
}else{
|
208 |
+
throw new Exception('User already exists.');
|
209 |
+
}
|
210 |
+
}elseif('update' == $this->found_action){
|
211 |
+
$this->merge = true;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
if(!$this->is_user_exist && $this->skip_new){
|
216 |
+
throw new Exception('Skipping new item' );
|
217 |
+
}
|
218 |
+
|
219 |
+
if(!$this->is_user_exist){
|
220 |
+
$create_user_without_email = apply_filters('wt_create_user_without_email',FALSE); // create user without email address
|
221 |
+
if ( empty($item['user_email']) && $create_user_without_email === FALSE ) {
|
222 |
+
$this->hf_log_data_change( 'user-csv-import', __( '> skipped: cannot insert user without email.' ));
|
223 |
+
unset($item);
|
224 |
+
return new WP_Error( 'parse-error', __( '> skipped: cannot insert user without email.' ) );
|
225 |
+
}elseif(!is_email($item['user_email']) && $create_user_without_email === FALSE){
|
226 |
+
$this->hf_log_data_change( 'user-csv-import', sprintf(__( '> skipped: Email is not valid. %s' ),$item['user_email']) );
|
227 |
+
unset($item);
|
228 |
+
return new WP_Error( 'parse-error', __( '> skipped: Email is not valid.' ) );
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
$user_meta = $user_details = array();
|
233 |
+
|
234 |
+
$user_details['ID'] = $user_id;
|
235 |
+
|
236 |
+
foreach ($this->user_base_fields as $key => $value) {
|
237 |
+
if(in_array($key, array('ID'))){ // ID alreay set
|
238 |
+
continue;
|
239 |
+
}
|
240 |
+
if(isset($item[$value]))
|
241 |
+
$user_details[$key] = $item[$value];
|
242 |
+
//$user_details[$key] = isset( $item[$value] ) ? $item[$value] : "" ;
|
243 |
+
}
|
244 |
+
|
245 |
+
// adding metas from csv to user meta fields
|
246 |
+
foreach ($item as $key => $value) {
|
247 |
+
if ( strstr( $key, 'meta:' ) ){
|
248 |
+
$key_val =$key;
|
249 |
+
$key = trim(str_replace('meta:', '', $key));
|
250 |
+
|
251 |
+
// if($this->user_meta_fields[$key])
|
252 |
+
// continue;
|
253 |
+
|
254 |
+
$this->user_meta_fields[$key] = $key_val;
|
255 |
+
}
|
256 |
+
|
257 |
+
}
|
258 |
+
foreach ($this->user_meta_fields as $key => $value){
|
259 |
+
$user_meta[] = array( 'key' => $key, 'value' => isset( $item[$value] ) ? $item[$value] : "" );
|
260 |
+
}
|
261 |
+
|
262 |
+
// the $user_details array will now contain the necessary name-value pairs for the wp_users table, and also any meta data in the 'usermeta' array
|
263 |
+
$parsed_details = array();
|
264 |
+
|
265 |
+
$parsed_details['user_details'] = $user_details;
|
266 |
+
$parsed_details['user_meta'] = $user_meta;
|
267 |
+
|
268 |
+
|
269 |
+
return $parsed_details;
|
270 |
+
} catch (Exception $e) {
|
271 |
+
return new WP_Error('woocommerce_product_importer_error', $e->getMessage(), array('status' => $e->getCode()));
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
+
|
276 |
+
/**
|
277 |
+
* Create new posts based on import information
|
278 |
+
*/
|
279 |
+
private function process_users($post, $parsed_item) {
|
280 |
+
try{
|
281 |
+
global $wpdb;
|
282 |
+
|
283 |
+
$this->hf_log_data_change('user-csv-import', __('Processing users.'));
|
284 |
+
|
285 |
+
$user_id = !empty($post['user_details']['ID']) && $post['user_details']['ID'] ? $post['user_details']['ID'] : 0;
|
286 |
+
|
287 |
+
// user exists when importing & merge not ticked
|
288 |
+
$new_added = false;
|
289 |
+
|
290 |
+
if ($user_id && $this->merge) {
|
291 |
+
$current_user = get_current_user_id();
|
292 |
+
if ($current_user == $user_id) {
|
293 |
+
$usr_msg = 'Current user is skipped.';
|
294 |
+
$this->hf_log_data_change('user-csv-import', sprintf(__('> “%s”' . $usr_msg), $user_id), true);
|
295 |
+
unset($post);
|
296 |
+
return new WP_Error( 'parse-error',sprintf(__('> “%s”' . $usr_msg), $user_id));
|
297 |
+
}
|
298 |
+
$user_id = $this->hf_update_customer($user_id, $post, $this->send_mail);
|
299 |
+
} else {
|
300 |
+
|
301 |
+
$user_id = $this->hf_create_customer($post, $this->send_mail);
|
302 |
+
$new_added = true;
|
303 |
+
if (is_wp_error($user_id)) {
|
304 |
+
|
305 |
+
$this->hf_log_data_change('user-csv-import', sprintf(__('> Error inserting %s: %s'), 1, $user_id->get_error_message()), true);
|
306 |
+
$skipped++;
|
307 |
+
unset($post);
|
308 |
+
return new WP_Error( 'parse-error',sprintf(__('> Error inserting %s: %s'), 1, $user_id->get_error_message()));
|
309 |
+
} elseif (empty($user_id)) {
|
310 |
+
|
311 |
+
$skipped++;
|
312 |
+
unset($post);
|
313 |
+
return new WP_Error( 'parse-error',__('An error occurred with the customer information provided.'));
|
314 |
+
}
|
315 |
+
}
|
316 |
+
|
317 |
+
if ($this->merge && !$new_added)
|
318 |
+
$out_msg = "User updated successfully. ID:$user_id";
|
319 |
+
else
|
320 |
+
$out_msg = "User imported successfully. ID:$user_id";
|
321 |
+
|
322 |
+
$this->hf_log_data_change('user-csv-import', sprintf(__('> “%s”' . $out_msg), $user_id), true);
|
323 |
+
|
324 |
+
$this->hf_log_data_change('user-csv-import', sprintf(__('> Finished importing user %s'), $user_id ));
|
325 |
+
|
326 |
+
do_action('wt_customer_csv_import_data', $parsed_item, $user_id);
|
327 |
+
unset($post);
|
328 |
+
return $result = array(
|
329 |
+
'id' => $user_id,
|
330 |
+
'updated' => $this->merge,
|
331 |
+
);
|
332 |
+
} catch (Exception $e) {
|
333 |
+
return new WP_Error('woocommerce_product_importer_error', $e->getMessage(), array('status' => $e->getCode()));
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
public function hf_create_customer($data, $email_customer) {
|
338 |
+
$customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
|
339 |
+
$username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
|
340 |
+
$customer_id = (!empty($data['user_details']['customer_id']) ) ? $data['user_details']['customer_id'] : '';
|
341 |
+
$insertion_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
|
342 |
+
|
343 |
+
|
344 |
+
|
345 |
+
if (!empty($data['user_details']['user_pass'])) {
|
346 |
+
$password = ($this->use_same_password) ? $data['user_details']['user_pass'] : wp_hash_password($data['user_details']['user_pass']);
|
347 |
+
$password_generated = false;
|
348 |
+
} else {
|
349 |
+
$password = wp_generate_password(12, true);
|
350 |
+
$password_generated = true;
|
351 |
+
}
|
352 |
+
$found_customer = false;
|
353 |
+
$create_user_without_email = apply_filters('wt_create_user_without_email', FALSE); // create user without email address
|
354 |
+
if (is_email($customer_email) || $create_user_without_email === TRUE) {
|
355 |
+
$maybe_username = $username;
|
356 |
+
// Not in test mode, create a user account for this email
|
357 |
+
if (empty($username)) {
|
358 |
+
$maybe_username = explode('@', $customer_email);
|
359 |
+
$maybe_username = sanitize_user($maybe_username[0]);
|
360 |
+
}
|
361 |
+
$counter = 1;
|
362 |
+
$username = $maybe_username;
|
363 |
+
while (username_exists($username)) {
|
364 |
+
$username = $maybe_username . $counter;
|
365 |
+
$counter++;
|
366 |
+
}
|
367 |
+
|
368 |
+
if (!$this->is_user_exist && $insertion_id) {
|
369 |
+
global $wpdb;
|
370 |
+
$insertion_id = (int) $insertion_id;
|
371 |
+
$username = sanitize_user($username);
|
372 |
+
$customer_email = sanitize_email($customer_email);
|
373 |
+
if($password_generated && !$this->use_same_password){
|
374 |
+
$password = wp_hash_password($password);
|
375 |
+
}
|
376 |
+
$result = $wpdb->insert($wpdb->users, array('ID' => $insertion_id, 'user_login' => $username, 'user_email' => $customer_email, 'user_pass' => $password));
|
377 |
+
if ($result) {
|
378 |
+
$found_customer = $insertion_id;
|
379 |
+
}
|
380 |
+
|
381 |
+
} else {
|
382 |
+
$found_customer = wp_create_user($username, $password, $customer_email);
|
383 |
+
}
|
384 |
+
$user_data = array('ID' => $found_customer, 'user_login' => $username, 'user_email' => $customer_email);
|
385 |
+
if (!$password_generated) {
|
386 |
+
$user_data['user_pass'] = $password;
|
387 |
+
}
|
388 |
+
|
389 |
+
wp_insert_user($user_data);
|
390 |
+
if (!is_wp_error($found_customer)) {
|
391 |
+
$wp_user_object = new WP_User($found_customer);
|
392 |
+
if ( ! function_exists( 'get_editable_roles' ) ) {
|
393 |
+
require_once ABSPATH . 'wp-admin/includes/user.php';
|
394 |
+
}
|
395 |
+
$roles = get_editable_roles();
|
396 |
+
$new_roles_str = str_replace(' ', '', $data['user_details']['roles']);
|
397 |
+
|
398 |
+
if(empty($new_roles_str)){
|
399 |
+
$new_roles_str = get_option('default_role');
|
400 |
+
}
|
401 |
+
|
402 |
+
$new_roles = explode(',', $new_roles_str);
|
403 |
+
$new_roles = array_intersect($new_roles, array_keys($roles));
|
404 |
+
$roles_to_remove = array();
|
405 |
+
$user_roles = array_intersect(array_values($wp_user_object->roles), array_keys($roles));
|
406 |
+
if (!$new_roles) {
|
407 |
+
// If there are no roles, delete all of the user's roles
|
408 |
+
$roles_to_remove = $user_roles;
|
409 |
+
} else {
|
410 |
+
$roles_to_remove = array_diff($user_roles, $new_roles);
|
411 |
+
}
|
412 |
+
if (!empty($new_roles)) {
|
413 |
+
foreach ($roles_to_remove as $_role) {
|
414 |
+
$wp_user_object->remove_role($_role); //remove the default role before adding new roles
|
415 |
+
}
|
416 |
+
// Make sure that we don't call $wp_user_object->add_role() any more than it's necessary
|
417 |
+
$_new_roles = array_diff($new_roles, array_intersect(array_values($wp_user_object->roles), array_keys($roles)));
|
418 |
+
foreach ($_new_roles as $_role) {
|
419 |
+
$wp_user_object->add_role($_role);
|
420 |
+
}
|
421 |
+
}
|
422 |
+
$meta_array = array();
|
423 |
+
foreach ($data['user_meta'] as $meta) {
|
424 |
+
$meta_array[$meta['key']] = $meta['value'];
|
425 |
+
}
|
426 |
+
|
427 |
+
$user_nicename = (!empty($data['user_details']['user_nicename'])) ? $data['user_details']['user_nicename'] : '';
|
428 |
+
$website = (!empty($data['user_details']['user_url'])) ? $data['user_details']['user_url'] : '';
|
429 |
+
$user_registered = (!empty($data['user_details']['user_registered'])) ? $data['user_details']['user_registered'] : '';
|
430 |
+
$display_name = (!empty($data['user_details']['display_name'])) ? $data['user_details']['display_name'] : '';
|
431 |
+
$first_name = (!empty($data['user_details']['first_name'])) ? $data['user_details']['first_name'] : '';
|
432 |
+
$last_name = (!empty($data['user_details']['last_name'])) ? $data['user_details']['last_name'] : '';
|
433 |
+
$user_status = (!empty($data['user_details']['user_status'])) ? $data['user_details']['user_status'] : '';
|
434 |
+
wp_update_user(array(
|
435 |
+
'ID' => $found_customer,
|
436 |
+
'user_nicename' => $user_nicename,
|
437 |
+
'user_url' => $website,
|
438 |
+
'user_registered' => $user_registered,
|
439 |
+
'display_name' => $display_name,
|
440 |
+
'first_name' => $first_name,
|
441 |
+
'last_name' => $last_name,
|
442 |
+
'user_status' => $user_status,
|
443 |
+
)
|
444 |
+
);
|
445 |
+
|
446 |
+
//unset($this->user_meta_fields['role']);
|
447 |
+
// update user meta data
|
448 |
+
foreach ($this->user_meta_fields as $key => $meta) {
|
449 |
+
if (($key == 'wp_capabilities') || (in_array($key, $this->user_base_fields))) {
|
450 |
+
continue;
|
451 |
+
}
|
452 |
+
$key = trim(str_replace('meta:', '', $key));
|
453 |
+
// $meta = trim(str_replace('meta:', '', $meta));
|
454 |
+
$meta_value = (!empty($meta_array[$key]) ) ? maybe_unserialize($meta_array[$key]) : '';
|
455 |
+
if ($key == 'wp_user_level' && $meta_value == ''){
|
456 |
+
$meta_value = 0;
|
457 |
+
}
|
458 |
+
update_user_meta($found_customer, $key, $meta_value);
|
459 |
+
}
|
460 |
+
|
461 |
+
// $this->hf_make_user_active($found_customer);
|
462 |
+
// send user registration email if admin as chosen to do so
|
463 |
+
if ($email_customer && function_exists('wp_new_user_notification')) {
|
464 |
+
$blog_name = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
|
465 |
+
$to = $customer_email;
|
466 |
+
$subject = "Your " . $blog_name . " account has been created!";
|
467 |
+
// if ((strlen($password) == 34 && strlen($data['user_details']['user_pass']) == 34)) {
|
468 |
+
|
469 |
+
if (strlen($password) == 34 && $this->use_same_password) {
|
470 |
+
|
471 |
+
$body = "Hi $first_name,
|
472 |
+
|
473 |
+
Thanks for creating an account on " . $blog_name . ". Your username is $username. You can access your account area to view orders, change your password.
|
474 |
+
|
475 |
+
We look forward to seeing you soon.
|
476 |
+
|
477 |
+
" . $blog_name;
|
478 |
+
} elseif (!empty($data['user_details']['user_pass']) && !$this->use_same_password) {
|
479 |
+
$new_password = $data['user_details']['user_pass'];
|
480 |
+
$body = "Hi $first_name,
|
481 |
+
|
482 |
+
Thanks for creating an account on " . $blog_name . ". Your username is $username. You can access your account area to view orders, change your password.
|
483 |
+
|
484 |
+
Your password has been generated: $new_password
|
485 |
+
|
486 |
+
We look forward to seeing you soon.
|
487 |
+
|
488 |
+
" . $blog_name;
|
489 |
+
} else {
|
490 |
+
$body = "Hi $first_name,
|
491 |
+
|
492 |
+
Thanks for creating an account on " . $blog_name . ". Your username is $username. You can access your account area to view orders, change your password.
|
493 |
+
|
494 |
+
Your password has been generated: $password
|
495 |
+
|
496 |
+
We look forward to seeing you soon.
|
497 |
+
|
498 |
+
" . $blog_name;
|
499 |
+
}
|
500 |
+
$headers = '';
|
501 |
+
//$headers[] = 'From: ' . $blog_name;
|
502 |
+
$mail_attrs['to'] = $to;
|
503 |
+
$mail_attrs['subject'] = $subject;
|
504 |
+
$mail_attrs['body'] = $body;
|
505 |
+
$mail_attrs['headers'] = $headers;
|
506 |
+
$mail_attrs['password'] = (isset($new_password)) ? $new_password : $password;
|
507 |
+
$mail_attrs['user_current_roles'] = $user_roles;
|
508 |
+
$mail_attrs['user_new_roles'] = $new_roles;
|
509 |
+
$mail_attrs['user_id'] = $found_customer;
|
510 |
+
$mail_attrs['mail_already_sent'] = FALSE;
|
511 |
+
$mail_template = get_option('wt_' . WT_CUSTOMER_IMP_EXP_ID . '_mail_option', null);
|
512 |
+
if($mail_template['enable_email_templates'] == 1){
|
513 |
+
$fetch_user = get_user_by( 'email', $mail_attrs['to'] );
|
514 |
+
$mail_attrs['headers'] ='Content-Type: text/html; charset=UTF-8';
|
515 |
+
$mail_attrs['subject'] = $mail_template['subject_mail'];
|
516 |
+
$blog_name = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
|
517 |
+
$mail_body = $mail_template['body_mail'];
|
518 |
+
$mail_body = str_replace( "###EMAIL###", $mail_attrs['to'], $mail_body );
|
519 |
+
$mail_body = str_replace( "###USERNAME###", $fetch_user->user_login, $mail_body );
|
520 |
+
$mail_body = str_replace( "###DISPLAYNAME###", $fetch_user->display_name , $mail_body );
|
521 |
+
// $mail_body = str_replace( "###NICENAME###", $fetch_user->user_nicename , $mail_body );
|
522 |
+
$mail_body = str_replace( "###PASSWORD###", $mail_attrs['password'] , $mail_body );
|
523 |
+
$mail_body = str_replace('###SITENAME###', $blog_name, $mail_body);
|
524 |
+
$mail_body = str_replace('###SITEURL###', home_url(), $mail_body);
|
525 |
+
$mail_body = str_replace('###LOGINURL###', wp_login_url(), $mail_body );
|
526 |
+
$mail_body = str_replace("###LOSTPASSWORDURL###", wp_lostpassword_url(), $mail_body );
|
527 |
+
$mail_attrs['body'] = $mail_body;
|
528 |
+
}
|
529 |
+
$mail_attrs = apply_filters('wt_user_registration_email', $mail_attrs); //this filter can use for alter mail as well as send mail with other third party plugins
|
530 |
+
|
531 |
+
if (!isset($mail_attrs['mail_already_sent']) || $mail_attrs['mail_already_sent'] == FALSE) {// this parameter used for determine whether the email already sent or not by any Custom mail
|
532 |
+
wp_mail($mail_attrs['to'], $mail_attrs['subject'], $mail_attrs['body'], $mail_attrs['headers']);
|
533 |
+
}
|
534 |
+
|
535 |
+
}
|
536 |
+
|
537 |
+
}
|
538 |
+
} else {
|
539 |
+
$found_customer = new WP_Error('hf_invalid_customer', sprintf(__('User could not be created without Email.'), $customer_id));
|
540 |
+
}
|
541 |
+
return apply_filters('xa_user_impexp_alter_user_meta', $found_customer, $this->user_meta_fields, $meta_array);
|
542 |
+
}
|
543 |
+
|
544 |
+
public function hf_update_customer($found_customer, $data, $email_customer) {
|
545 |
+
$meta_array = array();
|
546 |
+
if ($found_customer) {
|
547 |
+
$wp_user_object = new WP_User($found_customer);
|
548 |
+
$roles = get_editable_roles();
|
549 |
+
$new_roles_str = str_replace(' ', '', $data['user_details']['roles']);
|
550 |
+
$new_roles = explode(',', $new_roles_str);
|
551 |
+
$new_roles = array_intersect($new_roles, array_keys($roles));
|
552 |
+
$roles_to_remove = array();
|
553 |
+
$user_roles = array_intersect(array_values($wp_user_object->roles), array_keys($roles));
|
554 |
+
if (!$new_roles) {
|
555 |
+
// If there are no roles, delete all of the user's roles
|
556 |
+
$roles_to_remove = $user_roles;
|
557 |
+
} else {
|
558 |
+
$roles_to_remove = array_diff($user_roles, $new_roles);
|
559 |
+
}
|
560 |
+
if (!empty($new_roles)) {
|
561 |
+
foreach ($roles_to_remove as $_role) {
|
562 |
+
$wp_user_object->remove_role($_role); //remove the default role before adding new roles
|
563 |
+
}
|
564 |
+
// Make sure that we don't call $wp_user_object->add_role() any more than it's necessary
|
565 |
+
$_new_roles = array_diff($new_roles, array_intersect(array_values($wp_user_object->roles), array_keys($roles)));
|
566 |
+
foreach ($_new_roles as $_role) {
|
567 |
+
$wp_user_object->add_role($_role);
|
568 |
+
}
|
569 |
+
}
|
570 |
+
|
571 |
+
foreach ($data['user_meta'] as $meta) {
|
572 |
+
$meta_array[$meta['key']] = $meta['value'];
|
573 |
+
}
|
574 |
+
// update user meta data
|
575 |
+
foreach ($this->user_meta_fields as $key => $meta) {
|
576 |
+
if (($key == 'wp_capabilities') || (in_array($key, $this->user_base_fields))) {
|
577 |
+
continue;
|
578 |
+
}
|
579 |
+
$key = trim(str_replace('meta:', '', $key));
|
580 |
+
// $meta = trim(str_replace('meta:', '', $meta));
|
581 |
+
$meta_value = (!empty($meta_array[$key]) ) ? maybe_unserialize($meta_array[$key]) : '';
|
582 |
+
if ($key == 'wp_user_level' && $meta_value == ''){
|
583 |
+
$meta_value = 0;
|
584 |
+
}
|
585 |
+
update_user_meta($found_customer, $key, $meta_value);
|
586 |
+
}
|
587 |
+
|
588 |
+
$user_data = array(
|
589 |
+
'ID' => $found_customer
|
590 |
+
);
|
591 |
+
if (isset($data['user_details']['user_nicename'])) {
|
592 |
+
$user_data['user_nicename'] = $data['user_details']['user_nicename'];
|
593 |
+
}
|
594 |
+
|
595 |
+
//added when implement merge with user id use for update email
|
596 |
+
if (isset($data['user_details']['user_email']) && !empty($data['user_details']['user_email'])) {
|
597 |
+
if ($wp_user_object->user_email != $data['user_details']['user_email']) {
|
598 |
+
$email_updated = true;
|
599 |
+
$customer_email = $data['user_details']['user_email'];
|
600 |
+
}
|
601 |
+
$user_data['user_email'] = $data['user_details']['user_email'];
|
602 |
+
}
|
603 |
+
if (isset($data['user_details']['user_url'])) {
|
604 |
+
$user_data['user_url'] = $data['user_details']['user_url'];
|
605 |
+
}
|
606 |
+
if (isset($data['user_details']['user_registered'])) {
|
607 |
+
$user_data['user_registered'] = $data['user_details']['user_registered'];
|
608 |
+
}
|
609 |
+
if (isset($data['user_details']['user_pass'])) {
|
610 |
+
$user_data['user_pass'] = $data['user_details']['user_pass'];
|
611 |
+
}
|
612 |
+
if (isset($data['user_details']['display_name'])) {
|
613 |
+
$user_data['display_name'] = $data['user_details']['display_name'];
|
614 |
+
}
|
615 |
+
if (isset($data['user_details']['first_name'])) {
|
616 |
+
$user_data['first_name'] = $data['user_details']['first_name'];
|
617 |
+
}
|
618 |
+
if (isset($data['user_details']['last_name'])) {
|
619 |
+
$user_data['last_name'] = $data['user_details']['last_name'];
|
620 |
+
}
|
621 |
+
if (isset($data['user_details']['user_status'])) {
|
622 |
+
$user_data['user_status'] = $data['user_details']['user_status'];
|
623 |
+
}
|
624 |
+
add_filter('send_password_change_email', '__return_false'); // for preventing sending password change notification mail on by wp_update_user.
|
625 |
+
if (sizeof($user_data) > 1) {
|
626 |
+
wp_update_user($user_data);
|
627 |
+
}
|
628 |
+
|
629 |
+
if ($this->use_same_password && isset($data['user_details']['user_pass']) && !empty($data['user_details']['user_pass'])) {
|
630 |
+
$password = $data['user_details']['user_pass'];
|
631 |
+
$user_data = array_merge($user_data, array('user_login' => $wp_user_object->user_login, 'user_email' => ( $email_updated ) ? $customer_email : $wp_user_object->user_email));
|
632 |
+
$user_data['user_pass'] = $password;
|
633 |
+
wp_insert_user($user_data);
|
634 |
+
}
|
635 |
+
|
636 |
+
// send user registration email if admin as chosen to do so
|
637 |
+
if ($email_customer && function_exists('wp_new_user_notification') && isset($user_data['user_pass'])) {
|
638 |
+
//added when implement merge with user id use to get to email id
|
639 |
+
$mail_sent_email = ( $email_updated ) ? $customer_email : $wp_user_object->user_email;
|
640 |
+
unset($email_updated);
|
641 |
+
$blog_name = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
|
642 |
+
/* translators: Do not translate USERNAME, ADMIN_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */
|
643 |
+
$pass_change_text = __('Hi ###USERNAME###,
|
644 |
+
|
645 |
+
This notice confirms that your password was changed on ###SITENAME### to ###PASSWORD###.
|
646 |
+
|
647 |
+
|
648 |
+
This email has been sent to ###EMAIL###
|
649 |
+
|
650 |
+
Regards,
|
651 |
+
All at ###SITENAME###
|
652 |
+
###SITEURL###');
|
653 |
+
$mail_attrs = array(
|
654 |
+
'to' => $mail_sent_email,
|
655 |
+
/* translators: User password change notification email subject. 1: Site name */
|
656 |
+
'subject' => __('[%s] Notice of Password Change'),
|
657 |
+
'message' => $pass_change_text,
|
658 |
+
'headers' => '',
|
659 |
+
);
|
660 |
+
$mail_attrs['message'] = str_replace('###USERNAME###', $wp_user_object->user_login, $mail_attrs['message']);
|
661 |
+
$mail_attrs['message'] = str_replace('###EMAIL###', $wp_user_object->user_email, $mail_attrs['message']);
|
662 |
+
$mail_attrs['message'] = str_replace('###SITENAME###', $blog_name, $mail_attrs['message']);
|
663 |
+
$mail_attrs['message'] = str_replace('###SITEURL###', home_url(), $mail_attrs['message']);
|
664 |
+
$mail_attrs['message'] = str_replace('###PASSWORD###', $user_data['user_pass'], $mail_attrs['message']);
|
665 |
+
$mail_attrs['user_current_roles'] = $user_roles;
|
666 |
+
$mail_attrs['user_new_roles'] = $new_roles;
|
667 |
+
$mail_attrs['user_id'] = $found_customer;
|
668 |
+
$mail_attrs['password'] = $user_data['user_pass'];
|
669 |
+
$mail_attrs['mail_already_sent'] = FALSE;
|
670 |
+
$mail_template = get_option('wt_' . WT_CUSTOMER_IMP_EXP_ID . '_mail_option', null);
|
671 |
+
if($mail_template['enable_update_mail_template'] == 1){
|
672 |
+
$mail_attrs['headers'] ='Content-Type: text/html; charset=UTF-8';
|
673 |
+
$mail_attrs['subject'] = $mail_template['subject_mail_update'];
|
674 |
+
$mail_body_update = $mail_template['body_mail_update'];
|
675 |
+
$mail_body_update = str_replace( "###EMAIL###", $wp_user_object->user_email, $mail_body_update );
|
676 |
+
$mail_body_update = str_replace( "###USERNAME###", $wp_user_object->user_login, $mail_body_update );
|
677 |
+
$mail_body_update = str_replace( "###DISPLAYNAME###", $wp_user_object->display_name , $mail_body_update );
|
678 |
+
$mail_body_update = str_replace( "###PASSWORD###", $mail_attrs['password'] , $mail_body_update );
|
679 |
+
$mail_body_update = str_replace('###SITENAME###', $blog_name, $mail_body_update);
|
680 |
+
$mail_body_update = str_replace('###SITEURL###', home_url(), $mail_body_update);
|
681 |
+
$mail_body_update = str_replace('###LOGINURL###', wp_login_url(), $mail_body_update );
|
682 |
+
$mail_body_update = str_replace("###LOSTPASSWORDURL###", wp_lostpassword_url(), $mail_body_update );
|
683 |
+
|
684 |
+
$mail_attrs['message'] = $mail_body_update;
|
685 |
+
}
|
686 |
+
$mail_attrs = apply_filters('wt_user_password_change_email', $mail_attrs); // this filter can use for alter mail as well as send mail with other third party plugins
|
687 |
+
if (!isset($mail_attrs['mail_already_sent']) || $mail_attrs['mail_already_sent'] == FALSE) { // this parameter used for determine whether the email already sent or not by any Custom mail
|
688 |
+
wp_mail($mail_attrs['to'], sprintf($mail_attrs['subject'], $blog_name), $mail_attrs['message'], $mail_attrs['headers']);
|
689 |
+
}
|
690 |
+
|
691 |
+
}
|
692 |
+
} else {
|
693 |
+
$found_customer = new WP_Error('hf_invalid_customer', sprintf(__('User could not be found with given Email or username.'), $customer_email));
|
694 |
+
}
|
695 |
+
return apply_filters('xa_user_impexp_alter_user_meta', $found_customer, $this->user_meta_fields, $meta_array);
|
696 |
+
}
|
697 |
+
}
|
698 |
+
}
|
admin/modules/user/user.php
ADDED
@@ -0,0 +1,441 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Product section of the plugin
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
if(!class_exists('Wt_Import_Export_For_Woo_basic_User')){
|
14 |
+
class Wt_Import_Export_For_Woo_basic_User {
|
15 |
+
|
16 |
+
public $module_id = '';
|
17 |
+
public static $module_id_static = '';
|
18 |
+
public $module_base = 'user';
|
19 |
+
public $module_name = 'User Import Export for WordPress/WooCommerce';
|
20 |
+
public $min_base_version= '1.0.0'; /* Minimum `Import export plugin` required to run this add on plugin */
|
21 |
+
|
22 |
+
private $all_meta_keys = array();
|
23 |
+
private $found_meta = array();
|
24 |
+
private $found_hidden_meta = array();
|
25 |
+
private $selected_column_names = null;
|
26 |
+
|
27 |
+
public function __construct()
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* Checking the minimum required version of `Import export plugin` plugin available
|
31 |
+
*/
|
32 |
+
if(!Wt_Import_Export_For_Woo_Basic_Common_Helper::check_base_version($this->module_base, $this->module_name, $this->min_base_version))
|
33 |
+
{
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
$this->module_id = Wt_Import_Export_For_Woo_Basic::get_module_id($this->module_base);
|
39 |
+
|
40 |
+
self::$module_id_static = $this->module_id;
|
41 |
+
|
42 |
+
add_filter('wt_iew_exporter_post_types_basic', array($this, 'wt_iew_exporter_post_types'), 10, 1);
|
43 |
+
add_filter('wt_iew_importer_post_types_basic', array($this, 'wt_iew_exporter_post_types'), 10, 1);
|
44 |
+
|
45 |
+
add_filter('wt_iew_exporter_alter_filter_fields_basic', array($this, 'exporter_alter_filter_fields'), 10, 3);
|
46 |
+
|
47 |
+
add_filter('wt_iew_exporter_alter_mapping_fields_basic', array($this, 'exporter_alter_mapping_fields'), 10, 3);
|
48 |
+
add_filter('wt_iew_importer_alter_mapping_fields_basic', array($this, 'get_importer_post_columns'), 10, 3);
|
49 |
+
|
50 |
+
add_filter('wt_iew_importer_alter_advanced_fields_basic', array($this, 'importer_alter_advanced_fields'), 10, 3);
|
51 |
+
|
52 |
+
add_filter('wt_iew_exporter_alter_meta_mapping_fields_basic', array($this, 'exporter_alter_meta_mapping_fields'), 10, 3);
|
53 |
+
|
54 |
+
add_filter('wt_iew_exporter_alter_mapping_enabled_fields_basic', array($this, 'exporter_alter_mapping_enabled_fields'), 10, 3);
|
55 |
+
add_filter('wt_iew_importer_alter_mapping_enabled_fields_basic', array($this, 'exporter_alter_mapping_enabled_fields'), 10, 3);
|
56 |
+
|
57 |
+
add_filter('wt_iew_exporter_do_export_basic', array($this, 'exporter_do_export'), 10, 7);
|
58 |
+
add_filter('wt_iew_importer_do_import_basic', array($this, 'importer_do_import'), 10, 8);
|
59 |
+
|
60 |
+
add_filter('wt_iew_importer_steps_basic', array($this, 'importer_steps'), 10, 2);
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Altering advanced step description
|
66 |
+
*/
|
67 |
+
public function importer_steps($steps, $base)
|
68 |
+
{
|
69 |
+
if($this->module_base==$base)
|
70 |
+
{
|
71 |
+
$steps['advanced']['description']=__('Use advanced options from below to decide retain or not user passwords, batch import count. You can also save the template file for future imports.');
|
72 |
+
}
|
73 |
+
return $steps;
|
74 |
+
}
|
75 |
+
|
76 |
+
public function importer_do_import($import_data, $base, $step, $form_data, $selected_template_data, $method_import, $batch_offset, $is_last_batch) {
|
77 |
+
if ($this->module_base != $base) {
|
78 |
+
return $import_data;
|
79 |
+
}
|
80 |
+
|
81 |
+
if(0 == $batch_offset){
|
82 |
+
$memory = size_format(wt_let_to_num_basic(ini_get('memory_limit')));
|
83 |
+
$wp_memory = size_format(wt_let_to_num_basic(WP_MEMORY_LIMIT));
|
84 |
+
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->module_base, 'import', '---[ New import started at '.date('Y-m-d H:i:s').' ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory);
|
85 |
+
}
|
86 |
+
|
87 |
+
include plugin_dir_path(__FILE__) . 'import/import.php';
|
88 |
+
$import = new Wt_Import_Export_For_Woo_basic_User_Import($this);
|
89 |
+
|
90 |
+
$response = $import->prepare_data_to_import($import_data,$form_data, $batch_offset, $is_last_batch);
|
91 |
+
|
92 |
+
if($is_last_batch){
|
93 |
+
Wt_Import_Export_For_Woo_Basic_Logwriter::write_log($this->module_base, 'import', '---[ Import ended at '.date('Y-m-d H:i:s').']---');
|
94 |
+
}
|
95 |
+
|
96 |
+
return $response;
|
97 |
+
}
|
98 |
+
|
99 |
+
public function exporter_do_export($export_data, $base, $step, $form_data, $selected_template_data, $method_export, $batch_offset) {
|
100 |
+
if ($this->module_base != $base) {
|
101 |
+
return $export_data;
|
102 |
+
}
|
103 |
+
|
104 |
+
switch ($method_export) {
|
105 |
+
case 'quick':
|
106 |
+
$this->set_export_columns_for_quick_export($form_data);
|
107 |
+
break;
|
108 |
+
|
109 |
+
case 'template':
|
110 |
+
case 'new':
|
111 |
+
$this->set_selected_column_names($form_data);
|
112 |
+
break;
|
113 |
+
|
114 |
+
default:
|
115 |
+
break;
|
116 |
+
}
|
117 |
+
|
118 |
+
include plugin_dir_path(__FILE__) . 'export/export.php';
|
119 |
+
$export = new Wt_Import_Export_For_Woo_basic_User_Export($this);
|
120 |
+
|
121 |
+
$header_row = $export->prepare_header();
|
122 |
+
|
123 |
+
$data_row = $export->prepare_data_to_export($form_data, $batch_offset);
|
124 |
+
|
125 |
+
$export_data = array(
|
126 |
+
'head_data' => $header_row,
|
127 |
+
'body_data' => $data_row['data'],
|
128 |
+
);
|
129 |
+
|
130 |
+
if(isset($data_row['total']) && !empty($data_row['total'])){
|
131 |
+
$export_data['total'] = $data_row['total'];
|
132 |
+
}
|
133 |
+
|
134 |
+
return $export_data;
|
135 |
+
}
|
136 |
+
|
137 |
+
/*
|
138 |
+
* Setting default export columns for quick export
|
139 |
+
*/
|
140 |
+
|
141 |
+
public function set_export_columns_for_quick_export($form_data) {
|
142 |
+
|
143 |
+
$post_columns = self::get_user_post_columns();
|
144 |
+
|
145 |
+
$this->selected_column_names = array_combine(array_keys($post_columns), array_keys($post_columns));
|
146 |
+
|
147 |
+
if (isset($form_data['method_export_form_data']['mapping_enabled_fields']) && !empty($form_data['method_export_form_data']['mapping_enabled_fields'])) {
|
148 |
+
foreach ($form_data['method_export_form_data']['mapping_enabled_fields'] as $value) {
|
149 |
+
$additional_quick_export_fields[$value] = array('fields' => array());
|
150 |
+
}
|
151 |
+
|
152 |
+
$export_additional_columns = $this->exporter_alter_meta_mapping_fields($additional_quick_export_fields, $this->module_base, array());
|
153 |
+
foreach ($export_additional_columns as $value) {
|
154 |
+
$this->selected_column_names = array_merge($this->selected_column_names, $value['fields']);
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Adding current post type to export list
|
161 |
+
*
|
162 |
+
*/
|
163 |
+
public function wt_iew_exporter_post_types($arr) {
|
164 |
+
$arr['user'] = __('User/Customer');
|
165 |
+
return $arr;
|
166 |
+
}
|
167 |
+
|
168 |
+
public static function get_user_sort_columns() {
|
169 |
+
$sort_columns = array('ID'=>'ID', 'user_registered'=>'user_registered','user_email'=> 'user_email', 'user_login'=>'user_login', 'user_nicename'=>'user_nicename','user_url'=>'user_url');
|
170 |
+
return apply_filters('wt_iew_export_user_sort_columns', $sort_columns);
|
171 |
+
}
|
172 |
+
|
173 |
+
public static function get_user_roles() {
|
174 |
+
global $wp_roles;
|
175 |
+
$roles = array();
|
176 |
+
foreach ( $wp_roles->role_names as $role => $name ) {
|
177 |
+
$roles[esc_attr( $role )] = esc_html( $name );
|
178 |
+
}
|
179 |
+
return apply_filters('wt_iew_export_user_roles', $roles);
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
public static function get_user_post_columns() {
|
184 |
+
return include plugin_dir_path(__FILE__) . 'data/data-user-columns.php';
|
185 |
+
}
|
186 |
+
|
187 |
+
public function get_importer_post_columns($fields, $base, $step_page_form_data) {
|
188 |
+
if ($base != $this->module_base) {
|
189 |
+
return $fields;
|
190 |
+
}
|
191 |
+
$colunm = include plugin_dir_path(__FILE__) . 'data/data/data-wf-reserved-fields-pair.php';
|
192 |
+
// $colunm = array_map(function($vl){ return array('title'=>$vl, 'description'=>$vl); }, $arr);
|
193 |
+
return $colunm;
|
194 |
+
}
|
195 |
+
|
196 |
+
public function exporter_alter_mapping_enabled_fields($mapping_enabled_fields, $base, $form_data_mapping_enabled_fields) {
|
197 |
+
if ($base != $this->module_base) {
|
198 |
+
return $mapping_enabled_fields;
|
199 |
+
}
|
200 |
+
$mapping_enabled_fields = array();
|
201 |
+
|
202 |
+
return $mapping_enabled_fields;
|
203 |
+
}
|
204 |
+
|
205 |
+
public function exporter_alter_meta_mapping_fields($fields, $base, $step_page_form_data) {
|
206 |
+
if ($base != $this->module_base) {
|
207 |
+
return $fields;
|
208 |
+
}
|
209 |
+
|
210 |
+
foreach ($fields as $key => $value) {
|
211 |
+
switch ($key) {
|
212 |
+
|
213 |
+
default:
|
214 |
+
break;
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
return $fields;
|
219 |
+
}
|
220 |
+
|
221 |
+
|
222 |
+
public function importer_alter_meta_mapping_fields($fields, $base, $step_page_form_data) {
|
223 |
+
if ($base != $this->module_base) {
|
224 |
+
return $fields;
|
225 |
+
}
|
226 |
+
$fields=$this->exporter_alter_meta_mapping_fields($fields, $base, $step_page_form_data);
|
227 |
+
$out=array();
|
228 |
+
foreach ($fields as $key => $value)
|
229 |
+
{
|
230 |
+
$value['fields']=array_map(function($vl){ return array('title'=>$vl, 'description'=>$vl); }, $value['fields']);
|
231 |
+
$out[$key]=$value;
|
232 |
+
}
|
233 |
+
return $out;
|
234 |
+
}
|
235 |
+
|
236 |
+
|
237 |
+
public function wt_get_found_meta() {
|
238 |
+
|
239 |
+
if (!empty($this->found_meta)) {
|
240 |
+
return $this->found_meta;
|
241 |
+
}
|
242 |
+
|
243 |
+
// Loop products and load meta data
|
244 |
+
$found_meta = array();
|
245 |
+
// Some of the values may not be usable (e.g. arrays of arrays) but the worse
|
246 |
+
// that can happen is we get an empty column.
|
247 |
+
|
248 |
+
$all_meta_keys = $this->wt_get_all_meta_keys();
|
249 |
+
|
250 |
+
$csv_columns = self::get_user_post_columns();
|
251 |
+
|
252 |
+
foreach ($all_meta_keys as $meta) {
|
253 |
+
|
254 |
+
if (!$meta || (substr((string) $meta, 0, 1) == '_') || in_array($meta, array_keys($csv_columns)) || in_array('meta:' . $meta, array_keys($csv_columns)))
|
255 |
+
continue;
|
256 |
+
|
257 |
+
$found_meta[] = $meta;
|
258 |
+
}
|
259 |
+
|
260 |
+
$found_meta = array_diff($found_meta, array_keys($csv_columns));
|
261 |
+
|
262 |
+
$this->found_meta = $found_meta;
|
263 |
+
return $this->found_meta;
|
264 |
+
}
|
265 |
+
|
266 |
+
|
267 |
+
|
268 |
+
public function wt_get_all_meta_keys() {
|
269 |
+
|
270 |
+
if (!empty($this->all_meta_keys)) {
|
271 |
+
return $this->all_meta_keys;
|
272 |
+
}
|
273 |
+
|
274 |
+
$all_meta_pkeys = self::get_all_metakeys();
|
275 |
+
|
276 |
+
$this->all_meta_keys = $all_meta_pkeys;
|
277 |
+
|
278 |
+
return $this->all_meta_keys;
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* Get a list of all the meta keys for a post type. This includes all public, private,
|
283 |
+
* used, no-longer used etc. They will be sorted once fetched.
|
284 |
+
*/
|
285 |
+
public static function get_all_metakeys() {
|
286 |
+
global $wpdb;
|
287 |
+
return apply_filters('wt_alter_user_meta_data', $wpdb->get_col("SELECT distinct(meta_key) FROM $wpdb->usermeta WHERE meta_key NOT IN ('wp_capabilities')"));
|
288 |
+
}
|
289 |
+
|
290 |
+
|
291 |
+
|
292 |
+
public function wt_get_found_hidden_meta() {
|
293 |
+
|
294 |
+
if (!empty($this->found_hidden_meta)) {
|
295 |
+
return $this->found_hidden_meta;
|
296 |
+
}
|
297 |
+
|
298 |
+
// Loop products and load meta data
|
299 |
+
$found_hidden_meta = array();
|
300 |
+
// Some of the values may not be usable (e.g. arrays of arrays) but the worse
|
301 |
+
// that can happen is we get an empty column.
|
302 |
+
|
303 |
+
$all_meta_keys = $this->wt_get_all_meta_keys();
|
304 |
+
$csv_columns = self::get_user_post_columns();
|
305 |
+
foreach ($all_meta_keys as $meta) {
|
306 |
+
|
307 |
+
if (!$meta || (substr((string) $meta, 0, 1) != '_') || in_array($meta, array_keys($csv_columns)) || in_array('meta:' . $meta, array_keys($csv_columns)))
|
308 |
+
continue;
|
309 |
+
|
310 |
+
$found_hidden_meta[] = $meta;
|
311 |
+
}
|
312 |
+
|
313 |
+
$found_hidden_meta = array_diff($found_hidden_meta, array_keys($csv_columns));
|
314 |
+
|
315 |
+
$this->found_hidden_meta = $found_hidden_meta;
|
316 |
+
return $this->found_hidden_meta;
|
317 |
+
}
|
318 |
+
|
319 |
+
public function set_selected_column_names($full_form_data) {
|
320 |
+
|
321 |
+
if (is_null($this->selected_column_names)) {
|
322 |
+
if (isset($full_form_data['mapping_form_data']['mapping_selected_fields']) && !empty($full_form_data['mapping_form_data']['mapping_selected_fields'])) {
|
323 |
+
$this->selected_column_names = $full_form_data['mapping_form_data']['mapping_selected_fields'];
|
324 |
+
}
|
325 |
+
if (isset($full_form_data['meta_step_form_data']['mapping_selected_fields']) && !empty($full_form_data['meta_step_form_data']['mapping_selected_fields'])) {
|
326 |
+
$export_additional_columns = $full_form_data['meta_step_form_data']['mapping_selected_fields'];
|
327 |
+
foreach ($export_additional_columns as $value) {
|
328 |
+
$this->selected_column_names = array_merge($this->selected_column_names, $value);
|
329 |
+
}
|
330 |
+
}
|
331 |
+
}
|
332 |
+
|
333 |
+
return $full_form_data;
|
334 |
+
}
|
335 |
+
|
336 |
+
public function get_selected_column_names() {
|
337 |
+
return $this->selected_column_names;
|
338 |
+
}
|
339 |
+
|
340 |
+
public function exporter_alter_mapping_fields($fields, $base, $mapping_form_data) {
|
341 |
+
if ($base != $this->module_base) {
|
342 |
+
return $fields;
|
343 |
+
}
|
344 |
+
|
345 |
+
$fields = self::get_user_post_columns();
|
346 |
+
return $fields;
|
347 |
+
}
|
348 |
+
|
349 |
+
|
350 |
+
/**
|
351 |
+
* Customize the items in filter export page
|
352 |
+
*/
|
353 |
+
public function exporter_alter_filter_fields($fields, $base, $filter_form_data) {
|
354 |
+
if ($this->module_base != $base) {
|
355 |
+
return $fields;
|
356 |
+
}
|
357 |
+
|
358 |
+
/* altering help text of default fields */
|
359 |
+
$fields['offset']['help_text']=__('Specify the number of users that should be skipped from the beginning. e.g. An offset of 10 skips the first 10 users.');
|
360 |
+
$fields['limit']['help_text']=__('The actual number of users you want to export. e.g. A limit of 500 with an offset 10 will export users from 11th to 510th position.');
|
361 |
+
|
362 |
+
$fields['roles'] = array(
|
363 |
+
'label' => __('User Roles'),
|
364 |
+
'placeholder' => __('All Roles'),
|
365 |
+
'field_name' => 'roles',
|
366 |
+
'sele_vals' => self::get_user_roles(),
|
367 |
+
'help_text' => __('Input specific roles to export information pertaining to all customers with the respective role/s.'),
|
368 |
+
'type' => 'multi_select',
|
369 |
+
'css_class' => 'wc-enhanced-select',
|
370 |
+
'validation_rule' => array('type'=>'text_arr')
|
371 |
+
);
|
372 |
+
|
373 |
+
|
374 |
+
|
375 |
+
|
376 |
+
return $fields;
|
377 |
+
}
|
378 |
+
|
379 |
+
|
380 |
+
public function exporter_alter_advanced_fields($fields, $base, $advanced_form_data) {
|
381 |
+
if ($this->module_base != $base) {
|
382 |
+
return $fields;
|
383 |
+
}
|
384 |
+
unset($fields['export_shortcode_tohtml']);
|
385 |
+
$out = array();
|
386 |
+
$out['export_guest_user'] = array(
|
387 |
+
'label' => __("Export guest users"),
|
388 |
+
'type' => 'radio',
|
389 |
+
'radio_fields' => array(
|
390 |
+
'Yes' => __('Yes'),
|
391 |
+
'No' => __('No')
|
392 |
+
),
|
393 |
+
'value' => 'No',
|
394 |
+
'field_name' => 'export_guest_user',
|
395 |
+
'help_text' => __('Enable this option to export information related to guest users'),
|
396 |
+
);
|
397 |
+
|
398 |
+
foreach ($fields as $fieldk => $fieldv) {
|
399 |
+
$out[$fieldk] = $fieldv;
|
400 |
+
}
|
401 |
+
return $out;
|
402 |
+
}
|
403 |
+
|
404 |
+
public function importer_alter_advanced_fields($fields, $base, $advanced_form_data) {
|
405 |
+
if ($this->module_base != $base) {
|
406 |
+
return $fields;
|
407 |
+
}
|
408 |
+
$out = array();
|
409 |
+
|
410 |
+
|
411 |
+
|
412 |
+
$out['use_same_password'] = array(
|
413 |
+
'label' => __("Retain user passwords"),
|
414 |
+
'type' => 'radio',
|
415 |
+
'radio_fields' => array(
|
416 |
+
'1' => __('Yes'),
|
417 |
+
'0' => __('No')
|
418 |
+
),
|
419 |
+
'value' => '1',
|
420 |
+
'field_name' => 'use_same_password',
|
421 |
+
'help_text' => __('Retain user passwords as per the input record.'),
|
422 |
+
);
|
423 |
+
|
424 |
+
|
425 |
+
foreach ($fields as $fieldk => $fieldv) {
|
426 |
+
$out[$fieldk] = $fieldv;
|
427 |
+
}
|
428 |
+
return $out;
|
429 |
+
}
|
430 |
+
|
431 |
+
public function get_item_by_id($id) {
|
432 |
+
$post['edit_url']=get_edit_user_link($id);
|
433 |
+
$user_info = get_userdata($id);
|
434 |
+
$post['title'] = $user_info->user_login;
|
435 |
+
return $post;
|
436 |
+
}
|
437 |
+
|
438 |
+
}
|
439 |
+
}
|
440 |
+
|
441 |
+
new Wt_Import_Export_For_Woo_basic_User();
|
admin/partials/_form_field_generator.php
ADDED
@@ -0,0 +1,377 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
foreach($form_fields as $key=>$value)
|
6 |
+
{
|
7 |
+
/* setting default value form fields list array */
|
8 |
+
$vl=(isset($value['value']) ? $value['value'] : '');
|
9 |
+
$vl=($vl=='' && isset($value['default_value']) ? $value['default_value'] : $vl);
|
10 |
+
|
11 |
+
$type=(isset($value['type']) ? $value['type'] : 'text');
|
12 |
+
$css_class=(isset($value['css_class']) ? $value['css_class'] : '');
|
13 |
+
$html_id=(isset($value['html_id']) ? ' id="'.$value['html_id'].'" ' : '');
|
14 |
+
$tr_id=(isset($value['tr_id']) ? ' id="'.$value['tr_id'].'" ' : '');
|
15 |
+
$tr_class=(isset($value['tr_class']) ? $value['tr_class'] : '');
|
16 |
+
$td_class1=(isset($value['td_class1']) ? $value['td_class1'] : '');
|
17 |
+
$td_class2=(isset($value['td_class2']) ? $value['td_class2'] : '');
|
18 |
+
$td_class3=(isset($value['td_class3']) ? $value['td_class3'] : '');
|
19 |
+
|
20 |
+
$tr_html=(isset($value['tr_html']) ? $value['tr_html'] : '');
|
21 |
+
$field_html=(isset($value['field_html']) ? $value['field_html'] : '');
|
22 |
+
$help_text=(isset($value['help_text']) ? $value['help_text'] : '');
|
23 |
+
$placeholder=(isset($value['placeholder']) ? $value['placeholder'] : '');
|
24 |
+
$attr_arr=(isset($value['attr']) ? $value['attr'] : array());
|
25 |
+
$after_form_field_html=(isset($value['after_form_field_html']) ? $value['after_form_field_html'] : ''); /* after form field `td` */
|
26 |
+
$after_form_field=(isset($value['after_form_field']) ? $value['after_form_field'] : ''); /* after form field */
|
27 |
+
$before_form_field=(isset($value['before_form_field']) ? $value['before_form_field'] : '');
|
28 |
+
$merge_left=(isset($value['merge_left']) ? $value['merge_left'] : false); /* merge field td with left td */
|
29 |
+
$merge_right=(isset($value['merge_right']) ? $value['merge_right'] : false); /* merge field td with right td */
|
30 |
+
$colspan=1;
|
31 |
+
if($merge_left)
|
32 |
+
{
|
33 |
+
$colspan++;
|
34 |
+
}
|
35 |
+
if($merge_right)
|
36 |
+
{
|
37 |
+
$colspan++;
|
38 |
+
}
|
39 |
+
$colspan_attr='';
|
40 |
+
if($colspan>1)
|
41 |
+
{
|
42 |
+
$colspan_attr=' colspan="'.$colspan.'"';
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* conditional help texts
|
47 |
+
* !!Important: Using OR mixed with AND then add OR conditions first.
|
48 |
+
*/
|
49 |
+
$conditional_help_html='';
|
50 |
+
if(isset($value['help_text_conditional']) && is_array($value['help_text_conditional']))
|
51 |
+
{
|
52 |
+
foreach ($value['help_text_conditional'] as $help_text_config)
|
53 |
+
{
|
54 |
+
if(is_array($help_text_config))
|
55 |
+
{
|
56 |
+
$condition_attr='';
|
57 |
+
if(is_array($help_text_config['condition']))
|
58 |
+
{
|
59 |
+
$previous_type=''; /* this for avoiding fields without glue */
|
60 |
+
foreach ($help_text_config['condition'] as $condition)
|
61 |
+
{
|
62 |
+
if(is_array($condition))
|
63 |
+
{
|
64 |
+
if($previous_type!='field')
|
65 |
+
{
|
66 |
+
$condition_attr.='['.$condition['field'].'='.$condition['value'].']';
|
67 |
+
$previous_type='field';
|
68 |
+
}
|
69 |
+
}else
|
70 |
+
{
|
71 |
+
if(is_string($condition))
|
72 |
+
{
|
73 |
+
$condition=strtoupper($condition);
|
74 |
+
if(($condition=='AND' || $condition=='OR') && $previous_type!='glue')
|
75 |
+
{
|
76 |
+
$condition_attr.='['.$condition.']';
|
77 |
+
$previous_type='glue';
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
$conditional_help_html.='<span class="wt-iew_form_help wt-iew_conditional_help_text" data-iew-help-condition="'.esc_attr($condition_attr).'">'.$help_text_config['help_text'].'</span>';
|
84 |
+
}
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
$form_toggler_p_class="";
|
89 |
+
$form_toggler_register="";
|
90 |
+
$form_toggler_child="";
|
91 |
+
if(isset($value['form_toggler']))
|
92 |
+
{
|
93 |
+
if($value['form_toggler']['type']=='parent')
|
94 |
+
{
|
95 |
+
$form_toggler_p_class="wt_iew_form_toggler";
|
96 |
+
$form_toggler_register=' wf_frm_tgl-target="'.$value['form_toggler']['target'].'"';
|
97 |
+
}
|
98 |
+
elseif($value['form_toggler']['type']=='child')
|
99 |
+
{
|
100 |
+
$form_toggler_child=' wf_frm_tgl-id="'.$value['form_toggler']['id'].'" wf_frm_tgl-val="'.$value['form_toggler']['val'].'" '.(isset($value['form_toggler']['chk']) ? 'wf_frm_tgl-chk="'.$value['form_toggler']['chk'].'"' : '').(isset($value['form_toggler']['depth']) ? ' wf_frm_tgl-lvl="'.$value['form_toggler']['depth'].'"' : '');
|
101 |
+
}else
|
102 |
+
{
|
103 |
+
$form_toggler_child=' wf_frm_tgl-id="'.$value['form_toggler']['id'].'" wf_frm_tgl-val="'.$value['form_toggler']['val'].'" '.(isset($value['form_toggler']['chk']) ? 'wf_frm_tgl-chk="'.$value['form_toggler']['chk'].'"' : '').(isset($value['form_toggler']['depth']) ? ' wf_frm_tgl-lvl="'.$value['form_toggler']['depth'].'"' : '');
|
104 |
+
$form_toggler_p_class="wt_iew_form_toggler";
|
105 |
+
$form_toggler_register=' wf_frm_tgl-target="'.$value['form_toggler']['target'].'"';
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
$field_group_attr=(isset($value['field_group']) ? ' data-field-group="'.$value['field_group'].'" ' : '');
|
110 |
+
$tr_class.=(isset($value['field_group']) ? ' wt_iew_field_group_children ' : ''); //add an extra class to tr when field grouping enabled
|
111 |
+
|
112 |
+
if($type=='image_export')
|
113 |
+
{
|
114 |
+
$css_class.=' wt_iew_separate_image_export';
|
115 |
+
}
|
116 |
+
|
117 |
+
$attr='';
|
118 |
+
$has_class_attr=0;
|
119 |
+
$css_attr_value='';
|
120 |
+
foreach ($attr_arr as $attr_key => $attr_value)
|
121 |
+
{
|
122 |
+
if($attr_key=='class')
|
123 |
+
{
|
124 |
+
$attr_value.=" ".$form_toggler_p_class." ".$css_class;
|
125 |
+
$form_toggler_p_class='';
|
126 |
+
$css_class='';
|
127 |
+
$has_class_attr=1;
|
128 |
+
$css_attr_value=$attr_value;
|
129 |
+
}
|
130 |
+
$attr.=$attr_key.'="'.$attr_value.'" ';
|
131 |
+
}
|
132 |
+
|
133 |
+
$css_class.=($form_toggler_p_class!="" ? ' '.$form_toggler_p_class : '');
|
134 |
+
$css_attr=($css_class!="" ? ' class="'.$css_class.'"' : '');
|
135 |
+
|
136 |
+
|
137 |
+
if($tr_html=="")
|
138 |
+
{
|
139 |
+
$form_data_key=(substr($value['field_name'],0,8)!=='wt_iew_' ? 'wt_iew_' : '').$value['field_name'];
|
140 |
+
|
141 |
+
/* checking field value exist in form data array */
|
142 |
+
if(isset($form_data[$form_data_key]))
|
143 |
+
{
|
144 |
+
$vl=$form_data[$form_data_key];
|
145 |
+
}
|
146 |
+
if($type=='field_group_head') //heading for field group
|
147 |
+
{
|
148 |
+
$visibility=(isset($value['show_on_default']) ? $value['show_on_default'] : 0);
|
149 |
+
?>
|
150 |
+
<tr <?php echo $tr_id.$field_group_attr;?> class="<?php echo $tr_class;?>">
|
151 |
+
<td colspan="3" class="wt_iew_field_group">
|
152 |
+
<div class="wt_iew_field_group_hd">
|
153 |
+
<?php echo isset($value['head']) ? $value['head'] : ''; ?>
|
154 |
+
<div class="wt_iew_field_group_toggle_btn" data-id="<?php echo isset($value['group_id']) ? $value['group_id'] : ''; ?>" data-visibility="<?php echo $visibility; ?>"><span class="dashicons dashicons-arrow-<?php echo ($visibility==1 ? 'down' : 'right'); ?>"></span></div>
|
155 |
+
</div>
|
156 |
+
<div class="wt_iew_field_group_content">
|
157 |
+
<table></table>
|
158 |
+
</div>
|
159 |
+
</td>
|
160 |
+
</tr>
|
161 |
+
<?php
|
162 |
+
}else
|
163 |
+
{
|
164 |
+
?>
|
165 |
+
<tr <?php echo $tr_id.$field_group_attr;?> class="<?php echo $tr_class;?>" <?php echo $form_toggler_child; ?>>
|
166 |
+
<?php
|
167 |
+
if(!$merge_left) /* if merge left not enabled */
|
168 |
+
{
|
169 |
+
?>
|
170 |
+
<th class="<?php echo $td_class1;?>">
|
171 |
+
<label><?php echo isset($value['label']) ? $value['label'] : ''; ?></label>
|
172 |
+
</th>
|
173 |
+
<?php
|
174 |
+
}
|
175 |
+
?>
|
176 |
+
<td <?php echo $colspan_attr;?> class="<?php echo $td_class2;?>">
|
177 |
+
|
178 |
+
<?php
|
179 |
+
if($field_html=='')
|
180 |
+
{
|
181 |
+
echo $before_form_field;
|
182 |
+
if($type=='text' || $type=='number' || $type=='password')
|
183 |
+
{
|
184 |
+
?>
|
185 |
+
<input placeholder="<?php echo $placeholder;?>" type="<?php echo $type; ?>" <?php echo $html_id;?> <?php echo $css_attr;?> name="<?php echo $form_data_key;?>" value="<?php echo $vl;?>" <?php echo $attr;?> >
|
186 |
+
<?php
|
187 |
+
}
|
188 |
+
if($type=='textarea')
|
189 |
+
{
|
190 |
+
?>
|
191 |
+
<textarea placeholder="<?php echo $placeholder;?>" <?php echo $html_id;?> <?php echo $css_attr;?> name="<?php echo $form_data_key;?>" <?php echo $attr;?> ><?php echo $vl;?></textarea>
|
192 |
+
<?php
|
193 |
+
}
|
194 |
+
elseif($type=='multi_select')
|
195 |
+
{
|
196 |
+
$sele_vals=(isset($value['sele_vals']) && is_array($value['sele_vals']) ? $value['sele_vals'] : array());
|
197 |
+
$vl=(is_array($vl) ? $vl : array($vl));
|
198 |
+
$vl=array_filter($vl);
|
199 |
+
?>
|
200 |
+
<select <?php echo $html_id;?> <?php echo $css_attr;?> data-placeholder="<?php echo $placeholder;?>" name="<?php echo $form_data_key;?>" multiple="multiple" <?php echo $attr;?> >
|
201 |
+
<?php
|
202 |
+
foreach($sele_vals as $sele_val=>$sele_lbl)
|
203 |
+
{
|
204 |
+
?>
|
205 |
+
<option value="<?php echo $sele_val;?>" <?php echo (in_array($sele_val,$vl) ? 'selected' : ''); ?>><?php echo $sele_lbl;?></option>
|
206 |
+
<?php
|
207 |
+
}
|
208 |
+
|
209 |
+
/* in the case of ajax product search selectbox */
|
210 |
+
if($has_class_attr==1)
|
211 |
+
{
|
212 |
+
$css_class_arr=explode(" ", $css_attr_value);
|
213 |
+
}else
|
214 |
+
{
|
215 |
+
$css_class_arr=explode(" ", $css_class);
|
216 |
+
}
|
217 |
+
if(count($sele_vals)==0 && in_array('wc-product-search', $css_class_arr))
|
218 |
+
{
|
219 |
+
foreach($vl as $single_vl)
|
220 |
+
{
|
221 |
+
$single_vl=(int) $single_vl;
|
222 |
+
if($single_vl>0)
|
223 |
+
{
|
224 |
+
$product=wc_get_product($single_vl);
|
225 |
+
?>
|
226 |
+
<option value="<?php echo $single_vl;?>" selected><?php echo $product->get_title();?></option>
|
227 |
+
<?php
|
228 |
+
}
|
229 |
+
}
|
230 |
+
}
|
231 |
+
?>
|
232 |
+
</select>
|
233 |
+
<?php
|
234 |
+
}
|
235 |
+
elseif($type=='select')
|
236 |
+
{
|
237 |
+
$sele_vals=(isset($value['sele_vals']) && is_array($value['sele_vals']) ? $value['sele_vals'] : array());
|
238 |
+
$vl=(is_array($vl) ? $vl : array($vl));
|
239 |
+
?>
|
240 |
+
<select <?php echo $html_id;?> <?php echo $css_attr;?> data-placeholder="<?php echo $placeholder;?>" name="<?php echo $form_data_key;?>" <?php echo $attr;?> <?php echo $form_toggler_register;?> >
|
241 |
+
<?php
|
242 |
+
foreach($sele_vals as $sele_val=>$sele_lbl)
|
243 |
+
{
|
244 |
+
$sele_lbl_txt=(is_array($sele_lbl) ? ( isset($sele_lbl['value']) ? $sele_lbl['value'] : (isset($sele_lbl[0]) ? $sele_lbl[0] : '' ) ) : $sele_lbl);
|
245 |
+
|
246 |
+
/* check any extra data to append */
|
247 |
+
$sele_extra_attr='';
|
248 |
+
if(is_array($sele_lbl))
|
249 |
+
{
|
250 |
+
foreach($sele_lbl as $sele_lblk=>$sele_lblv)
|
251 |
+
{
|
252 |
+
if($sele_lblk=='value')
|
253 |
+
{
|
254 |
+
continue;
|
255 |
+
}
|
256 |
+
$sele_extra_attr.=' data-'.$sele_lblk.'="'.$sele_lblv.'"';
|
257 |
+
}
|
258 |
+
}
|
259 |
+
?>
|
260 |
+
<option value="<?php echo $sele_val;?>" <?php echo (in_array($sele_val,$vl) ? 'selected' : ''); ?> <?php echo $sele_extra_attr; ?> ><?php echo $sele_lbl_txt;?></option>
|
261 |
+
<?php
|
262 |
+
}
|
263 |
+
?>
|
264 |
+
</select>
|
265 |
+
<?php
|
266 |
+
}
|
267 |
+
elseif($type=='radio') //radio button
|
268 |
+
{
|
269 |
+
?>
|
270 |
+
<div class="wt_form_radio_block">
|
271 |
+
<?php
|
272 |
+
$radio_fields=isset($value['radio_fields']) ? $value['radio_fields'] : array();
|
273 |
+
foreach ($radio_fields as $rad_vl=>$rad_label)
|
274 |
+
{
|
275 |
+
?>
|
276 |
+
<input <?php echo $css_attr;?> type="radio" id="<?php echo $form_data_key.'_'.$rad_vl;?>" name="<?php echo $form_data_key;?>" value="<?php echo $rad_vl;?>" <?php echo ($vl==$rad_vl) ? ' checked="checked"' : ''; ?> <?php echo $attr;?> <?php echo $form_toggler_register;?> /> <?php echo $rad_label; ?>
|
277 |
+
|
278 |
+
<?php
|
279 |
+
}
|
280 |
+
?>
|
281 |
+
</div>
|
282 |
+
<?php
|
283 |
+
}
|
284 |
+
elseif($type=='image_export') //image export radio button
|
285 |
+
{
|
286 |
+
?>
|
287 |
+
<div class="wt_form_radio_block">
|
288 |
+
<?php
|
289 |
+
$radio_fields=array(
|
290 |
+
'Yes' => __('Yes'),
|
291 |
+
'No' => __('No')
|
292 |
+
);
|
293 |
+
foreach ($radio_fields as $rad_vl=>$rad_label)
|
294 |
+
{
|
295 |
+
?>
|
296 |
+
<input <?php echo $css_attr;?> type="radio" id="<?php echo $form_data_key.'_'.$rad_vl;?>" name="<?php echo $form_data_key;?>" value="<?php echo $rad_vl;?>" <?php echo ($vl==$rad_vl) ? ' checked="checked"' : ''; ?> <?php echo $attr;?> <?php echo $form_toggler_register;?> /> <?php echo $rad_label; ?>
|
297 |
+
|
298 |
+
<?php
|
299 |
+
}
|
300 |
+
?>
|
301 |
+
</div>
|
302 |
+
<?php
|
303 |
+
}
|
304 |
+
elseif($type=='checkbox') //checkbox
|
305 |
+
{
|
306 |
+
?>
|
307 |
+
<div class="wt_form_checkbox_block">
|
308 |
+
<?php
|
309 |
+
$checkbox_fields=isset($value['checkbox_fields']) ? $value['checkbox_fields'] : array();
|
310 |
+
foreach ($checkbox_fields as $chk_vl=>$chk_label)
|
311 |
+
{
|
312 |
+
?>
|
313 |
+
<input <?php echo $css_attr;?> type="checkbox" id="<?php echo $form_data_key.'_'.$chk_vl;?>" name="<?php echo $form_data_key;?>" value="<?php echo $chk_vl;?>" <?php echo ($vl==$chk_vl) ? ' checked="checked"' : ''; ?> <?php echo $attr;?> <?php echo $form_toggler_register;?> /> <?php echo $chk_label; ?>
|
314 |
+
|
315 |
+
<?php
|
316 |
+
}?>
|
317 |
+
</div>
|
318 |
+
<?php
|
319 |
+
}elseif($type=='uploader')
|
320 |
+
{
|
321 |
+
$field_id=(isset($value['html_id']) ? $value['html_id'] : $form_data_key);
|
322 |
+
?>
|
323 |
+
<div class="wt_iew_file_attacher_dv">
|
324 |
+
<input <?php echo ($html_id!="" ? $html_id : 'id="'.$field_id.'"');?> placeholder="<?php echo $placeholder;?>" <?php echo $css_attr;?> type="text" name="<?php echo $form_data_key; ?>" value="<?php echo $vl; ?>" <?php echo $attr;?>/>
|
325 |
+
<input type="button" name="upload_file" data-wt_iew_file_attacher_title="<?php _e('Choose a file.'); ?>" data-wt_iew_file_attacher_button_text="<?php _e('Select'); ?>" class="wf_button button button-primary wt_iew_file_attacher" wt_iew_file_attacher_target="#<?php echo $field_id; ?>" value="<?php _e('Upload'); ?>" />
|
326 |
+
</div>
|
327 |
+
<?php
|
328 |
+
}elseif($type=='dropzone') /* dropzone file uploader */
|
329 |
+
{
|
330 |
+
$dropzone_id=(isset($value['dropzone']) ? $value['dropzone'] : $form_data_key.'_dropzone');
|
331 |
+
$field_id=(isset($value['html_id']) ? $value['html_id'] : $form_data_key);
|
332 |
+
?>
|
333 |
+
<input <?php echo $css_attr;?> type="hidden" name="<?php echo $form_data_key; ?>" value="<?php echo $vl; ?>" <?php echo $attr;?> <?php echo ($html_id!="" ? $html_id : 'id="'.$field_id.'"');?>/>
|
334 |
+
|
335 |
+
<div id="<?php echo $dropzone_id;?>" class="wt_iew_dropzone" wt_iew_dropzone_target="#<?php echo $field_id; ?>">
|
336 |
+
<div class="dz-message">
|
337 |
+
<?php _e('Drop files here or click to upload');?>
|
338 |
+
<br /><br /><div class="wt_iew_dz_file_success"></div> <br />
|
339 |
+
<div class="wt_iew_dz_file_name"></div> <br />
|
340 |
+
<div class="wt_iew_dz_remove_link"></div> <br />
|
341 |
+
</div>
|
342 |
+
</div>
|
343 |
+
<?php
|
344 |
+
}
|
345 |
+
echo $after_form_field;
|
346 |
+
}else
|
347 |
+
{
|
348 |
+
echo $field_html;
|
349 |
+
}
|
350 |
+
if($help_text!="")
|
351 |
+
{
|
352 |
+
?>
|
353 |
+
<span class="wt-iew_form_help"><?php echo $help_text;?></span>
|
354 |
+
<?php
|
355 |
+
}
|
356 |
+
echo $conditional_help_html;
|
357 |
+
?>
|
358 |
+
</td>
|
359 |
+
<?php
|
360 |
+
if(!$merge_right) /* if merge right not enabled */
|
361 |
+
{
|
362 |
+
?>
|
363 |
+
<td class="<?php echo $td_class3;?>">
|
364 |
+
<?php echo $after_form_field_html; ?>
|
365 |
+
</td>
|
366 |
+
<?php
|
367 |
+
}
|
368 |
+
?>
|
369 |
+
</tr>
|
370 |
+
<?php
|
371 |
+
}
|
372 |
+
}else
|
373 |
+
{
|
374 |
+
echo $tr_html;
|
375 |
+
}
|
376 |
+
}
|
377 |
+
?>
|
admin/partials/wt-import-export-for-woo-admin-display.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
$wf_admin_view_path=WT_U_IEW_PLUGIN_PATH.'admin/views/';
|
6 |
+
$wf_img_path=WT_U_IEW_PLUGIN_URL.'images/';
|
7 |
+
?>
|
8 |
+
<div class="wrap" id="<?php echo WT_IEW_PLUGIN_ID_BASIC;?>">
|
9 |
+
<h2 class="wp-heading-inline">
|
10 |
+
<?php _e('Import Export for WooCommerce');?>
|
11 |
+
</h2>
|
12 |
+
<div class="nav-tab-wrapper wp-clearfix wt-iew-tab-head">
|
13 |
+
<?php
|
14 |
+
$tab_head_arr=array(
|
15 |
+
'wt-advanced'=>__('General'),
|
16 |
+
'wt-help'=>__('Help Guide')
|
17 |
+
);
|
18 |
+
if(isset($_GET['debug']))
|
19 |
+
{
|
20 |
+
$tab_head_arr['wt-debug']='Debug';
|
21 |
+
}
|
22 |
+
Wt_Import_Export_For_Woo_Basic::generate_settings_tabhead($tab_head_arr);
|
23 |
+
?>
|
24 |
+
</div>
|
25 |
+
<div class="wt-iew-tab-container">
|
26 |
+
<?php
|
27 |
+
//inside the settings form
|
28 |
+
$setting_views_a=array(
|
29 |
+
'wt-advanced'=>'admin-settings-advanced.php',
|
30 |
+
);
|
31 |
+
|
32 |
+
//outside the settings form
|
33 |
+
$setting_views_b=array(
|
34 |
+
'wt-help'=>'admin-settings-help.php',
|
35 |
+
);
|
36 |
+
if(isset($_GET['debug']))
|
37 |
+
{
|
38 |
+
$setting_views_b['wt-debug']='admin-settings-debug.php';
|
39 |
+
}
|
40 |
+
?>
|
41 |
+
<form method="post" class="wt_iew_settings_form_basic">
|
42 |
+
<?php
|
43 |
+
// Set nonce:
|
44 |
+
if (function_exists('wp_nonce_field'))
|
45 |
+
{
|
46 |
+
wp_nonce_field(WT_IEW_PLUGIN_ID_BASIC);
|
47 |
+
}
|
48 |
+
foreach ($setting_views_a as $target_id=>$value)
|
49 |
+
{
|
50 |
+
$settings_view=$wf_admin_view_path.$value;
|
51 |
+
if(file_exists($settings_view))
|
52 |
+
{
|
53 |
+
include $settings_view;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
?>
|
57 |
+
<?php
|
58 |
+
//settings form fields for module
|
59 |
+
do_action('wt_iew_plugin_settings_form');?>
|
60 |
+
</form>
|
61 |
+
<?php
|
62 |
+
foreach ($setting_views_b as $target_id=>$value)
|
63 |
+
{
|
64 |
+
$settings_view=$wf_admin_view_path.$value;
|
65 |
+
if(file_exists($settings_view))
|
66 |
+
{
|
67 |
+
include $settings_view;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
?>
|
71 |
+
<?php do_action('wt_iew_plugin_out_settings_form');?>
|
72 |
+
</div>
|
73 |
+
</div>
|
admin/views/_save_template_popup.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Template saving popup HTML for Import/Export
|
4 |
+
*
|
5 |
+
* @link
|
6 |
+
*
|
7 |
+
* @package Wt_Import_Export_For_Woo
|
8 |
+
*/
|
9 |
+
if (!defined('ABSPATH')) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<div class="wt_iew_template_name wt_iew_popup" data-save-label="<?php _e('Save');?>" data-saveas-label="<?php _e('Save as');?>">
|
14 |
+
<div class="wt_iew_popup_hd">
|
15 |
+
<span style="line-height:40px;" class="dashicons dashicons-edit"></span>
|
16 |
+
<span class="wt_iew_popup_hd_label"></span>
|
17 |
+
<div class="wt_iew_popup_close">X</div>
|
18 |
+
</div>
|
19 |
+
<div class="wt_iew_warn_box">
|
20 |
+
<div class="wt_iew_warn wt_iew_template_name_wrn">
|
21 |
+
<?php _e('Please enter name');?>
|
22 |
+
</div>
|
23 |
+
</div>
|
24 |
+
<div class="wt_iew_template_name_box">
|
25 |
+
<label class="wt_iew_template_name_label"><?php _e('Template name');?></label>
|
26 |
+
<input type="text" name="wt_iew_template_name_field" class="wt_iew_text_field wt_iew_template_name_field">
|
27 |
+
<div class="wt_iew_popup_footer">
|
28 |
+
<button type="button" name="" class="button-secondary wt_iew_popup_cancel">
|
29 |
+
<?php _e('Cancel');?>
|
30 |
+
</button>
|
31 |
+
<button type="button" name="" class="button-primary wt_iew_template_create_btn"></button>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
</div>
|
admin/views/admin-settings-advanced.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt-iew-tab-content" data-id="<?php echo $target_id;?>">
|
7 |
+
<?php
|
8 |
+
$fields=Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings_fields();
|
9 |
+
|
10 |
+
$advanced_settings=Wt_Import_Export_For_Woo_Basic_Common_Helper::get_advanced_settings();
|
11 |
+
?>
|
12 |
+
<table class="form-table wt-iew-form-table">
|
13 |
+
<?php
|
14 |
+
Wt_Import_Export_For_Woo_Basic_Common_Helper::field_generator($fields, $advanced_settings);
|
15 |
+
?>
|
16 |
+
</table>
|
17 |
+
<?php
|
18 |
+
include "admin-settings-save-button.php";
|
19 |
+
?>
|
20 |
+
</div>
|
admin/views/admin-settings-debug.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt-iew-tab-content" data-id="<?php echo $target_id;?>">
|
7 |
+
|
8 |
+
</div>
|
admin/views/admin-settings-help.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'WPINC' ) ) {
|
3 |
+
die;
|
4 |
+
}
|
5 |
+
?>
|
6 |
+
<div class="wt-iew-tab-content" data-id="<?php echo $target_id;?>">
|
7 |
+
<ul class="wt_iew_sub_tab">
|
8 |
+
<li style="border-left:none; padding-left: 0px;" data-target="help-links"><a><?php _e('Help Links'); ?></a></li>
|
9 |
+
<li data-target="help-doc"><a><?php _e('Help doc');?></a></li>
|
10 |
+
</ul>
|
11 |
+
<div class="wt_iew_sub_tab_container">
|
12 |
+
<div class="wt_iew_sub_tab_content" data-id="help-links" style="display:block;">
|
13 |
+
<h3><?php _e('Help Links'); ?></h3>
|
14 |
+
<ul class="wf-help-links">
|
15 |
+
<li>
|
16 |
+
<img src="<?php echo WT_U_IEW_PLUGIN_URL;?>assets/images/documentation.png">
|
17 |
+
<h3><?php _e('Documentation'); ?></h3>
|
18 |
+
<p><?php _e('Refer to our documentation to set up and get started.'); ?></p>
|
19 |
+
<a target="_blank" href="https://www.webtoffee.com/category/documentation/" class="button button-primary">
|
20 |
+
<?php _e('Documentation'); ?>
|
21 |
+
</a>
|
22 |
+
</li>
|
23 |
+
<li>
|
24 |
+
<img src="<?php echo WT_U_IEW_PLUGIN_URL;?>assets/images/support.png">
|
25 |
+
<h3><?php _e('Help and Support'); ?></h3>
|
26 |
+
<p><?php _e('We would love to help you on any queries or issues.'); ?></p>
|
27 |
+
<a target="_blank" href="https://www.webtoffee.com/support/" class="button button-primary">
|
28 |
+
<?php _e('Contact Us'); ?>
|
29 |
+
</a>
|
30 |
+
</li>
|
31 |
+
</ul>
|
32 |
+
</div>
|
33 |
+
<div class="wt_iew_sub_tab_content" data-id="help-doc">
|
34 |
+
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
</div>
|
admin/views/admin-settings-save-button.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// If this file is called directly, abort.
|
3 |
+
if ( ! defined( 'WPINC' ) ) {
|
4 |
+
die;
|
5 |
+
}
|
6 |
+
$settings_button_title=isset($settings_button_title) ? $settings_button_title : 'Update Settings';
|
7 |
+
$before_button_text=isset($before_button_text) ? $before_button_text : '';
|
8 |
+
$after_button_text=isset($after_button_text) ? $after_button_text : '';
|
9 |
+
?>
|
10 |
+
<div style="clear: both;"></div>
|
11 |
+
<div class="wt-iew-plugin-toolbar bottom">
|
12 |
+
<div class="left">
|
13 |
+
</div>
|
14 |
+
<div class="right">
|
15 |
+
<?php echo $before_button_text; ?>
|
16 |
+
<input type="submit" name="wt_iew_update_admin_settings_form" value="<?php _e($settings_button_title); ?>" class="button button-primary" style="float:right;"/>
|
17 |
+
<?php echo $after_button_text; ?>
|
18 |
+
<span class="spinner" style="margin-top:11px"></span>
|
19 |
+
</div>
|
20 |
+
</div>
|
assets/images/documentation.png
ADDED
Binary file
|
assets/images/drag_icon.png
ADDED
Binary file
|
assets/images/loading.gif
ADDED
Binary file
|
assets/images/support.png
ADDED
Binary file
|
helpers/class-wt-common-helper.php
ADDED
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Common_Helper')){
|
3 |
+
class Wt_Import_Export_For_Woo_Basic_Common_Helper
|
4 |
+
{
|
5 |
+
|
6 |
+
public static $min_version_msg='';
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Get File name by url
|
10 |
+
* @param string $file_url URL of the file.
|
11 |
+
* @return string the base name of the given URL (File name).
|
12 |
+
*/
|
13 |
+
public static function wt_wc_get_filename_from_url( $file_url ) {
|
14 |
+
$parts = parse_url( $file_url );
|
15 |
+
if ( isset( $parts['path'] ) ) {
|
16 |
+
return basename( $parts['path'] );
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Get info like language code, parent product ID etc by product id.
|
22 |
+
* @param int Product ID.
|
23 |
+
* @return array/false.
|
24 |
+
*/
|
25 |
+
public static function wt_get_wpml_original_post_language_info($element_id){
|
26 |
+
$get_language_args = array('element_id' => $element_id, 'element_type' => 'post_product');
|
27 |
+
$original_post_language_info = apply_filters('wpml_element_language_details', null, $get_language_args);
|
28 |
+
return $original_post_language_info;
|
29 |
+
}
|
30 |
+
|
31 |
+
public static function wt_get_product_id_by_sku($sku){
|
32 |
+
global $wpdb;
|
33 |
+
$post_exists_sku = $wpdb->get_var($wpdb->prepare("
|
34 |
+
SELECT $wpdb->posts.ID
|
35 |
+
FROM $wpdb->posts
|
36 |
+
LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )
|
37 |
+
WHERE $wpdb->posts.post_status IN ( 'publish', 'private', 'draft', 'pending', 'future' )
|
38 |
+
AND $wpdb->postmeta.meta_key = '_sku' AND $wpdb->postmeta.meta_value = '%s'
|
39 |
+
", $sku));
|
40 |
+
if ($post_exists_sku) {
|
41 |
+
return $post_exists_sku;
|
42 |
+
}
|
43 |
+
return false;
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* To strip the specific string from the array key as well as value.
|
49 |
+
* @param array $array.
|
50 |
+
* @param string $data.
|
51 |
+
* @return array.
|
52 |
+
*/
|
53 |
+
public static function wt_array_walk($array , $data) {
|
54 |
+
$new_array =array();
|
55 |
+
foreach ($array as $key => $value) {
|
56 |
+
$new_array[str_replace($data, '', $key)] = str_replace($data, '', $value);
|
57 |
+
}
|
58 |
+
return $new_array;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Check the minimum base version required for post type modules
|
63 |
+
*
|
64 |
+
*/
|
65 |
+
public static function check_base_version($post_type, $post_type_title, $min_version)
|
66 |
+
{
|
67 |
+
$warn_icon='<span class="dashicons dashicons-warning"></span> ';
|
68 |
+
if(!version_compare(WT_U_IEW_VERSION, $min_version, '>=')) /* not matching the min version */
|
69 |
+
{
|
70 |
+
self::$min_version_msg.=$warn_icon.sprintf(__("The %s requires a minimum version of %s %s. Please upgrade the %s accordingly."), "<b>$post_type_title</b>", "<b>".WT_U_IEW_PLUGIN_NAME."</b>", "<b>v$min_version</b>", "<b>".WT_U_IEW_PLUGIN_NAME."</b>").'<br />';
|
71 |
+
add_action('admin_notices', array(__CLASS__, 'no_minimum_base_version') );
|
72 |
+
return false;
|
73 |
+
}
|
74 |
+
return true;
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
*
|
79 |
+
* No minimum version error message
|
80 |
+
*/
|
81 |
+
public static function no_minimum_base_version()
|
82 |
+
{
|
83 |
+
?>
|
84 |
+
<div class="notice notice-warning">
|
85 |
+
<p>
|
86 |
+
<?php
|
87 |
+
echo self::$min_version_msg;
|
88 |
+
?>
|
89 |
+
</p>
|
90 |
+
</div>
|
91 |
+
<?php
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Decode the post data as normal array from json encoded from data.
|
96 |
+
* If step key is specified, then it will return the data corresponds to the form key
|
97 |
+
* @param array $form_data
|
98 |
+
* @param string $key
|
99 |
+
*/
|
100 |
+
public static function process_formdata($form_data, $key='')
|
101 |
+
{
|
102 |
+
if($key!="") /* if key is given then take its data */
|
103 |
+
{
|
104 |
+
if(isset($form_data[$key]))
|
105 |
+
{
|
106 |
+
if(is_array($form_data[$key]))
|
107 |
+
{
|
108 |
+
$form_data_vl=$form_data[$key];
|
109 |
+
}else
|
110 |
+
{
|
111 |
+
$form_data_vl=json_decode(stripslashes($form_data[$key]),true);
|
112 |
+
}
|
113 |
+
}else
|
114 |
+
{
|
115 |
+
$form_data_vl=array();
|
116 |
+
}
|
117 |
+
}else
|
118 |
+
{
|
119 |
+
$form_data_vl=array();
|
120 |
+
foreach($form_data as $form_datak=>$form_datav)
|
121 |
+
{
|
122 |
+
$form_data_vl[$form_datak]=self::process_formdata($form_data, $form_datak);
|
123 |
+
}
|
124 |
+
}
|
125 |
+
return (is_array($form_data_vl) ? $form_data_vl : array());
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Form field generator
|
130 |
+
*/
|
131 |
+
public static function field_generator($form_fields, $form_data)
|
132 |
+
{
|
133 |
+
include plugin_dir_path( dirname( __FILE__ ) ).'admin/partials/_form_field_generator.php';
|
134 |
+
}
|
135 |
+
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Save advanced settings
|
139 |
+
* @param array $settings array of setting values
|
140 |
+
*/
|
141 |
+
public static function set_advanced_settings($settings)
|
142 |
+
{
|
143 |
+
update_option('wt_iew_advanced_settings', $settings);
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
*
|
148 |
+
* Extract validation rule from form field array
|
149 |
+
* @param array $fields form field array
|
150 |
+
*/
|
151 |
+
public static function extract_validation_rules($fields)
|
152 |
+
{
|
153 |
+
$out=array_map(function ($r) { return (isset($r['validation_rule']) ? $r['validation_rule'] : ''); }, $fields);
|
154 |
+
return array_filter($out);
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Get advanced settings.
|
159 |
+
* @param string $key key for specific setting (optional)
|
160 |
+
* @return mixed if key provided then the value of key otherwise array of values
|
161 |
+
*/
|
162 |
+
public static function get_advanced_settings($key="")
|
163 |
+
{
|
164 |
+
$advanced_settings=get_option('wt_iew_advanced_settings');
|
165 |
+
$advanced_settings=($advanced_settings ? $advanced_settings : array());
|
166 |
+
if($key!="")
|
167 |
+
{
|
168 |
+
$key=(substr($key,0,8)!=='wt_iew_' ? 'wt_iew_' : '').$key;
|
169 |
+
if(isset($advanced_settings[$key]))
|
170 |
+
{
|
171 |
+
return $advanced_settings[$key];
|
172 |
+
}else
|
173 |
+
{
|
174 |
+
$default_settings=self::get_advanced_settings_default();
|
175 |
+
return (isset($default_settings[$key]) ? $default_settings[$key] : '');
|
176 |
+
}
|
177 |
+
}else
|
178 |
+
{
|
179 |
+
$default_settings=self::get_advanced_settings_default();
|
180 |
+
$advanced_settings=wp_parse_args($advanced_settings, $default_settings);
|
181 |
+
return $advanced_settings;
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Get default value of advanced settings
|
187 |
+
* @return array array of default values
|
188 |
+
*
|
189 |
+
*/
|
190 |
+
public static function get_advanced_settings_default()
|
191 |
+
{
|
192 |
+
$fields=self::get_advanced_settings_fields();
|
193 |
+
foreach ($fields as $key => $value)
|
194 |
+
{
|
195 |
+
if(isset($value['value']))
|
196 |
+
{
|
197 |
+
$key=(substr($key,0,8)!=='wt_iew_' ? 'wt_iew_' : '').$key;
|
198 |
+
$out[$key]=$value['value'];
|
199 |
+
}
|
200 |
+
}
|
201 |
+
return $out;
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Get advanced fields
|
206 |
+
* @return array array of fields
|
207 |
+
*
|
208 |
+
*/
|
209 |
+
public static function get_advanced_settings_fields()
|
210 |
+
{
|
211 |
+
$fields=array();
|
212 |
+
return apply_filters('wt_iew_advanced_setting_fields_basic', $fields);
|
213 |
+
}
|
214 |
+
|
215 |
+
public static function wt_allowed_screens(){
|
216 |
+
$screens=array('wt_import_export_for_woo_basic','wt_import_export_for_woo_basic_export','wt_import_export_for_woo_basic_import','wt_import_export_for_woo_basic_history','wt_import_export_for_woo_basic_history_log');
|
217 |
+
return apply_filters('wt_iew_allowed_screens_basic', $screens);
|
218 |
+
|
219 |
+
}
|
220 |
+
public static function wt_get_current_page(){
|
221 |
+
if (isset($_GET['page'])) {
|
222 |
+
return $_GET['page'];
|
223 |
+
}
|
224 |
+
return '';
|
225 |
+
}
|
226 |
+
|
227 |
+
public static function wt_is_screen_allowed(){
|
228 |
+
if(in_array(self::wt_get_current_page(), self::wt_allowed_screens())){
|
229 |
+
return true;
|
230 |
+
}else{
|
231 |
+
return false;
|
232 |
+
}
|
233 |
+
}
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
if(!function_exists('is_woocommerce_prior_to_basic')){
|
238 |
+
function is_woocommerce_prior_to_basic($version) {
|
239 |
+
|
240 |
+
$woocommerce_is_pre_version = (!defined('WC_VERSION') || version_compare(WC_VERSION, $version, '<')) ? true : false;
|
241 |
+
return $woocommerce_is_pre_version;
|
242 |
+
|
243 |
+
if (WC()->version < $version) {
|
244 |
+
return TRUE;
|
245 |
+
} else {
|
246 |
+
return FALSE;
|
247 |
+
}
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
if(!function_exists('wt_let_to_num_basic')){
|
252 |
+
function wt_let_to_num_basic( $size ) {
|
253 |
+
$l = substr( $size, -1 );
|
254 |
+
$ret = (int) substr( $size, 0, -1 );
|
255 |
+
switch ( strtoupper( $l ) ) {
|
256 |
+
case 'P':
|
257 |
+
$ret *= 1024;
|
258 |
+
// No break.
|
259 |
+
case 'T':
|
260 |
+
$ret *= 1024;
|
261 |
+
// No break.
|
262 |
+
case 'G':
|
263 |
+
$ret *= 1024;
|
264 |
+
// No break.
|
265 |
+
case 'M':
|
266 |
+
$ret *= 1024;
|
267 |
+
// No break.
|
268 |
+
case 'K':
|
269 |
+
$ret *= 1024;
|
270 |
+
// No break.
|
271 |
+
}
|
272 |
+
return $ret;
|
273 |
+
}
|
274 |
+
}
|
275 |
+
|
276 |
+
if(!function_exists('wt_removeBomUtf8_basic')){
|
277 |
+
function wt_removeBomUtf8_basic($s) {
|
278 |
+
if (substr($s, 0, 3) == chr(hexdec('EF')) . chr(hexdec('BB')) . chr(hexdec('BF'))) {
|
279 |
+
return substr($s, 3);
|
280 |
+
} else {
|
281 |
+
return $s;
|
282 |
+
}
|
283 |
+
}
|
284 |
+
}
|
helpers/class-wt-import-export-helper.php
ADDED
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Import Export Helper Library
|
5 |
+
*
|
6 |
+
* Includes helper functions for import, export, history modules
|
7 |
+
* @author WebToffee <info@webtoffee.com>
|
8 |
+
*/
|
9 |
+
|
10 |
+
if(!class_exists('Wt_Iew_IE_Basic_Helper'))
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
class Wt_Iew_IE_Basic_Helper
|
16 |
+
{
|
17 |
+
|
18 |
+
public static function _get_csv_delimiters()
|
19 |
+
{
|
20 |
+
return array(
|
21 |
+
'comma'=>array('value'=>__('Comma'), 'val'=>","),
|
22 |
+
'semicolon'=>array('value'=>__('Semicolon'), 'val'=>";"),
|
23 |
+
'tab'=>array('value'=>__('Tab'), 'val'=>"\t"),
|
24 |
+
'space'=>array('value'=>__('Space'), 'val'=>" "),
|
25 |
+
'other'=>array('value'=>__('Other'), 'val'=>""),
|
26 |
+
);
|
27 |
+
}
|
28 |
+
public static function _get_local_file_path($file_url)
|
29 |
+
{
|
30 |
+
$file_path = untrailingslashit(ABSPATH).str_replace(site_url(), '', $file_url);
|
31 |
+
|
32 |
+
if(file_exists($file_path))
|
33 |
+
{
|
34 |
+
return $file_path;
|
35 |
+
}else
|
36 |
+
{
|
37 |
+
/* Retrying if the directory structure is different from wordpress default file structure */
|
38 |
+
$url_parms = explode('/', $file_url);
|
39 |
+
|
40 |
+
$file_name = end($url_parms);
|
41 |
+
|
42 |
+
$file_dir_name = prev($url_parms);
|
43 |
+
|
44 |
+
$file_path = WP_CONTENT_DIR.'/'.$file_dir_name.'/'.$file_name;
|
45 |
+
|
46 |
+
if(file_exists($file_path))
|
47 |
+
{
|
48 |
+
return $file_path;
|
49 |
+
}else
|
50 |
+
{
|
51 |
+
|
52 |
+
return false;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
public static function get_validation_rules($step, $form_data, $module_obj)
|
57 |
+
{
|
58 |
+
$method_name='get_'.$step.'_screen_fields';
|
59 |
+
$out=array();
|
60 |
+
if(method_exists($module_obj, $method_name))
|
61 |
+
{
|
62 |
+
$fields=$module_obj->{$method_name}($form_data);
|
63 |
+
$out=Wt_Import_Export_For_Woo_Basic_Common_Helper::extract_validation_rules($fields);
|
64 |
+
}
|
65 |
+
$form_data=$module_obj=null;
|
66 |
+
unset($form_data, $module_obj);
|
67 |
+
return $out;
|
68 |
+
}
|
69 |
+
public static function sanitize_formdata($form_data, $module_obj)
|
70 |
+
{
|
71 |
+
$out=array();
|
72 |
+
foreach ($module_obj->steps as $step=>$step_data)
|
73 |
+
{
|
74 |
+
if($step=='mapping') //custom rule needed for mapping fieds
|
75 |
+
{
|
76 |
+
|
77 |
+
/* general mapping fields section */
|
78 |
+
if(isset($form_data['mapping_form_data']) && is_array($form_data['mapping_form_data']))
|
79 |
+
{
|
80 |
+
$mapping_form_data=$form_data['mapping_form_data'];
|
81 |
+
|
82 |
+
/* mapping fields. This is an internal purpose array */
|
83 |
+
if(isset($mapping_form_data['mapping_fields']) && is_array($mapping_form_data['mapping_fields']))
|
84 |
+
{
|
85 |
+
foreach ($mapping_form_data['mapping_fields'] as $key => $value)
|
86 |
+
{
|
87 |
+
$new_key=sanitize_text_field($key);
|
88 |
+
$value=array(sanitize_text_field($value[0]), absint($value[1]));
|
89 |
+
unset($mapping_form_data['mapping_fields'][$key]);
|
90 |
+
$mapping_form_data['mapping_fields'][$new_key]=$value;
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
/*mapping enabled meta items */
|
95 |
+
if(isset($mapping_form_data['mapping_enabled_fields']) && is_array($mapping_form_data['mapping_enabled_fields']))
|
96 |
+
{
|
97 |
+
$mapping_form_data['mapping_enabled_fields']=Wt_Iew_Sh::sanitize_item($mapping_form_data['mapping_enabled_fields'], 'text_arr');
|
98 |
+
}
|
99 |
+
|
100 |
+
/* mapping fields. Selected fields only */
|
101 |
+
if(isset($mapping_form_data['mapping_selected_fields']) && is_array($mapping_form_data['mapping_selected_fields']))
|
102 |
+
{
|
103 |
+
foreach ($mapping_form_data['mapping_selected_fields'] as $key => $value)
|
104 |
+
{
|
105 |
+
$new_key=sanitize_text_field($key);
|
106 |
+
unset($mapping_form_data['mapping_selected_fields'][$key]);
|
107 |
+
$mapping_form_data['mapping_selected_fields'][$new_key]=sanitize_text_field($value);
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
$out['mapping_form_data']=$mapping_form_data;
|
112 |
+
}
|
113 |
+
|
114 |
+
|
115 |
+
/* meta mapping fields section */
|
116 |
+
if(isset($form_data['meta_step_form_data']) && is_array($form_data['meta_step_form_data']))
|
117 |
+
{
|
118 |
+
$meta_step_form_data=$form_data['meta_step_form_data'];
|
119 |
+
/* mapping fields. This is an internal purpose array */
|
120 |
+
if(isset($meta_step_form_data['mapping_fields']) && is_array($meta_step_form_data['mapping_fields']))
|
121 |
+
{
|
122 |
+
foreach ($meta_step_form_data['mapping_fields'] as $meta_key => $meta_value)
|
123 |
+
{
|
124 |
+
foreach ($meta_value as $key => $value)
|
125 |
+
{
|
126 |
+
$new_key=sanitize_text_field($key);
|
127 |
+
$value=array(sanitize_text_field($value[0]), absint($value[1]));
|
128 |
+
unset($meta_value[$key]);
|
129 |
+
$meta_value[$new_key]=$value;
|
130 |
+
}
|
131 |
+
$meta_step_form_data['mapping_fields'][$meta_key]=$meta_value;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
|
136 |
+
/* mapping fields. Selected fields only */
|
137 |
+
if(isset($meta_step_form_data['mapping_selected_fields']) && is_array($meta_step_form_data['mapping_selected_fields']))
|
138 |
+
{
|
139 |
+
foreach ($meta_step_form_data['mapping_selected_fields'] as $meta_key => $meta_value)
|
140 |
+
{
|
141 |
+
foreach ($meta_value as $key => $value)
|
142 |
+
{
|
143 |
+
$new_key=sanitize_text_field($key);
|
144 |
+
unset($meta_value[$key]);
|
145 |
+
$meta_value[$new_key]=sanitize_text_field($value);
|
146 |
+
}
|
147 |
+
$meta_step_form_data['mapping_selected_fields'][$meta_key]=$meta_value;
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
$out['meta_step_form_data']=$meta_step_form_data;
|
152 |
+
}
|
153 |
+
}else
|
154 |
+
{
|
155 |
+
$current_form_data_key=$step.'_form_data';
|
156 |
+
$current_form_data=(isset($form_data[$current_form_data_key]) ? $form_data[$current_form_data_key] : array());
|
157 |
+
if(in_array($step, $module_obj->step_need_validation_filter))
|
158 |
+
{
|
159 |
+
$validation_rule=self::get_validation_rules($step, $current_form_data, $module_obj);
|
160 |
+
|
161 |
+
foreach($current_form_data as $key => $value)
|
162 |
+
{
|
163 |
+
$no_prefix_key=str_replace('wt_iew_', '', $key);
|
164 |
+
$current_form_data[$key]=Wt_Iew_Sh::sanitize_data($value, $no_prefix_key, $validation_rule);
|
165 |
+
}
|
166 |
+
}else
|
167 |
+
{
|
168 |
+
$validation_rule=(isset($module_obj->validation_rule[$step]) ? $module_obj->validation_rule[$step] : array());
|
169 |
+
foreach($current_form_data as $key => $value)
|
170 |
+
{
|
171 |
+
$current_form_data[$key]=Wt_Iew_Sh::sanitize_data($value, $key, $validation_rule);
|
172 |
+
}
|
173 |
+
}
|
174 |
+
$out[$current_form_data_key]=$current_form_data;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
$form_data=$current_form_data=$mapping_form_data=$meta_step_form_data=$module_obj=null;
|
178 |
+
unset($form_data, $current_form_data, $mapping_form_data, $meta_step_form_data, $module_obj);
|
179 |
+
return $out;
|
180 |
+
}
|
181 |
+
public static function debug_panel($module_base)
|
182 |
+
{
|
183 |
+
if($module_base=='import' || $module_base=='export')
|
184 |
+
{
|
185 |
+
$debug_panel_btns=array(
|
186 |
+
'refresh_step'=>array(
|
187 |
+
'title'=>__('Refresh the step'),
|
188 |
+
'icon'=>'dashicons dashicons-update',
|
189 |
+
'onclick'=>'wt_iew_basic_'.$module_base.'.refresh_step();',
|
190 |
+
),
|
191 |
+
'console_form_data'=>array(
|
192 |
+
'title'=>__('Console form data'),
|
193 |
+
'icon'=>'dashicons dashicons-code-standards',
|
194 |
+
'onclick'=>'wt_iew_basic_'.$module_base.'.console_formdata();',
|
195 |
+
),
|
196 |
+
);
|
197 |
+
}
|
198 |
+
|
199 |
+
$debug_panel_btns=apply_filters('wt_iew_debug_panel_buttons_basic', $debug_panel_btns, $module_base);
|
200 |
+
if(defined('WT_IEW_DEBUG_BASIC') && WT_IEW_DEBUG_BASIC && is_array($debug_panel_btns) && count($debug_panel_btns)>0)
|
201 |
+
{
|
202 |
+
?>
|
203 |
+
<div class="wt_iew_debug_panel" title="<?php _e('For debugging process');?>">
|
204 |
+
<div class="wt_iew_debug_panel_hd"><?php _e('Debug panel');?></div>
|
205 |
+
<div class="wt_iew_debug_panel_con">
|
206 |
+
<?php
|
207 |
+
foreach ($debug_panel_btns as $btn)
|
208 |
+
{
|
209 |
+
?>
|
210 |
+
<a onclick="<?php echo $btn['onclick'];?>" title="<?php echo $btn['title'];?>">
|
211 |
+
<span class="<?php echo $btn['icon'];?>"></span>
|
212 |
+
</a>
|
213 |
+
<?php
|
214 |
+
}
|
215 |
+
?>
|
216 |
+
</div>
|
217 |
+
</div>
|
218 |
+
<?php
|
219 |
+
}
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
}
|
{includes → helpers}/class-wt-security-helper.php
RENAMED
@@ -7,10 +7,10 @@
|
|
7 |
* @author WebToffee <info@webtoffee.com>
|
8 |
*/
|
9 |
|
10 |
-
if(!class_exists('
|
11 |
{
|
12 |
|
13 |
-
class
|
14 |
{
|
15 |
|
16 |
/**
|
@@ -69,11 +69,26 @@ if(!class_exists('Wt_WUWCIEP_Security_helper'))
|
|
69 |
case 'int_arr':
|
70 |
$val = self::sanitize_arr($val, 'int');
|
71 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
case 'float':
|
73 |
$val = floatval($val);
|
74 |
break;
|
75 |
case 'post_content':
|
76 |
$val = wp_kses_post($val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
break;
|
78 |
default:
|
79 |
$val = sanitize_text_field($val);
|
@@ -129,11 +144,7 @@ if(!class_exists('Wt_WUWCIEP_Security_helper'))
|
|
129 |
|
130 |
if($er === true) //no error then proceed
|
131 |
{
|
132 |
-
|
133 |
-
$nonce = (is_array($nonce) ? $nonce[0] : $nonce); //in some cases multiple nonces are declared
|
134 |
-
$nonce_id = ($nonce_id == "" ? $plugin_id : $nonce_id); //if nonce id not provided then uses plugin id as nonce id
|
135 |
-
|
136 |
-
if(!(wp_verify_nonce($nonce, $nonce_id))) //verifying nonce
|
137 |
{
|
138 |
$er = false;
|
139 |
}else
|
@@ -147,6 +158,28 @@ if(!class_exists('Wt_WUWCIEP_Security_helper'))
|
|
147 |
return $er;
|
148 |
}
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
|
151 |
/**
|
152 |
* Checks if user role has access
|
@@ -157,7 +190,7 @@ if(!class_exists('Wt_WUWCIEP_Security_helper'))
|
|
157 |
public static function check_role_access($plugin_id)
|
158 |
{
|
159 |
$roles = array('manage_options');
|
160 |
-
$roles = apply_filters('wt_'.$plugin_id.'
|
161 |
$roles = (!is_array($roles) ? array() : $roles);
|
162 |
$is_allowed = false;
|
163 |
|
7 |
* @author WebToffee <info@webtoffee.com>
|
8 |
*/
|
9 |
|
10 |
+
if(!class_exists('Wt_Iew_Sh'))
|
11 |
{
|
12 |
|
13 |
+
class Wt_Iew_Sh
|
14 |
{
|
15 |
|
16 |
/**
|
69 |
case 'int_arr':
|
70 |
$val = self::sanitize_arr($val, 'int');
|
71 |
break;
|
72 |
+
case 'absint':
|
73 |
+
$val = absint($val);
|
74 |
+
break;
|
75 |
+
case 'absint_arr':
|
76 |
+
$val = self::sanitize_arr($val, 'absint');
|
77 |
+
break;
|
78 |
case 'float':
|
79 |
$val = floatval($val);
|
80 |
break;
|
81 |
case 'post_content':
|
82 |
$val = wp_kses_post($val);
|
83 |
+
break;
|
84 |
+
case 'hex':
|
85 |
+
$val = sanitize_hex_color($val);
|
86 |
+
break;
|
87 |
+
case 'skip': /* skip the validation */
|
88 |
+
$val = $val;
|
89 |
+
break;
|
90 |
+
case 'file_name':
|
91 |
+
$val = sanitize_file_name($val);
|
92 |
break;
|
93 |
default:
|
94 |
$val = sanitize_text_field($val);
|
144 |
|
145 |
if($er === true) //no error then proceed
|
146 |
{
|
147 |
+
if(!(self::verify_nonce($plugin_id, $nonce_id))) //verifying nonce
|
|
|
|
|
|
|
|
|
148 |
{
|
149 |
$er = false;
|
150 |
}else
|
158 |
return $er;
|
159 |
}
|
160 |
|
161 |
+
/**
|
162 |
+
* Verifying nonce
|
163 |
+
*
|
164 |
+
* @param string $plugin_id unique plugin id. Note: This id is used as an identifier in filter name so please use characters allowed in filters
|
165 |
+
* @param string $nonce_id Nonce id. If not specified then uses plugin id
|
166 |
+
* @return boolean if user allowed or not
|
167 |
+
*/
|
168 |
+
public static function verify_nonce($plugin_id, $nonce_id = '')
|
169 |
+
{
|
170 |
+
$nonce = (isset($_REQUEST['_wpnonce']) ? sanitize_text_field($_REQUEST['_wpnonce']) : '');
|
171 |
+
$nonce = (is_array($nonce) ? $nonce[0] : $nonce); //in some cases multiple nonces are declared
|
172 |
+
$nonce_id = ($nonce_id == "" ? $plugin_id : $nonce_id); //if nonce id not provided then uses plugin id as nonce id
|
173 |
+
|
174 |
+
if(!(wp_verify_nonce($nonce, $nonce_id))) //verifying nonce
|
175 |
+
{
|
176 |
+
return false;
|
177 |
+
}else
|
178 |
+
{
|
179 |
+
return true;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
|
184 |
/**
|
185 |
* Checks if user role has access
|
190 |
public static function check_role_access($plugin_id)
|
191 |
{
|
192 |
$roles = array('manage_options');
|
193 |
+
$roles = apply_filters('wt_'.$plugin_id.'_alter_role_access_basic', $roles); //dynamic filter based on plugin id to alter roles
|
194 |
$roles = (!is_array($roles) ? array() : $roles);
|
195 |
$is_allowed = false;
|
196 |
|
images/calendar.png
DELETED
Binary file
|
images/csv.png
DELETED
Binary file
|
images/documentation.png
DELETED
Binary file
|
images/setup.png
DELETED
Binary file
|
images/storefrog.png
DELETED
Binary file
|
images/support.png
DELETED
Binary file
|
images/video.png
DELETED
Binary file
|
images/wf-ajax-loader.gif
DELETED
Binary file
|
images/wf-failed.png
DELETED
Binary file
|
images/wf-import.png
DELETED
Binary file
|
images/wf-notice.png
DELETED
Binary file
|
images/wf-success.png
DELETED
Binary file
|
includes/class-wf-customerimpexpcsv-admin-screen.php
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
|
6 |
-
class WF_CustomerImpExpCsv_Admin_Screen {
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Constructor
|
10 |
-
*/
|
11 |
-
public function __construct() {
|
12 |
-
add_action('admin_menu', array($this, 'admin_menu'));
|
13 |
-
add_action('admin_print_styles', array($this, 'admin_scripts'));
|
14 |
-
add_action('admin_notices', array($this, 'admin_notices'));
|
15 |
-
}
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Notices in admin
|
19 |
-
*/
|
20 |
-
public function admin_notices() {
|
21 |
-
if (!function_exists('mb_detect_encoding')) {
|
22 |
-
echo '<div class="error"><p>' . __('User/Customer CSV Import Export requires the function <code>mb_detect_encoding</code> to import and export CSV files. Please ask your hosting provider to enable this function.', 'users-customers-import-export-for-wp-woocommerce') . '</p></div>';
|
23 |
-
}
|
24 |
-
}
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Admin Menu
|
28 |
-
*/
|
29 |
-
public function admin_menu() {
|
30 |
-
$page = add_users_page( __( 'User Import Export', 'users-customers-import-export-for-wp-woocommerce' ), __( 'User Import Export', 'users-customers-import-export-for-wp-woocommerce' ), 'list_users', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
|
31 |
-
$page1 = add_submenu_page( 'woocommerce', __( 'Customer Import Export', 'users-customers-import-export-for-wp-woocommerce' ), __( 'Customer Import Export', 'users-customers-import-export-for-wp-woocommerce' ), 'manage_woocommerce', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Admin Scripts
|
36 |
-
*/
|
37 |
-
public function admin_scripts() {
|
38 |
-
$screen = get_current_screen();
|
39 |
-
$allowed_creen_id = array('users_page_hf_wordpress_customer_im_ex');
|
40 |
-
if (in_array($screen->id, $allowed_creen_id) || (isset($_GET['import']) && $_GET['import'] == 'wordpress_hf_user_csv')) {
|
41 |
-
global $wp_scripts;
|
42 |
-
if (function_exists('WC')) {
|
43 |
-
wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css');
|
44 |
-
wp_enqueue_script('wc-enhanced-select');
|
45 |
-
} else {
|
46 |
-
wp_enqueue_style('wt-user-csv-importer-select2-css', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/select2.css', basename(__FILE__)), '', '4.0.6', '');
|
47 |
-
wp_enqueue_script('wt-user-csv-importer-select2-js', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/select2.js', basename(__FILE__)), array(), '4.0.6', true);
|
48 |
-
}
|
49 |
-
wp_enqueue_style('woocommerce-user-csv-importer', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/wf-style.css', basename(__FILE__)), '', '1.0.0', 'screen');
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Admin Screen output
|
55 |
-
*/
|
56 |
-
public function output() {
|
57 |
-
$tab = 'export';
|
58 |
-
|
59 |
-
if (!empty($_GET['tab'])) {
|
60 |
-
if ($_GET['tab'] == 'import') {
|
61 |
-
$tab = 'import';
|
62 |
-
} else if ($_GET['tab'] == 'help') {
|
63 |
-
$tab = 'help';
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
include( 'views/html-wf-admin-screen.php' );
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Admin page for help
|
72 |
-
*/
|
73 |
-
public function admin_help_page() {
|
74 |
-
include('views/html-wf-help-guide.php');
|
75 |
-
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Admin Page for exporting
|
79 |
-
*/
|
80 |
-
public function admin_export_page() {
|
81 |
-
$post_columns = include( 'exporter/data/data-wf-post-columns.php' );
|
82 |
-
include( 'views/export/html-wf-export-customers.php' );
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
}
|
87 |
-
|
88 |
-
new WF_CustomerImpExpCsv_Admin_Screen();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-wf-customerimpexpcsv-ajax-handler.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
|
6 |
-
class WF_CustomerImpExpCsv_AJAX_Handler {
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Constructor
|
10 |
-
*/
|
11 |
-
public function __construct() {
|
12 |
-
add_action( 'wp_ajax_user_csv_import_request', array( $this, 'csv_customer_import_request' ) );
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Ajax event for importing a CSV
|
17 |
-
*/
|
18 |
-
public function csv_customer_import_request() {
|
19 |
-
define( 'WP_LOAD_IMPORTERS', true );
|
20 |
-
WF_CustomerImpExpCsv_Importer::customer_importer();
|
21 |
-
}
|
22 |
-
|
23 |
-
}
|
24 |
-
|
25 |
-
new WF_CustomerImpExpCsv_AJAX_Handler();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-wt-import-export-for-woo-activator.php
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fired during plugin activation
|
4 |
+
*
|
5 |
+
* @link https://www.webtoffee.com/
|
6 |
+
* @since 1.0.0
|
7 |
+
*
|
8 |
+
* @package Wt_Import_Export_For_Woo
|
9 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Fired during plugin activation.
|
14 |
+
*
|
15 |
+
* This class defines all code necessary to run during the plugin's activation.
|
16 |
+
*
|
17 |
+
* @since 1.0.0
|
18 |
+
* @package Wt_Import_Export_For_Woo
|
19 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
20 |
+
* @author Webtoffee <info@webtoffee.com>
|
21 |
+
*/
|
22 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Activator_User')){
|
23 |
+
class Wt_Import_Export_For_Woo_Basic_Activator_User {
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Short Description. (use period)
|
27 |
+
*
|
28 |
+
* Long Description.
|
29 |
+
*
|
30 |
+
* @since 1.0.0
|
31 |
+
*/
|
32 |
+
public static function activate()
|
33 |
+
{
|
34 |
+
global $wpdb;
|
35 |
+
delete_option('wt_u_iew_is_active'); /* remove if exists */
|
36 |
+
|
37 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
38 |
+
if(is_multisite())
|
39 |
+
{
|
40 |
+
// Get all blogs in the network and activate plugin on each one
|
41 |
+
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
|
42 |
+
foreach($blog_ids as $blog_id )
|
43 |
+
{
|
44 |
+
switch_to_blog( $blog_id );
|
45 |
+
self::install_tables();
|
46 |
+
restore_current_blog();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
else
|
50 |
+
{
|
51 |
+
self::install_tables();
|
52 |
+
}
|
53 |
+
|
54 |
+
add_option('wt_u_iew_is_active', 1);
|
55 |
+
}
|
56 |
+
|
57 |
+
public static function install_tables()
|
58 |
+
{
|
59 |
+
global $wpdb;
|
60 |
+
$charset_collate = $wpdb->get_charset_collate();
|
61 |
+
//install necessary tables
|
62 |
+
|
63 |
+
//creating table for saving template data================
|
64 |
+
$search_query = "SHOW TABLES LIKE %s";
|
65 |
+
$tb='wt_iew_mapping_template';
|
66 |
+
$like = '%' . $wpdb->prefix.$tb.'%';
|
67 |
+
$table_name = $wpdb->prefix.$tb;
|
68 |
+
if(!$wpdb->get_results($wpdb->prepare($search_query, $like), ARRAY_N))
|
69 |
+
{
|
70 |
+
$sql_settings = "CREATE TABLE IF NOT EXISTS `$table_name` (
|
71 |
+
`id` INT NOT NULL AUTO_INCREMENT,
|
72 |
+
`template_type` VARCHAR(255) NOT NULL,
|
73 |
+
`item_type` VARCHAR(255) NOT NULL,
|
74 |
+
`name` VARCHAR(255) NOT NULL,
|
75 |
+
`data` LONGTEXT NOT NULL,
|
76 |
+
PRIMARY KEY (`id`)
|
77 |
+
) DEFAULT CHARSET=utf8;";
|
78 |
+
dbDelta($sql_settings);
|
79 |
+
}
|
80 |
+
//creating table for saving template data================
|
81 |
+
|
82 |
+
//creating table for saving export/import history================
|
83 |
+
$search_query = "SHOW TABLES LIKE %s";
|
84 |
+
$tb='wt_iew_action_history';
|
85 |
+
$like = '%'.$wpdb->prefix.$tb.'%';
|
86 |
+
$table_name = $wpdb->prefix.$tb;
|
87 |
+
if(!$wpdb->get_results($wpdb->prepare($search_query, $like), ARRAY_N))
|
88 |
+
{
|
89 |
+
$sql_settings = "CREATE TABLE IF NOT EXISTS `$table_name` (
|
90 |
+
`id` INT NOT NULL AUTO_INCREMENT,
|
91 |
+
`template_type` VARCHAR(255) NOT NULL,
|
92 |
+
`item_type` VARCHAR(255) NOT NULL,
|
93 |
+
`file_name` VARCHAR(255) NOT NULL,
|
94 |
+
`created_at` INT NOT NULL DEFAULT '0',
|
95 |
+
`status` INT NOT NULL DEFAULT '0',
|
96 |
+
`status_text` VARCHAR(255) NOT NULL,
|
97 |
+
`offset` INT NOT NULL DEFAULT '0',
|
98 |
+
`total` INT NOT NULL DEFAULT '0',
|
99 |
+
`data` LONGTEXT NOT NULL,
|
100 |
+
PRIMARY KEY (`id`)
|
101 |
+
) DEFAULT CHARSET=utf8;";
|
102 |
+
dbDelta($sql_settings);
|
103 |
+
}
|
104 |
+
//creating table for saving export/import history================
|
105 |
+
|
106 |
+
//creating table for saving ftp details================
|
107 |
+
$search_query = "SHOW TABLES LIKE %s";
|
108 |
+
$tb='wt_iew_ftp';
|
109 |
+
$like = '%'.$wpdb->prefix.$tb.'%';
|
110 |
+
$table_name = $wpdb->prefix.$tb;
|
111 |
+
if(!$wpdb->get_results($wpdb->prepare($search_query, $like), ARRAY_N))
|
112 |
+
{
|
113 |
+
$sql_settings = "CREATE TABLE IF NOT EXISTS `$table_name` (
|
114 |
+
`id` INT NOT NULL AUTO_INCREMENT,
|
115 |
+
`name` VARCHAR(255) NOT NULL,
|
116 |
+
`server` VARCHAR(255) NOT NULL,
|
117 |
+
`user_name` VARCHAR(255) NOT NULL,
|
118 |
+
`password` VARCHAR(255) NOT NULL,
|
119 |
+
`port` INT NOT NULL DEFAULT '21',
|
120 |
+
`ftps` INT NOT NULL DEFAULT '0',
|
121 |
+
`is_sftp` INT NOT NULL DEFAULT '0',
|
122 |
+
`passive_mode` INT NOT NULL DEFAULT '0',
|
123 |
+
`export_path` VARCHAR(255) NOT NULL,
|
124 |
+
`import_path` VARCHAR(255) NOT NULL,
|
125 |
+
PRIMARY KEY (`id`)
|
126 |
+
) DEFAULT CHARSET=utf8;";
|
127 |
+
dbDelta($sql_settings);
|
128 |
+
}
|
129 |
+
//creating table for saving ftp details================
|
130 |
+
|
131 |
+
|
132 |
+
//creating table for saving cron data================
|
133 |
+
$search_query = "SHOW TABLES LIKE %s";
|
134 |
+
$tb='wt_iew_cron';
|
135 |
+
$like = '%'.$wpdb->prefix.$tb.'%';
|
136 |
+
$table_name = $wpdb->prefix.$tb;
|
137 |
+
if(!$wpdb->get_results($wpdb->prepare($search_query, $like), ARRAY_N))
|
138 |
+
{
|
139 |
+
$sql_settings = "CREATE TABLE IF NOT EXISTS `$table_name` (
|
140 |
+
`id` INT NOT NULL AUTO_INCREMENT,
|
141 |
+
`status` INT NOT NULL DEFAULT '0',
|
142 |
+
`old_status` INT NOT NULL DEFAULT '0',
|
143 |
+
`action_type` VARCHAR(255) NOT NULL,
|
144 |
+
`schedule_type` VARCHAR(50) NOT NULL,
|
145 |
+
`item_type` VARCHAR(255) NOT NULL,
|
146 |
+
`data` LONGTEXT NOT NULL,
|
147 |
+
`start_time` INT NOT NULL,
|
148 |
+
`cron_data` TEXT NOT NULL,
|
149 |
+
`last_run` INT NOT NULL,
|
150 |
+
`next_offset` INT NOT NULL DEFAULT '0',
|
151 |
+
`history_id_list` TEXT NOT NULL,
|
152 |
+
`history_id` INT NOT NULL,
|
153 |
+
PRIMARY KEY (`id`)
|
154 |
+
) DEFAULT CHARSET=utf8;";
|
155 |
+
dbDelta($sql_settings);
|
156 |
+
}
|
157 |
+
//creating table for saving cron data================
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
includes/class-wt-import-export-for-woo-deactivator.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Fired during plugin deactivation
|
5 |
+
*
|
6 |
+
* @link https://www.webtoffee.com/
|
7 |
+
* @since 1.0.0
|
8 |
+
*
|
9 |
+
* @package Wt_Import_Export_For_Woo
|
10 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
11 |
+
*/
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Fired during plugin deactivation.
|
15 |
+
*
|
16 |
+
* This class defines all code necessary to run during the plugin's deactivation.
|
17 |
+
*
|
18 |
+
* @since 1.0.0
|
19 |
+
* @package Wt_Import_Export_For_Woo
|
20 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
21 |
+
* @author Webtoffee <info@webtoffee.com>
|
22 |
+
*/
|
23 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic_Deactivator_User')){
|
24 |
+
class Wt_Import_Export_For_Woo_Basic_Deactivator_User {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Short Description. (use period)
|
28 |
+
*
|
29 |
+
* Long Description.
|
30 |
+
*
|
31 |
+
* @since 1.0.0
|
32 |
+
*/
|
33 |
+
public static function deactivate() {
|
34 |
+
delete_option('wt_u_iew_is_active');
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
38 |
+
}
|
includes/class-wt-import-export-for-woo-i18n.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Define the internationalization functionality
|
5 |
+
*
|
6 |
+
* Loads and defines the internationalization files for this plugin
|
7 |
+
* so that it is ready for translation.
|
8 |
+
*
|
9 |
+
* @link https://www.webtoffee.com/
|
10 |
+
* @since 1.0.0
|
11 |
+
*
|
12 |
+
* @package Wt_Import_Export_For_Woo
|
13 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
14 |
+
*/
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Define the internationalization functionality.
|
18 |
+
*
|
19 |
+
* Loads and defines the internationalization files for this plugin
|
20 |
+
* so that it is ready for translation.
|
21 |
+
*
|
22 |
+
* @since 1.0.0
|
23 |
+
* @package Wt_Import_Export_For_Woo
|
24 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
25 |
+
* @author Webtoffee <info@webtoffee.com>
|
26 |
+
*/
|
27 |
+
if(!class_exists('Wt_Import_Export_For_Woo_i18n_Basic')){
|
28 |
+
class Wt_Import_Export_For_Woo_i18n_Basic {
|
29 |
+
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Load the plugin text domain for translation.
|
33 |
+
*
|
34 |
+
* @since 1.0.0
|
35 |
+
*/
|
36 |
+
public function load_plugin_textdomain() {
|
37 |
+
|
38 |
+
load_plugin_textdomain(
|
39 |
+
'wt-import-export-for-woo',
|
40 |
+
false,
|
41 |
+
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
|
42 |
+
);
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
}
|
49 |
+
}
|
includes/class-wt-import-export-for-woo-loader.php
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Register all actions and filters for the plugin
|
5 |
+
*
|
6 |
+
* @link https://www.webtoffee.com/
|
7 |
+
* @since 1.0.0
|
8 |
+
*
|
9 |
+
* @package Wt_Import_Export_For_Woo
|
10 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
11 |
+
*/
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Register all actions and filters for the plugin.
|
15 |
+
*
|
16 |
+
* Maintain a list of all hooks that are registered throughout
|
17 |
+
* the plugin, and register them with the WordPress API. Call the
|
18 |
+
* run function to execute the list of actions and filters.
|
19 |
+
*
|
20 |
+
* @package Wt_Import_Export_For_Woo
|
21 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
22 |
+
* @author Webtoffee <info@webtoffee.com>
|
23 |
+
*/
|
24 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Loader_Basic')){
|
25 |
+
class Wt_Import_Export_For_Woo_Loader_Basic {
|
26 |
+
|
27 |
+
/**
|
28 |
+
* The array of actions registered with WordPress.
|
29 |
+
*
|
30 |
+
* @since 1.0.0
|
31 |
+
* @access protected
|
32 |
+
* @var array $actions The actions registered with WordPress to fire when the plugin loads.
|
33 |
+
*/
|
34 |
+
protected $actions;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* The array of filters registered with WordPress.
|
38 |
+
*
|
39 |
+
* @since 1.0.0
|
40 |
+
* @access protected
|
41 |
+
* @var array $filters The filters registered with WordPress to fire when the plugin loads.
|
42 |
+
*/
|
43 |
+
protected $filters;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Initialize the collections used to maintain the actions and filters.
|
47 |
+
*
|
48 |
+
* @since 1.0.0
|
49 |
+
*/
|
50 |
+
public function __construct() {
|
51 |
+
|
52 |
+
$this->actions = array();
|
53 |
+
$this->filters = array();
|
54 |
+
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Add a new action to the collection to be registered with WordPress.
|
59 |
+
*
|
60 |
+
* @since 1.0.0
|
61 |
+
* @param string $hook The name of the WordPress action that is being registered.
|
62 |
+
* @param object $component A reference to the instance of the object on which the action is defined.
|
63 |
+
* @param string $callback The name of the function definition on the $component.
|
64 |
+
* @param int $priority Optional. The priority at which the function should be fired. Default is 10.
|
65 |
+
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
|
66 |
+
*/
|
67 |
+
public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
|
68 |
+
$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Add a new filter to the collection to be registered with WordPress.
|
73 |
+
*
|
74 |
+
* @since 1.0.0
|
75 |
+
* @param string $hook The name of the WordPress filter that is being registered.
|
76 |
+
* @param object $component A reference to the instance of the object on which the filter is defined.
|
77 |
+
* @param string $callback The name of the function definition on the $component.
|
78 |
+
* @param int $priority Optional. The priority at which the function should be fired. Default is 10.
|
79 |
+
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
|
80 |
+
*/
|
81 |
+
public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
|
82 |
+
$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* A utility function that is used to register the actions and hooks into a single
|
87 |
+
* collection.
|
88 |
+
*
|
89 |
+
* @since 1.0.0
|
90 |
+
* @access private
|
91 |
+
* @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
|
92 |
+
* @param string $hook The name of the WordPress filter that is being registered.
|
93 |
+
* @param object $component A reference to the instance of the object on which the filter is defined.
|
94 |
+
* @param string $callback The name of the function definition on the $component.
|
95 |
+
* @param int $priority The priority at which the function should be fired.
|
96 |
+
* @param int $accepted_args The number of arguments that should be passed to the $callback.
|
97 |
+
* @return array The collection of actions and filters registered with WordPress.
|
98 |
+
*/
|
99 |
+
private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
|
100 |
+
|
101 |
+
$hooks[] = array(
|
102 |
+
'hook' => $hook,
|
103 |
+
'component' => $component,
|
104 |
+
'callback' => $callback,
|
105 |
+
'priority' => $priority,
|
106 |
+
'accepted_args' => $accepted_args
|
107 |
+
);
|
108 |
+
|
109 |
+
return $hooks;
|
110 |
+
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Register the filters and actions with WordPress.
|
115 |
+
*
|
116 |
+
* @since 1.0.0
|
117 |
+
*/
|
118 |
+
public function run() {
|
119 |
+
|
120 |
+
foreach ( $this->filters as $hook ) {
|
121 |
+
add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
|
122 |
+
}
|
123 |
+
|
124 |
+
foreach ( $this->actions as $hook ) {
|
125 |
+
add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
|
126 |
+
}
|
127 |
+
|
128 |
+
}
|
129 |
+
|
130 |
+
}
|
131 |
+
}
|
includes/class-wt-import-export-for-woo-remoteadapter.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if(!class_exists('Wt_Import_Export_For_Woo_RemoteAdapter_Basic')){
|
3 |
+
abstract class Wt_Import_Export_For_Woo_RemoteAdapter_Basic
|
4 |
+
{
|
5 |
+
public $id='';
|
6 |
+
public $title='';
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
|
10 |
+
}
|
11 |
+
abstract public function upload($local_file, $remote_file_name, $form_data, $out);
|
12 |
+
abstract public function delete();
|
13 |
+
}
|
14 |
+
}
|
includes/class-wt-import-export-for-woo.php
ADDED
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The file that defines the core plugin class
|
4 |
+
*
|
5 |
+
* A class definition that includes attributes and functions used across both the
|
6 |
+
* public-facing side of the site and the admin area.
|
7 |
+
*
|
8 |
+
* @link https://www.webtoffee.com/
|
9 |
+
* @since 1.0.0
|
10 |
+
*
|
11 |
+
* @package Wt_Import_Export_For_Woo
|
12 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
13 |
+
*/
|
14 |
+
|
15 |
+
/**
|
16 |
+
* The core plugin class.
|
17 |
+
*
|
18 |
+
* This is used to define internationalization, admin-specific hooks, and
|
19 |
+
* public-facing site hooks.
|
20 |
+
*
|
21 |
+
* Also maintains the unique identifier of this plugin as well as the current
|
22 |
+
* version of the plugin.
|
23 |
+
*
|
24 |
+
* @since 1.0.0
|
25 |
+
* @package Wt_Import_Export_For_Woo
|
26 |
+
* @subpackage Wt_Import_Export_For_Woo/includes
|
27 |
+
* @author Webtoffee <info@webtoffee.com>
|
28 |
+
*/
|
29 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Basic')){
|
30 |
+
class Wt_Import_Export_For_Woo_Basic {
|
31 |
+
|
32 |
+
/**
|
33 |
+
* The loader that's responsible for maintaining and registering all hooks that power
|
34 |
+
* the plugin.
|
35 |
+
*
|
36 |
+
* @since 1.0.0
|
37 |
+
* @access protected
|
38 |
+
* @var Wt_Import_Export_For_Woo_Loader $loader Maintains and registers all hooks for the plugin.
|
39 |
+
*/
|
40 |
+
protected $loader;
|
41 |
+
|
42 |
+
/**
|
43 |
+
* The unique identifier of this plugin.
|
44 |
+
*
|
45 |
+
* @since 1.0.0
|
46 |
+
* @access protected
|
47 |
+
* @var string $plugin_name The string used to uniquely identify this plugin.
|
48 |
+
*/
|
49 |
+
protected $plugin_name;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* The current version of the plugin.
|
53 |
+
*
|
54 |
+
* @since 1.0.0
|
55 |
+
* @access protected
|
56 |
+
* @var string $version The current version of the plugin.
|
57 |
+
*/
|
58 |
+
protected $version;
|
59 |
+
|
60 |
+
public static $loaded_modules=array();
|
61 |
+
|
62 |
+
public static $template_tb='wt_iew_mapping_template';
|
63 |
+
public static $history_tb='wt_iew_action_history';
|
64 |
+
public static $ftp_tb='wt_iew_ftp';
|
65 |
+
public static $cron_tb='wt_iew_cron';
|
66 |
+
|
67 |
+
public $plugin_admin;
|
68 |
+
public $plugin_public;
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Define the core functionality of the plugin.
|
72 |
+
*
|
73 |
+
* Set the plugin name and the plugin version that can be used throughout the plugin.
|
74 |
+
* Load the dependencies, define the locale, and set the hooks for the admin area and
|
75 |
+
* the public-facing side of the site.
|
76 |
+
*
|
77 |
+
* @since 1.0.0
|
78 |
+
*/
|
79 |
+
public function __construct() {
|
80 |
+
if ( defined( 'WT_U_IEW_VERSION' ) ) {
|
81 |
+
$this->version = WT_U_IEW_VERSION;
|
82 |
+
} else {
|
83 |
+
$this->version = '2.0.0';
|
84 |
+
}
|
85 |
+
$this->plugin_name = 'wt-import-export-for-woo-basic';
|
86 |
+
|
87 |
+
$this->load_dependencies();
|
88 |
+
$this->set_locale();
|
89 |
+
$this->define_admin_hooks();
|
90 |
+
$this->define_public_hooks();
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Load the required dependencies for this plugin.
|
96 |
+
*
|
97 |
+
* Include the following files that make up the plugin:
|
98 |
+
*
|
99 |
+
* - Wt_Import_Export_For_Woo_Loader. Orchestrates the hooks of the plugin.
|
100 |
+
* - Wt_Import_Export_For_Woo_i18n. Defines internationalization functionality.
|
101 |
+
* - Wt_Import_Export_For_Woo_Admin. Defines all hooks for the admin area.
|
102 |
+
* - Wt_Import_Export_For_Woo_Public. Defines all hooks for the public side of the site.
|
103 |
+
*
|
104 |
+
* Create an instance of the loader which will be used to register the hooks
|
105 |
+
* with WordPress.
|
106 |
+
*
|
107 |
+
* @since 1.0.0
|
108 |
+
* @access private
|
109 |
+
*/
|
110 |
+
private function load_dependencies() {
|
111 |
+
|
112 |
+
/**
|
113 |
+
* The class responsible for orchestrating the actions and filters of the
|
114 |
+
* core plugin.
|
115 |
+
*/
|
116 |
+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wt-import-export-for-woo-loader.php';
|
117 |
+
|
118 |
+
/**
|
119 |
+
* The class responsible for defining internationalization functionality
|
120 |
+
* of the plugin.
|
121 |
+
*/
|
122 |
+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wt-import-export-for-woo-i18n.php';
|
123 |
+
|
124 |
+
/**
|
125 |
+
* The class responsible for defining remote file functionality
|
126 |
+
* of the plugin.
|
127 |
+
*/
|
128 |
+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wt-import-export-for-woo-remoteadapter.php';
|
129 |
+
|
130 |
+
/**
|
131 |
+
* The class responsible for defining all actions that occur in the admin area.
|
132 |
+
*/
|
133 |
+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wt-import-export-for-woo-admin.php';
|
134 |
+
|
135 |
+
/**
|
136 |
+
* The class responsible for defining all actions that occur in the public-facing
|
137 |
+
* side of the site.
|
138 |
+
*/
|
139 |
+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wt-import-export-for-woo-public.php';
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Class includes input sanitization and role checking
|
143 |
+
*/
|
144 |
+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'helpers/class-wt-security-helper.php';
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Class includes common helper functions
|
148 |
+
*/
|
149 |
+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'helpers/class-wt-common-helper.php';
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Class includes helper functions for import and export modules
|
153 |
+
*/
|
154 |
+
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'helpers/class-wt-import-export-helper.php';
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Class includes log writing functions
|
158 |
+
*/
|
159 |
+
require_once WT_U_IEW_PLUGIN_PATH . 'admin/classes/class-log.php';
|
160 |
+
require_once WT_U_IEW_PLUGIN_PATH . 'admin/classes/class-logwriter.php';
|
161 |
+
|
162 |
+
|
163 |
+
$this->loader = new Wt_Import_Export_For_Woo_Loader_Basic();
|
164 |
+
$this->plugin_admin = new Wt_Import_Export_For_Woo_Admin_Basic( $this->get_plugin_name(), $this->get_version() );
|
165 |
+
$this->plugin_public = new Wt_Import_Export_For_Woo_Public_Basic( $this->get_plugin_name(), $this->get_version() );
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Define the locale for this plugin for internationalization.
|
170 |
+
*
|
171 |
+
* Uses the Wt_Import_Export_For_Woo_i18n class in order to set the domain and to register the hook
|
172 |
+
* with WordPress.
|
173 |
+
*
|
174 |
+
* @since 1.0.0
|
175 |
+
* @access private
|
176 |
+
*/
|
177 |
+
private function set_locale() {
|
178 |
+
|
179 |
+
$plugin_i18n = new Wt_Import_Export_For_Woo_i18n_Basic();
|
180 |
+
|
181 |
+
$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
|
182 |
+
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Register all of the hooks related to the admin area functionality
|
187 |
+
* of the plugin.
|
188 |
+
*
|
189 |
+
* @since 1.0.0
|
190 |
+
* @access private
|
191 |
+
*/
|
192 |
+
private function define_admin_hooks()
|
193 |
+
{
|
194 |
+
//ajax hook for saving settings, Includes plugin main settings and settings from module
|
195 |
+
$this->loader->add_action('wp_ajax_wt_iew_save_settings_basic',$this->plugin_admin,'save_settings');
|
196 |
+
|
197 |
+
/* Loading admin modules */
|
198 |
+
$this->plugin_admin->admin_modules();
|
199 |
+
|
200 |
+
/* Plugin page links */
|
201 |
+
// $this->loader->add_filter('plugin_action_links_'.WT_U_IEW_PLUGIN_BASENAME, $this->plugin_admin, 'plugin_action_links');
|
202 |
+
|
203 |
+
/* Admin menus */
|
204 |
+
$this->loader->add_action('admin_menu',$this->plugin_admin, 'admin_menu',11);
|
205 |
+
|
206 |
+
/* Enqueue CSS and JS */
|
207 |
+
$this->loader->add_action( 'admin_enqueue_scripts', $this->plugin_admin, 'enqueue_styles' );
|
208 |
+
$this->loader->add_action( 'admin_enqueue_scripts', $this->plugin_admin, 'enqueue_scripts' );
|
209 |
+
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* Register all of the hooks related to the public-facing functionality
|
214 |
+
* of the plugin.
|
215 |
+
*
|
216 |
+
* @since 1.0.0
|
217 |
+
* @access private
|
218 |
+
*/
|
219 |
+
private function define_public_hooks()
|
220 |
+
{
|
221 |
+
|
222 |
+
$this->loader->add_action( 'wp_enqueue_scripts', $this->plugin_public, 'enqueue_styles' );
|
223 |
+
$this->loader->add_action( 'wp_enqueue_scripts', $this->plugin_public, 'enqueue_scripts' );
|
224 |
+
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Run the loader to execute all of the hooks with WordPress.
|
229 |
+
*
|
230 |
+
* @since 1.0.0
|
231 |
+
*/
|
232 |
+
public function run() {
|
233 |
+
$this->loader->run();
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* The name of the plugin used to uniquely identify it within the context of
|
238 |
+
* WordPress and to define internationalization functionality.
|
239 |
+
*
|
240 |
+
* @since 1.0.0
|
241 |
+
* @return string The name of the plugin.
|
242 |
+
*/
|
243 |
+
public function get_plugin_name() {
|
244 |
+
return $this->plugin_name;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* The reference to the class that orchestrates the hooks with the plugin.
|
249 |
+
*
|
250 |
+
* @since 1.0.0
|
251 |
+
* @return Wt_Import_Export_For_Woo_Loader Orchestrates the hooks of the plugin.
|
252 |
+
*/
|
253 |
+
public function get_loader() {
|
254 |
+
return $this->loader;
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Retrieve the version number of the plugin.
|
259 |
+
*
|
260 |
+
* @since 1.0.0
|
261 |
+
* @return string The version number of the plugin.
|
262 |
+
*/
|
263 |
+
public function get_version() {
|
264 |
+
return $this->version;
|
265 |
+
}
|
266 |
+
|
267 |
+
public static function get_module_id($module_base)
|
268 |
+
{
|
269 |
+
return WT_IEW_PLUGIN_ID_BASIC.'_'.$module_base;
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Some modules are not start by default. So need to initialize via code OR get object of already started modules
|
274 |
+
*
|
275 |
+
* @since 1.0.0
|
276 |
+
*/
|
277 |
+
public static function load_modules($module)
|
278 |
+
{
|
279 |
+
if(Wt_Import_Export_For_Woo_Admin_Basic::module_exists($module))
|
280 |
+
{
|
281 |
+
if(!isset(self::$loaded_modules[$module]))
|
282 |
+
{
|
283 |
+
$module_class='Wt_Import_Export_For_Woo_Basic_'.ucfirst($module);
|
284 |
+
self::$loaded_modules[$module]=new $module_class;
|
285 |
+
}
|
286 |
+
return self::$loaded_modules[$module];
|
287 |
+
}
|
288 |
+
else
|
289 |
+
{
|
290 |
+
return null;
|
291 |
+
}
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Generate tab head for settings page.
|
296 |
+
* @since 1.0.0
|
297 |
+
*/
|
298 |
+
public static function generate_settings_tabhead($title_arr, $type="plugin")
|
299 |
+
{
|
300 |
+
$out_arr=apply_filters("wt_iew_".$type."_settings_tabhead_basic",$title_arr);
|
301 |
+
foreach($out_arr as $k=>$v)
|
302 |
+
{
|
303 |
+
if(is_array($v))
|
304 |
+
{
|
305 |
+
$v=(isset($v[2]) ? $v[2] : '').$v[0].' '.(isset($v[1]) ? $v[1] : '');
|
306 |
+
}
|
307 |
+
?>
|
308 |
+
<a class="nav-tab" href="#<?php echo $k;?>"><?php echo $v; ?></a>
|
309 |
+
<?php
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Get remote file adapters. Eg: FTP, Gdrive, OneDrive
|
315 |
+
* @param string $action action to be executed, If the current adapter is not suitable for a specific action then skip it
|
316 |
+
* @param string $adapter optional specify an adapter name to retrive the specific one
|
317 |
+
* @return array|single array of remote adapters or single adapter if the adapter name specified
|
318 |
+
*/
|
319 |
+
public static function get_remote_adapters($action, $adapter='')
|
320 |
+
{
|
321 |
+
$adapters=array();
|
322 |
+
$adapters = apply_filters("wt_iew_remote_adapters_basic", $adapters, $action, $adapter);
|
323 |
+
if($adapter != "")
|
324 |
+
{
|
325 |
+
return (isset($adapters[ $adapter ]) ? $adapters[ $adapter ] : null);
|
326 |
+
}
|
327 |
+
return $adapters;
|
328 |
+
}
|
329 |
+
|
330 |
+
}
|
331 |
+
}
|
includes/class-wt-legecy-menu-moved.php
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (!defined('ABSPATH')) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
if (!class_exists('wt_legecy_menu_moved')) {
|
6 |
+
|
7 |
+
class wt_legecy_menu_moved {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* config options
|
11 |
+
*/
|
12 |
+
public $plugin = "";
|
13 |
+
public $prefix = "";
|
14 |
+
public $menu_title = "";
|
15 |
+
public $plugin_title = "";
|
16 |
+
public $banner_message = "";
|
17 |
+
public $old_menu = '';
|
18 |
+
public $sholud_show_legacy_menu = '';
|
19 |
+
public $old_menu_params = array();
|
20 |
+
|
21 |
+
public function __construct($plugin) {
|
22 |
+
$this->plugin = $plugin;
|
23 |
+
$this->sholud_show_legacy_menu = 'wt_' . $this->plugin . '_show_legecy_menu';
|
24 |
+
add_action('upgrader_process_complete', array($this, 'wt_upgrade_completed'), 10, 2);
|
25 |
+
if ($this->wt_should_display_legacy_menu()) {
|
26 |
+
add_action('admin_menu', array($this, 'wt_maybe_add_legecy_menu_redirect'));
|
27 |
+
if (Wt_Import_Export_For_Woo_Basic_Common_Helper::wt_is_screen_allowed()) {
|
28 |
+
$this->banner_css_class = 'wt_' . $this->plugin . '_show_legecy_menu';
|
29 |
+
add_action('admin_notices', array($this, 'show_banner'));
|
30 |
+
add_action('admin_print_footer_scripts', array($this, 'add_banner_scripts')); /* add banner scripts */
|
31 |
+
}
|
32 |
+
}
|
33 |
+
$this->ajax_action_name = $this->plugin . '_process_show_legecy_menu_action';
|
34 |
+
add_action('wp_ajax_' . $this->ajax_action_name, array($this, 'process_user_action')); /* process banner user action */
|
35 |
+
add_action('admin_init',array($this,'wt_import_export_menu_old_moved'));
|
36 |
+
}
|
37 |
+
|
38 |
+
public function wt_upgrade_completed($upgrader_object, $options) {
|
39 |
+
// The path to our plugin's main file
|
40 |
+
$our_plugin = plugin_basename(__FILE__);
|
41 |
+
// If an update has taken place and the updated type is plugins and the plugins element exists
|
42 |
+
if ($options['action'] == 'update' && $options['type'] == 'plugin' && isset($options['plugins'])) {
|
43 |
+
// Iterate through the plugins being updated and check if ours is there
|
44 |
+
foreach ($options['plugins'] as $plugin) {
|
45 |
+
if ($plugin == $our_plugin) {
|
46 |
+
$this->display_legacy_menu(1);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Prints the banner
|
54 |
+
*/
|
55 |
+
public function show_banner() {
|
56 |
+
?>
|
57 |
+
<div class="<?php echo $this->banner_css_class; ?> notice-info notice is-dismissible">
|
58 |
+
|
59 |
+
<p>
|
60 |
+
<?php echo $this->banner_message; ?>
|
61 |
+
</p>
|
62 |
+
<p>
|
63 |
+
|
64 |
+
<a class="button button-primary" data-type="remove_legecy_menu_banner">Remove legacy menu</a>
|
65 |
+
</p>
|
66 |
+
</div>
|
67 |
+
<?php
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Ajax hook to process user action on the banner
|
72 |
+
*/
|
73 |
+
public function process_user_action() {
|
74 |
+
check_ajax_referer($this->plugin);
|
75 |
+
if (isset($_POST['wt_action_type']) && 'dismiss' == $_POST['wt_action_type']) {
|
76 |
+
$this->display_legacy_menu(0);
|
77 |
+
}
|
78 |
+
exit();
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Add banner JS to admin footer
|
83 |
+
*/
|
84 |
+
public function add_banner_scripts() {
|
85 |
+
$ajax_url = admin_url('admin-ajax.php');
|
86 |
+
$nonce = wp_create_nonce($this->plugin);
|
87 |
+
?>
|
88 |
+
<script type="text/javascript">
|
89 |
+
(function ($) {
|
90 |
+
"use strict";
|
91 |
+
|
92 |
+
/* prepare data object */
|
93 |
+
var data_obj = {
|
94 |
+
_wpnonce: '<?php echo $nonce; ?>',
|
95 |
+
action: '<?php echo $this->ajax_action_name; ?>',
|
96 |
+
wt_action_type: 'dismiss',
|
97 |
+
};
|
98 |
+
|
99 |
+
$(document).on('click', '.<?php echo $this->banner_css_class; ?> a.button', function (e)
|
100 |
+
{
|
101 |
+
e.preventDefault();
|
102 |
+
var elm = $(this);
|
103 |
+
elm.parents('.<?php echo $this->banner_css_class; ?>').hide();
|
104 |
+
|
105 |
+
$.ajax({
|
106 |
+
url: '<?php echo $ajax_url; ?>',
|
107 |
+
data: data_obj,
|
108 |
+
type: 'POST'
|
109 |
+
});
|
110 |
+
|
111 |
+
}).on('click', '.<?php echo $this->banner_css_class; ?> .notice-dismiss', function (e)
|
112 |
+
{
|
113 |
+
e.preventDefault();
|
114 |
+
$.ajax({
|
115 |
+
url: '<?php echo $ajax_url; ?>',
|
116 |
+
data: data_obj,
|
117 |
+
type: 'POST',
|
118 |
+
});
|
119 |
+
|
120 |
+
});
|
121 |
+
|
122 |
+
})(jQuery)
|
123 |
+
</script>
|
124 |
+
<?php
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Maybe add menu item back in original spot to help people transition
|
129 |
+
*/
|
130 |
+
public function wt_maybe_add_legecy_menu_redirect() {
|
131 |
+
if(isset($this->old_menu_params) && !empty($this->old_menu_params) && is_array($this->old_menu_params)){
|
132 |
+
foreach ($this->old_menu_params as $menu) {
|
133 |
+
add_submenu_page($menu['parent_slug'],__($menu['menu_title']), __($menu['menu_title']), $menu['capability'], 'import-export-menu-old', array($this, 'wt_import_export_menu_old_moved_old'));
|
134 |
+
}
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
public function wt_import_export_menu_old_moved_old(){
|
139 |
+
// this mooved wt_import_export_menu_old_moved
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Call back for transition menu item
|
144 |
+
*/
|
145 |
+
public function wt_import_export_menu_old_moved() {
|
146 |
+
if(isset($_GET['page']) && $_GET['page']=='import-export-menu-old'){
|
147 |
+
wp_safe_redirect(admin_url('/admin.php?page=wt_import_export_for_woo_basic_export'), 301);
|
148 |
+
exit();
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
public function wt_should_display_legacy_menu() {
|
153 |
+
return (bool) get_option($this->sholud_show_legacy_menu);
|
154 |
+
}
|
155 |
+
|
156 |
+
public function display_legacy_menu($display = false) {
|
157 |
+
update_option($this->sholud_show_legacy_menu, $display ? 1 : 0 );
|
158 |
+
}
|
159 |
+
|
160 |
+
}
|
161 |
+
|
162 |
+
}
|
includes/class-wt-userimport-uninstall-feedback.php
CHANGED
@@ -237,7 +237,7 @@ if (!class_exists('WT_UserImport_Uninstall_Feedback')) :
|
|
237 |
'wc_version' => (!defined('WC_VERSION')) ? '' : WC_VERSION,
|
238 |
'locale' => get_locale(),
|
239 |
'multisite' => is_multisite() ? 'Yes' : 'No',
|
240 |
-
'userimport_version' =>
|
241 |
);
|
242 |
// Write an action/hook here in webtoffe to recieve the data
|
243 |
$resp = wp_remote_post('https://feedback.webtoffee.com/wp-json/userimport/v1/uninstall', array(
|
237 |
'wc_version' => (!defined('WC_VERSION')) ? '' : WC_VERSION,
|
238 |
'locale' => get_locale(),
|
239 |
'multisite' => is_multisite() ? 'Yes' : 'No',
|
240 |
+
'userimport_version' => WT_U_IEW_VERSION
|
241 |
);
|
242 |
// Write an action/hook here in webtoffe to recieve the data
|
243 |
$resp = wp_remote_post('https://feedback.webtoffee.com/wp-json/userimport/v1/uninstall', array(
|
includes/exporter/class-wf-customerimpexpcsv-exporter.php
DELETED
@@ -1,144 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!defined('ABSPATH')) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
class WF_CustomerImpExpCsv_Exporter {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Customer Exporter Tool
|
11 |
-
*/
|
12 |
-
public static function do_export() {
|
13 |
-
global $wpdb;
|
14 |
-
|
15 |
-
$export_limit = !empty($_POST['limit']) ? intval($_POST['limit']) : 999999999;
|
16 |
-
$export_offset = !empty($_POST['offset']) ? intval($_POST['offset']) : 0;
|
17 |
-
$csv_columns = include( 'data/data-wf-post-columns.php' );
|
18 |
-
$user_columns_name = !empty($_POST['columns_name']) ? Wt_WUWCIEP_Security_helper::sanitize_item($_POST['columns_name'], 'text_arr') : $csv_columns;
|
19 |
-
$export_columns = !empty($_POST['columns']) ? Wt_WUWCIEP_Security_helper::sanitize_item($_POST['columns'], 'text_arr') : array();
|
20 |
-
$export_user_roles = !empty($_POST['user_roles']) ? Wt_WUWCIEP_Security_helper::sanitize_item($_POST['user_roles'], 'text_arr') : array();
|
21 |
-
$delimiter = !empty($_POST['delimiter']) ? stripslashes($_POST['delimiter']) : ',';
|
22 |
-
|
23 |
-
$wpdb->hide_errors();
|
24 |
-
@set_time_limit(0);
|
25 |
-
if (function_exists('apache_setenv'))
|
26 |
-
@apache_setenv('no-gzip', 1);
|
27 |
-
@ini_set('zlib.output_compression', 0);
|
28 |
-
@ob_end_clean();
|
29 |
-
|
30 |
-
header('Content-Type: text/csv; charset=UTF-8');
|
31 |
-
header('Content-Disposition: attachment; filename=Customer-Export-' . date('Y_m_d_H_i_s', current_time('timestamp')) . ".csv");
|
32 |
-
header('Pragma: no-cache');
|
33 |
-
header('Expires: 0');
|
34 |
-
|
35 |
-
$fp = fopen('php://output', 'w');
|
36 |
-
|
37 |
-
$args = array(
|
38 |
-
'fields' => 'ID', // exclude standard wp_users fields from get_users query -> get Only ID##
|
39 |
-
'role__in' => $export_user_roles, //An array of role names. Matched users must have at least one of these roles. Default empty array.
|
40 |
-
'number' => $export_limit, // number of users to retrieve
|
41 |
-
'offset' => $export_offset // offset to skip from list
|
42 |
-
);
|
43 |
-
|
44 |
-
$users = get_users($args);
|
45 |
-
|
46 |
-
// Variable to hold the CSV data we're exporting
|
47 |
-
$row = array();
|
48 |
-
|
49 |
-
// Export header rows
|
50 |
-
foreach ($csv_columns as $column => $value) {
|
51 |
-
$temp_head = esc_attr($user_columns_name[$column]);
|
52 |
-
if (!$export_columns || in_array($column, $export_columns))
|
53 |
-
$row[] = $temp_head;
|
54 |
-
}
|
55 |
-
|
56 |
-
$row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $row);
|
57 |
-
fwrite($fp, implode($delimiter, $row) . "\n");
|
58 |
-
unset($row);
|
59 |
-
|
60 |
-
ini_set('max_execution_time', -1);
|
61 |
-
ini_set('memory_limit', -1);
|
62 |
-
// Loop users
|
63 |
-
foreach ($users as $user) {
|
64 |
-
//$row = array();
|
65 |
-
$data = WF_CustomerImpExpCsv_Exporter::get_customers_csv_row($user, $export_columns, $csv_columns);
|
66 |
-
$row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $data);
|
67 |
-
fwrite($fp, implode($delimiter, $row) . "\n");
|
68 |
-
unset($row);
|
69 |
-
unset($data);
|
70 |
-
}
|
71 |
-
|
72 |
-
fclose($fp);
|
73 |
-
exit;
|
74 |
-
}
|
75 |
-
|
76 |
-
public static function format_data($data, $key) {
|
77 |
-
|
78 |
-
switch ($key) {
|
79 |
-
case "user_login":
|
80 |
-
case "user_pass":
|
81 |
-
case "roles":
|
82 |
-
break;
|
83 |
-
default:
|
84 |
-
if(is_string($data) && in_array($data[0], array('=','+','-','@')) ){ // for avoid vulnerable to Remote Command Execution
|
85 |
-
$data = ' '.$data;
|
86 |
-
}
|
87 |
-
|
88 |
-
}
|
89 |
-
return $data;
|
90 |
-
|
91 |
-
|
92 |
-
//if (!is_array($data));
|
93 |
-
//$data = (string) urldecode($data);
|
94 |
-
$enc = mb_detect_encoding($data, 'UTF-8, ISO-8859-1', true);
|
95 |
-
$data = ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
|
96 |
-
return $data;
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Wrap a column in quotes for the CSV
|
101 |
-
* @param string data to wrap
|
102 |
-
* @return string wrapped data
|
103 |
-
*/
|
104 |
-
public static function wrap_column($data) {
|
105 |
-
return '"' . str_replace('"', '""', $data) . '"';
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* Get the customer data for a single CSV row
|
110 |
-
* @since 3.0
|
111 |
-
* @param int $customer_id
|
112 |
-
* @param array $export_columns - user selected columns / all
|
113 |
-
* @return array $meta_keys customer/user meta data
|
114 |
-
*/
|
115 |
-
public static function get_customers_csv_row($id, $export_columns, $csv_columns) {
|
116 |
-
$user = get_user_by('id', $id);
|
117 |
-
$customer_data = array();
|
118 |
-
foreach ($csv_columns as $key) {
|
119 |
-
$customer_data[$key] = !empty($user->{$key}) ? self::format_data(maybe_serialize($user->{$key}),$key) : '';
|
120 |
-
}
|
121 |
-
$user_roles = (!empty($user->roles)) ? $user->roles : array();
|
122 |
-
$customer_data['roles'] = implode(',', $user_roles);
|
123 |
-
|
124 |
-
foreach ($customer_data as $key => $value) {
|
125 |
-
if (!$export_columns || in_array($key, $export_columns)) {
|
126 |
-
// need to modify code
|
127 |
-
} else {
|
128 |
-
unset($customer_data[$key]);
|
129 |
-
}
|
130 |
-
}
|
131 |
-
|
132 |
-
if(in_array("wt_hash", $export_columns)){
|
133 |
-
$customer_data['wt_hash'] = 'no';
|
134 |
-
}
|
135 |
-
/*
|
136 |
-
* CSV Customer Export Row.
|
137 |
-
* Filter the individual row data for the customer export
|
138 |
-
* @since 3.0
|
139 |
-
* @param array $customer_data
|
140 |
-
*/
|
141 |
-
return apply_filters('hf_customer_csv_export_data', $customer_data);
|
142 |
-
}
|
143 |
-
|
144 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/exporter/data/data-wf-post-columns.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!defined('ABSPATH')) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
$columns = array(
|
8 |
-
'ID' => 'ID',
|
9 |
-
'user_login' => 'user_login',
|
10 |
-
'user_pass' => 'user_pass',
|
11 |
-
'wt_hash' => 'wt_hash',
|
12 |
-
'user_nicename' => 'user_nicename',
|
13 |
-
'user_email' => 'user_email',
|
14 |
-
'user_url' => 'user_url',
|
15 |
-
'user_registered' => 'user_registered',
|
16 |
-
'display_name' => 'display_name',
|
17 |
-
'first_name' => 'first_name',
|
18 |
-
'last_name' => 'last_name',
|
19 |
-
'user_status' => 'user_status',
|
20 |
-
'description' => 'description',
|
21 |
-
'roles' => 'roles'
|
22 |
-
);
|
23 |
-
|
24 |
-
return apply_filters('hf_csv_customer_post_columns', $columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/importer/class-wf-csv-parser.php
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WooCommerce CSV Importer class for managing parsing of CSV files.
|
4 |
-
*/
|
5 |
-
class WF_CSV_Parser {
|
6 |
-
|
7 |
-
var $row;
|
8 |
-
var $post_type;
|
9 |
-
var $log;
|
10 |
-
var $skipped = 0;
|
11 |
-
var $delimiter;
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Constructor
|
15 |
-
*/
|
16 |
-
public function __construct( $post_type = 'user' ) {
|
17 |
-
$this->post_type = $post_type;
|
18 |
-
$this->user_base_fields = array(
|
19 |
-
'ID' => 'ID',
|
20 |
-
'user_login' => 'user_login',
|
21 |
-
'user_pass' => 'user_pass',
|
22 |
-
'wt_hash' => 'wt_hash',
|
23 |
-
'user_nicename' => 'user_nicename',
|
24 |
-
'user_email' => 'user_email',
|
25 |
-
'user_url' => 'user_url',
|
26 |
-
'user_registered' => 'user_registered',
|
27 |
-
'display_name' => 'display_name',
|
28 |
-
'first_name' => 'first_name',
|
29 |
-
'last_name' => 'last_name',
|
30 |
-
'user_status' => 'user_status',
|
31 |
-
'description' => 'description',
|
32 |
-
'roles' => 'roles'
|
33 |
-
);
|
34 |
-
}
|
35 |
-
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Format data from the csv file
|
39 |
-
* @param string $data
|
40 |
-
* @param string $enc
|
41 |
-
* @return string
|
42 |
-
*/
|
43 |
-
public function format_data_from_csv( $data, $enc ) {
|
44 |
-
return ( $enc == 'UTF-8' ) ? $data : utf8_encode( $data );
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Parse the data
|
49 |
-
* @param string $file [description]
|
50 |
-
* @param string $delimiter [description]
|
51 |
-
* @param integer $start_pos [description]
|
52 |
-
* @param integer $end_pos [description]
|
53 |
-
* @return array
|
54 |
-
*/
|
55 |
-
public function parse_data( $file, $delimiter, $start_pos = 0, $end_pos = null ) {
|
56 |
-
// Set locale
|
57 |
-
$enc = mb_detect_encoding( $file, 'UTF-8, ISO-8859-1', true );
|
58 |
-
if ( $enc )
|
59 |
-
setlocale( LC_ALL, 'en_US.' . $enc );
|
60 |
-
@ini_set( 'auto_detect_line_endings', true );
|
61 |
-
$parsed_data = array();
|
62 |
-
$raw_headers = array();
|
63 |
-
// Put all CSV data into an associative array
|
64 |
-
if ( ( $handle = fopen( $file, "r" ) ) !== FALSE ) {
|
65 |
-
$header = fgetcsv( $handle, 0, $delimiter );
|
66 |
-
if ( $start_pos != 0 )
|
67 |
-
fseek( $handle, $start_pos );
|
68 |
-
while ( ( $postmeta = fgetcsv( $handle, 0, $delimiter ) ) !== FALSE ) {
|
69 |
-
$row = array();
|
70 |
-
foreach ( $header as $key => $heading ) {
|
71 |
-
$s_heading = strtolower($heading);
|
72 |
-
if ( $s_heading == '' )
|
73 |
-
continue;
|
74 |
-
// Add the heading to the parsed data
|
75 |
-
$row[$s_heading] = ( isset( $postmeta[$key] ) ) ? $this->format_data_from_csv( $postmeta[$key], $enc ) : '';
|
76 |
-
// Raw Headers stores the actual column name in the CSV
|
77 |
-
$raw_headers[ $s_heading ] = $heading;
|
78 |
-
}
|
79 |
-
$parsed_data[] = $row;
|
80 |
-
unset( $postmeta, $row );
|
81 |
-
$position = ftell( $handle );
|
82 |
-
if ( $end_pos && $position >= $end_pos )
|
83 |
-
break;
|
84 |
-
}
|
85 |
-
fclose( $handle );
|
86 |
-
}
|
87 |
-
return array( $parsed_data, $raw_headers, $position );
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Parse users
|
92 |
-
* @param array $item
|
93 |
-
* @return array
|
94 |
-
*/
|
95 |
-
public function parse_users( $item, $raw_headers, $record_offset ) {
|
96 |
-
global $WF_CSV_Customer_Import, $wpdb;
|
97 |
-
$results = array();
|
98 |
-
$row = 0;
|
99 |
-
$skipped = 0;
|
100 |
-
|
101 |
-
$row++;
|
102 |
-
if ( $row <= $record_offset ) {
|
103 |
-
if($WF_CSV_Customer_Import->log)
|
104 |
-
$WF_CSV_Customer_Import->hf_log_data_change( 'user-csv-import', sprintf( __( '> Row %s - skipped due to record offset.', 'users-customers-import-export-for-wp-woocommerce' ), $row ) );
|
105 |
-
unset($item);
|
106 |
-
return;
|
107 |
-
}
|
108 |
-
if ( empty($item['user_email']) ) {
|
109 |
-
if($WF_CSV_Customer_Import->log)
|
110 |
-
$WF_CSV_Customer_Import->hf_log_data_change( 'user-csv-import', sprintf( __( '> Row %s - skipped: cannot insert user without email.', 'users-customers-import-export-for-wp-woocommerce' ), $row ) );
|
111 |
-
unset($item);
|
112 |
-
return;
|
113 |
-
}elseif(!is_email($item['user_email'])){
|
114 |
-
if($WF_CSV_Customer_Import->log)
|
115 |
-
$WF_CSV_Customer_Import->hf_log_data_change( 'user-csv-import', sprintf( __( '> Row %s - skipped: Email is not valid.', 'users-customers-import-export-for-wp-woocommerce' ), $row ) );
|
116 |
-
unset($item);
|
117 |
-
return;
|
118 |
-
}
|
119 |
-
$user_details = array();
|
120 |
-
foreach ($this->user_base_fields as $key => $value) {
|
121 |
-
$user_details[$key] = isset( $item[$value] ) ? $item[$value] : "" ;
|
122 |
-
}
|
123 |
-
$parsed_details = array();
|
124 |
-
$parsed_details['user_details'] = $user_details;
|
125 |
-
// the $user_details array will now contain the necessary name-value pairs for the wp_users table
|
126 |
-
$results[] = $parsed_details;
|
127 |
-
// Result
|
128 |
-
return array(
|
129 |
-
$this->post_type => $results,
|
130 |
-
'skipped' => $skipped,
|
131 |
-
);
|
132 |
-
}
|
133 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/importer/class-wf-customerimpexpcsv-customer-import.php
DELETED
@@ -1,732 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WordPress Importer class for managing the import process of a CSV file
|
4 |
-
*
|
5 |
-
* @package WordPress
|
6 |
-
* @subpackage Importer
|
7 |
-
*/
|
8 |
-
if (!class_exists('WP_Importer'))
|
9 |
-
return;
|
10 |
-
|
11 |
-
class WF_CustomerImpExpCsv_Customer_Import extends WP_Importer {
|
12 |
-
|
13 |
-
var $id;
|
14 |
-
var $file_url;
|
15 |
-
var $delimiter;
|
16 |
-
var $processed_posts = array();
|
17 |
-
var $skipped = 0;
|
18 |
-
var $imported = 0;
|
19 |
-
var $errored = 0;
|
20 |
-
// Results
|
21 |
-
var $import_results = array();
|
22 |
-
var $log = false;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Constructor
|
26 |
-
*/
|
27 |
-
public function __construct() {
|
28 |
-
// Check that the class exists before trying to use it
|
29 |
-
if (function_exists('WC')) {
|
30 |
-
if(WC()->version < '2.7.0'){
|
31 |
-
$this->log = new WC_Logger();
|
32 |
-
} else {
|
33 |
-
$this->log = wc_get_logger();
|
34 |
-
}
|
35 |
-
}
|
36 |
-
$this->import_page = 'wordpress_hf_user_csv';
|
37 |
-
$this->file_url_import_enabled = apply_filters('woocommerce_csv_product_file_url_import_enabled', true);
|
38 |
-
}
|
39 |
-
|
40 |
-
public function hf_log_data_change ($content = 'user-csv-import',$data='') {
|
41 |
-
if (WC()->version < '2.7.0'){
|
42 |
-
$this->log->add($content,$data);
|
43 |
-
}else{
|
44 |
-
$context = array( 'source' => $content );
|
45 |
-
$this->log->log("debug", $data ,$context);
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Registered callback function for the WordPress Importer
|
51 |
-
*
|
52 |
-
* Manages the three separate stages of the CSV import process
|
53 |
-
*/
|
54 |
-
public function dispatch() {
|
55 |
-
global $wpdb;
|
56 |
-
|
57 |
-
if (!empty($_POST['delimiter'])) {
|
58 |
-
$this->delimiter = stripslashes(trim($_POST['delimiter']));
|
59 |
-
} else if (!empty($_GET['delimiter'])) {
|
60 |
-
$this->delimiter = stripslashes(trim($_GET['delimiter']));
|
61 |
-
}
|
62 |
-
|
63 |
-
if (!$this->delimiter)
|
64 |
-
$this->delimiter = ',';
|
65 |
-
|
66 |
-
$step = empty($_GET['step']) ? 0 : (int) $_GET['step'];
|
67 |
-
|
68 |
-
switch ($step) {
|
69 |
-
case 0 :
|
70 |
-
$this->header();
|
71 |
-
$this->greet();
|
72 |
-
break;
|
73 |
-
case 1 :
|
74 |
-
$this->header();
|
75 |
-
|
76 |
-
check_admin_referer('import-upload');
|
77 |
-
|
78 |
-
if (!empty($_GET['file_url']))
|
79 |
-
$this->file_url = Wt_WUWCIEP_Security_helper::sanitize_item($_GET['file_url'], 'url');
|
80 |
-
if (!empty($_GET['file_id']))
|
81 |
-
$this->id = Wt_WUWCIEP_Security_helper::sanitize_item($_GET['file_id'], 'int');
|
82 |
-
|
83 |
-
if (!empty($_GET['clearmapping']) || $this->handle_upload())
|
84 |
-
$this->import_options();
|
85 |
-
else
|
86 |
-
_e('Error with handle_upload!', 'users-customers-import-export-for-wp-woocommerce');
|
87 |
-
break;
|
88 |
-
case 2 :
|
89 |
-
$this->header();
|
90 |
-
|
91 |
-
check_admin_referer('import-woocommerce');
|
92 |
-
|
93 |
-
$this->id = (int) $_POST['import_id'];
|
94 |
-
|
95 |
-
if ($this->file_url_import_enabled)
|
96 |
-
$this->file_url = Wt_WUWCIEP_Security_helper::sanitize_item($_POST['import_url'], 'url');
|
97 |
-
|
98 |
-
if ($this->id)
|
99 |
-
$file = get_attached_file($this->id);
|
100 |
-
else if ($this->file_url_import_enabled)
|
101 |
-
$file = ABSPATH . $this->file_url;
|
102 |
-
|
103 |
-
$file = str_replace("\\", "/", $file);
|
104 |
-
|
105 |
-
if ($file) {
|
106 |
-
$file_delimiter = $this->detectDelimiter($file);
|
107 |
-
if(!empty($file_delimiter) && ($file_delimiter != $this->delimiter)){
|
108 |
-
echo '<p class="error"><strong>' . __("Basic version supports only ',' as delimiter. Your file's delimiter seems to be unsupported.", 'users-customers-import-export-for-wp-woocommerce') . '</strong></p>';
|
109 |
-
break;
|
110 |
-
}
|
111 |
-
?>
|
112 |
-
<table id="import-progress" class="widefat_importer widefat">
|
113 |
-
<thead>
|
114 |
-
<tr>
|
115 |
-
<th class="status"> </th>
|
116 |
-
<th class="row"><?php _e('Row', 'users-customers-import-export-for-wp-woocommerce'); ?></th>
|
117 |
-
<th><?php _e('User ID', 'users-customers-import-export-for-wp-woocommerce'); ?></th>
|
118 |
-
<th><?php _e('User Status', 'users-customers-import-export-for-wp-woocommerce'); ?></th>
|
119 |
-
<th class="reason"><?php _e('Status Msg', 'users-customers-import-export-for-wp-woocommerce'); ?></th>
|
120 |
-
</tr>
|
121 |
-
</thead>
|
122 |
-
<tfoot>
|
123 |
-
<tr class="importer-loading">
|
124 |
-
<td colspan="5"></td>
|
125 |
-
</tr>
|
126 |
-
</tfoot>
|
127 |
-
<tbody></tbody>
|
128 |
-
</table>
|
129 |
-
<script type="text/javascript">
|
130 |
-
jQuery(document).ready(function($) {
|
131 |
-
if (! window.console) { window.console = function(){}; }
|
132 |
-
var processed_posts = [];
|
133 |
-
var i = 1;
|
134 |
-
var done_count = 0;
|
135 |
-
function import_rows(start_pos, end_pos) {
|
136 |
-
var data = {
|
137 |
-
action: 'user_csv_import_request',
|
138 |
-
file: '<?php echo addslashes($file); ?>',
|
139 |
-
start_pos: start_pos,
|
140 |
-
end_pos: end_pos,
|
141 |
-
nonce : '<?php echo wp_create_nonce( WF_CUSTOMER_IMP_EXP_ID )?>',
|
142 |
-
};
|
143 |
-
return $.ajax({
|
144 |
-
url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '3'), admin_url('admin-ajax.php')); ?>',
|
145 |
-
data: data,
|
146 |
-
type: 'POST',
|
147 |
-
success: function(response) {
|
148 |
-
if (response) {
|
149 |
-
try {
|
150 |
-
// Get the valid JSON only from the returned string
|
151 |
-
if (response.indexOf("<!--WC_START-->") >= 0)
|
152 |
-
response = response.split("<!--WC_START-->")[1]; // Strip off before after WC_START
|
153 |
-
if (response.indexOf("<!--WC_END-->") >= 0)
|
154 |
-
response = response.split("<!--WC_END-->")[0]; // Strip off anything after WC_END
|
155 |
-
|
156 |
-
// Parse
|
157 |
-
var results = $.parseJSON(response);
|
158 |
-
if (results.error) {
|
159 |
-
$('#import-progress tbody').append('<tr id="row-' + i + '" class="error"><td class="status" colspan="5">' + results.error + '</td></tr>');
|
160 |
-
i++;
|
161 |
-
} else if (results.import_results && $(results.import_results).size() > 0) {
|
162 |
-
$.each(results.processed_posts, function(index, value) {
|
163 |
-
processed_posts.push(value);
|
164 |
-
});
|
165 |
-
$(results.import_results).each(function(index, row) {
|
166 |
-
$('#import-progress tbody').append('<tr id="row-' + i + '" class="' + row['status'] + '"><td><mark class="result" title="' + row['status'] + '">' + row['status'] + '</mark></td><td class="row">' + i + '</td><td>' + row['user_id'] + '</td><td>' + row['post_id'] + ' - ' + row['post_title'] + '</td><td class="reason">' + row['reason'] + '</td></tr>');
|
167 |
-
i++;
|
168 |
-
});
|
169 |
-
}
|
170 |
-
} catch (err) {}
|
171 |
-
} else {
|
172 |
-
$('#import-progress tbody').append('<tr class="error"><td class="status" colspan="5">' + '<?php _e('AJAX Error', 'users-customers-import-export-for-wp-woocommerce'); ?>' + '</td></tr>');
|
173 |
-
}
|
174 |
-
|
175 |
-
var w = $(window);
|
176 |
-
var row = $("#row-" + (i - 1));
|
177 |
-
if (row.length) {
|
178 |
-
w.scrollTop(row.offset().top - (w.height() / 2));
|
179 |
-
}
|
180 |
-
done_count++;
|
181 |
-
$('body').trigger('user_csv_import_request_complete');
|
182 |
-
}
|
183 |
-
});
|
184 |
-
}
|
185 |
-
|
186 |
-
var rows = [];
|
187 |
-
<?php
|
188 |
-
$limit = apply_filters('woocommerce_csv_import_limit_per_request', 10);
|
189 |
-
$enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
|
190 |
-
if ($enc)
|
191 |
-
setlocale(LC_ALL, 'en_US.' . $enc);
|
192 |
-
@ini_set('auto_detect_line_endings', true);
|
193 |
-
$count = 0;
|
194 |
-
$previous_position = 0;
|
195 |
-
$position = 0;
|
196 |
-
$import_count = 0;
|
197 |
-
// Get CSV positions
|
198 |
-
if (( $handle = fopen($file, "r") ) !== FALSE) {
|
199 |
-
while (( $postmeta = fgetcsv($handle, 0, $this->delimiter)) !== FALSE) {
|
200 |
-
$count++;
|
201 |
-
if ($count >= $limit) {
|
202 |
-
$previous_position = $position;
|
203 |
-
$position = ftell($handle);
|
204 |
-
$count = 0;
|
205 |
-
$import_count ++;
|
206 |
-
// Import rows between $previous_position $position
|
207 |
-
?>rows.push([ <?php echo $previous_position; ?>, <?php echo $position; ?> ]); <?php
|
208 |
-
}
|
209 |
-
}
|
210 |
-
// Remainder
|
211 |
-
if ($count > 0) {
|
212 |
-
?>rows.push([ <?php echo $position; ?>, '' ]); <?php
|
213 |
-
$import_count ++;
|
214 |
-
}
|
215 |
-
fclose($handle);
|
216 |
-
}
|
217 |
-
?>
|
218 |
-
var data = rows.shift();
|
219 |
-
var regen_count = 0;
|
220 |
-
import_rows( data[0], data[1] );
|
221 |
-
|
222 |
-
$('body').on( 'user_csv_import_request_complete', function() {
|
223 |
-
if ( done_count == <?php echo $import_count; ?> ) {
|
224 |
-
import_done();
|
225 |
-
} else {
|
226 |
-
// Call next request
|
227 |
-
data = rows.shift();
|
228 |
-
import_rows( data[0], data[1] );
|
229 |
-
}
|
230 |
-
});
|
231 |
-
|
232 |
-
function import_done() {
|
233 |
-
var data = {
|
234 |
-
action: 'user_csv_import_request',
|
235 |
-
file: '<?php echo $file; ?>',
|
236 |
-
processed_posts: processed_posts,
|
237 |
-
nonce : '<?php echo wp_create_nonce( WF_CUSTOMER_IMP_EXP_ID )?>',
|
238 |
-
};
|
239 |
-
$.ajax({
|
240 |
-
url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '4'), admin_url('admin-ajax.php')); ?>',
|
241 |
-
data: data,
|
242 |
-
type: 'POST',
|
243 |
-
success: function( response ) {
|
244 |
-
console.log( response );
|
245 |
-
$('#import-progress tbody').append( '<tr class="complete"><td colspan="5">' + response + '</td></tr>' );
|
246 |
-
$('.importer-loading').hide();
|
247 |
-
}
|
248 |
-
});
|
249 |
-
}
|
250 |
-
});
|
251 |
-
</script>
|
252 |
-
<?php
|
253 |
-
} else {
|
254 |
-
echo '<p class="error">' . __('Error finding uploaded file!', 'users-customers-import-export-for-wp-woocommerce') . '</p>';
|
255 |
-
}
|
256 |
-
break;
|
257 |
-
case 3 :
|
258 |
-
if (!wp_verify_nonce($_POST['nonce'], WF_CUSTOMER_IMP_EXP_ID) || !WF_Customer_Import_Export_CSV::hf_user_permission()) {
|
259 |
-
wp_die(__('Access Denied', 'users-customers-import-export-for-wp-woocommerce'));
|
260 |
-
}
|
261 |
-
$file = stripslashes( $_POST['file'] ); // Validating given path is valid path, not a URL
|
262 |
-
if (filter_var($file, FILTER_VALIDATE_URL)) {
|
263 |
-
die();
|
264 |
-
}
|
265 |
-
add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
|
266 |
-
|
267 |
-
if (function_exists('gc_enable'))
|
268 |
-
gc_enable();
|
269 |
-
|
270 |
-
@set_time_limit(0);
|
271 |
-
@ob_flush();
|
272 |
-
@flush();
|
273 |
-
$wpdb->hide_errors();
|
274 |
-
|
275 |
-
$start_pos = isset($_POST['start_pos']) ? absint($_POST['start_pos']) : 0;
|
276 |
-
$end_pos = isset($_POST['end_pos']) ? absint($_POST['end_pos']) : '';
|
277 |
-
|
278 |
-
$position = $this->import_start($file, $start_pos, $end_pos);
|
279 |
-
$this->import();
|
280 |
-
$this->import_end();
|
281 |
-
|
282 |
-
$results = array();
|
283 |
-
$results['import_results'] = $this->import_results;
|
284 |
-
$results['processed_posts'] = $this->processed_posts;
|
285 |
-
echo "<!--WC_START-->";
|
286 |
-
echo json_encode($results);
|
287 |
-
echo "<!--WC_END-->";
|
288 |
-
exit;
|
289 |
-
break;
|
290 |
-
case 4 :
|
291 |
-
if (!wp_verify_nonce($_POST['nonce'], WF_CUSTOMER_IMP_EXP_ID) || !WF_Customer_Import_Export_CSV::hf_user_permission()) {
|
292 |
-
wp_die(__('Access Denied', 'users-customers-import-export-for-wp-woocommerce'));
|
293 |
-
}
|
294 |
-
add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
|
295 |
-
if (function_exists('gc_enable'))
|
296 |
-
gc_enable();
|
297 |
-
|
298 |
-
@set_time_limit(0);
|
299 |
-
@ob_flush();
|
300 |
-
@flush();
|
301 |
-
$wpdb->hide_errors();
|
302 |
-
|
303 |
-
$this->processed_posts = isset($_POST['processed_posts']) ? Wt_WUWCIEP_Security_helper::sanitize_item($_POST['processed_posts'], 'int_arr') : array();
|
304 |
-
$file = isset($_POST['file']) ? stripslashes($_POST['file']) : '';
|
305 |
-
|
306 |
-
_e('Step 1...', 'users-customers-import-export-for-wp-woocommerce') . ' ';
|
307 |
-
|
308 |
-
wp_defer_term_counting(true);
|
309 |
-
wp_defer_comment_counting(true);
|
310 |
-
|
311 |
-
_e('Step 2...', 'users-customers-import-export-for-wp-woocommerce') . ' ';
|
312 |
-
|
313 |
-
echo 'Step 3...' . ' '; // Easter egg
|
314 |
-
|
315 |
-
_e('Finalizing...', 'users-customers-import-export-for-wp-woocommerce') . ' ';
|
316 |
-
|
317 |
-
// SUCCESS
|
318 |
-
_e('Finished. Import complete.', 'users-customers-import-export-for-wp-woocommerce');
|
319 |
-
|
320 |
-
if(in_array(pathinfo($file, PATHINFO_EXTENSION),array('txt','csv'))){
|
321 |
-
unlink($file);
|
322 |
-
}
|
323 |
-
$this->import_end();
|
324 |
-
exit;
|
325 |
-
break;
|
326 |
-
}
|
327 |
-
$this->footer();
|
328 |
-
}
|
329 |
-
|
330 |
-
/**
|
331 |
-
* format_data_from_csv
|
332 |
-
*/
|
333 |
-
public function format_data_from_csv($data, $enc) {
|
334 |
-
return ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
|
335 |
-
}
|
336 |
-
|
337 |
-
/**
|
338 |
-
* Display pre-import options
|
339 |
-
*/
|
340 |
-
public function import_options() {
|
341 |
-
$j = 0;
|
342 |
-
if ($this->id)
|
343 |
-
$file = get_attached_file($this->id);
|
344 |
-
else if ($this->file_url_import_enabled)
|
345 |
-
$file = ABSPATH . $this->file_url;
|
346 |
-
else
|
347 |
-
return;
|
348 |
-
|
349 |
-
// Set locale
|
350 |
-
$enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
|
351 |
-
if ($enc)
|
352 |
-
setlocale(LC_ALL, 'en_US.' . $enc);
|
353 |
-
@ini_set('auto_detect_line_endings', true);
|
354 |
-
|
355 |
-
// Get headers
|
356 |
-
if (( $handle = fopen($file, "r") ) !== FALSE) {
|
357 |
-
$row = $raw_headers = array();
|
358 |
-
$header = fgetcsv($handle, 0, $this->delimiter);
|
359 |
-
while (( $postmeta = fgetcsv($handle, 0, $this->delimiter) ) !== FALSE) {
|
360 |
-
foreach ($header as $key => $heading) {
|
361 |
-
if (!$heading)
|
362 |
-
continue;
|
363 |
-
$s_heading = $heading;
|
364 |
-
$row[$s_heading] = ( isset($postmeta[$key]) ) ? $this->format_data_from_csv($postmeta[$key], $enc) : '';
|
365 |
-
$raw_headers[$s_heading] = $heading;
|
366 |
-
}
|
367 |
-
break;
|
368 |
-
}
|
369 |
-
fclose($handle);
|
370 |
-
}
|
371 |
-
include( 'views/html-wf-import-options.php' );
|
372 |
-
}
|
373 |
-
|
374 |
-
/**
|
375 |
-
* The main controller for the actual import stage.
|
376 |
-
*/
|
377 |
-
public function import() {
|
378 |
-
wp_suspend_cache_invalidation(true);
|
379 |
-
if ($this->log) {
|
380 |
-
$this->hf_log_data_change('user-csv-import', '---');
|
381 |
-
$this->hf_log_data_change('user-csv-import', __('Processing users.', 'users-customers-import-export-for-wp-woocommerce'));
|
382 |
-
}
|
383 |
-
$record_offset = 0;
|
384 |
-
|
385 |
-
$i = 0;
|
386 |
-
//echo '<pre>';print_r($this->parsed_data);exit;
|
387 |
-
foreach ($this->parsed_data as $key => &$item) {
|
388 |
-
$user = $this->parser->parse_users($item, $this->raw_headers, $record_offset);
|
389 |
-
if (!is_wp_error($user))
|
390 |
-
$this->process_users($user['user'][0]);
|
391 |
-
else
|
392 |
-
$this->add_import_result('failed', $user->get_error_message(), 'Not parsed', json_encode($item), '-');
|
393 |
-
|
394 |
-
unset($item, $user);
|
395 |
-
$i++;
|
396 |
-
}
|
397 |
-
if ($this->log)
|
398 |
-
$this->hf_log_data_change('user-csv-import', __('Finished processing Users.', 'users-customers-import-export-for-wp-woocommerce'));
|
399 |
-
wp_suspend_cache_invalidation(false);
|
400 |
-
}
|
401 |
-
|
402 |
-
/**
|
403 |
-
* Parses the CSV file and prepares us for the task of processing parsed data
|
404 |
-
*
|
405 |
-
* @param string $file Path to the CSV file for importing
|
406 |
-
*/
|
407 |
-
public function import_start($file,$start_pos, $end_pos) {
|
408 |
-
if (function_exists('WC')) {
|
409 |
-
if (WC()->version < '2.7.0') {
|
410 |
-
$memory = size_format(woocommerce_let_to_num(ini_get('memory_limit')));
|
411 |
-
$wp_memory = size_format(woocommerce_let_to_num(WP_MEMORY_LIMIT));
|
412 |
-
} else {
|
413 |
-
$memory = size_format(wc_let_to_num(ini_get('memory_limit')));
|
414 |
-
$wp_memory = size_format(wc_let_to_num(WP_MEMORY_LIMIT));
|
415 |
-
}
|
416 |
-
} else {
|
417 |
-
$memory = size_format($this->wf_let_to_num(ini_get('memory_limit')));
|
418 |
-
$wp_memory = size_format($this->wf_let_to_num(WP_MEMORY_LIMIT));
|
419 |
-
}
|
420 |
-
if ($this->log) {
|
421 |
-
$this->hf_log_data_change('user-csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory);
|
422 |
-
$this->hf_log_data_change('user-csv-import', __('Parsing users CSV.', 'users-customers-import-export-for-wp-woocommerce'));
|
423 |
-
}
|
424 |
-
$this->parser = new WF_CSV_Parser('user');
|
425 |
-
|
426 |
-
list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data($file, $this->delimiter, $start_pos, $end_pos);
|
427 |
-
if ($this->log)
|
428 |
-
$this->hf_log_data_change('user-csv-import', __('Finished parsing users CSV.', 'users-customers-import-export-for-wp-woocommerce'));
|
429 |
-
|
430 |
-
wp_defer_term_counting(true);
|
431 |
-
wp_defer_comment_counting(true);
|
432 |
-
|
433 |
-
return $position;
|
434 |
-
}
|
435 |
-
|
436 |
-
/**
|
437 |
-
* Performs post-import cleanup of files and the cache
|
438 |
-
*/
|
439 |
-
public function import_end() {
|
440 |
-
//wp_cache_flush(); Stops output in some hosting environments
|
441 |
-
foreach (get_taxonomies() as $tax) {
|
442 |
-
delete_option("{$tax}_children");
|
443 |
-
_get_term_hierarchy($tax);
|
444 |
-
}
|
445 |
-
|
446 |
-
wp_defer_term_counting(false);
|
447 |
-
wp_defer_comment_counting(false);
|
448 |
-
|
449 |
-
do_action('import_end');
|
450 |
-
}
|
451 |
-
|
452 |
-
/**
|
453 |
-
* Handles the CSV upload and initial parsing of the file to prepare for
|
454 |
-
* displaying author import options
|
455 |
-
*
|
456 |
-
* @return bool False if error uploading or invalid file, true otherwise
|
457 |
-
*/
|
458 |
-
public function handle_upload() {
|
459 |
-
if (empty($_POST['file_url'])) {
|
460 |
-
$file = wp_import_handle_upload();
|
461 |
-
if (isset($file['error'])) {
|
462 |
-
echo '<p><strong>' . __('Sorry, there has been an error.', 'users-customers-import-export-for-wp-woocommerce') . '</strong><br />';
|
463 |
-
echo esc_html($file['error']) . '</p>';
|
464 |
-
return false;
|
465 |
-
}
|
466 |
-
$this->id = (int) $file['id'];
|
467 |
-
return true;
|
468 |
-
} else {
|
469 |
-
if (file_exists(ABSPATH . $_POST['file_url'])) {
|
470 |
-
$this->file_url = Wt_WUWCIEP_Security_helper::sanitize_item($_POST['file_url'], 'url');
|
471 |
-
return true;
|
472 |
-
} else {
|
473 |
-
echo '<p><strong>' . __('Sorry, there has been an error.', 'users-customers-import-export-for-wp-woocommerce') . '</strong></p>';
|
474 |
-
return false;
|
475 |
-
}
|
476 |
-
}
|
477 |
-
return false;
|
478 |
-
}
|
479 |
-
|
480 |
-
/**
|
481 |
-
* Create new posts based on import information
|
482 |
-
*/
|
483 |
-
private function process_users($post) {
|
484 |
-
$this->imported = 0;
|
485 |
-
// plan a dry run
|
486 |
-
//$dry_run = isset( $_POST['dry_run'] ) && $_POST['dry_run'] ? true : false;
|
487 |
-
$dry_run = 0; //mockup import and check weather the users can be imported without fail
|
488 |
-
if ($this->log) {
|
489 |
-
$this->hf_log_data_change('user-csv-import', '---');
|
490 |
-
}
|
491 |
-
if (empty($post['user_details']['user_email'])) {
|
492 |
-
$this->add_import_result('skipped', __('Cannot insert user without email', 'users-customers-import-export-for-wp-woocommerce'), 1, 1, 1);
|
493 |
-
unset($post);
|
494 |
-
return;
|
495 |
-
} elseif (!is_email($post['user_details']['user_email'])) {
|
496 |
-
$this->add_import_result('skipped', __('skipped: Email is not valid.', 'users-customers-import-export-for-wp-woocommerce'), 1, $post['user_details']['user_email'], 1);
|
497 |
-
unset($post);
|
498 |
-
return;
|
499 |
-
}
|
500 |
-
$user_id = $this->hf_check_customer($post);
|
501 |
-
$new_added = false;
|
502 |
-
|
503 |
-
if ($user_id) {
|
504 |
-
$usr_msg = 'User already exists.';
|
505 |
-
$user_info = get_userdata($user_id);
|
506 |
-
$user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
|
507 |
-
$this->add_import_result('skipped', __($usr_msg, 'users-customers-import-export-for-wp-woocommerce'),$user_id , $user_string, $user_id);
|
508 |
-
if ($this->log)
|
509 |
-
$this->hf_log_data_change('user-csv-import', sprintf(__('> “%s”' . $usr_msg, 'users-customers-import-export-for-wp-woocommerce'), $user_id), true);
|
510 |
-
unset($post);
|
511 |
-
return;
|
512 |
-
} else {
|
513 |
-
$user_id = $this->hf_create_customer($post);
|
514 |
-
$new_added = true;
|
515 |
-
if (is_wp_error($user_id)) {
|
516 |
-
$this->errored++;
|
517 |
-
$this->add_import_result('failed', __($user_id->get_error_message(), 'users-customers-import-export-for-wp-woocommerce'), 0, 'failed', 1);
|
518 |
-
if ($this->log)
|
519 |
-
$this->hf_log_data_change('user-csv-import', sprintf(__('> Error inserting %s: %s', 'users-customers-import-export-for-wp-woocommerce'), 1, $user_id->get_error_message()), true);
|
520 |
-
$skipped++;
|
521 |
-
unset($post);
|
522 |
-
return;
|
523 |
-
} elseif (empty($user_id)) {
|
524 |
-
$this->errored++;
|
525 |
-
if ($this->log)
|
526 |
-
$this->hf_log_data_change('user-csv-import', sprintf(__('An error occurred with the customer information provided.', 'users-customers-import-export-for-wp-woocommerce')));
|
527 |
-
$this->add_import_result('skipped', __('An error occurred with the customer information provided.', 'users-customers-import-export-for-wp-woocommerce'), 0, 'failed', 1);
|
528 |
-
$skipped++;
|
529 |
-
unset($post);
|
530 |
-
return;
|
531 |
-
}
|
532 |
-
}
|
533 |
-
|
534 |
-
$out_msg = 'User Imported Successfully.';
|
535 |
-
|
536 |
-
$user_info = get_userdata($user_id);
|
537 |
-
$user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
|
538 |
-
|
539 |
-
$this->add_import_result('imported', __($out_msg, 'users-customers-import-export-for-wp-woocommerce'), $user_id , $user_string, $user_id);
|
540 |
-
if ($this->log)
|
541 |
-
$this->hf_log_data_change('user-csv-import', sprintf(__('> “%s”' . $out_msg, 'users-customers-import-export-for-wp-woocommerce'), $user_id), true);
|
542 |
-
$this->imported++;
|
543 |
-
|
544 |
-
unset($post);
|
545 |
-
}
|
546 |
-
|
547 |
-
public function hf_check_customer($data) {
|
548 |
-
$customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
|
549 |
-
$username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
|
550 |
-
$customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
|
551 |
-
|
552 |
-
$found_customer = false;
|
553 |
-
|
554 |
-
if (!empty($customer_email)) {
|
555 |
-
if (is_email($customer_email) && false !== email_exists($customer_email)) {
|
556 |
-
$found_customer = email_exists($customer_email);
|
557 |
-
} elseif (!empty($username) && false !== username_exists($username)) {
|
558 |
-
$found_customer = username_exists($username);
|
559 |
-
}
|
560 |
-
}
|
561 |
-
return $found_customer;
|
562 |
-
}
|
563 |
-
|
564 |
-
public function hf_create_customer($data) {
|
565 |
-
|
566 |
-
$customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
|
567 |
-
$username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
|
568 |
-
$customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
|
569 |
-
if (!empty($data['user_details']['user_pass'])) {
|
570 |
-
$password = (isset($data['user_details']['wt_hash']) && (strtolower( $data['user_details']['wt_hash'])=='no' ) )? $data['user_details']['user_pass'] : wp_hash_password($data['user_details']['user_pass']);
|
571 |
-
$password_generated = false;
|
572 |
-
} else {
|
573 |
-
$password = wp_generate_password(12, true);
|
574 |
-
$password_generated = true;
|
575 |
-
}
|
576 |
-
$found_customer = false;
|
577 |
-
if (is_email($customer_email)) {
|
578 |
-
// Not in test mode, create a user account for this email
|
579 |
-
if (empty($username)) {
|
580 |
-
$maybe_username = explode('@', $customer_email);
|
581 |
-
$maybe_username = sanitize_user($maybe_username[0]);
|
582 |
-
$counter = 1;
|
583 |
-
$username = $maybe_username;
|
584 |
-
while (username_exists($username)) {
|
585 |
-
$username = $maybe_username . $counter;
|
586 |
-
$counter++;
|
587 |
-
}
|
588 |
-
}
|
589 |
-
|
590 |
-
$found_customer = wp_create_user($username, $password, $customer_email);
|
591 |
-
wp_insert_user(array('ID' => $found_customer,'user_login'=>$username,'user_email'=>$customer_email, 'user_pass' => $password));
|
592 |
-
|
593 |
-
if (!is_wp_error($found_customer)) {
|
594 |
-
$wp_user_object = new WP_User($found_customer);
|
595 |
-
$roles = get_editable_roles();
|
596 |
-
$new_roles = explode(',', $data['user_details']['roles']);
|
597 |
-
$new_roles = array_intersect( $new_roles, array_keys( $roles ) );
|
598 |
-
$roles_to_remove = array();
|
599 |
-
$user_roles = array_intersect( array_values( $wp_user_object->roles ), array_keys( $roles ) );
|
600 |
-
if ( ! $new_roles ) {
|
601 |
-
// If there are no roles, delete all of the user's roles
|
602 |
-
$roles_to_remove = $user_roles;
|
603 |
-
} else {
|
604 |
-
$roles_to_remove = array_diff( $user_roles, $new_roles );
|
605 |
-
}
|
606 |
-
foreach ( $roles_to_remove as $_role ) {
|
607 |
-
$wp_user_object->remove_role( $_role );
|
608 |
-
}
|
609 |
-
if(!empty($new_roles)){
|
610 |
-
// Make sure that we don't call $wp_user_object->add_role() any more than it's necessary
|
611 |
-
$_new_roles = array_diff( $new_roles, array_intersect( array_values( $wp_user_object->roles ), array_keys( $roles ) ) );
|
612 |
-
foreach ( $_new_roles as $_role ) {
|
613 |
-
$wp_user_object->add_role( $_role );
|
614 |
-
}
|
615 |
-
}
|
616 |
-
$user_nicename = (!empty($data['user_details']['user_nicename'])) ? $data['user_details']['user_nicename'] : '';
|
617 |
-
$website = (!empty($data['user_details']['user_url'])) ? $data['user_details']['user_url'] : '';
|
618 |
-
$user_registered = (!empty($data['user_details']['user_registered'])) ? $data['user_details']['user_registered'] : '';
|
619 |
-
$display_name = (!empty($data['user_details']['display_name'])) ? $data['user_details']['display_name'] : '';
|
620 |
-
$first_name = (!empty($data['user_details']['first_name'])) ? $data['user_details']['first_name'] : '';
|
621 |
-
$last_name = (!empty($data['user_details']['last_name'])) ? $data['user_details']['last_name'] : '';
|
622 |
-
$user_status = (!empty($data['user_details']['user_status'])) ? $data['user_details']['user_status'] : '';
|
623 |
-
$description = (!empty($data['user_details']['description'])) ? $data['user_details']['description'] : '';
|
624 |
-
wp_update_user( array(
|
625 |
-
'ID' => $found_customer,
|
626 |
-
'user_nicename' => $user_nicename,
|
627 |
-
'user_url' => $website,
|
628 |
-
'user_registered' => $user_registered,
|
629 |
-
'display_name' => $display_name,
|
630 |
-
'first_name' => $first_name,
|
631 |
-
'last_name' => $last_name,
|
632 |
-
'description' => $description,
|
633 |
-
'user_status' => $user_status,
|
634 |
-
)
|
635 |
-
);
|
636 |
-
}
|
637 |
-
} else {
|
638 |
-
$found_customer = new WP_Error('hf_invalid_customer', sprintf(__('User could not be created without Email.', 'users-customers-import-export-for-wp-woocommerce'), $customer_id));
|
639 |
-
}
|
640 |
-
return $found_customer;
|
641 |
-
}
|
642 |
-
|
643 |
-
/**
|
644 |
-
* Log a row's import status
|
645 |
-
*/
|
646 |
-
protected function add_import_result($status, $reason, $post_id = '', $post_title = '', $user_id = '') {
|
647 |
-
$this->import_results[] = array(
|
648 |
-
'post_title' => $post_title,
|
649 |
-
'post_id' => $post_id,
|
650 |
-
'user_id' => $user_id,
|
651 |
-
'status' => $status,
|
652 |
-
'reason' => $reason
|
653 |
-
);
|
654 |
-
}
|
655 |
-
|
656 |
-
/**
|
657 |
-
* Decide what the maximum file size for downloaded attachments is.
|
658 |
-
* Default is 0 (unlimited), can be filtered via import_attachment_size_limit
|
659 |
-
*
|
660 |
-
* @return int Maximum attachment file size to import
|
661 |
-
*/
|
662 |
-
public function max_attachment_size() {
|
663 |
-
return apply_filters('import_attachment_size_limit', 0);
|
664 |
-
}
|
665 |
-
|
666 |
-
// Display import page title
|
667 |
-
public function header() {
|
668 |
-
echo '<div class="woocommerce"><div class="icon32" id="icon-woocommerce-importer"><br></div>';
|
669 |
-
$tab = "import";
|
670 |
-
include_once(plugin_dir_path(WF_CustomerImpExpCsv_FILE).'includes/views/html-wf-common-header.php');
|
671 |
-
}
|
672 |
-
|
673 |
-
// Close div.wrap
|
674 |
-
public function footer() {
|
675 |
-
echo '</div>';
|
676 |
-
}
|
677 |
-
|
678 |
-
/**
|
679 |
-
* Display introductory text and file upload form
|
680 |
-
*/
|
681 |
-
public function greet() {
|
682 |
-
$action = 'admin.php?import=wordpress_hf_user_csv&step=1';
|
683 |
-
$bytes = apply_filters('import_upload_size_limit', wp_max_upload_size());
|
684 |
-
$size = size_format($bytes);
|
685 |
-
$upload_dir = wp_upload_dir();
|
686 |
-
include( 'views/html-wf-import-greeting.php' );
|
687 |
-
}
|
688 |
-
|
689 |
-
/**
|
690 |
-
* Added to http_request_timeout filter to force timeout at 60 seconds during import
|
691 |
-
* @return int 60
|
692 |
-
*/
|
693 |
-
public function bump_request_timeout($val) {
|
694 |
-
return 60;
|
695 |
-
}
|
696 |
-
|
697 |
-
public function wf_let_to_num($size) {
|
698 |
-
$l = substr($size, -1);
|
699 |
-
$ret = substr($size, 0, -1);
|
700 |
-
switch (strtoupper($l)) {
|
701 |
-
case 'P':
|
702 |
-
$ret *= 1024;
|
703 |
-
case 'T':
|
704 |
-
$ret *= 1024;
|
705 |
-
case 'G':
|
706 |
-
$ret *= 1024;
|
707 |
-
case 'M':
|
708 |
-
$ret *= 1024;
|
709 |
-
case 'K':
|
710 |
-
$ret *= 1024;
|
711 |
-
}
|
712 |
-
return $ret;
|
713 |
-
}
|
714 |
-
|
715 |
-
public function detectDelimiter($csvFile) {
|
716 |
-
$delimiters = array(
|
717 |
-
';' => 0,
|
718 |
-
',' => 0,
|
719 |
-
"\t" => 0,
|
720 |
-
"|" => 0
|
721 |
-
);
|
722 |
-
|
723 |
-
$handle = fopen($csvFile, "r");
|
724 |
-
$firstLine = fgets($handle);
|
725 |
-
fclose($handle);
|
726 |
-
foreach ($delimiters as $delimiter => &$count) {
|
727 |
-
$count = count(str_getcsv($firstLine, $delimiter));
|
728 |
-
}
|
729 |
-
return array_search(max($delimiters), $delimiters);
|
730 |
-
}
|
731 |
-
|
732 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/importer/class-wf-customerimpexpcsv-importer.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
|
6 |
-
class WF_CustomerImpExpCsv_Importer {
|
7 |
-
|
8 |
-
/**
|
9 |
-
* User Exporter Tool
|
10 |
-
*/
|
11 |
-
public static function load_wp_importer() {
|
12 |
-
// Load Importer API
|
13 |
-
require_once ABSPATH . 'wp-admin/includes/import.php';
|
14 |
-
|
15 |
-
if ( ! class_exists( 'WP_Importer' ) ) {
|
16 |
-
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
|
17 |
-
if ( file_exists( $class_wp_importer ) ) {
|
18 |
-
require $class_wp_importer;
|
19 |
-
}
|
20 |
-
}
|
21 |
-
}
|
22 |
-
|
23 |
-
/**
|
24 |
-
* User Importer Tool
|
25 |
-
*/
|
26 |
-
public static function customer_importer() {
|
27 |
-
if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) {
|
28 |
-
return;
|
29 |
-
}
|
30 |
-
|
31 |
-
self::load_wp_importer();
|
32 |
-
|
33 |
-
// includes
|
34 |
-
require_once 'class-wf-customerimpexpcsv-customer-import.php';
|
35 |
-
require_once 'class-wf-csv-parser.php';
|
36 |
-
|
37 |
-
// Dispatch
|
38 |
-
$GLOBALS['WF_CSV_Customer_Import'] = new WF_CustomerImpExpCsv_Customer_Import();
|
39 |
-
$GLOBALS['WF_CSV_Customer_Import'] ->dispatch();
|
40 |
-
}
|
41 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/importer/data/data-wf-reserved-fields-pair.php
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
|
6 |
-
$columns = array(
|
7 |
-
'ID' => 'ID | Customer/User ID ',
|
8 |
-
'user_login' => 'User Login | User Login',
|
9 |
-
'user_pass' => 'user_pass | user_pass',
|
10 |
-
'user_nicename' => 'user_nicename | user_nicename',
|
11 |
-
'user_email' => 'user_email | user_email',
|
12 |
-
'user_url' => 'user_url | user_url',
|
13 |
-
'user_registered' => 'user_registered | user_registered',
|
14 |
-
'display_name' => 'display_name | display_name',
|
15 |
-
'first_name' => 'first_name | first_name',
|
16 |
-
'last_name' => 'last_name | last_name',
|
17 |
-
'user_status' => 'user_status | user_status',
|
18 |
-
'description' => 'description',
|
19 |
-
'roles' => 'roles | roles'
|
20 |
-
);
|
21 |
-
return apply_filters('hf_csv_customer_import_columns', $columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/importer/views/html-wf-import-greeting.php
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
<div class="woocommerce">
|
2 |
-
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
-
<?php
|
4 |
-
$tab = "import";
|
5 |
-
include_once(plugin_dir_path(WF_CustomerImpExpCsv_FILE).'includes/views/html-wf-common-header.php');
|
6 |
-
include_once(plugin_dir_path(WF_CustomerImpExpCsv_FILE).'includes/views/market.php');
|
7 |
-
?>
|
8 |
-
</div>
|
9 |
-
<div class="tool-box bg-white p-20p pipe-view">
|
10 |
-
<h3 class="title"><?php _e('Import Users in CSV Format:', 'users-customers-import-export-for-wp-woocommerce'); ?></h3>
|
11 |
-
<p><?php _e('Import Users in CSV format from your computer.You can import users/customers (in CSV format) in to the shop.', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
12 |
-
<?php if (!empty($upload_dir['error'])) : ?>
|
13 |
-
<div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
14 |
-
<p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
|
15 |
-
|
16 |
-
<?php else : ?>
|
17 |
-
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
|
18 |
-
<table class="form-table">
|
19 |
-
<tbody>
|
20 |
-
<tr>
|
21 |
-
<th>
|
22 |
-
<label for="upload"><?php _e('Select a file from your computer', 'users-customers-import-export-for-wp-woocommerce'); ?></label>
|
23 |
-
</th>
|
24 |
-
<td>
|
25 |
-
<input type="file" id="upload" name="import" size="25" />
|
26 |
-
<input type="hidden" name="action" value="save" />
|
27 |
-
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" /><br>
|
28 |
-
<small><?php _e('Please upload UTF-8 encoded CSV', 'users-customers-import-export-for-wp-woocommerce'); ?> -- <?php printf(__('Maximum size: %s', 'users-customers-import-export-for-wp-woocommerce'), $size); ?></small>
|
29 |
-
</td>
|
30 |
-
</tr>
|
31 |
-
</tbody>
|
32 |
-
</table>
|
33 |
-
<p class="submit">
|
34 |
-
<input type="submit" class="button button-primary" value="<?php esc_attr_e('Upload file and import'); ?>" />
|
35 |
-
</p>
|
36 |
-
</form>
|
37 |
-
<?php endif; ?>
|
38 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/importer/views/html-wf-import-options.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2'); ?>" method="post" id="nomap">
|
2 |
-
<?php wp_nonce_field('import-woocommerce'); ?>
|
3 |
-
<input type="hidden" name="import_id" value="<?php echo $this->id; ?>" />
|
4 |
-
<?php if ($this->file_url_import_enabled) : ?>
|
5 |
-
<input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
|
6 |
-
<?php endif; ?>
|
7 |
-
<p class="submit">
|
8 |
-
<input style="display:none" type="submit" class="button button-primary" value="<?php esc_attr_e('Submit', 'users-customers-import-export-for-wp-woocommerce'); ?>" />
|
9 |
-
</p>
|
10 |
-
</form>
|
11 |
-
<script type="text/javascript">
|
12 |
-
jQuery(document).ready(function(){
|
13 |
-
jQuery("form#nomap").submit();
|
14 |
-
});
|
15 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/importer/views/market.php
DELETED
@@ -1,115 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
?>
|
6 |
-
|
7 |
-
<style>
|
8 |
-
.wf_customer_import_export.market-box{
|
9 |
-
width:30%;
|
10 |
-
float: right;
|
11 |
-
}
|
12 |
-
|
13 |
-
.wf_customer_import_export .pipe-premium-features{
|
14 |
-
background: #fff;
|
15 |
-
padding:5px;
|
16 |
-
}
|
17 |
-
.wf_customer_import_export .pipe-premium-features ul {
|
18 |
-
padding-left: 20px;
|
19 |
-
padding-right: 20px;
|
20 |
-
}
|
21 |
-
.wf_customer_import_export .pipe-premium-features li {
|
22 |
-
margin-bottom: 15px;
|
23 |
-
padding-left: 15px;
|
24 |
-
}
|
25 |
-
.wf_customer_import_export .pipe-premium-features li:before
|
26 |
-
{
|
27 |
-
font-family: dashicons;
|
28 |
-
text-decoration: inherit;
|
29 |
-
font-weight: 400;
|
30 |
-
font-style: normal;
|
31 |
-
vertical-align: top;
|
32 |
-
text-align: center;
|
33 |
-
content: "\f147";
|
34 |
-
margin-right: 10px;
|
35 |
-
margin-left: -25px;
|
36 |
-
font-size: 16px;
|
37 |
-
color: #3085bb;
|
38 |
-
}
|
39 |
-
.wf_customer_import_export .pipe-premium-features .button {
|
40 |
-
margin-bottom: 20px;
|
41 |
-
}
|
42 |
-
.wf_customer_import_export .pipe-premium-features .button-go-pro {
|
43 |
-
box-shadow: none;
|
44 |
-
border: 0;
|
45 |
-
text-shadow: none;
|
46 |
-
padding: 10px 15px;
|
47 |
-
height: auto;
|
48 |
-
font-size: 18px;
|
49 |
-
border-radius: 4px;
|
50 |
-
font-weight: 600;
|
51 |
-
background: #00cb95;
|
52 |
-
margin-top: 20px;
|
53 |
-
}
|
54 |
-
.wf_customer_import_export .pipe-premium-features .button-go-pro:hover,
|
55 |
-
.wf_customer_import_export .pipe-premium-features .button-go-pro:focus,
|
56 |
-
.wf_customer_import_export .pipe-premium-features .button-go-pro:active {
|
57 |
-
background: #00a378;
|
58 |
-
}
|
59 |
-
.wf_customer_import_export .pipe-premium-features .button-doc-demo {
|
60 |
-
border: 0;
|
61 |
-
background: #d8d8dc;
|
62 |
-
box-shadow: none;
|
63 |
-
padding: 10px 15px;
|
64 |
-
font-size: 15px;
|
65 |
-
height: auto;
|
66 |
-
margin-left: 10px;
|
67 |
-
margin-right: 10px;
|
68 |
-
margin-top: 10px;
|
69 |
-
}
|
70 |
-
.wf_customer_import_export .pipe-premium-features .button-doc-demo:hover,
|
71 |
-
.wf_customer_import_export .pipe-premium-features .button-doc-demo:focus,
|
72 |
-
.wf_customer_import_export .pipe-premium-features .button-doc-demo:active {
|
73 |
-
background: #dfdfe4;
|
74 |
-
}
|
75 |
-
.wf_customer_import_export .xa-pipe-rating-link{color:#ffc600;}
|
76 |
-
|
77 |
-
.wf_customer_import_export .pipe-review-widget{
|
78 |
-
background: #fff;
|
79 |
-
padding: 5px;
|
80 |
-
margin-top: 23px;
|
81 |
-
}
|
82 |
-
.wf_customer_import_export .pipe-review-widget p{
|
83 |
-
margin-right:5px;
|
84 |
-
margin-left:5px;
|
85 |
-
}
|
86 |
-
</style>
|
87 |
-
<div class="wf_customer_import_export market-box table-box-main">
|
88 |
-
<div class="pipe-premium-features">
|
89 |
-
<center><a href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium Version', 'users-customers-import-export-for-wp-woocommerce'); ?></a></center>
|
90 |
-
<span>
|
91 |
-
<ul>
|
92 |
-
<li style='color:red;'><strong><?php _e('Your Business is precious! Go Premium!','users-customers-import-export-for-wp-woocommerce'); ?></strong></li>
|
93 |
-
|
94 |
-
<li><?php _e('HikeForce Import Export Users Plugin Premium version helps you to seamlessly import/export Customer details into your Woocommerce Store.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
95 |
-
|
96 |
-
<li><?php _e('Export/Import WooCommerce Customer details into a CSV file.', 'users-customers-import-export-for-wp-woocommerce'); ?><strong><?php _e('( Basic version supports only WordPress User details )', 'users-customers-import-export-for-wp-woocommerce'); ?></strong></li>
|
97 |
-
<li><?php _e('Various Filter options for exporting Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
98 |
-
<li><?php _e('Map and Transform fields while Importing Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
99 |
-
<li><?php _e('Change values while importing Customers using Evaluation Fields.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
100 |
-
<li><?php _e('Choice to Update or Skip existing imported Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
101 |
-
<li><?php _e('Choice to Send or Skip Emails for newly imported Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
102 |
-
<li><?php _e('Import/Export file from/to a remote server via FTP in Scheduled time interval with Cron Job.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
103 |
-
<li><?php _e('Excellent Support for setting it up!', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
104 |
-
</ul>
|
105 |
-
</span>
|
106 |
-
<center>
|
107 |
-
|
108 |
-
<a href="https://www.webtoffee.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'users-customers-import-export-for-wp-woocommerce'); ?></a></center>
|
109 |
-
</div>
|
110 |
-
<div class="pipe-review-widget">
|
111 |
-
<?php
|
112 |
-
echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'users-customers-import-export-for-wp-woocommerce'), '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'users-customers-import-export-for-wp-woocommerce') . '">★★★★★</a>');
|
113 |
-
?>
|
114 |
-
</div>
|
115 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
includes/views/export/html-wf-export-customers.php
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
<div class="tool-box bg-white p-20p pipe-view">
|
2 |
-
<h3 class="title"><?php _e('Export Users in CSV Format:', 'users-customers-import-export-for-wp-woocommerce'); ?></h3>
|
3 |
-
<p><?php _e('Export and download your Users in CSV format. This file can be used to import users back into your Website.', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
4 |
-
<form action="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&action=export'); ?>" method="post">
|
5 |
-
|
6 |
-
<table class="form-table">
|
7 |
-
<tr>
|
8 |
-
<th>
|
9 |
-
<label for="v_user_roles"><?php _e('User Roles', 'users-customers-import-export-for-wp-woocommerce'); ?></label>
|
10 |
-
</th>
|
11 |
-
<td>
|
12 |
-
<select id="v_user_roles" name="user_roles[]" data-placeholder="<?php _e('All Roles', 'users-customers-import-export-for-wp-woocommerce'); ?>" class="wc-enhanced-select" multiple="multiple">
|
13 |
-
|
14 |
-
<?php
|
15 |
-
global $wp_roles;
|
16 |
-
|
17 |
-
foreach ( $wp_roles->role_names as $role => $name ) {
|
18 |
-
echo '<option value="' . esc_attr( $role ) . '">' . $name . '</option>';
|
19 |
-
}
|
20 |
-
?>
|
21 |
-
</select>
|
22 |
-
|
23 |
-
<p style="font-size: 12px"><?php _e('Users with these roles will be exported.', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
24 |
-
</td>
|
25 |
-
</tr>
|
26 |
-
<tr>
|
27 |
-
<th>
|
28 |
-
<label for="v_offset"><?php _e('Offset', 'users-customers-import-export-for-wp-woocommerce'); ?></label>
|
29 |
-
</th>
|
30 |
-
<td>
|
31 |
-
<input type="text" name="offset" id="v_offset" placeholder="<?php _e('0', 'users-customers-import-export-for-wp-woocommerce'); ?>" class="input-text" />
|
32 |
-
<p style="font-size: 12px"><?php _e('The number of users to skip before returning.', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
33 |
-
</td>
|
34 |
-
</tr>
|
35 |
-
<tr>
|
36 |
-
<th>
|
37 |
-
<label for="v_limit"><?php _e('Limit', 'users-customers-import-export-for-wp-woocommerce'); ?></label>
|
38 |
-
</th>
|
39 |
-
<td>
|
40 |
-
<input type="text" name="limit" id="v_limit" placeholder="<?php _e('Unlimited', 'users-customers-import-export-for-wp-woocommerce'); ?>" class="input-text" />
|
41 |
-
<p style="font-size: 12px"><?php _e('The number of users to return.', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
42 |
-
</td>
|
43 |
-
</tr>
|
44 |
-
<tr>
|
45 |
-
<th>
|
46 |
-
<label for="v_columns"><?php _e('Columns', 'users-customers-import-export-for-wp-woocommerce'); ?></label>
|
47 |
-
</th>
|
48 |
-
<table id="datagrid">
|
49 |
-
<th style="text-align: left;">
|
50 |
-
<label for="v_columns"><?php _e('Column', 'users-customers-import-export-for-wp-woocommerce'); ?></label>
|
51 |
-
</th>
|
52 |
-
<th style="text-align: left;">
|
53 |
-
<label for="v_columns_name"><?php _e('Column Name', 'users-customers-import-export-for-wp-woocommerce'); ?></label>
|
54 |
-
</th>
|
55 |
-
<!-- select all boxes -->
|
56 |
-
<tr>
|
57 |
-
<td style="padding: 10px;">
|
58 |
-
<a href="#" id="pselectall" onclick="return false;" ><?php _e('Select all', 'users-customers-import-export-for-wp-woocommerce'); ?></a> /
|
59 |
-
<a href="#" id="punselectall" onclick="return false;"><?php _e('Unselect all', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
60 |
-
</td>
|
61 |
-
</tr>
|
62 |
-
|
63 |
-
<?php foreach ($post_columns as $pkey => $pcolumn) { ?>
|
64 |
-
<tr>
|
65 |
-
<td>
|
66 |
-
<input name= "columns[<?php echo $pkey; ?>]" type="checkbox" value="<?php echo $pkey; ?>" checked>
|
67 |
-
<label for="columns[<?php echo $pkey; ?>]"><?php _e($pcolumn, 'users-customers-import-export-for-wp-woocommerce'); ?></label>
|
68 |
-
</td>
|
69 |
-
<td>
|
70 |
-
<input type="text" name="columns_name[<?php echo $pkey; ?>]" value="<?php echo $pkey; ?>" class="input-text" />
|
71 |
-
</td>
|
72 |
-
</tr>
|
73 |
-
<?php } ?>
|
74 |
-
</table><br/>
|
75 |
-
</tr>
|
76 |
-
</table>
|
77 |
-
<p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Users', 'users-customers-import-export-for-wp-woocommerce'); ?>" /></p>
|
78 |
-
</form>
|
79 |
-
</div>
|
80 |
-
|
81 |
-
<script>
|
82 |
-
jQuery(document).ready(function (a) {
|
83 |
-
"use strict";
|
84 |
-
// Listen for click on toggle checkbox
|
85 |
-
jQuery( "body" ).on( "click", "#pselectall", function() {
|
86 |
-
// Iterate each checkbox
|
87 |
-
jQuery(':checkbox').each(function () {
|
88 |
-
this.checked = true;
|
89 |
-
});
|
90 |
-
});
|
91 |
-
jQuery( "body" ).on( "click", "#punselectall", function() {
|
92 |
-
// Iterate each checkbox
|
93 |
-
jQuery(':checkbox').each(function () {
|
94 |
-
this.checked = false;
|
95 |
-
});
|
96 |
-
});
|
97 |
-
});
|
98 |
-
</script>
|
99 |
-
|
100 |
-
<?php if(!class_exists('WooCommerce')){ ?>
|
101 |
-
<script>
|
102 |
-
jQuery(document).ready(function () {
|
103 |
-
jQuery('.wc-enhanced-select').select2();
|
104 |
-
|
105 |
-
});
|
106 |
-
</script>
|
107 |
-
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/views/export/market.php
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
?>
|
6 |
-
|
7 |
-
<style>
|
8 |
-
.wf_customer_import_export.market-box{
|
9 |
-
width:30%;
|
10 |
-
float: right;
|
11 |
-
}
|
12 |
-
|
13 |
-
.wf_customer_import_export .uipe-premium-features{
|
14 |
-
background: #fff;
|
15 |
-
padding: 5px;
|
16 |
-
/* margin-bottom: 23px;*/
|
17 |
-
margin-top: 5px;
|
18 |
-
}
|
19 |
-
.wf_customer_import_export .uipe-premium-features ul {
|
20 |
-
padding-left: 20px;
|
21 |
-
padding-right: 20px;
|
22 |
-
}
|
23 |
-
.wf_customer_import_export .uipe-premium-features .ticked-list li {
|
24 |
-
margin-bottom: 15px;
|
25 |
-
padding-left: 15px;
|
26 |
-
}
|
27 |
-
.wf_customer_import_export .uipe-premium-features .ticked-list li:before
|
28 |
-
{
|
29 |
-
font-family: dashicons;
|
30 |
-
text-decoration: inherit;
|
31 |
-
font-weight: 400;
|
32 |
-
font-style: normal;
|
33 |
-
vertical-align: top;
|
34 |
-
text-align: center;
|
35 |
-
content: "\f147";
|
36 |
-
margin-right: 10px;
|
37 |
-
margin-left: -25px;
|
38 |
-
font-size: 16px;
|
39 |
-
color: #3085bb;
|
40 |
-
}
|
41 |
-
.wf_customer_import_export .uipe-premium-features .button {
|
42 |
-
/*margin-bottom: 20px;*/
|
43 |
-
}
|
44 |
-
.wf_customer_import_export .uipe-premium-features .button-go-pro {
|
45 |
-
box-shadow: none;
|
46 |
-
border: 0;
|
47 |
-
text-shadow: none;
|
48 |
-
padding: 10px 15px;
|
49 |
-
height: auto;
|
50 |
-
font-size: 16px;
|
51 |
-
border-radius: 4px;
|
52 |
-
font-weight: 400;
|
53 |
-
background: #00cb95;
|
54 |
-
/* margin-top: 20px;*/
|
55 |
-
}
|
56 |
-
.wf_customer_import_export .uipe-premium-features .button-go-pro:hover,
|
57 |
-
.wf_customer_import_export .uipe-premium-features .button-go-pro:focus,
|
58 |
-
.wf_customer_import_export .uipe-premium-features .button-go-pro:active {
|
59 |
-
background: #00a378;
|
60 |
-
}
|
61 |
-
.wf_customer_import_export .uipe-premium-features .button-doc-demo {
|
62 |
-
border: 0;
|
63 |
-
background: #d8d8dc;
|
64 |
-
box-shadow: none;
|
65 |
-
padding: 10px 15px;
|
66 |
-
font-size: 15px;
|
67 |
-
height: auto;
|
68 |
-
margin-left: 10px;
|
69 |
-
margin-right: 10px;
|
70 |
-
margin-top: 10px;
|
71 |
-
}
|
72 |
-
.wf_customer_import_export .uipe-premium-features .button-doc-demo:hover,
|
73 |
-
.wf_customer_import_export .uipe-premium-features .button-doc-demo:focus,
|
74 |
-
.wf_customer_import_export .uipe-premium-features .button-doc-demo:active {
|
75 |
-
background: #dfdfe4;
|
76 |
-
}
|
77 |
-
.wf_customer_import_export .xa-uipe-rating-link{color:#ffc600;}
|
78 |
-
|
79 |
-
.wf_customer_import_export .uipe-review-widget{
|
80 |
-
background: #fff;
|
81 |
-
padding: 5px;
|
82 |
-
margin-bottom: 23px;
|
83 |
-
margin-top: 5px;
|
84 |
-
}
|
85 |
-
.wf_customer_import_export .uipe-review-widget p{
|
86 |
-
margin-right:5px;
|
87 |
-
margin-left:5px;
|
88 |
-
}
|
89 |
-
</style>
|
90 |
-
<div class="wf_customer_import_export market-box table-box-main">
|
91 |
-
<div class="uipe-review-widget">
|
92 |
-
<?php
|
93 |
-
echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'users-customers-import-export-for-wp-woocommerce'), '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews?rate=5#new-post" target="_blank" class="xa-uipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'users-customers-import-export-for-wp-woocommerce') . '">★★★★★</a>');
|
94 |
-
?>
|
95 |
-
</div>
|
96 |
-
|
97 |
-
<div class="uipe-premium-features">
|
98 |
-
<ul style="font-weight: bold; color:#666; list-style: none; background:#f8f8f8; padding:20px; margin:20px 15px; font-size: 15px; line-height: 26px;">
|
99 |
-
<li style=""><?php echo __('30 Day Money Back Guarantee','users-customers-import-export-for-wp-woocommerce'); ?></li>
|
100 |
-
<li style=""><?php echo __('Fast and Superior Support','users-customers-import-export-for-wp-woocommerce'); ?></li>
|
101 |
-
<li style="">
|
102 |
-
<a href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
103 |
-
</li>
|
104 |
-
</ul>
|
105 |
-
<span>
|
106 |
-
<ul class="ticked-list">
|
107 |
-
<li style='color:red;'><strong><?php _e('Your Business is precious! Go Premium!','users-customers-import-export-for-wp-woocommerce'); ?></strong></li>
|
108 |
-
|
109 |
-
<li><?php _e('WebToffee Import Export Users Plugin Premium version helps you to seamlessly import/export Customer details into your Woocommerce Store.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
110 |
-
|
111 |
-
<li><?php _e('Export/Import WooCommerce Customer details into a CSV file.', 'users-customers-import-export-for-wp-woocommerce'); ?><strong><?php _e('( Basic version supports only WordPress User details )', 'users-customers-import-export-for-wp-woocommerce'); ?></strong></li>
|
112 |
-
<li><?php _e('Various Filter options for exporting Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
113 |
-
<li><?php _e('Map and Transform fields while Importing Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
114 |
-
<li><?php _e('Change values while importing Customers using Evaluation Fields.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
115 |
-
<li><?php _e('Choice to Update or Skip existing imported Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
116 |
-
<li><?php _e('Choice to Send or Skip Emails for newly imported Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
117 |
-
<li><?php _e('Import/Export file from/to a remote server via FTP in Scheduled time interval with Cron Job.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
118 |
-
<li><?php _e('Excellent Support for setting it up!', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
119 |
-
<li><?php _e('BuddyPress Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
120 |
-
<li><?php _e('Ultimate Member – User Profile & Membership Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
121 |
-
<li><?php _e('Ultimate Membership Pro Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
122 |
-
<li><?php _e('Better Notifications for WP Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
123 |
-
<li><?php _e('Advanced Custom Fields (ACF) Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
124 |
-
|
125 |
-
|
126 |
-
</ul>
|
127 |
-
</span>
|
128 |
-
<center style="padding-bottom: 20px">
|
129 |
-
|
130 |
-
<a href="https://www.webtoffee.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'users-customers-import-export-for-wp-woocommerce'); ?></a></center>
|
131 |
-
</div>
|
132 |
-
|
133 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/views/html-wf-admin-screen.php
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
<div class="woocommerce">
|
2 |
-
<div class="icon32" id="icon-woocommerce-importer"><br></div>
|
3 |
-
<?php
|
4 |
-
include_once('html-wf-common-header.php');
|
5 |
-
switch ($tab) {
|
6 |
-
case "export" :
|
7 |
-
$this->admin_export_page();
|
8 |
-
include_once("market.php");
|
9 |
-
break;
|
10 |
-
case "help" :
|
11 |
-
$this->admin_help_page();
|
12 |
-
break;
|
13 |
-
default :
|
14 |
-
$this->admin_export_page();
|
15 |
-
break;
|
16 |
-
}
|
17 |
-
?>
|
18 |
-
|
19 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/views/html-wf-common-header.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
2 |
-
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex') ?>" class="nav-tab <?php echo ($tab == 'export') ? 'nav-tab-active' : ''; ?>"><?php _e('User/Customer Export', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
3 |
-
<a href="<?php echo admin_url('admin.php?import=wordpress_hf_user_csv') ?>" class="nav-tab <?php echo ($tab == 'import') ? 'nav-tab-active' : ''; ?>"><?php _e('User/Customer Import', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
4 |
-
<a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&tab=help'); ?>" class="nav-tab <?php echo ('help' == $tab) ? 'nav-tab-active' : ''; ?>"><?php _e('Help', 'wf_csv_import_export'); ?></a>
|
5 |
-
<a href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
|
6 |
-
</h2>
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/views/html-wf-help-guide.php
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
?>
|
6 |
-
<style>
|
7 |
-
.help-guide .cols {
|
8 |
-
display: flex;
|
9 |
-
}
|
10 |
-
.help-guide .inner-panel {
|
11 |
-
padding: 10px 11px 20px 11px;
|
12 |
-
background-color: #FFF;
|
13 |
-
margin: 15px 10px;
|
14 |
-
box-shadow: 1px 1px 5px 1px rgba(0,0,0,.1);
|
15 |
-
text-align: center;
|
16 |
-
width: 50%;
|
17 |
-
}
|
18 |
-
.help-guide .inner-panel p{
|
19 |
-
margin-bottom: 20px;
|
20 |
-
}
|
21 |
-
.help-guide .inner-panel img{
|
22 |
-
margin:12px 15px 0;
|
23 |
-
height: 90px;
|
24 |
-
width: 90px;
|
25 |
-
}
|
26 |
-
</style>
|
27 |
-
<div class="pipe-main-box">
|
28 |
-
<div class="tool-box bg-white p-20p pipe-view">
|
29 |
-
<div id="tab-help" class="coltwo-col panel help-guide">
|
30 |
-
<div class="cols">
|
31 |
-
<div class="inner-panel" style="">
|
32 |
-
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/setup.png'; ?>"/>
|
33 |
-
<h3><?php _e('How-to-setup', 'users-customers-import-export-for-wp-woocommerce'); ?></h3>
|
34 |
-
<p style=""><?php _e('Read the set-up guide to get started with the plugin', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
35 |
-
<a href="https://www.webtoffee.com/setting-wordpress-users-woocommerce-customers-import-export-plugin/" target="_blank" class="button button-primary"><?php _e('Setup Guide', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
36 |
-
</div>
|
37 |
-
<div class="inner-panel" style="">
|
38 |
-
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/documentation.png'; ?>"/>
|
39 |
-
<h3><?php _e('Documentation', 'users-customers-import-export-for-wp-woocommerce'); ?></h3>
|
40 |
-
<p style=""><?php _e('Troubleshoot any issues with our extensive documentation', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
41 |
-
<a target="_blank" href="https://www.webtoffee.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" class="button button-primary"><?php _e('Documentation', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
42 |
-
</div>
|
43 |
-
</div>
|
44 |
-
<div class="cols">
|
45 |
-
<div class="inner-panel" style="">
|
46 |
-
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/support.png'; ?>"/>
|
47 |
-
<h3><?php _e('Support', 'users-customers-import-export-for-wp-woocommerce'); ?></h3>
|
48 |
-
<p style=""><?php _e('We would love to help you on any queries or issues.', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
49 |
-
<a href="https://www.webtoffee.com/support/" target="_blank" class="button button-primary"><?php _e('Contact Us', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
50 |
-
</div>
|
51 |
-
<div class="inner-panel" style="">
|
52 |
-
<img src="<?php echo plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/csv.png'; ?>"/>
|
53 |
-
<h3><?php _e('Sample-CSV', 'users-customers-import-export-for-wp-woocommerce'); ?></h3>
|
54 |
-
<p style=""><?php _e('Familiarize yourself with the CSV format.', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
55 |
-
<a href="<?php echo plugins_url('Sample_Users.csv', WF_CustomerImpExpCsv_FILE); ?>" class="button button-primary"><?php _e('Get Sample CSV', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
56 |
-
</div>
|
57 |
-
</div>
|
58 |
-
</div>
|
59 |
-
</div>
|
60 |
-
<?php include_once("market.php"); ?>
|
61 |
-
<div class="clearfix"></div>
|
62 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/views/import/html-wf-import-customers.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<div class="tool-box">
|
2 |
-
<h3 class="title"><?php _e('Import Users in CSV Format:', 'users-customers-import-export-for-wp-woocommerce'); ?></h3>
|
3 |
-
<p><?php _e('Import Users in CSV format from your computer', 'users-customers-import-export-for-wp-woocommerce'); ?></p>
|
4 |
-
<p class="submit">
|
5 |
-
<?php $import_url = admin_url('admin.php?import=wordpress_hf_user_csv'); ?>
|
6 |
-
<a class="button button-primary" id="mylink" href="<?php echo $import_url; ?>"><?php _e('Import Users', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
7 |
-
</p>
|
8 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/views/market.php
DELETED
@@ -1,132 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
-
exit;
|
4 |
-
}
|
5 |
-
?>
|
6 |
-
|
7 |
-
<style>
|
8 |
-
.wf_customer_import_export.market-box{
|
9 |
-
width:30%;
|
10 |
-
float: right;
|
11 |
-
}
|
12 |
-
|
13 |
-
.wf_customer_import_export .uipe-premium-features{
|
14 |
-
background: #fff;
|
15 |
-
padding: 5px;
|
16 |
-
/* margin-bottom: 23px;*/
|
17 |
-
margin-top: 5px;
|
18 |
-
}
|
19 |
-
.wf_customer_import_export .uipe-premium-features ul {
|
20 |
-
padding-left: 20px;
|
21 |
-
padding-right: 20px;
|
22 |
-
}
|
23 |
-
.wf_customer_import_export .uipe-premium-features .ticked-list li {
|
24 |
-
margin-bottom: 15px;
|
25 |
-
padding-left: 15px;
|
26 |
-
}
|
27 |
-
.wf_customer_import_export .uipe-premium-features .ticked-list li:before
|
28 |
-
{
|
29 |
-
font-family: dashicons;
|
30 |
-
text-decoration: inherit;
|
31 |
-
font-weight: 400;
|
32 |
-
font-style: normal;
|
33 |
-
vertical-align: top;
|
34 |
-
text-align: center;
|
35 |
-
content: "\f147";
|
36 |
-
margin-right: 10px;
|
37 |
-
margin-left: -25px;
|
38 |
-
font-size: 16px;
|
39 |
-
color: #3085bb;
|
40 |
-
}
|
41 |
-
.wf_customer_import_export .uipe-premium-features .button {
|
42 |
-
/*margin-bottom: 20px;*/
|
43 |
-
}
|
44 |
-
.wf_customer_import_export .uipe-premium-features .button-go-pro {
|
45 |
-
box-shadow: none;
|
46 |
-
border: 0;
|
47 |
-
text-shadow: none;
|
48 |
-
padding: 10px 15px;
|
49 |
-
height: auto;
|
50 |
-
font-size: 16px;
|
51 |
-
border-radius: 4px;
|
52 |
-
font-weight: 400;
|
53 |
-
background: #00cb95;
|
54 |
-
/* margin-top: 20px;*/
|
55 |
-
}
|
56 |
-
.wf_customer_import_export .uipe-premium-features .button-go-pro:hover,
|
57 |
-
.wf_customer_import_export .uipe-premium-features .button-go-pro:focus,
|
58 |
-
.wf_customer_import_export .uipe-premium-features .button-go-pro:active {
|
59 |
-
background: #00a378;
|
60 |
-
}
|
61 |
-
.wf_customer_import_export .uipe-premium-features .button-doc-demo {
|
62 |
-
border: 0;
|
63 |
-
background: #d8d8dc;
|
64 |
-
box-shadow: none;
|
65 |
-
padding: 10px 15px;
|
66 |
-
font-size: 15px;
|
67 |
-
height: auto;
|
68 |
-
margin-left: 10px;
|
69 |
-
margin-right: 10px;
|
70 |
-
margin-top: 10px;
|
71 |
-
}
|
72 |
-
.wf_customer_import_export .uipe-premium-features .button-doc-demo:hover,
|
73 |
-
.wf_customer_import_export .uipe-premium-features .button-doc-demo:focus,
|
74 |
-
.wf_customer_import_export .uipe-premium-features .button-doc-demo:active {
|
75 |
-
background: #dfdfe4;
|
76 |
-
}
|
77 |
-
.wf_customer_import_export .xa-uipe-rating-link{color:#ffc600;}
|
78 |
-
|
79 |
-
.wf_customer_import_export .uipe-review-widget{
|
80 |
-
background: #fff;
|
81 |
-
padding: 5px;
|
82 |
-
margin-bottom: 23px;
|
83 |
-
}
|
84 |
-
.wf_customer_import_export .uipe-review-widget p{
|
85 |
-
margin-right:5px;
|
86 |
-
margin-left:5px;
|
87 |
-
}
|
88 |
-
</style>
|
89 |
-
<div class="wf_customer_import_export market-box table-box-main">
|
90 |
-
<div class="uipe-review-widget">
|
91 |
-
<?php
|
92 |
-
echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'users-customers-import-export-for-wp-woocommerce'), '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews?rate=5#new-post" target="_blank" class="xa-uipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'users-customers-import-export-for-wp-woocommerce') . '">★★★★★</a>');
|
93 |
-
?>
|
94 |
-
</div>
|
95 |
-
|
96 |
-
<div class="uipe-premium-features">
|
97 |
-
<ul style="font-weight: bold; color:#666; list-style: none; background:#f8f8f8; padding:20px; margin:20px 15px; font-size: 15px; line-height: 26px;">
|
98 |
-
<li style=""><?php echo __('30 Day Money Back Guarantee','users-customers-import-export-for-wp-woocommerce'); ?></li>
|
99 |
-
<li style=""><?php echo __('Fast and Superior Support','users-customers-import-export-for-wp-woocommerce'); ?></li>
|
100 |
-
<li style="">
|
101 |
-
<a href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium', 'users-customers-import-export-for-wp-woocommerce'); ?></a>
|
102 |
-
</li>
|
103 |
-
</ul>
|
104 |
-
<span>
|
105 |
-
<ul class="ticked-list">
|
106 |
-
<li style='color:red;'><strong><?php _e('Your Business is precious! Go Premium!','users-customers-import-export-for-wp-woocommerce'); ?></strong></li>
|
107 |
-
|
108 |
-
<li><?php _e('WebToffee Import Export Users Plugin Premium version helps you to seamlessly import/export Customer details into your Woocommerce Store.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
109 |
-
|
110 |
-
<li><?php _e('Export/Import WooCommerce Customer details into a CSV file.', 'users-customers-import-export-for-wp-woocommerce'); ?><strong><?php _e('( Basic version supports only WordPress User details )', 'users-customers-import-export-for-wp-woocommerce'); ?></strong></li>
|
111 |
-
<li><?php _e('Various Filter options for exporting Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
112 |
-
<li><?php _e('Map and Transform fields while Importing Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
113 |
-
<li><?php _e('Change values while importing Customers using Evaluation Fields.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
114 |
-
<li><?php _e('Choice to Update or Skip existing imported Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
115 |
-
<li><?php _e('Choice to Send or Skip Emails for newly imported Customers.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
116 |
-
<li><?php _e('Import/Export file from/to a remote server via FTP in Scheduled time interval with Cron Job.', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
117 |
-
<li><?php _e('Excellent Support for setting it up!', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
118 |
-
<li><?php _e('BuddyPress Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
119 |
-
<li><?php _e('Ultimate Member – User Profile & Membership Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
120 |
-
<li><?php _e('Ultimate Membership Pro Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
121 |
-
<li><?php _e('Better Notifications for WP Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
122 |
-
<li><?php _e('Advanced Custom Fields (ACF) Plugin compatible,', 'users-customers-import-export-for-wp-woocommerce'); ?></li>
|
123 |
-
|
124 |
-
|
125 |
-
</ul>
|
126 |
-
</span>
|
127 |
-
<center style="padding-bottom: 20px">
|
128 |
-
|
129 |
-
<a href="https://www.webtoffee.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'users-customers-import-export-for-wp-woocommerce'); ?></a></center>
|
130 |
-
</div>
|
131 |
-
|
132 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
lang/users-customers-import-export-for-wp-woocommerce-de_DE.mo
DELETED
Binary file
|
lang/users-customers-import-export-for-wp-woocommerce-de_DE.po
DELETED
@@ -1,536 +0,0 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: \n"
|
4 |
-
"POT-Creation-Date: 2019-01-17 12:12+0530\n"
|
5 |
-
"PO-Revision-Date: 2019-01-17 12:13+0530\n"
|
6 |
-
"Last-Translator: \n"
|
7 |
-
"Language-Team: \n"
|
8 |
-
"Language: de\n"
|
9 |
-
"MIME-Version: 1.0\n"
|
10 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
-
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Generator: Poedit 1.8.12\n"
|
13 |
-
"X-Poedit-Basepath: ..\n"
|
14 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
-
"X-Poedit-KeywordsList: __;_e\n"
|
16 |
-
"X-Poedit-SearchPath-0: .\n"
|
17 |
-
"X-Poedit-SearchPathExcluded-0: styles\n"
|
18 |
-
|
19 |
-
#: includes/class-wf-customerimpexpcsv-admin-screen.php:22
|
20 |
-
msgid ""
|
21 |
-
"User/Customer CSV Import Export requires the function "
|
22 |
-
"<code>mb_detect_encoding</code> to import and export CSV files. Please ask "
|
23 |
-
"your hosting provider to enable this function."
|
24 |
-
msgstr ""
|
25 |
-
"Produkt CSV Import Export krever funksjonen <code> mb_detect_encoding </"
|
26 |
-
"code> for å importere og eksportere CSV-filer. Vennligst spør "
|
27 |
-
"nettleverandøren din for å aktivere denne funksjonen."
|
28 |
-
|
29 |
-
#: includes/class-wf-customerimpexpcsv-admin-screen.php:30
|
30 |
-
msgid "User Import Export"
|
31 |
-
msgstr "Importieren und Exportieren"
|
32 |
-
|
33 |
-
#: includes/class-wf-customerimpexpcsv-admin-screen.php:31
|
34 |
-
msgid "Customer Import Export"
|
35 |
-
msgstr "Kundenimport Export"
|
36 |
-
|
37 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:19
|
38 |
-
msgid "Used it successfully. Don't need anymore."
|
39 |
-
msgstr "Erfolgreich eingesetzt Brauche nicht mehr"
|
40 |
-
|
41 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:21
|
42 |
-
msgid "Have used it successfully and aint in need of it anymore"
|
43 |
-
msgstr "Habe es erfolgreich benutzt und brauche es nicht mehr"
|
44 |
-
|
45 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:25
|
46 |
-
msgid "I couldn't understand how to make it work"
|
47 |
-
msgstr "Ich habe nicht verstanden, wie es funktioniert"
|
48 |
-
|
49 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:27
|
50 |
-
msgid "Would you like us to assist you?"
|
51 |
-
msgstr "Möchtest Du Hilfe?"
|
52 |
-
|
53 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:31
|
54 |
-
msgid "I found a better plugin"
|
55 |
-
msgstr "Ich fand ein besseres Plugin"
|
56 |
-
|
57 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:33
|
58 |
-
msgid "Which plugin?"
|
59 |
-
msgstr "Welches Plugin?"
|
60 |
-
|
61 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:37
|
62 |
-
msgid "The plugin is great, but I need specific feature that you don't support"
|
63 |
-
msgstr ""
|
64 |
-
"Das Plugin ist großartig, aber ich brauche besondere Funktionen, die das "
|
65 |
-
"PlugIn nicht bietet"
|
66 |
-
|
67 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:39
|
68 |
-
msgid "Could you tell us more about that feature?"
|
69 |
-
msgstr "Können Sie uns mehr über dieses Feature erzählen?"
|
70 |
-
|
71 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:43
|
72 |
-
msgid "The plugin is not working"
|
73 |
-
msgstr "Das PlugIn funktioniert nicht"
|
74 |
-
|
75 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:45
|
76 |
-
msgid "Could you tell us a bit more whats not working?"
|
77 |
-
msgstr "Können Sie uns mehr dazu sagen, was nicht funktioniert?"
|
78 |
-
|
79 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:49
|
80 |
-
msgid "It's not what I was looking for"
|
81 |
-
msgstr "Es ist nicht das, was ich suchte"
|
82 |
-
|
83 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:55
|
84 |
-
msgid "The plugin didn't work as expected"
|
85 |
-
msgstr "Das PlugIn funktioniert nicht wie erwartet"
|
86 |
-
|
87 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:57
|
88 |
-
msgid "What did you expect?"
|
89 |
-
msgstr "Was haben Sie erwartet?"
|
90 |
-
|
91 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:61
|
92 |
-
msgid "Other"
|
93 |
-
msgstr "Sonstiges"
|
94 |
-
|
95 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:63
|
96 |
-
msgid "Could you tell us a bit more?"
|
97 |
-
msgstr "Könnten Sie uns noch etwas mehr erzählen?"
|
98 |
-
|
99 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:81
|
100 |
-
msgid "If you have a moment, please let us know why you are deactivating:"
|
101 |
-
msgstr ""
|
102 |
-
"Wenn Du einen Moment Zeit hast, lass uns wissen, warum Du das Plugin "
|
103 |
-
"deaktivieren möchtest:"
|
104 |
-
|
105 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:93
|
106 |
-
msgid "I rather wouldn't say"
|
107 |
-
msgstr "Ich würde das lieber nicht sagen"
|
108 |
-
|
109 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:94
|
110 |
-
msgid "Submit & Deactivate"
|
111 |
-
msgstr "Absenden & Deaktivieren"
|
112 |
-
|
113 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:95
|
114 |
-
msgid "Cancel"
|
115 |
-
msgstr "Abbrechen"
|
116 |
-
|
117 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:174
|
118 |
-
msgid "Deactivate and leave a review"
|
119 |
-
msgstr "Deaktivieren Sie und hinterlassen Sie eine Bewertung"
|
120 |
-
|
121 |
-
#: includes/importer/class-wf-csv-parser.php:193
|
122 |
-
#, php-format
|
123 |
-
msgid "> Row %s - skipped due to record offset."
|
124 |
-
msgstr "> Zeile%s - Überspringt wegen Datensatzversatz."
|
125 |
-
|
126 |
-
#: includes/importer/class-wf-csv-parser.php:199
|
127 |
-
#, php-format
|
128 |
-
msgid "> Row %s - skipped: cannot insert user without email."
|
129 |
-
msgstr ""
|
130 |
-
"> Zeile%s - übersprungen: Benutzer können ohne E-Mail nicht eingefügt werden."
|
131 |
-
|
132 |
-
#: includes/importer/class-wf-csv-parser.php:204
|
133 |
-
#, php-format
|
134 |
-
msgid "> Row %s - skipped: Email is not valid."
|
135 |
-
msgstr "> Zeile%s - übersprungen: E-Mail ist ungültig."
|
136 |
-
|
137 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:117
|
138 |
-
msgid "Error with handle_upload!"
|
139 |
-
msgstr "Fehler mit Handle_upload!"
|
140 |
-
|
141 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:142
|
142 |
-
msgid "Row"
|
143 |
-
msgstr "Zeile"
|
144 |
-
|
145 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:143
|
146 |
-
msgid "User ID"
|
147 |
-
msgstr "Benutzer ID"
|
148 |
-
|
149 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:144
|
150 |
-
msgid "User Status"
|
151 |
-
msgstr "Benutzerstatus"
|
152 |
-
|
153 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:145
|
154 |
-
msgid "Status Msg"
|
155 |
-
msgstr "Status Msg"
|
156 |
-
|
157 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:214
|
158 |
-
msgid "AJAX Error"
|
159 |
-
msgstr "Ajax Fehler"
|
160 |
-
|
161 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:307
|
162 |
-
msgid "Error finding uploaded file!"
|
163 |
-
msgstr "Fehler beim suchen Datei hochgeladen!"
|
164 |
-
|
165 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:374
|
166 |
-
msgid "Step 1..."
|
167 |
-
msgstr "1. Schritt"
|
168 |
-
|
169 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:379
|
170 |
-
msgid "Step 2..."
|
171 |
-
msgstr "2. Schritt"
|
172 |
-
|
173 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:383
|
174 |
-
msgid "Finalizing..."
|
175 |
-
msgstr "Finalisierung"
|
176 |
-
|
177 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:386
|
178 |
-
msgid "Finished. Import complete."
|
179 |
-
msgstr "Fertig. Import abgeschlossen."
|
180 |
-
|
181 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:456
|
182 |
-
msgid ""
|
183 |
-
"Columns are pre-selected using the Mapping file: \"<b style=\"color:gray\">"
|
184 |
-
msgstr "Spalten werden mithilfe der Zuordnungsdatei vorgewählt: \""
|
185 |
-
|
186 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:475
|
187 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:600
|
188 |
-
msgid "Processing users."
|
189 |
-
msgstr "Benutzer bearbeiten."
|
190 |
-
|
191 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:493
|
192 |
-
msgid "Finished processing Users."
|
193 |
-
msgstr "Beendete Verarbeitung Benutzer."
|
194 |
-
|
195 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:516
|
196 |
-
msgid "Parsing products CSV."
|
197 |
-
msgstr "Parsen Produkte CSV."
|
198 |
-
|
199 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:523
|
200 |
-
msgid "Finished parsing products CSV."
|
201 |
-
msgstr "Parsing Fertigprodukte CSV."
|
202 |
-
|
203 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:563
|
204 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:578
|
205 |
-
msgid "Sorry, there has been an error."
|
206 |
-
msgstr "Leider ist ein Fehler aufgetreten."
|
207 |
-
|
208 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:604
|
209 |
-
msgid "Cannot insert user without email"
|
210 |
-
msgstr "Benutzer kann ohne E-Mail nicht eingefügt werden"
|
211 |
-
|
212 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:608
|
213 |
-
msgid "skipped: Email is not valid."
|
214 |
-
msgstr "Übersprungen: E-Mail ist ungültig."
|
215 |
-
|
216 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:624
|
217 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:657
|
218 |
-
#, php-format
|
219 |
-
msgid "> “%s”"
|
220 |
-
msgstr "> “ %s ”"
|
221 |
-
|
222 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:634
|
223 |
-
#, php-format
|
224 |
-
msgid "> Error inserting %s: %s"
|
225 |
-
msgstr "> Fehler beim Einfügen von%s:%s"
|
226 |
-
|
227 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:641
|
228 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:642
|
229 |
-
msgid "An error occurred with the customer information provided."
|
230 |
-
msgstr "Bei den angegebenen Kundeninformationen ist ein Fehler aufgetreten."
|
231 |
-
|
232 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:660
|
233 |
-
#, php-format
|
234 |
-
msgid "> Finished importing user %s"
|
235 |
-
msgstr "> Import des Benutzers%s abgeschlossen"
|
236 |
-
|
237 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:661
|
238 |
-
msgid "Finished processing users."
|
239 |
-
msgstr "Fertige Benutzer der Verarbeitung."
|
240 |
-
|
241 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:767
|
242 |
-
msgid "User could not be created without Email."
|
243 |
-
msgstr "Benutzer konnte nicht ohne E-Mail erstellt werden."
|
244 |
-
|
245 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:800
|
246 |
-
msgid "Import"
|
247 |
-
msgstr "Importieren"
|
248 |
-
|
249 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:800
|
250 |
-
msgid "Merge Users"
|
251 |
-
msgstr "Benutzer zusammenführen"
|
252 |
-
|
253 |
-
#: includes/importer/views/html-wf-import-greeting.php:5
|
254 |
-
#: includes/views/html-wf-admin-screen.php:4
|
255 |
-
msgid "User/Customer Export"
|
256 |
-
msgstr "Benutzer- / Kundenexport"
|
257 |
-
|
258 |
-
#: includes/importer/views/html-wf-import-greeting.php:6
|
259 |
-
#: includes/views/html-wf-admin-screen.php:5
|
260 |
-
msgid "User/Customer Import"
|
261 |
-
msgstr "Kundenimport"
|
262 |
-
|
263 |
-
#: includes/importer/views/html-wf-import-greeting.php:7
|
264 |
-
#: includes/views/html-wf-admin-screen.php:6
|
265 |
-
msgid "Help"
|
266 |
-
msgstr "Hilfe"
|
267 |
-
|
268 |
-
#: includes/importer/views/html-wf-import-greeting.php:8
|
269 |
-
#: includes/views/html-wf-admin-screen.php:7
|
270 |
-
msgid "Upgrade to Premium for More Features"
|
271 |
-
msgstr "Upgrade auf Premium für mehr Funktionen"
|
272 |
-
|
273 |
-
#: includes/importer/views/html-wf-import-greeting.php:16
|
274 |
-
#: includes/views/import/html-wf-import-customers.php:2
|
275 |
-
msgid "Import Users in CSV Format:"
|
276 |
-
msgstr "Benutzer im CSV-Format importieren:"
|
277 |
-
|
278 |
-
#: includes/importer/views/html-wf-import-greeting.php:17
|
279 |
-
msgid ""
|
280 |
-
"Import Users in CSV format from your computer.You can import users/customers "
|
281 |
-
"(in CSV format) in to the shop."
|
282 |
-
msgstr ""
|
283 |
-
"Benutzer im CSV-Format von Ihrem Computer importieren. Sie können Benutzer / "
|
284 |
-
"Kunden (im CSV-Format) in den Shop importieren."
|
285 |
-
|
286 |
-
#: includes/importer/views/html-wf-import-greeting.php:19
|
287 |
-
msgid ""
|
288 |
-
"Before you can upload your import file, you will need to fix the following "
|
289 |
-
"error:"
|
290 |
-
msgstr ""
|
291 |
-
"Bevor Sie Ihre Importdatei hochladen können, müssen Sie folgenden Fehler "
|
292 |
-
"beheben:"
|
293 |
-
|
294 |
-
#: includes/importer/views/html-wf-import-greeting.php:28
|
295 |
-
msgid "Select a file from your computer"
|
296 |
-
msgstr "Methode 1: Wählen Sie eine Datei von Ihrem computer"
|
297 |
-
|
298 |
-
#: includes/importer/views/html-wf-import-greeting.php:34
|
299 |
-
#, php-format
|
300 |
-
msgid "Maximum size: %s"
|
301 |
-
msgstr "Maximale Größe: %s"
|
302 |
-
|
303 |
-
#: includes/importer/views/market.php:89 includes/views/export/market.php:94
|
304 |
-
msgid "Upgrade to Premium Version"
|
305 |
-
msgstr "Upgrade auf Premium-Version"
|
306 |
-
|
307 |
-
#: includes/importer/views/market.php:92 includes/views/export/market.php:97
|
308 |
-
msgid "Your Business is precious! Go Premium!"
|
309 |
-
msgstr "Ihr Geschäft ist kostbar! Go Premium-!"
|
310 |
-
|
311 |
-
#: includes/importer/views/market.php:94 includes/views/export/market.php:99
|
312 |
-
msgid ""
|
313 |
-
"HikeForce Import Export Users Plugin Premium version helps you to seamlessly "
|
314 |
-
"import/export Customer details into your Woocommerce Store."
|
315 |
-
msgstr ""
|
316 |
-
"HikeForce Import Export Plugin Premium-versjonen hjelper deg med å sømløst "
|
317 |
-
"importere / eksportere produkter til din Woocommerce Store."
|
318 |
-
|
319 |
-
#: includes/importer/views/market.php:96 includes/views/export/market.php:101
|
320 |
-
msgid "Export/Import WooCommerce Customer details into a CSV file."
|
321 |
-
msgstr ""
|
322 |
-
"Exportieren / Importieren von WooCommerce-Kundendetails in eine CSV-Datei."
|
323 |
-
|
324 |
-
#: includes/importer/views/market.php:96 includes/views/export/market.php:101
|
325 |
-
msgid "( Basic version supports only WordPress User details )"
|
326 |
-
msgstr "(Basisversion unterstützt nur WordPress-Benutzerdetails)"
|
327 |
-
|
328 |
-
#: includes/importer/views/market.php:97 includes/views/export/market.php:102
|
329 |
-
msgid "Various Filter options for exporting Customers."
|
330 |
-
msgstr "Verschiedene Filteroptionen für den Export von Kunden."
|
331 |
-
|
332 |
-
#: includes/importer/views/market.php:98 includes/views/export/market.php:103
|
333 |
-
msgid "Map and Transform fields while Importing Customers."
|
334 |
-
msgstr "Felder zuordnen und umwandeln, während Kunden importiert werden."
|
335 |
-
|
336 |
-
#: includes/importer/views/market.php:99 includes/views/export/market.php:104
|
337 |
-
msgid "Change values while importing Customers using Evaluation Fields."
|
338 |
-
msgstr ""
|
339 |
-
"Ändern Sie die Werte, während Sie Kunden mithilfe von Bewertungsfeldern "
|
340 |
-
"importieren."
|
341 |
-
|
342 |
-
#: includes/importer/views/market.php:100 includes/views/export/market.php:105
|
343 |
-
msgid "Choice to Update or Skip existing imported Customers."
|
344 |
-
msgstr ""
|
345 |
-
"Wahl zum Aktualisieren oder Überspringen vorhandener importierter Kunden."
|
346 |
-
|
347 |
-
#: includes/importer/views/market.php:101 includes/views/export/market.php:106
|
348 |
-
msgid "Choice to Send or Skip Emails for newly imported Customers."
|
349 |
-
msgstr ""
|
350 |
-
"Wahl zum Senden oder Überspringen von E-Mails für neu importierte Kunden."
|
351 |
-
|
352 |
-
#: includes/importer/views/market.php:102 includes/views/export/market.php:107
|
353 |
-
msgid ""
|
354 |
-
"Import/Export file from/to a remote server via FTP in Scheduled time "
|
355 |
-
"interval with Cron Job."
|
356 |
-
msgstr ""
|
357 |
-
"Importieren / Exportieren von Dateien von / zu einem Remote-Server über FTP "
|
358 |
-
"im geplanten Zeitintervall mit Cron Job."
|
359 |
-
|
360 |
-
#: includes/importer/views/market.php:103 includes/views/export/market.php:108
|
361 |
-
msgid "Excellent Support for setting it up!"
|
362 |
-
msgstr "-Hervorragende Unterstützung für sie eingerichtet!"
|
363 |
-
|
364 |
-
#: includes/importer/views/market.php:108 includes/views/export/market.php:113
|
365 |
-
#: includes/views/html-wf-help-guide.php:39
|
366 |
-
#: includes/views/html-wf-help-guide.php:41
|
367 |
-
msgid "Documentation"
|
368 |
-
msgstr "Dokumentation"
|
369 |
-
|
370 |
-
#: includes/importer/views/market.php:112 includes/views/export/market.php:90
|
371 |
-
#, php-format
|
372 |
-
msgid ""
|
373 |
-
"<div class=\"\"><p><i>If you like the plugin please leave us a %1$s review!</"
|
374 |
-
"i><p></div>"
|
375 |
-
msgstr ""
|
376 |
-
"<div class=\"\"><p><i>Wenn Ihnen das Plugin gefällt, lassen Sie uns bitte "
|
377 |
-
"eine %1$s Rezension zukommen!</i><p></div>"
|
378 |
-
|
379 |
-
#: includes/views/export/html-wf-export-customers.php:4
|
380 |
-
msgid "Export Users in CSV Format:"
|
381 |
-
msgstr "Benutzer im CSV-Format exportieren:"
|
382 |
-
|
383 |
-
#: includes/views/export/html-wf-export-customers.php:5
|
384 |
-
msgid ""
|
385 |
-
"Export and download your Users in CSV format. This file can be used to "
|
386 |
-
"import users back into your Website."
|
387 |
-
msgstr ""
|
388 |
-
"Exportieren und laden Sie Ihre Benutzer im CSV-Format. Diese Datei kann "
|
389 |
-
"verwendet werden, um Benutzer zurück in Ihre Website zu importieren."
|
390 |
-
|
391 |
-
#: includes/views/export/html-wf-export-customers.php:11
|
392 |
-
msgid "User Roles"
|
393 |
-
msgstr "Benutzerrollen"
|
394 |
-
|
395 |
-
#: includes/views/export/html-wf-export-customers.php:14
|
396 |
-
msgid "All Roles"
|
397 |
-
msgstr "Alle Rollen"
|
398 |
-
|
399 |
-
#: includes/views/export/html-wf-export-customers.php:25
|
400 |
-
msgid "Users with these roles will be exported."
|
401 |
-
msgstr "Benutzer mit diesen Rollen werden exportiert."
|
402 |
-
|
403 |
-
#: includes/views/export/html-wf-export-customers.php:30
|
404 |
-
msgid "Offset"
|
405 |
-
msgstr "Mitarbeiter überspringen"
|
406 |
-
|
407 |
-
#: includes/views/export/html-wf-export-customers.php:33
|
408 |
-
msgid "0"
|
409 |
-
msgstr "0"
|
410 |
-
|
411 |
-
#: includes/views/export/html-wf-export-customers.php:34
|
412 |
-
msgid "The number of users to skip before returning."
|
413 |
-
msgstr ""
|
414 |
-
"Die Anzahl der Benutzer, die vor der Rückkehr übersprungen werden sollen."
|
415 |
-
|
416 |
-
#: includes/views/export/html-wf-export-customers.php:39
|
417 |
-
msgid "Limit"
|
418 |
-
msgstr "Limit"
|
419 |
-
|
420 |
-
#: includes/views/export/html-wf-export-customers.php:42
|
421 |
-
msgid "Unlimited"
|
422 |
-
msgstr "Unbegrenzt"
|
423 |
-
|
424 |
-
#: includes/views/export/html-wf-export-customers.php:43
|
425 |
-
msgid "The number of users to return."
|
426 |
-
msgstr "Die Anzahl der Benutzer, die zurückgegeben werden sollen."
|
427 |
-
|
428 |
-
#: includes/views/export/html-wf-export-customers.php:53
|
429 |
-
msgid "Columns"
|
430 |
-
msgstr "Spalten"
|
431 |
-
|
432 |
-
#: includes/views/export/html-wf-export-customers.php:57
|
433 |
-
msgid "Column"
|
434 |
-
msgstr "Spalte"
|
435 |
-
|
436 |
-
#: includes/views/export/html-wf-export-customers.php:60
|
437 |
-
msgid "Column Name"
|
438 |
-
msgstr "Spaltenname"
|
439 |
-
|
440 |
-
#: includes/views/export/html-wf-export-customers.php:87
|
441 |
-
msgid "Export Users"
|
442 |
-
msgstr "Benutzer exportieren"
|
443 |
-
|
444 |
-
#: includes/views/html-wf-help-guide.php:31
|
445 |
-
msgid "How-to-setup"
|
446 |
-
msgstr "Anleitung zur Einrichtung"
|
447 |
-
|
448 |
-
#: includes/views/html-wf-help-guide.php:32
|
449 |
-
msgid "Get to know about our produt in 3 minutes with this video"
|
450 |
-
msgstr "Lernen Sie unser Produkt in 3 Minuten mit diesem Video kennen."
|
451 |
-
|
452 |
-
#: includes/views/html-wf-help-guide.php:34
|
453 |
-
msgid "Setup Guide"
|
454 |
-
msgstr "Einrichtungsanleitung"
|
455 |
-
|
456 |
-
#: includes/views/html-wf-help-guide.php:40
|
457 |
-
msgid "Refer to our documentation to set and get started"
|
458 |
-
msgstr ""
|
459 |
-
"Schlagen Sie in unserer Dokumentation nach, um die Einstellungen vorzunehmen "
|
460 |
-
"und loszulegen."
|
461 |
-
|
462 |
-
#: includes/views/html-wf-help-guide.php:46
|
463 |
-
#: users-customers-import-export-for-wp-woocommerce.php:97
|
464 |
-
msgid "Support"
|
465 |
-
msgstr "Unterstützen"
|
466 |
-
|
467 |
-
#: includes/views/html-wf-help-guide.php:47
|
468 |
-
msgid "We would love to help you on any queries or issues."
|
469 |
-
msgstr "Gerne stehen wir Ihnen bei Fragen und Problemen zur Verfügung."
|
470 |
-
|
471 |
-
#: includes/views/html-wf-help-guide.php:49
|
472 |
-
msgid "Contact Us"
|
473 |
-
msgstr ""
|
474 |
-
"Keine Lieferarten verfügbar. Bitte prüfen Sie Ihre Adresse – oder "
|
475 |
-
"kontaktieren Sie uns, wenn Sie Hilfe benötigen."
|
476 |
-
|
477 |
-
#: includes/views/import/html-wf-import-customers.php:3
|
478 |
-
msgid "Import Users in CSV format from your computer"
|
479 |
-
msgstr "Importieren Sie Benutzer im CSV-Format von Ihrem Computer"
|
480 |
-
|
481 |
-
#: includes/views/import/html-wf-import-customers.php:6
|
482 |
-
msgid "Import Users"
|
483 |
-
msgstr "User importieren"
|
484 |
-
|
485 |
-
#: users-customers-import-export-for-wp-woocommerce.php:28
|
486 |
-
msgid ""
|
487 |
-
"You already have the Premium version installed. For any issues, kindly "
|
488 |
-
"contact our <a target='_blank' href='https://www.webtoffee.com/"
|
489 |
-
"support/'>support</a>."
|
490 |
-
msgstr ""
|
491 |
-
"Sie haben bereits die Premium-Version installiert. Bei Fragen wenden Sie "
|
492 |
-
"sich bitte an unseren <a target='_blank' href='https://www.webtoffee.com/"
|
493 |
-
"support/'>Support</a> ."
|
494 |
-
|
495 |
-
#: users-customers-import-export-for-wp-woocommerce.php:95
|
496 |
-
msgid "Import Export Users"
|
497 |
-
msgstr "Import / Export Benutzer"
|
498 |
-
|
499 |
-
#: users-customers-import-export-for-wp-woocommerce.php:96
|
500 |
-
msgid "Premium Upgrade"
|
501 |
-
msgstr "Premium-Upgrade"
|
502 |
-
|
503 |
-
#: users-customers-import-export-for-wp-woocommerce.php:98
|
504 |
-
msgid "Review"
|
505 |
-
msgstr "Bewertung"
|
506 |
-
|
507 |
-
#: users-customers-import-export-for-wp-woocommerce.php:157
|
508 |
-
msgid "Import <strong>users/customers</strong> to your site via a csv file."
|
509 |
-
msgstr ""
|
510 |
-
"Importieren Sie <strong>Benutzer / Kunden</strong> über eine CSV-Datei in "
|
511 |
-
"Ihre Site."
|
512 |
-
|
513 |
-
#: users-customers-import-export-for-wp-woocommerce.php:184
|
514 |
-
msgid "<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>"
|
515 |
-
msgstr ""
|
516 |
-
"<h3> Sparen Sie Zeit, Geld und Ärger bei der Migration Ihrer WooCommerce-"
|
517 |
-
"Daten? </h3>"
|
518 |
-
|
519 |
-
#: users-customers-import-export-for-wp-woocommerce.php:185
|
520 |
-
msgid "<h3>Use StoreFrog Migration Services.</h3>"
|
521 |
-
msgstr "<h3> Verwenden Sie StoreFrog Migration Services. </h3>"
|
522 |
-
|
523 |
-
#: users-customers-import-export-for-wp-woocommerce.php:188
|
524 |
-
msgid "Dismiss this notice."
|
525 |
-
msgstr "Diesen Hinweis ausblenden"
|
526 |
-
|
527 |
-
#: users-customers-import-export-for-wp-woocommerce.php:220
|
528 |
-
#, php-format
|
529 |
-
msgid "If you like the plugin please leave us a %1$s review."
|
530 |
-
msgstr ""
|
531 |
-
"<div class=\"\"><p><i>Wenn Ihnen das Plugin gefällt, lassen Sie uns bitte "
|
532 |
-
"eine %1$s Rezension zukommen!</i><p></div>"
|
533 |
-
|
534 |
-
#: users-customers-import-export-for-wp-woocommerce.php:232
|
535 |
-
msgid "Thank you for your review."
|
536 |
-
msgstr "Danke für deine Bewertung."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lang/users-customers-import-export-for-wp-woocommerce-fr_FR.mo
DELETED
Binary file
|
lang/users-customers-import-export-for-wp-woocommerce-fr_FR.po
DELETED
@@ -1,4016 +0,0 @@
|
|
1 |
-
# Copyright (C) 2016 Nick
|
2 |
-
# This file is distributed under the GNU General Public License v2.0 or later.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Users/Customers Import/Export for WooCommerce\n"
|
6 |
-
"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/style\n"
|
7 |
-
"POT-Creation-Date: 2019-01-12 15:53+0100\n"
|
8 |
-
"PO-Revision-Date: 2019-01-17 12:18+0530\n"
|
9 |
-
"Last-Translator: FreePixel <contact@freepixel.net>\n"
|
10 |
-
"Language-Team: FreePixel\n"
|
11 |
-
"Language: fr\n"
|
12 |
-
"MIME-Version: 1.0\n"
|
13 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
-
"Content-Transfer-Encoding: 8bit\n"
|
15 |
-
"X-Generator: Poedit 1.8.12\n"
|
16 |
-
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
17 |
-
"X-Poedit-Basepath: users-customers-import-export-for-wp-woocommerce\n"
|
18 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
19 |
-
"X-Poedit-KeywordsList: esc_html_e;esc_html__;__;_e\n"
|
20 |
-
"X-Textdomain-Support: yes\n"
|
21 |
-
"X-Poedit-SearchPath-0: customer-import-export.php\n"
|
22 |
-
"X-Poedit-SearchPath-1: includes/class-wf-customerimpexpcsv-admin-screen.php\n"
|
23 |
-
"X-Poedit-SearchPath-2: includes/class-wf-customerimpexpcsv-ajax-handler.php\n"
|
24 |
-
"X-Poedit-SearchPath-3: includes/class-wt-userimport-uninstall-feedback.php\n"
|
25 |
-
"X-Poedit-SearchPath-4: includes/exporter/class-wf-customerimpexpcsv-exporter."
|
26 |
-
"php\n"
|
27 |
-
"X-Poedit-SearchPath-5: includes/exporter/data/data-wf-post-columns.php\n"
|
28 |
-
"X-Poedit-SearchPath-6: includes/importer/class-wf-csv-parser.php\n"
|
29 |
-
"X-Poedit-SearchPath-7: includes/importer/class-wf-customerimpexpcsv-customer-"
|
30 |
-
"import.php\n"
|
31 |
-
"X-Poedit-SearchPath-8: includes/importer/class-wf-customerimpexpcsv-importer."
|
32 |
-
"php\n"
|
33 |
-
"X-Poedit-SearchPath-9: includes/importer/data/data-wf-reserved-fields-pair."
|
34 |
-
"php\n"
|
35 |
-
"X-Poedit-SearchPath-10: includes/importer/views/html-wf-import-greeting.php\n"
|
36 |
-
"X-Poedit-SearchPath-11: includes/importer/views/html-wf-import-options.php\n"
|
37 |
-
"X-Poedit-SearchPath-12: includes/importer/views/market.php\n"
|
38 |
-
"X-Poedit-SearchPath-13: includes/settings/class-wf-customerimpexpcsv-"
|
39 |
-
"settings.php\n"
|
40 |
-
"X-Poedit-SearchPath-14: includes/views/html-wf-admin-screen.php\n"
|
41 |
-
"X-Poedit-SearchPath-15: includes/views/html-wf-help-guide.php\n"
|
42 |
-
"X-Poedit-SearchPath-16: includes/views/export/html-wf-export-customers.php\n"
|
43 |
-
"X-Poedit-SearchPath-17: includes/views/export/market.php\n"
|
44 |
-
"X-Poedit-SearchPath-18: includes/views/import/html-wf-import-customers.php\n"
|
45 |
-
|
46 |
-
#: customer-import-export.php:28
|
47 |
-
msgid ""
|
48 |
-
"You already have the Premium version installed. For any issues, kindly "
|
49 |
-
"contact our <a target='_blank' href='https://www.webtoffee.com/"
|
50 |
-
"support/'>support</a>."
|
51 |
-
msgstr ""
|
52 |
-
"Vous avez déjà la version Premium installée. Pour toute question, veuillez "
|
53 |
-
"contacter notre <a target='_blank' href='https://www.webtoffee.com/"
|
54 |
-
"support/'>support</a>."
|
55 |
-
|
56 |
-
#: customer-import-export.php:95
|
57 |
-
msgid "Import Export Users"
|
58 |
-
msgstr "Importer des utilisateurs"
|
59 |
-
|
60 |
-
#: customer-import-export.php:96
|
61 |
-
msgid "Premium Upgrade"
|
62 |
-
msgstr "Mise à niveau Premium"
|
63 |
-
|
64 |
-
#: customer-import-export.php:97 includes/views/html-wf-help-guide.php:46
|
65 |
-
msgid "Support"
|
66 |
-
msgstr "Support"
|
67 |
-
|
68 |
-
#: customer-import-export.php:98
|
69 |
-
msgid "Review"
|
70 |
-
msgstr "Avis"
|
71 |
-
|
72 |
-
#: customer-import-export.php:157
|
73 |
-
msgid "Import <strong>users/customers</strong> to your site via a csv file."
|
74 |
-
msgstr ""
|
75 |
-
"Importer des <strong>utilisateurs/clients</strong> dans votre site via un "
|
76 |
-
"fichier CSV."
|
77 |
-
|
78 |
-
#: customer-import-export.php:184
|
79 |
-
msgid "<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>"
|
80 |
-
msgstr ""
|
81 |
-
"<h3>Vous souhaitez gagner du temps et de l’argent sur votre migration de "
|
82 |
-
"données WooCommerce ?</h3>"
|
83 |
-
|
84 |
-
#: customer-import-export.php:185
|
85 |
-
msgid "<h3>Use StoreFrog Migration Services.</h3>"
|
86 |
-
msgstr "<h3>Utilisez les services de migration StoreFrog.</h3>"
|
87 |
-
|
88 |
-
#: customer-import-export.php:188
|
89 |
-
msgid "Dismiss this notice."
|
90 |
-
msgstr "Ignorer cette notification."
|
91 |
-
|
92 |
-
#: customer-import-export.php:220
|
93 |
-
#, php-format
|
94 |
-
msgid "If you like the plugin please leave us a %1$s review."
|
95 |
-
msgstr "Si vous aimez l’extension merci de nous laisser un avis %1$s."
|
96 |
-
|
97 |
-
#: customer-import-export.php:232
|
98 |
-
msgid "Thank you for your review."
|
99 |
-
msgstr "Merci pour votre avis."
|
100 |
-
|
101 |
-
#: includes/class-wf-customerimpexpcsv-admin-screen.php:22
|
102 |
-
msgid ""
|
103 |
-
"User/Customer CSV Import Export requires the function "
|
104 |
-
"<code>mb_detect_encoding</code> to import and export CSV files. Please ask "
|
105 |
-
"your hosting provider to enable this function."
|
106 |
-
msgstr ""
|
107 |
-
"Importation/exportation CSV utilisateur/client requiert la fonction "
|
108 |
-
"<code>mb_detect_encoding</code> pour importer et exporter des fichiers CSV. "
|
109 |
-
"Veuillez demander à votre fournisseur d’hébergement pour activer cette "
|
110 |
-
"fonction."
|
111 |
-
|
112 |
-
#: includes/class-wf-customerimpexpcsv-admin-screen.php:30
|
113 |
-
msgid "User Import Export"
|
114 |
-
msgstr "Import/export d’utilisateurs"
|
115 |
-
|
116 |
-
#: includes/class-wf-customerimpexpcsv-admin-screen.php:31
|
117 |
-
msgid "Customer Import Export"
|
118 |
-
msgstr "Exportation/importation de clients"
|
119 |
-
|
120 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:19
|
121 |
-
msgid "Used it successfully. Don't need anymore."
|
122 |
-
msgstr "Utilisé avec succès. Je n’en ai plus besoin."
|
123 |
-
|
124 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:21
|
125 |
-
msgid "Have used it successfully and aint in need of it anymore"
|
126 |
-
msgstr "Je l’ai utilisé avec succès et je n’en ai plus besoin"
|
127 |
-
|
128 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:25
|
129 |
-
msgid "I couldn't understand how to make it work"
|
130 |
-
msgstr "Je ne comprenais pas comment la faire fonctionner"
|
131 |
-
|
132 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:27
|
133 |
-
msgid "Would you like us to assist you?"
|
134 |
-
msgstr "Voulez-vous que nous vous assistions ?"
|
135 |
-
|
136 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:31
|
137 |
-
msgid "I found a better plugin"
|
138 |
-
msgstr "J’ai trouvé une meilleure extension"
|
139 |
-
|
140 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:33
|
141 |
-
msgid "Which plugin?"
|
142 |
-
msgstr "Avec qu’elle extension ?"
|
143 |
-
|
144 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:37
|
145 |
-
msgid "The plugin is great, but I need specific feature that you don't support"
|
146 |
-
msgstr ""
|
147 |
-
"L’extension est géniale, mais il me faut une fonctionnalité spécifique que "
|
148 |
-
"vous ne supportez pas"
|
149 |
-
|
150 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:39
|
151 |
-
msgid "Could you tell us more about that feature?"
|
152 |
-
msgstr "Pourriez-vous nous en dire plus sur cette fonctionnalité ?"
|
153 |
-
|
154 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:43
|
155 |
-
msgid "The plugin is not working"
|
156 |
-
msgstr "L’extension ne fonctionne pas"
|
157 |
-
|
158 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:45
|
159 |
-
msgid "Could you tell us a bit more whats not working?"
|
160 |
-
msgstr "Pourriez-vous nous en dire un peu plus ce qui ne fonctionne pas ?"
|
161 |
-
|
162 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:49
|
163 |
-
msgid "It's not what I was looking for"
|
164 |
-
msgstr "Ce n’est pas ce que je cherchais"
|
165 |
-
|
166 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:55
|
167 |
-
msgid "The plugin didn't work as expected"
|
168 |
-
msgstr "L’extension n’a pas fonctionné comme prévu"
|
169 |
-
|
170 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:57
|
171 |
-
msgid "What did you expect?"
|
172 |
-
msgstr "Qu’est-ce que vous attendiez ?"
|
173 |
-
|
174 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:61
|
175 |
-
msgid "Other"
|
176 |
-
msgstr "Autre"
|
177 |
-
|
178 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:63
|
179 |
-
msgid "Could you tell us a bit more?"
|
180 |
-
msgstr "Pourriez-vous nous en dire un peu plus ?"
|
181 |
-
|
182 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:81
|
183 |
-
msgid "If you have a moment, please let us know why you are deactivating:"
|
184 |
-
msgstr ""
|
185 |
-
"Si vous avez un moment, merci de nous expliquer pourquoi vous désactivez :"
|
186 |
-
|
187 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:93
|
188 |
-
msgid "I rather wouldn't say"
|
189 |
-
msgstr "Je préfère ne pas dire"
|
190 |
-
|
191 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:94
|
192 |
-
msgid "Submit & Deactivate"
|
193 |
-
msgstr "Soumettre & désactiver"
|
194 |
-
|
195 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:95
|
196 |
-
msgid "Cancel"
|
197 |
-
msgstr "Annuler"
|
198 |
-
|
199 |
-
#: includes/class-wt-userimport-uninstall-feedback.php:174
|
200 |
-
msgid "Deactivate and leave a review"
|
201 |
-
msgstr "Désactiver et laisser un commentaire"
|
202 |
-
|
203 |
-
#: includes/importer/class-wf-csv-parser.php:193
|
204 |
-
#, php-format
|
205 |
-
msgid "> Row %s - skipped due to record offset."
|
206 |
-
msgstr "> Ligne %s - ignoré en raison du décalage d’enregistrement."
|
207 |
-
|
208 |
-
#: includes/importer/class-wf-csv-parser.php:199
|
209 |
-
#, php-format
|
210 |
-
msgid "> Row %s - skipped: cannot insert user without email."
|
211 |
-
msgstr ""
|
212 |
-
"> Ligne %s - ignoré : impossible d’insérer un utilisateur sans adresse "
|
213 |
-
"courriel."
|
214 |
-
|
215 |
-
#: includes/importer/class-wf-csv-parser.php:204
|
216 |
-
#, php-format
|
217 |
-
msgid "> Row %s - skipped: Email is not valid."
|
218 |
-
msgstr "> Ligne %s - ignoré : l’adresse courriel n’est pas valide."
|
219 |
-
|
220 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:117
|
221 |
-
msgid "Error with handle_upload!"
|
222 |
-
msgstr "Erreur avec handle_upload !"
|
223 |
-
|
224 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:142
|
225 |
-
msgid "Row"
|
226 |
-
msgstr "Rangée"
|
227 |
-
|
228 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:143
|
229 |
-
msgid "User ID"
|
230 |
-
msgstr "ID de l’utilisateur"
|
231 |
-
|
232 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:144
|
233 |
-
msgid "User Status"
|
234 |
-
msgstr "Statut de l'utilisateur"
|
235 |
-
|
236 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:145
|
237 |
-
msgid "Status Msg"
|
238 |
-
msgstr "Message d’état"
|
239 |
-
|
240 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:214
|
241 |
-
msgid "AJAX Error"
|
242 |
-
msgstr "Erreur AJAX"
|
243 |
-
|
244 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:307
|
245 |
-
msgid "Error finding uploaded file!"
|
246 |
-
msgstr "Erreur lors de la recherche du fichier téléchargé !"
|
247 |
-
|
248 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:374
|
249 |
-
msgid "Step 1..."
|
250 |
-
msgstr "Étape 1…"
|
251 |
-
|
252 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:379
|
253 |
-
msgid "Step 2..."
|
254 |
-
msgstr "Étape 2…"
|
255 |
-
|
256 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:383
|
257 |
-
msgid "Finalizing..."
|
258 |
-
msgstr "Finalisation…"
|
259 |
-
|
260 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:386
|
261 |
-
msgid "Finished. Import complete."
|
262 |
-
msgstr "Terminé. Importation complète."
|
263 |
-
|
264 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:456
|
265 |
-
msgid ""
|
266 |
-
"Columns are pre-selected using the Mapping file: \"<b style=\"color:gray\">"
|
267 |
-
msgstr ""
|
268 |
-
"Les colonnes sont présélectionnées à l’aide du fichier de mappage : \"<b "
|
269 |
-
"style=\"color:gray\">"
|
270 |
-
|
271 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:475
|
272 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:600
|
273 |
-
msgid "Processing users."
|
274 |
-
msgstr "Traitement des utilisateurs."
|
275 |
-
|
276 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:493
|
277 |
-
msgid "Finished processing Users."
|
278 |
-
msgstr "Traitement des utilisateurs terminé."
|
279 |
-
|
280 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:516
|
281 |
-
msgid "Parsing products CSV."
|
282 |
-
msgstr "Analyse des produits CSV."
|
283 |
-
|
284 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:523
|
285 |
-
msgid "Finished parsing products CSV."
|
286 |
-
msgstr "Analyse syntaxique des produits au format CSV."
|
287 |
-
|
288 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:563
|
289 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:578
|
290 |
-
msgid "Sorry, there has been an error."
|
291 |
-
msgstr "Désolé, il y a eu une erreur."
|
292 |
-
|
293 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:604
|
294 |
-
msgid "Cannot insert user without email"
|
295 |
-
msgstr "Impossible d’insérer un utilisateur sans adresse courriel"
|
296 |
-
|
297 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:608
|
298 |
-
msgid "skipped: Email is not valid."
|
299 |
-
msgstr "ignoré : l’adresse courriel n’est pas valide."
|
300 |
-
|
301 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:624
|
302 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:657
|
303 |
-
#, php-format
|
304 |
-
msgid "> “%s”"
|
305 |
-
msgstr "> “%s”"
|
306 |
-
|
307 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:634
|
308 |
-
#, php-format
|
309 |
-
msgid "> Error inserting %s: %s"
|
310 |
-
msgstr "> Erreur d’insertion %s : %s"
|
311 |
-
|
312 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:641
|
313 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:642
|
314 |
-
msgid "An error occurred with the customer information provided."
|
315 |
-
msgstr "Une erreur s’est produite avec les informations client fournies."
|
316 |
-
|
317 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:660
|
318 |
-
#, php-format
|
319 |
-
msgid "> Finished importing user %s"
|
320 |
-
msgstr "> Importation terminée de l’utilisateur %s"
|
321 |
-
|
322 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:661
|
323 |
-
msgid "Finished processing users."
|
324 |
-
msgstr "Traitement des utilisateurs terminé."
|
325 |
-
|
326 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:767
|
327 |
-
msgid "User could not be created without Email."
|
328 |
-
msgstr "L’utilisateur n’a pas pu être créé sans adresse courriel."
|
329 |
-
|
330 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:800
|
331 |
-
msgid "Import"
|
332 |
-
msgstr "Importer"
|
333 |
-
|
334 |
-
#: includes/importer/class-wf-customerimpexpcsv-customer-import.php:800
|
335 |
-
msgid "Merge Users"
|
336 |
-
msgstr "Fusionner les utilisateurs"
|
337 |
-
|
338 |
-
#: includes/importer/views/html-wf-import-greeting.php:5
|
339 |
-
#: includes/views/html-wf-admin-screen.php:4
|
340 |
-
msgid "User/Customer Export"
|
341 |
-
msgstr "Export utilisateur/client"
|
342 |
-
|
343 |
-
#: includes/importer/views/html-wf-import-greeting.php:6
|
344 |
-
#: includes/views/html-wf-admin-screen.php:5
|
345 |
-
msgid "User/Customer Import"
|
346 |
-
msgstr "Import utilisateur/client"
|
347 |
-
|
348 |
-
#: includes/importer/views/html-wf-import-greeting.php:7
|
349 |
-
#: includes/views/html-wf-admin-screen.php:6
|
350 |
-
msgid "Help"
|
351 |
-
msgstr "Aide"
|
352 |
-
|
353 |
-
#: includes/importer/views/html-wf-import-greeting.php:8
|
354 |
-
#: includes/views/html-wf-admin-screen.php:7
|
355 |
-
msgid "Upgrade to Premium for More Features"
|
356 |
-
msgstr "Mettre à niveau vers Premium pour plus de fonctionnalités"
|
357 |
-
|
358 |
-
#: includes/importer/views/html-wf-import-greeting.php:16
|
359 |
-
#: includes/views/import/html-wf-import-customers.php:2
|
360 |
-
msgid "Import Users in CSV Format:"
|
361 |
-
msgstr "Importer des utilisateurs au format CSV :"
|
362 |
-
|
363 |
-
#: includes/importer/views/html-wf-import-greeting.php:17
|
364 |
-
msgid ""
|
365 |
-
"Import Users in CSV format from your computer.You can import users/customers "
|
366 |
-
"(in CSV format) in to the shop."
|
367 |
-
msgstr ""
|
368 |
-
"Importer des utilisateurs au format CSV à partir de votre ordinateur. Vous "
|
369 |
-
"pouvez importer des utilisateurs/clients (au format CSV) dans la boutique."
|
370 |
-
|
371 |
-
#: includes/importer/views/html-wf-import-greeting.php:19
|
372 |
-
msgid ""
|
373 |
-
"Before you can upload your import file, you will need to fix the following "
|
374 |
-
"error:"
|
375 |
-
msgstr ""
|
376 |
-
"Avant de pouvoir télécharger votre fichier d’importation, vous devez "
|
377 |
-
"corriger l’erreur suivante :"
|
378 |
-
|
379 |
-
#: includes/importer/views/html-wf-import-greeting.php:28
|
380 |
-
msgid "Select a file from your computer"
|
381 |
-
msgstr "Sélectionnez un fichier dans votre ordinateur"
|
382 |
-
|
383 |
-
#: includes/importer/views/html-wf-import-greeting.php:34
|
384 |
-
#, php-format
|
385 |
-
msgid "Maximum size: %s"
|
386 |
-
msgstr "Taille maximum : %s"
|
387 |
-
|
388 |
-
#: includes/importer/views/market.php:89 includes/views/export/market.php:94
|
389 |
-
msgid "Upgrade to Premium Version"
|
390 |
-
msgstr "Mise à niveau vers la version Premium"
|
391 |
-
|
392 |
-
#: includes/importer/views/market.php:92 includes/views/export/market.php:97
|
393 |
-
msgid "Your Business is precious! Go Premium!"
|
394 |
-
msgstr "Votre entreprise est précieuse ! Passer en Premium !"
|
395 |
-
|
396 |
-
#: includes/importer/views/market.php:94 includes/views/export/market.php:99
|
397 |
-
msgid ""
|
398 |
-
"HikeForce Import Export Users Plugin Premium version helps you to seamlessly "
|
399 |
-
"import/export Customer details into your Woocommerce Store."
|
400 |
-
msgstr ""
|
401 |
-
"L’extension Premium Import/export Utilisateurs HikeForce vous permet "
|
402 |
-
"d’importer/exporter en toute transparence les détails du client dans votre "
|
403 |
-
"boutique Woocommerce."
|
404 |
-
|
405 |
-
#: includes/importer/views/market.php:96 includes/views/export/market.php:101
|
406 |
-
msgid "Export/Import WooCommerce Customer details into a CSV file."
|
407 |
-
msgstr "Exporter/importer les détails du client dans un fichier CSV. "
|
408 |
-
|
409 |
-
#: includes/importer/views/market.php:96 includes/views/export/market.php:101
|
410 |
-
msgid "( Basic version supports only WordPress User details )"
|
411 |
-
msgstr ""
|
412 |
-
"(La version de base ne prend en charge que les détails de l’utilisateur "
|
413 |
-
"WordPress)"
|
414 |
-
|
415 |
-
#: includes/importer/views/market.php:97 includes/views/export/market.php:102
|
416 |
-
msgid "Various Filter options for exporting Customers."
|
417 |
-
msgstr "Diverses options de filtrage pour exporter des clients."
|
418 |
-
|
419 |
-
#: includes/importer/views/market.php:98 includes/views/export/market.php:103
|
420 |
-
msgid "Map and Transform fields while Importing Customers."
|
421 |
-
msgstr "Mappez et transformez les champs lors de l’importation de clients."
|
422 |
-
|
423 |
-
#: includes/importer/views/market.php:99 includes/views/export/market.php:104
|
424 |
-
msgid "Change values while importing Customers using Evaluation Fields."
|
425 |
-
msgstr ""
|
426 |
-
"Modifiez les valeurs lors de l’importation de clients à l’aide des champs "
|
427 |
-
"d’évaluation."
|
428 |
-
|
429 |
-
#: includes/importer/views/market.php:100 includes/views/export/market.php:105
|
430 |
-
msgid "Choice to Update or Skip existing imported Customers."
|
431 |
-
msgstr "Choix de mettre à jour ou ignorer les clients importés existants."
|
432 |
-
|
433 |
-
#: includes/importer/views/market.php:101 includes/views/export/market.php:106
|
434 |
-
msgid "Choice to Send or Skip Emails for newly imported Customers."
|
435 |
-
msgstr ""
|
436 |
-
"Choix d’envoyer ou de ignorer des courriels pour les clients nouvellement "
|
437 |
-
"importés."
|
438 |
-
|
439 |
-
#: includes/importer/views/market.php:102 includes/views/export/market.php:107
|
440 |
-
msgid ""
|
441 |
-
"Import/Export file from/to a remote server via FTP in Scheduled time "
|
442 |
-
"interval with Cron Job."
|
443 |
-
msgstr ""
|
444 |
-
"Importer/exporter un fichier depuis/vers un serveur distant via FTP dans un "
|
445 |
-
"intervalle de temps planifié avec un travail cron."
|
446 |
-
|
447 |
-
#: includes/importer/views/market.php:103 includes/views/export/market.php:108
|
448 |
-
msgid "Excellent Support for setting it up!"
|
449 |
-
msgstr "Excellent support pour la mise en place !"
|
450 |
-
|
451 |
-
#: includes/importer/views/market.php:108 includes/views/export/market.php:113
|
452 |
-
#: includes/views/html-wf-help-guide.php:39
|
453 |
-
#: includes/views/html-wf-help-guide.php:41
|
454 |
-
msgid "Documentation"
|
455 |
-
msgstr "Documentation"
|
456 |
-
|
457 |
-
#: includes/importer/views/market.php:112 includes/views/export/market.php:90
|
458 |
-
#, php-format
|
459 |
-
msgid ""
|
460 |
-
"<div class=\"\"><p><i>If you like the plugin please leave us a %1$s review!</"
|
461 |
-
"i><p></div>"
|
462 |
-
msgstr ""
|
463 |
-
"<div class=\"\"><p><i>Si vous aimez l’extension merci de nous laisser un "
|
464 |
-
"avis %1$s !</i><p></div>"
|
465 |
-
|
466 |
-
#: includes/views/export/html-wf-export-customers.php:4
|
467 |
-
msgid "Export Users in CSV Format:"
|
468 |
-
msgstr "Exporter des utilisateurs au format CSV :"
|
469 |
-
|
470 |
-
#: includes/views/export/html-wf-export-customers.php:5
|
471 |
-
msgid ""
|
472 |
-
"Export and download your Users in CSV format. This file can be used to "
|
473 |
-
"import users back into your Website."
|
474 |
-
msgstr ""
|
475 |
-
"Exportez et téléchargez vos utilisateurs au format CSV. Ce fichier peut être "
|
476 |
-
"utilisé pour importer des utilisateurs dans votre site Web."
|
477 |
-
|
478 |
-
#: includes/views/export/html-wf-export-customers.php:11
|
479 |
-
msgid "User Roles"
|
480 |
-
msgstr "Rôles de l’utilisateur"
|
481 |
-
|
482 |
-
#: includes/views/export/html-wf-export-customers.php:14
|
483 |
-
msgid "All Roles"
|
484 |
-
msgstr "Tous les rôles"
|
485 |
-
|
486 |
-
#: includes/views/export/html-wf-export-customers.php:25
|
487 |
-
msgid "Users with these roles will be exported."
|
488 |
-
msgstr "Les utilisateurs avec ces rôles seront exportés."
|
489 |
-
|
490 |
-
#: includes/views/export/html-wf-export-customers.php:30
|
491 |
-
msgid "Offset"
|
492 |
-
msgstr "Décalage"
|
493 |
-
|
494 |
-
#: includes/views/export/html-wf-export-customers.php:33
|
495 |
-
msgid "0"
|
496 |
-
msgstr "0"
|
497 |
-
|
498 |
-
#: includes/views/export/html-wf-export-customers.php:34
|
499 |
-
msgid "The number of users to skip before returning."
|
500 |
-
msgstr "Nombre d’utilisateurs à ignorer avant le traitement."
|
501 |
-
|
502 |
-
#: includes/views/export/html-wf-export-customers.php:39
|
503 |
-
msgid "Limit"
|
504 |
-
msgstr "Limite"
|
505 |
-
|
506 |
-
#: includes/views/export/html-wf-export-customers.php:42
|
507 |
-
msgid "Unlimited"
|
508 |
-
msgstr "Illimitée"
|
509 |
-
|
510 |
-
#: includes/views/export/html-wf-export-customers.php:43
|
511 |
-
msgid "The number of users to return."
|
512 |
-
msgstr "Nombre d’utilisateurs à traiter."
|
513 |
-
|
514 |
-
#: includes/views/export/html-wf-export-customers.php:53
|
515 |
-
msgid "Columns"
|
516 |
-
msgstr "Colonnes"
|
517 |
-
|
518 |
-
#: includes/views/export/html-wf-export-customers.php:57
|
519 |
-
msgid "Column"
|
520 |
-
msgstr "Colonne"
|
521 |
-
|
522 |
-
#: includes/views/export/html-wf-export-customers.php:60
|
523 |
-
msgid "Column Name"
|
524 |
-
msgstr "Nom de la colonne"
|
525 |
-
|
526 |
-
#: includes/views/export/html-wf-export-customers.php:87
|
527 |
-
msgid "Export Users"
|
528 |
-
msgstr "Exporter les utilisateurs"
|
529 |
-
|
530 |
-
#: includes/views/html-wf-help-guide.php:31
|
531 |
-
msgid "How-to-setup"
|
532 |
-
msgstr "Comment configurer"
|
533 |
-
|
534 |
-
#: includes/views/html-wf-help-guide.php:32
|
535 |
-
msgid "Get to know about our produt in 3 minutes with this video"
|
536 |
-
msgstr "Découvrez notre produit en 3 minutes avec cette vidéo"
|
537 |
-
|
538 |
-
#: includes/views/html-wf-help-guide.php:34
|
539 |
-
msgid "Setup Guide"
|
540 |
-
msgstr "Guide de configuration"
|
541 |
-
|
542 |
-
#: includes/views/html-wf-help-guide.php:40
|
543 |
-
msgid "Refer to our documentation to set and get started"
|
544 |
-
msgstr "Reportez-vous à notre documentation pour définir et commencer"
|
545 |
-
|
546 |
-
#: includes/views/html-wf-help-guide.php:47
|
547 |
-
msgid "We would love to help you on any queries or issues."
|
548 |
-
msgstr ""
|
549 |
-
"Nous serions ravis de vous aider si vous avez des questions ou des problèmes."
|
550 |
-
|
551 |
-
#: includes/views/html-wf-help-guide.php:49
|
552 |
-
msgid "Contact Us"
|
553 |
-
msgstr "Contactez-nous"
|
554 |
-
|
555 |
-
#: includes/views/import/html-wf-import-customers.php:3
|
556 |
-
msgid "Import Users in CSV format from your computer"
|
557 |
-
msgstr "Importer des utilisateurs au format CSV à partir de votre ordinateur"
|
558 |
-
|
559 |
-
#: includes/views/import/html-wf-import-customers.php:6
|
560 |
-
msgid "Import Users"
|
561 |
-
msgstr "Importer des utilisateurs"
|
562 |
-
|
563 |
-
#~ msgid "This page could not be found!"
|
564 |
-
#~ msgstr "Oups, cette page n’existe pas !"
|
565 |
-
|
566 |
-
#~ msgid "We are sorry. But the page you are looking for is not available."
|
567 |
-
#~ msgstr "Nous sommes désolés, mais la page que vous cherchez n’existe plus."
|
568 |
-
|
569 |
-
#~ msgid "Perhaps you can try a new searching."
|
570 |
-
#~ msgstr "Peut-être vous pouvez essayer une nouvelle recherche."
|
571 |
-
|
572 |
-
#~ msgid "Back To Homepage"
|
573 |
-
#~ msgstr "Revenir à l’accueil"
|
574 |
-
|
575 |
-
#~ msgid "This Post Has One Comment"
|
576 |
-
#~ msgstr "Cet article a %d commentaire"
|
577 |
-
|
578 |
-
#~ msgid "This Post Has %s Comments"
|
579 |
-
#~ msgstr "Cet article a %s commentaires"
|
580 |
-
|
581 |
-
#~ msgid "Previous"
|
582 |
-
#~ msgstr "Article précédent"
|
583 |
-
|
584 |
-
#~ msgid "Next"
|
585 |
-
#~ msgstr "Suiv."
|
586 |
-
|
587 |
-
#~ msgid "Comments are closed."
|
588 |
-
#~ msgstr "Les commentaires sont fermés."
|
589 |
-
|
590 |
-
#~ msgid "You must be %1$slogged in%2$s to post a comment."
|
591 |
-
#~ msgstr "Vous devez être %1$sidentifié%2$s pour poster un commentaire."
|
592 |
-
|
593 |
-
#~ msgid "Logged in as"
|
594 |
-
#~ msgstr "Connecté en tant que"
|
595 |
-
|
596 |
-
#~ msgid "Log out of this account"
|
597 |
-
#~ msgstr "Se déconnecter de ce compte"
|
598 |
-
|
599 |
-
#~ msgid "Log out »"
|
600 |
-
#~ msgstr "Déconnexion »"
|
601 |
-
|
602 |
-
#~ msgid "Your Comment Here..."
|
603 |
-
#~ msgstr "Votre Commentaire Ici…"
|
604 |
-
|
605 |
-
#~ msgid "Post Comment"
|
606 |
-
#~ msgstr "Poster le commentaire"
|
607 |
-
|
608 |
-
#~ msgid "Top Bar"
|
609 |
-
#~ msgstr "Barre du haut"
|
610 |
-
|
611 |
-
#~ msgid "Main"
|
612 |
-
#~ msgstr "Principal"
|
613 |
-
|
614 |
-
#~ msgid "Footer"
|
615 |
-
#~ msgstr "Pied de page"
|
616 |
-
|
617 |
-
#~ msgid "Mobile (optional)"
|
618 |
-
#~ msgstr "Mobile (optionnel)"
|
619 |
-
|
620 |
-
#~ msgid "Right Sidebar"
|
621 |
-
#~ msgstr "Barre latérale à droite"
|
622 |
-
|
623 |
-
#, fuzzy
|
624 |
-
#~| msgid "Widgets in this area are used in the sidebar region."
|
625 |
-
#~ msgid "Widgets in this area are used in the right sidebar region."
|
626 |
-
#~ msgstr ""
|
627 |
-
#~ "Les widgets dans cette zone sont utilisés dans la région de la barre "
|
628 |
-
#~ "latérale."
|
629 |
-
|
630 |
-
#, fuzzy
|
631 |
-
#~| msgid "After Sidebar"
|
632 |
-
#~ msgid "Left Sidebar"
|
633 |
-
#~ msgstr "Barre latérale gauche"
|
634 |
-
|
635 |
-
#, fuzzy
|
636 |
-
#~| msgid "Widgets in this area are used in the sidebar region."
|
637 |
-
#~ msgid "Widgets in this area are used in the left sidebar region."
|
638 |
-
#~ msgstr ""
|
639 |
-
#~ "Les widgets dans cette zone sont utilisés dans la région de la barre "
|
640 |
-
#~ "latérale."
|
641 |
-
|
642 |
-
#, fuzzy
|
643 |
-
#~| msgid "Search Results Found"
|
644 |
-
#~ msgid "Search Results Sidebar"
|
645 |
-
#~ msgstr "Barre latérale de la page de résultats de recherche"
|
646 |
-
|
647 |
-
#~ msgid "Widgets in this area are used in the search result page."
|
648 |
-
#~ msgstr ""
|
649 |
-
#~ "Les widgets dans cette zone sont utilisés dans la page des résultats de "
|
650 |
-
#~ "recherche."
|
651 |
-
|
652 |
-
#~ msgid "Footer 1"
|
653 |
-
#~ msgstr "Pied de page 1"
|
654 |
-
|
655 |
-
#~ msgid "Widgets in this area are used in the first footer region."
|
656 |
-
#~ msgstr ""
|
657 |
-
#~ "Les widgets dans cette zone sont utilisés dans la première zone de bas de "
|
658 |
-
#~ "page."
|
659 |
-
|
660 |
-
#~ msgid "Footer 2"
|
661 |
-
#~ msgstr "Pied de page 2"
|
662 |
-
|
663 |
-
#~ msgid "Widgets in this area are used in the second footer region."
|
664 |
-
#~ msgstr ""
|
665 |
-
#~ "Les widgets dans cette zone sont utilisés dans la deuxième zone de bas de "
|
666 |
-
#~ "page."
|
667 |
-
|
668 |
-
#~ msgid "Footer 3"
|
669 |
-
#~ msgstr "Pied de page 3"
|
670 |
-
|
671 |
-
#~ msgid "Widgets in this area are used in the third footer region."
|
672 |
-
#~ msgstr ""
|
673 |
-
#~ "Les widgets dans cette zone sont utilisés dans la troisième zone de bas "
|
674 |
-
#~ "de page."
|
675 |
-
|
676 |
-
#~ msgid "Footer 4"
|
677 |
-
#~ msgstr "Pied de page 4"
|
678 |
-
|
679 |
-
#~ msgid "Widgets in this area are used in the fourth footer region."
|
680 |
-
#~ msgstr ""
|
681 |
-
#~ "Les widgets dans cette zone sont utilisés dans la quatrième partie du "
|
682 |
-
#~ "pied de page."
|
683 |
-
|
684 |
-
#~ msgid "Home"
|
685 |
-
#~ msgstr "Accueil"
|
686 |
-
|
687 |
-
#~ msgid "404 Not Found"
|
688 |
-
#~ msgstr "Erreur 404 Introuvable"
|
689 |
-
|
690 |
-
#~ msgid "Archives"
|
691 |
-
#~ msgstr "Archives"
|
692 |
-
|
693 |
-
#~ msgid "Page %s"
|
694 |
-
#~ msgstr "Page %s"
|
695 |
-
|
696 |
-
#~ msgid "Minute %s"
|
697 |
-
#~ msgstr "Minute %s"
|
698 |
-
|
699 |
-
#~ msgid "Week %s"
|
700 |
-
#~ msgstr "Semaine %s"
|
701 |
-
|
702 |
-
#~ msgid "Link values together"
|
703 |
-
#~ msgstr "Valeurs de lien globales"
|
704 |
-
|
705 |
-
#~ msgid "Select"
|
706 |
-
#~ msgstr "Sélectionner"
|
707 |
-
|
708 |
-
#~ msgid "Font Family"
|
709 |
-
#~ msgstr "Famille de Police"
|
710 |
-
|
711 |
-
#~ msgid "Font Size"
|
712 |
-
#~ msgstr "Taille de police (px)"
|
713 |
-
|
714 |
-
#~ msgid "Font Weight"
|
715 |
-
#~ msgstr "Graisse de la police"
|
716 |
-
|
717 |
-
#~ msgid "Font Style"
|
718 |
-
#~ msgstr "Style de la police"
|
719 |
-
|
720 |
-
#~ msgid "Text Transform"
|
721 |
-
#~ msgstr "Transformation du texte"
|
722 |
-
|
723 |
-
#~ msgid "Line Height"
|
724 |
-
#~ msgstr "Interlignage "
|
725 |
-
|
726 |
-
#~ msgid "Letter Spacing"
|
727 |
-
#~ msgstr "Interlettrage (px)"
|
728 |
-
|
729 |
-
#~ msgid "px - em - rem"
|
730 |
-
#~ msgstr "px - em - rem"
|
731 |
-
|
732 |
-
#~ msgid "Default"
|
733 |
-
#~ msgstr "Par défaut"
|
734 |
-
|
735 |
-
#~ msgid "Thin: 100"
|
736 |
-
#~ msgstr "Thin - 100"
|
737 |
-
|
738 |
-
#~ msgid "Light: 200"
|
739 |
-
#~ msgstr "Light - 200"
|
740 |
-
|
741 |
-
#~ msgid "Book: 300"
|
742 |
-
#~ msgstr "Book - 300"
|
743 |
-
|
744 |
-
#~ msgid "Normal: 400"
|
745 |
-
#~ msgstr "Normal - 400"
|
746 |
-
|
747 |
-
#~ msgid "Medium: 500"
|
748 |
-
#~ msgstr "Medium - 500"
|
749 |
-
|
750 |
-
#~ msgid "Semibold: 600"
|
751 |
-
#~ msgstr "Semibold - 600"
|
752 |
-
|
753 |
-
#~ msgid "Bold: 700"
|
754 |
-
#~ msgstr "Bold - 700"
|
755 |
-
|
756 |
-
#~ msgid "Extra Bold: 800"
|
757 |
-
#~ msgstr "Extra Bold - 800"
|
758 |
-
|
759 |
-
#~ msgid "Black: 900"
|
760 |
-
#~ msgstr "Black - 900"
|
761 |
-
|
762 |
-
#~ msgid "Normal"
|
763 |
-
#~ msgstr "Normal"
|
764 |
-
|
765 |
-
#~ msgid "Italic"
|
766 |
-
#~ msgstr "Italique"
|
767 |
-
|
768 |
-
#~ msgid "Capitalize"
|
769 |
-
#~ msgstr "1er lettre en majuscule"
|
770 |
-
|
771 |
-
#~ msgid "Lowercase"
|
772 |
-
#~ msgstr "Minuscule"
|
773 |
-
|
774 |
-
#~ msgid "Uppercase"
|
775 |
-
#~ msgstr "Majuscule"
|
776 |
-
|
777 |
-
#~ msgid "Custom Fonts"
|
778 |
-
#~ msgstr "Polices personnalisées"
|
779 |
-
|
780 |
-
#~ msgid "Standard Fonts"
|
781 |
-
#~ msgstr "Polices standards"
|
782 |
-
|
783 |
-
#~ msgid "Google Fonts"
|
784 |
-
#~ msgstr "Polices Google"
|
785 |
-
|
786 |
-
#~ msgid "Blog"
|
787 |
-
#~ msgstr "Blog"
|
788 |
-
|
789 |
-
#~ msgid "Blog Entries"
|
790 |
-
#~ msgstr "Entrées du blog"
|
791 |
-
|
792 |
-
#~ msgid "Archives & Entries Layout"
|
793 |
-
#~ msgstr "Mise en page des archives et entrées"
|
794 |
-
|
795 |
-
#~ msgid "Both Sidebars: Style"
|
796 |
-
#~ msgstr "Deux barres latérales : style"
|
797 |
-
|
798 |
-
#~ msgid "Sidebar / Sidebar / Content"
|
799 |
-
#~ msgstr "Barre latérale + barre latérale + contenu"
|
800 |
-
|
801 |
-
#~ msgid "Sidebar / Content / Sidebar"
|
802 |
-
#~ msgstr "Barre latérale + contenu + barre latérale"
|
803 |
-
|
804 |
-
#~ msgid "Content / Sidebar / Sidebar"
|
805 |
-
#~ msgstr "Contenu / barre latérale / barre latérale"
|
806 |
-
|
807 |
-
#~ msgid "Both Sidebars: Content Width (%)"
|
808 |
-
#~ msgstr "Deux barres latérales : largeur de contenu (%)"
|
809 |
-
|
810 |
-
#~ msgid "Both Sidebars: Sidebars Width (%)"
|
811 |
-
#~ msgstr "Deux barres latérales : largeur de barre latérale (%)"
|
812 |
-
|
813 |
-
#~ msgid "Heading Tag"
|
814 |
-
#~ msgstr "Balise de titre"
|
815 |
-
|
816 |
-
#~ msgid "H1"
|
817 |
-
#~ msgstr "Titre h1"
|
818 |
-
|
819 |
-
#~ msgid "H2"
|
820 |
-
#~ msgstr "Titre h2"
|
821 |
-
|
822 |
-
#~ msgid "H3"
|
823 |
-
#~ msgstr "Titre h3"
|
824 |
-
|
825 |
-
#~ msgid "H4"
|
826 |
-
#~ msgstr "Titre h4"
|
827 |
-
|
828 |
-
#~ msgid "H5"
|
829 |
-
#~ msgstr "Titre h5"
|
830 |
-
|
831 |
-
#~ msgid "H6"
|
832 |
-
#~ msgstr "Titre h6"
|
833 |
-
|
834 |
-
#~ msgid "div"
|
835 |
-
#~ msgstr "div"
|
836 |
-
|
837 |
-
#~ msgid "span"
|
838 |
-
#~ msgstr "span"
|
839 |
-
|
840 |
-
#~ msgid "p"
|
841 |
-
#~ msgstr "p"
|
842 |
-
|
843 |
-
#~ msgid "Add Overlay On image Hover"
|
844 |
-
#~ msgstr "Ajouter une superposition au survol de l'image"
|
845 |
-
|
846 |
-
#~ msgid "Blog Style"
|
847 |
-
#~ msgstr "Style du Blog"
|
848 |
-
|
849 |
-
#~ msgid "Large Image"
|
850 |
-
#~ msgstr "Image large"
|
851 |
-
|
852 |
-
#~ msgid "Grid"
|
853 |
-
#~ msgstr "Grille"
|
854 |
-
|
855 |
-
#~ msgid "Thumbnail"
|
856 |
-
#~ msgstr "Vignette"
|
857 |
-
|
858 |
-
#~ msgid "Images Size"
|
859 |
-
#~ msgstr "Taille des images"
|
860 |
-
|
861 |
-
#~ msgid "Medium"
|
862 |
-
#~ msgstr "Moyen"
|
863 |
-
|
864 |
-
#~ msgid "Medium Large"
|
865 |
-
#~ msgstr "Entête large"
|
866 |
-
|
867 |
-
#~ msgid "Large"
|
868 |
-
#~ msgstr "Large"
|
869 |
-
|
870 |
-
#~ msgid "Grid Columns"
|
871 |
-
#~ msgstr "Colonnes de la grille"
|
872 |
-
|
873 |
-
#~ msgid "Grid Style"
|
874 |
-
#~ msgstr "Style de grille"
|
875 |
-
|
876 |
-
#~ msgid "Fit Rows"
|
877 |
-
#~ msgstr "Ajuster les lignes"
|
878 |
-
|
879 |
-
#~ msgid "Masonry"
|
880 |
-
#~ msgstr "Maçonnerie"
|
881 |
-
|
882 |
-
#~ msgid "Equal Heights"
|
883 |
-
#~ msgstr "Hauteurs égales"
|
884 |
-
|
885 |
-
#~ msgid "Image Position"
|
886 |
-
#~ msgstr "Position de l’image"
|
887 |
-
|
888 |
-
#~ msgid "Left"
|
889 |
-
#~ msgstr "À gauche"
|
890 |
-
|
891 |
-
#~ msgid "Right"
|
892 |
-
#~ msgstr "À droite"
|
893 |
-
|
894 |
-
#~ msgid "Vertical Position"
|
895 |
-
#~ msgstr "Position verticale"
|
896 |
-
|
897 |
-
#~ msgid "Top"
|
898 |
-
#~ msgstr "En haut"
|
899 |
-
|
900 |
-
#~ msgid "Center"
|
901 |
-
#~ msgstr "Centré"
|
902 |
-
|
903 |
-
#~ msgid "Bottom"
|
904 |
-
#~ msgstr "En bas"
|
905 |
-
|
906 |
-
#~ msgid "Custom Image Width (px)"
|
907 |
-
#~ msgstr "Largeur d'image personnalisée (px)"
|
908 |
-
|
909 |
-
#~ msgid "Custom Image Height (px)"
|
910 |
-
#~ msgstr "Hauteur d'image personnalisée (px)"
|
911 |
-
|
912 |
-
#~ msgid "Category Color"
|
913 |
-
#~ msgstr "Couleur de catégorie"
|
914 |
-
|
915 |
-
#~ msgid "Category Hover Color"
|
916 |
-
#~ msgstr "Couleur au survol de la catégorie"
|
917 |
-
|
918 |
-
#~ msgid "Comments Color"
|
919 |
-
#~ msgstr "Couleur des commentaires"
|
920 |
-
|
921 |
-
#~ msgid "Comments Hover Color"
|
922 |
-
#~ msgstr "Couleur des commentaires au survol"
|
923 |
-
|
924 |
-
#~ msgid "Excerpt Length"
|
925 |
-
#~ msgstr "Longueur de l’extrait"
|
926 |
-
|
927 |
-
#~ msgid "Add 500 to display full content"
|
928 |
-
#~ msgstr "Ajouter 500 pour afficher le contenu complet"
|
929 |
-
|
930 |
-
#~ msgid "Blog Pagination Style"
|
931 |
-
#~ msgstr "Style de pagination du blog"
|
932 |
-
|
933 |
-
#~ msgid "Standard"
|
934 |
-
#~ msgstr "Standard"
|
935 |
-
|
936 |
-
#~ msgid "Infinite Scroll"
|
937 |
-
#~ msgstr "Défilement infini"
|
938 |
-
|
939 |
-
#~ msgid "Next/Prev"
|
940 |
-
#~ msgstr "Suiv./Préc."
|
941 |
-
|
942 |
-
#~ msgid "Infinite Scroll: Spinners Color"
|
943 |
-
#~ msgstr "Défilement infini : couleur des animations"
|
944 |
-
|
945 |
-
#~ msgid "End of content"
|
946 |
-
#~ msgstr "Fin du contenu"
|
947 |
-
|
948 |
-
#~ msgid "Infinite Scroll: Last Text"
|
949 |
-
#~ msgstr "Défilement infini : dernier texte"
|
950 |
-
|
951 |
-
#~ msgid "No more pages to load"
|
952 |
-
#~ msgstr "Plus de pages à charger"
|
953 |
-
|
954 |
-
#~ msgid "Infinite Scroll: Error Text"
|
955 |
-
#~ msgstr "Défilement infini : texte d'erreur"
|
956 |
-
|
957 |
-
#~ msgid "Elements Positioning"
|
958 |
-
#~ msgstr "Position des éléments"
|
959 |
-
|
960 |
-
#~ msgid "Meta"
|
961 |
-
#~ msgstr "Métadonnées"
|
962 |
-
|
963 |
-
#~ msgid "Author"
|
964 |
-
#~ msgstr "Auteur"
|
965 |
-
|
966 |
-
#~ msgid "Date"
|
967 |
-
#~ msgstr "Date"
|
968 |
-
|
969 |
-
#~ msgid "Categories"
|
970 |
-
#~ msgstr "Catégories"
|
971 |
-
|
972 |
-
#~ msgid "Comments"
|
973 |
-
#~ msgstr "Commentaires"
|
974 |
-
|
975 |
-
#~ msgid "Single Post"
|
976 |
-
#~ msgstr "Article individuel"
|
977 |
-
|
978 |
-
#~ msgid "Layout"
|
979 |
-
#~ msgstr "Mise en page"
|
980 |
-
|
981 |
-
#~ msgid "Page Header Title"
|
982 |
-
#~ msgstr "Titre de l’entête"
|
983 |
-
|
984 |
-
#~ msgid "Post Title"
|
985 |
-
#~ msgstr "Titre de l’article"
|
986 |
-
|
987 |
-
#~ msgid "Featured Image In Page Header"
|
988 |
-
#~ msgstr "Image à la une dans l'entête de la page"
|
989 |
-
|
990 |
-
#~ msgid "Title/Breadcrumb Position"
|
991 |
-
#~ msgstr "Position titre/fil d'Ariane"
|
992 |
-
|
993 |
-
#~ msgid "Position"
|
994 |
-
#~ msgstr "Position"
|
995 |
-
|
996 |
-
#~ msgid "Top Left"
|
997 |
-
#~ msgstr "En haut à gauche"
|
998 |
-
|
999 |
-
#~ msgid "Top Center"
|
1000 |
-
#~ msgstr "En haut centré"
|
1001 |
-
|
1002 |
-
#~ msgid "Top Right"
|
1003 |
-
#~ msgstr "En haut à droite"
|
1004 |
-
|
1005 |
-
#~ msgid "Center Left"
|
1006 |
-
#~ msgstr "Centré à gauche "
|
1007 |
-
|
1008 |
-
#~ msgid "Center Center"
|
1009 |
-
#~ msgstr "Centré centré"
|
1010 |
-
|
1011 |
-
#~ msgid "Center Right"
|
1012 |
-
#~ msgstr "Centrer à droite"
|
1013 |
-
|
1014 |
-
#~ msgid "Bottom Left"
|
1015 |
-
#~ msgstr "En bas à gauche"
|
1016 |
-
|
1017 |
-
#~ msgid "Bottom Center"
|
1018 |
-
#~ msgstr "En bas centré"
|
1019 |
-
|
1020 |
-
#~ msgid "Bottom Right"
|
1021 |
-
#~ msgstr "En bas à droite"
|
1022 |
-
|
1023 |
-
#~ msgid "Attachment"
|
1024 |
-
#~ msgstr "Comportement"
|
1025 |
-
|
1026 |
-
#~ msgid "Scroll"
|
1027 |
-
#~ msgstr "Fond défilant"
|
1028 |
-
|
1029 |
-
#~ msgid "Fixed"
|
1030 |
-
#~ msgstr "Fond fixe"
|
1031 |
-
|
1032 |
-
#~ msgid "Repeat"
|
1033 |
-
#~ msgstr "Répéter"
|
1034 |
-
|
1035 |
-
#~ msgid "No-repeat"
|
1036 |
-
#~ msgstr "Ne pas répéter"
|
1037 |
-
|
1038 |
-
#~ msgid "Repeat-x"
|
1039 |
-
#~ msgstr "Répéter sur X"
|
1040 |
-
|
1041 |
-
#~ msgid "Repeat-y"
|
1042 |
-
#~ msgstr "Répéter sur Y"
|
1043 |
-
|
1044 |
-
#~ msgid "Size"
|
1045 |
-
#~ msgstr "Taille"
|
1046 |
-
|
1047 |
-
#~ msgid "Auto"
|
1048 |
-
#~ msgstr "Auto"
|
1049 |
-
|
1050 |
-
#~ msgid "Cover"
|
1051 |
-
#~ msgstr "Recouvrir"
|
1052 |
-
|
1053 |
-
#~ msgid "Contain"
|
1054 |
-
#~ msgstr "Contient"
|
1055 |
-
|
1056 |
-
#~ msgid "Page Header Height (px)"
|
1057 |
-
#~ msgstr "Hauteur de l’entête (en px)"
|
1058 |
-
|
1059 |
-
#~ msgid "Overlay Opacity"
|
1060 |
-
#~ msgstr "Opacité de la superposition"
|
1061 |
-
|
1062 |
-
#~ msgid "Overlay Color"
|
1063 |
-
#~ msgstr "Couleur de la superposition"
|
1064 |
-
|
1065 |
-
#~ msgid "Full Width Content"
|
1066 |
-
#~ msgstr "Contenu pleine largeur"
|
1067 |
-
|
1068 |
-
#~ msgid "Next/Prev Taxonomy"
|
1069 |
-
#~ msgstr "Taxonomie Préc./Suiv."
|
1070 |
-
|
1071 |
-
#~ msgid "Category"
|
1072 |
-
#~ msgstr "Catégorie"
|
1073 |
-
|
1074 |
-
#~ msgid "Tag"
|
1075 |
-
#~ msgstr "Étiquette"
|
1076 |
-
|
1077 |
-
#~ msgid "Related Posts Count"
|
1078 |
-
#~ msgstr "Colonnes d’articles en relation"
|
1079 |
-
|
1080 |
-
#~ msgid "Related Posts Columns"
|
1081 |
-
#~ msgstr "Colonnes d’articles en relation"
|
1082 |
-
|
1083 |
-
#~ msgid "Related Posts Taxonomy"
|
1084 |
-
#~ msgstr "Colonnes d’articles en relation"
|
1085 |
-
|
1086 |
-
#~ msgid "Related Posts Image Width (px)"
|
1087 |
-
#~ msgstr "Largeur de l’image des articles en relation (px)"
|
1088 |
-
|
1089 |
-
#~ msgid "Related Posts Image Height (px)"
|
1090 |
-
#~ msgstr "Hauteur de l’image des articles en relation (px)"
|
1091 |
-
|
1092 |
-
#~ msgid "Footer Bottom"
|
1093 |
-
#~ msgstr "Zone de copyright"
|
1094 |
-
|
1095 |
-
#~ msgid "Enable Footer Bottom"
|
1096 |
-
#~ msgstr "Activer la zone de Copyright"
|
1097 |
-
|
1098 |
-
#~ msgid "Visibility"
|
1099 |
-
#~ msgstr "Visibilité "
|
1100 |
-
|
1101 |
-
#~ msgid "Show On All Devices"
|
1102 |
-
#~ msgstr "Afficher sur les appareils"
|
1103 |
-
|
1104 |
-
#~ msgid "Hide On Tablet"
|
1105 |
-
#~ msgstr "Masquer sur tablette"
|
1106 |
-
|
1107 |
-
#~ msgid "Hide On Mobile"
|
1108 |
-
#~ msgstr "Masquer sur mobile"
|
1109 |
-
|
1110 |
-
#~ msgid "Hide On Tablet & Mobile"
|
1111 |
-
#~ msgstr "Masquer sur tablette & mobile"
|
1112 |
-
|
1113 |
-
#~ msgid "Copyright"
|
1114 |
-
#~ msgstr "Copyright"
|
1115 |
-
|
1116 |
-
#~ msgid "Shortcodes allowed, %1$ssee the list%2$s."
|
1117 |
-
#~ msgstr "Codes courts autorisés, %1$svoir la liste%2$s."
|
1118 |
-
|
1119 |
-
#~ msgid "Padding (px)"
|
1120 |
-
#~ msgstr "Marge interne (px)"
|
1121 |
-
|
1122 |
-
#~ msgid "Background Color"
|
1123 |
-
#~ msgstr "Couleur d’arrière-plan"
|
1124 |
-
|
1125 |
-
#~ msgid "Text Color"
|
1126 |
-
#~ msgstr "Couleur du texte "
|
1127 |
-
|
1128 |
-
#~ msgid "Links Color"
|
1129 |
-
#~ msgstr "Couleur des liens"
|
1130 |
-
|
1131 |
-
#~ msgid "Links Color: Hover"
|
1132 |
-
#~ msgstr "Couleur des liens au survol"
|
1133 |
-
|
1134 |
-
#~ msgid "Footer Widgets"
|
1135 |
-
#~ msgstr "Pied de page"
|
1136 |
-
|
1137 |
-
#~ msgid "Enable Footer Widgets"
|
1138 |
-
#~ msgstr "Activer le pied de page"
|
1139 |
-
|
1140 |
-
#~ msgid "Fixed Footer"
|
1141 |
-
#~ msgstr "Pied de page fixe"
|
1142 |
-
|
1143 |
-
#~ msgid ""
|
1144 |
-
#~ "This option add a height to your content to keep your footer at the "
|
1145 |
-
#~ "bottom of your page."
|
1146 |
-
#~ msgstr ""
|
1147 |
-
#~ "Cette option ajoute une hauteur à votre contenu pour garder votre pied de "
|
1148 |
-
#~ "page au bas de votre page."
|
1149 |
-
|
1150 |
-
#~ msgid "On"
|
1151 |
-
#~ msgstr "Activé"
|
1152 |
-
|
1153 |
-
#~ msgid "Off"
|
1154 |
-
#~ msgstr "Désactivé"
|
1155 |
-
|
1156 |
-
#~ msgid "Parallax Footer Effect"
|
1157 |
-
#~ msgstr "Effet de parallaxe du pied de page"
|
1158 |
-
|
1159 |
-
#~ msgid "Add a parallax effect to your footer."
|
1160 |
-
#~ msgstr "Ajoutez un effet de parallaxe à votre pied de page."
|
1161 |
-
|
1162 |
-
#~ msgid "Select Template"
|
1163 |
-
#~ msgstr "Sélectionner un modèle"
|
1164 |
-
|
1165 |
-
#~ msgid "Choose a template created in Theme Panel > My Library."
|
1166 |
-
#~ msgstr "Sélectionnez votre modèle créé dans Theme Panel > Ma bibliothèque."
|
1167 |
-
|
1168 |
-
#~ msgid "Add Container"
|
1169 |
-
#~ msgstr "Ajouter un conteneur"
|
1170 |
-
|
1171 |
-
#~ msgid "Borders Color"
|
1172 |
-
#~ msgstr "Couleur des bordures"
|
1173 |
-
|
1174 |
-
#~ msgid "General Options"
|
1175 |
-
#~ msgstr "Options générales"
|
1176 |
-
|
1177 |
-
#~ msgid "General Styling"
|
1178 |
-
#~ msgstr "Couleurs générales"
|
1179 |
-
|
1180 |
-
#~ msgid "Primary Color"
|
1181 |
-
#~ msgstr "Couleur primaire"
|
1182 |
-
|
1183 |
-
#~ msgid "Hover Primary Color"
|
1184 |
-
#~ msgstr "Survol couleur primaire"
|
1185 |
-
|
1186 |
-
#~ msgid "Main Border Color"
|
1187 |
-
#~ msgstr "Couleur principale de bordure"
|
1188 |
-
|
1189 |
-
#~ msgid "Site Background"
|
1190 |
-
#~ msgstr "Arrière-plan du site"
|
1191 |
-
|
1192 |
-
#~ msgid "Background Image"
|
1193 |
-
#~ msgstr "Image d’arrière-plan"
|
1194 |
-
|
1195 |
-
#~ msgid "Color"
|
1196 |
-
#~ msgstr "Couleur"
|
1197 |
-
|
1198 |
-
#~ msgid "Color: Hover"
|
1199 |
-
#~ msgstr "Couleur au survol"
|
1200 |
-
|
1201 |
-
#~ msgid "General Settings"
|
1202 |
-
#~ msgstr "Mise en page globale"
|
1203 |
-
|
1204 |
-
#~ msgid "Layout Style"
|
1205 |
-
#~ msgstr "Style de mise en page"
|
1206 |
-
|
1207 |
-
#~ msgid "Wide"
|
1208 |
-
#~ msgstr "Large"
|
1209 |
-
|
1210 |
-
#~ msgid "Boxed"
|
1211 |
-
#~ msgstr "Boîte centrée"
|
1212 |
-
|
1213 |
-
#~ msgid "Separate"
|
1214 |
-
#~ msgstr "Séparer"
|
1215 |
-
|
1216 |
-
#~ msgid "Boxed Layout Drop-Shadow"
|
1217 |
-
#~ msgstr "Ombre portée mise en page centrée"
|
1218 |
-
|
1219 |
-
#~ msgid "Boxed Width (px)"
|
1220 |
-
#~ msgstr "Largeur encadrée (px)"
|
1221 |
-
|
1222 |
-
#~ msgid "Outside Background"
|
1223 |
-
#~ msgstr "Arrière-plan extérieur"
|
1224 |
-
|
1225 |
-
#~ msgid "Inner Background"
|
1226 |
-
#~ msgstr "Arrière-plan intérieur"
|
1227 |
-
|
1228 |
-
#~ msgid "Content Padding"
|
1229 |
-
#~ msgstr "Marge interne du contenu"
|
1230 |
-
|
1231 |
-
#~ msgid "Add a custom content padding. px - em - %."
|
1232 |
-
#~ msgstr "Ajouter une marge interne personnalisée de contenu. px - em - %."
|
1233 |
-
|
1234 |
-
#~ msgid "Widgets Padding"
|
1235 |
-
#~ msgstr "Marge interne des widgets"
|
1236 |
-
|
1237 |
-
#~ msgid "Add a custom widgets padding. px - em - %."
|
1238 |
-
#~ msgstr "Ajouter une marge interne personnalisée de widget. px - em - %."
|
1239 |
-
|
1240 |
-
#~ msgid "Main Container Width (px)"
|
1241 |
-
#~ msgstr "Largeur du conteneur principal (px)"
|
1242 |
-
|
1243 |
-
#~ msgid "Content Width (%)"
|
1244 |
-
#~ msgstr "Largeur du contenu (%)"
|
1245 |
-
|
1246 |
-
#~ msgid "Sidebar Width (%)"
|
1247 |
-
#~ msgstr "Largeur de la barre latérale (%)"
|
1248 |
-
|
1249 |
-
#~ msgid "Enable Schema Markup"
|
1250 |
-
#~ msgstr "Activer le schéma de marquage"
|
1251 |
-
|
1252 |
-
#~ msgid "Pages"
|
1253 |
-
#~ msgstr "Pages"
|
1254 |
-
|
1255 |
-
#~ msgid "Content Padding (px)"
|
1256 |
-
#~ msgstr "Rembourrage de contenu (px)"
|
1257 |
-
|
1258 |
-
#~ msgid "Search Result Page"
|
1259 |
-
#~ msgstr "Page de résultat de recherche"
|
1260 |
-
|
1261 |
-
#~ msgid "Source"
|
1262 |
-
#~ msgstr "Source"
|
1263 |
-
|
1264 |
-
#~ msgid "Search Posts Per Page"
|
1265 |
-
#~ msgstr "Rechercher des messages par page"
|
1266 |
-
|
1267 |
-
#~ msgid "Custom Sidebar"
|
1268 |
-
#~ msgstr "Barre latérale personnalisée"
|
1269 |
-
|
1270 |
-
#~ msgid "Page Title"
|
1271 |
-
#~ msgstr "Titre de la page "
|
1272 |
-
|
1273 |
-
#~ msgid "Style"
|
1274 |
-
#~ msgstr "Style"
|
1275 |
-
|
1276 |
-
#~ msgid "Centered"
|
1277 |
-
#~ msgstr "Centré"
|
1278 |
-
|
1279 |
-
#~ msgid "Centered Minimal"
|
1280 |
-
#~ msgstr "Centré minimaliste"
|
1281 |
-
|
1282 |
-
#~ msgid "Hidden"
|
1283 |
-
#~ msgstr "Masqué"
|
1284 |
-
|
1285 |
-
#~ msgid "Image"
|
1286 |
-
#~ msgstr "Image"
|
1287 |
-
|
1288 |
-
#~ msgid "Height (px)"
|
1289 |
-
#~ msgstr "Hauteur (px)"
|
1290 |
-
|
1291 |
-
#~ msgid "Breadcrumbs"
|
1292 |
-
#~ msgstr "Fil d’Ariane"
|
1293 |
-
|
1294 |
-
#~ msgid "Absolute Right"
|
1295 |
-
#~ msgstr "En absolute à droite"
|
1296 |
-
|
1297 |
-
#~ msgid "Under Title"
|
1298 |
-
#~ msgstr "Sous titre"
|
1299 |
-
|
1300 |
-
#~ msgid "Separator Color"
|
1301 |
-
#~ msgstr "Couleur du séparateur"
|
1302 |
-
|
1303 |
-
#~ msgid "Link Color"
|
1304 |
-
#~ msgstr "Couleur du lien"
|
1305 |
-
|
1306 |
-
#~ msgid "Link Color: Hover"
|
1307 |
-
#~ msgstr "Couleur du lien au survol"
|
1308 |
-
|
1309 |
-
#~ msgid "Scroll To Top"
|
1310 |
-
#~ msgstr "Retour haut de page"
|
1311 |
-
|
1312 |
-
#~ msgid "Scroll Up Button"
|
1313 |
-
#~ msgstr "Bouton retour haut de page"
|
1314 |
-
|
1315 |
-
#~ msgid "Arrow Icon"
|
1316 |
-
#~ msgstr "Icône flèche"
|
1317 |
-
|
1318 |
-
#~ msgid "Button Size (px)"
|
1319 |
-
#~ msgstr "Taille du bouton (px)"
|
1320 |
-
|
1321 |
-
#~ msgid "Icon Size (px)"
|
1322 |
-
#~ msgstr "Taille de l’icône (px)"
|
1323 |
-
|
1324 |
-
#~ msgid "Border Radius (px)"
|
1325 |
-
#~ msgstr "Rayon de la bordure (px)"
|
1326 |
-
|
1327 |
-
#~ msgid "Background Color: Hover"
|
1328 |
-
#~ msgstr "Couleur d’arrière-plan au survol"
|
1329 |
-
|
1330 |
-
#~ msgid "Pagination"
|
1331 |
-
#~ msgstr "Pagination"
|
1332 |
-
|
1333 |
-
#~ msgid "Align"
|
1334 |
-
#~ msgstr "Aligner"
|
1335 |
-
|
1336 |
-
#~ msgid "Font Size (px)"
|
1337 |
-
#~ msgstr "Taille de police (px)"
|
1338 |
-
|
1339 |
-
#~ msgid "Border Width (px)"
|
1340 |
-
#~ msgstr "Largeur de la bordure (px)"
|
1341 |
-
|
1342 |
-
#~ msgid "Border Color"
|
1343 |
-
#~ msgstr "Couleur de la bordure"
|
1344 |
-
|
1345 |
-
#~ msgid "Border Color: Hover"
|
1346 |
-
#~ msgstr "Couleur de la bordure au survol"
|
1347 |
-
|
1348 |
-
#~ msgid "Forms (Input - Textarea)"
|
1349 |
-
#~ msgstr "Formulaires (Input - Textarea)"
|
1350 |
-
|
1351 |
-
#~ msgid "Label Color"
|
1352 |
-
#~ msgstr "Couleur de label "
|
1353 |
-
|
1354 |
-
#~ msgid "Border Color: Focus"
|
1355 |
-
#~ msgstr "Couleur de la bordure au Focus"
|
1356 |
-
|
1357 |
-
#~ msgid "Theme Buttons"
|
1358 |
-
#~ msgstr "Thème des boutons"
|
1359 |
-
|
1360 |
-
#~ msgid "404 Error Page"
|
1361 |
-
#~ msgstr "Page Erreur 404"
|
1362 |
-
|
1363 |
-
#~ msgid "Blank Page"
|
1364 |
-
#~ msgstr "Page blanche"
|
1365 |
-
|
1366 |
-
#~ msgid ""
|
1367 |
-
#~ "Enable this option to remove all the elements and have full control of "
|
1368 |
-
#~ "the 404 error page."
|
1369 |
-
#~ msgstr ""
|
1370 |
-
#~ "Activez cette option pour supprimer tous les éléments et avoir le "
|
1371 |
-
#~ "contrôle total de la page d'erreur 404."
|
1372 |
-
|
1373 |
-
#~ msgid "Header"
|
1374 |
-
#~ msgstr "Entête"
|
1375 |
-
|
1376 |
-
#~ msgid "General"
|
1377 |
-
#~ msgstr "Général"
|
1378 |
-
|
1379 |
-
#~ msgid "Minimal"
|
1380 |
-
#~ msgstr "Minimal"
|
1381 |
-
|
1382 |
-
#~ msgid "Transparent"
|
1383 |
-
#~ msgstr "Transparent"
|
1384 |
-
|
1385 |
-
#~ msgid "Top Menu"
|
1386 |
-
#~ msgstr "Menu haut"
|
1387 |
-
|
1388 |
-
#~ msgid "Full Screen"
|
1389 |
-
#~ msgstr "Plein écran"
|
1390 |
-
|
1391 |
-
#~ msgid "Vertical"
|
1392 |
-
#~ msgstr "Vertical"
|
1393 |
-
|
1394 |
-
#~ msgid "Custom Header"
|
1395 |
-
#~ msgstr "Entête personnalisée"
|
1396 |
-
|
1397 |
-
#~ msgid "Header Full Width"
|
1398 |
-
#~ msgstr "Entête pleine largeur"
|
1399 |
-
|
1400 |
-
#~ msgid "Header Border Bottom"
|
1401 |
-
#~ msgstr "Bordure inférieure d’entête"
|
1402 |
-
|
1403 |
-
#~ msgid "Border Bottom Color"
|
1404 |
-
#~ msgstr "Couleur de bordure inférieure"
|
1405 |
-
|
1406 |
-
#~ msgid "Transparent Header Settings"
|
1407 |
-
#~ msgstr "Paramètres de l'entête transparente"
|
1408 |
-
|
1409 |
-
#~ msgid "Top Menu Header Settings"
|
1410 |
-
#~ msgstr "Paramètres menu supérieur d'entête"
|
1411 |
-
|
1412 |
-
#~ msgid "Menu Position"
|
1413 |
-
#~ msgstr "Position du menu"
|
1414 |
-
|
1415 |
-
#~ msgid "Before The Logo"
|
1416 |
-
#~ msgstr "Avant le logo"
|
1417 |
-
|
1418 |
-
#~ msgid "After The Logo"
|
1419 |
-
#~ msgstr "Après le logo"
|
1420 |
-
|
1421 |
-
#~ msgid "Menu Background Color"
|
1422 |
-
#~ msgstr "Couleur d’arrière-plan du menu"
|
1423 |
-
|
1424 |
-
#~ msgid "Search Button Border Color"
|
1425 |
-
#~ msgstr "Couleur de bordure du bouton de recherche"
|
1426 |
-
|
1427 |
-
#~ msgid "Search Button Color"
|
1428 |
-
#~ msgstr "Couleur du bouton de recherche"
|
1429 |
-
|
1430 |
-
#~ msgid "Search Button Color: Hover"
|
1431 |
-
#~ msgstr "Couleur au survol du bouton de recherche"
|
1432 |
-
|
1433 |
-
#~ msgid "Full Screen Header Settings"
|
1434 |
-
#~ msgstr "Paramètres de l'entête plein écran"
|
1435 |
-
|
1436 |
-
#~ msgid "Add Transparent Header"
|
1437 |
-
#~ msgstr "Ajouter une entête transparente"
|
1438 |
-
|
1439 |
-
#~ msgid "Logo (optional)"
|
1440 |
-
#~ msgstr "Logo (optionnel)"
|
1441 |
-
|
1442 |
-
#~ msgid "Select a custom logo when the menu is opened."
|
1443 |
-
#~ msgstr "Sélectionnez un logo personnalisé lorsque le menu est ouvert."
|
1444 |
-
|
1445 |
-
#~ msgid "Retina Logo (optional)"
|
1446 |
-
#~ msgstr "Logo Rétina (optionnel)"
|
1447 |
-
|
1448 |
-
#, fuzzy
|
1449 |
-
#~| msgid "Select a custom retina logo when the menu is opened."
|
1450 |
-
#~ msgid ""
|
1451 |
-
#~ "Select a custom retina logo (twice the logo size) when the menu is opened."
|
1452 |
-
#~ msgstr ""
|
1453 |
-
#~ "Sélectionnez un logo personnalisé de Rétina lorsque le menu est ouvert."
|
1454 |
-
|
1455 |
-
#~ msgid "Styling"
|
1456 |
-
#~ msgstr "Style"
|
1457 |
-
|
1458 |
-
#~ msgid "Menu Bar Color"
|
1459 |
-
#~ msgstr "Couleur de la barre du menu"
|
1460 |
-
|
1461 |
-
#~ msgid "Menu Bar Close Color"
|
1462 |
-
#~ msgstr "Couleur de la fermeture du menu"
|
1463 |
-
|
1464 |
-
#~ msgid "Links Background Color"
|
1465 |
-
#~ msgstr "Couleur d’arrière-plan des liens"
|
1466 |
-
|
1467 |
-
#~ msgid "Links Hover Background Color"
|
1468 |
-
#~ msgstr "Couleur d'arrière-plan du lien au survol"
|
1469 |
-
|
1470 |
-
#~ msgid "Links Hover Color"
|
1471 |
-
#~ msgstr "Couleur des liens au survol"
|
1472 |
-
|
1473 |
-
#~ msgid "Search Styling"
|
1474 |
-
#~ msgstr "Style de la recherche"
|
1475 |
-
|
1476 |
-
#~ msgid "Input Color"
|
1477 |
-
#~ msgstr "Couleur du texte de champ"
|
1478 |
-
|
1479 |
-
#~ msgid "Input Dashed Text Color"
|
1480 |
-
#~ msgstr "Couleur du texte factice"
|
1481 |
-
|
1482 |
-
#~ msgid "Input Border Bottom Color"
|
1483 |
-
#~ msgstr "Couleur de bordure inférieure de champ"
|
1484 |
-
|
1485 |
-
#~ msgid "Input Hover Border Bottom Color"
|
1486 |
-
#~ msgstr "Couleur de bordure inférieure de champ : survol"
|
1487 |
-
|
1488 |
-
#~ msgid "Input Focus Border Bottom Color"
|
1489 |
-
#~ msgstr "Couleur de bordure inférieure de champ : focus"
|
1490 |
-
|
1491 |
-
#~ msgid "Center Header Settings"
|
1492 |
-
#~ msgstr "Paramètres entête centrée"
|
1493 |
-
|
1494 |
-
#~ msgid "Left Menu"
|
1495 |
-
#~ msgstr "Menu de gauche"
|
1496 |
-
|
1497 |
-
#~ msgid "Menus Position"
|
1498 |
-
#~ msgstr "Position des menus"
|
1499 |
-
|
1500 |
-
#~ msgid "Wider Spacing"
|
1501 |
-
#~ msgstr "Espacement plus large"
|
1502 |
-
|
1503 |
-
#~ msgid "Centered Menus"
|
1504 |
-
#~ msgstr "Menus centrés "
|
1505 |
-
|
1506 |
-
#~ msgid "Closer Spacing"
|
1507 |
-
#~ msgstr "Espacement plus étroit"
|
1508 |
-
|
1509 |
-
#~ msgid "Medium Header Settings"
|
1510 |
-
#~ msgstr "Paramètres d'entête moyen"
|
1511 |
-
|
1512 |
-
#~ msgid "Hide Menu When Scrolling"
|
1513 |
-
#~ msgstr "Masquer le menu lors du défilement"
|
1514 |
-
|
1515 |
-
#~ msgid "Stick Only The Menu"
|
1516 |
-
#~ msgstr "Coller seulement le menu"
|
1517 |
-
|
1518 |
-
#~ msgid "Top Header"
|
1519 |
-
#~ msgstr "Entête supérieure"
|
1520 |
-
|
1521 |
-
#~ msgid "Search Form"
|
1522 |
-
#~ msgstr "Formulaire de recherche"
|
1523 |
-
|
1524 |
-
#~ msgid "Logo"
|
1525 |
-
#~ msgstr "Logo"
|
1526 |
-
|
1527 |
-
#~ msgid "Social Buttons"
|
1528 |
-
#~ msgstr "Boutons sociaux"
|
1529 |
-
|
1530 |
-
#~ msgid "Sticky Padding (px)"
|
1531 |
-
#~ msgstr "Marge interne collante (px)"
|
1532 |
-
|
1533 |
-
#~ msgid "If you use the sticky header extension"
|
1534 |
-
#~ msgstr "Si vous utilisez l’extension de menu collant"
|
1535 |
-
|
1536 |
-
#~ msgid "Menu"
|
1537 |
-
#~ msgstr "Menu"
|
1538 |
-
|
1539 |
-
#~ msgid "Menu Items Padding (px)"
|
1540 |
-
#~ msgstr "Marge interne des éléments de menu (px)"
|
1541 |
-
|
1542 |
-
#~ msgid "Input Background Color"
|
1543 |
-
#~ msgstr "Couleur d’arrière-plan de champ"
|
1544 |
-
|
1545 |
-
#~ msgid "Placeholder Color"
|
1546 |
-
#~ msgstr "Couleur du terme générique"
|
1547 |
-
|
1548 |
-
#~ msgid "Button Color"
|
1549 |
-
#~ msgstr "Couleur du bouton"
|
1550 |
-
|
1551 |
-
#~ msgid "Button Hover Color"
|
1552 |
-
#~ msgstr "Couleur du bouton au survol"
|
1553 |
-
|
1554 |
-
#~ msgid "Vertical Header Settings"
|
1555 |
-
#~ msgstr "Paramètres d'entête vertical"
|
1556 |
-
|
1557 |
-
#~ msgid ""
|
1558 |
-
#~ "Choose a template created in Theme Panel > My Library to replace the "
|
1559 |
-
#~ "header content."
|
1560 |
-
#~ msgstr ""
|
1561 |
-
#~ "Choisissez un modèle créé dans Panneau du thème > Ma bibliothèque pour "
|
1562 |
-
#~ "remplacer le contenu de l'entête."
|
1563 |
-
|
1564 |
-
#~ msgid "Select Bottom Template"
|
1565 |
-
#~ msgstr "Sélectionnez un modèle de bas"
|
1566 |
-
|
1567 |
-
#~ msgid ""
|
1568 |
-
#~ "Choose a template created in Theme Panel > My Library to add at the "
|
1569 |
-
#~ "header bottom."
|
1570 |
-
#~ msgstr ""
|
1571 |
-
#~ "Choisissez un modèle créé dans Panneau du thème > Ma bibliothèque pour "
|
1572 |
-
#~ "ajouter en bas de l'entête."
|
1573 |
-
|
1574 |
-
#~ msgid "Add Header Shadow"
|
1575 |
-
#~ msgstr "Ajouter une ombre à l'entête"
|
1576 |
-
|
1577 |
-
#~ msgid "Closed Header"
|
1578 |
-
#~ msgstr "Entête fermé"
|
1579 |
-
|
1580 |
-
#~ msgid "Custom Hamburger Button Color"
|
1581 |
-
#~ msgstr "Couleur du bouton de menu mobile personnalisé"
|
1582 |
-
|
1583 |
-
#, fuzzy
|
1584 |
-
#~| msgid "Boxed Width (px)"
|
1585 |
-
#~ msgid "Collapse Width (px)"
|
1586 |
-
#~ msgstr "Largeur encadrée (px)"
|
1587 |
-
|
1588 |
-
#~ msgid "Width (px)"
|
1589 |
-
#~ msgstr "Largeur (px)"
|
1590 |
-
|
1591 |
-
#~ msgid "Inner Padding (px)"
|
1592 |
-
#~ msgstr "Marge interne (px)"
|
1593 |
-
|
1594 |
-
#~ msgid "Logo Position"
|
1595 |
-
#~ msgstr "Position du logo"
|
1596 |
-
|
1597 |
-
#~ msgid "Menu Items Top/Bottom Padding (px)"
|
1598 |
-
#~ msgstr " Marge interne haute/basse des éléments de menu (px)"
|
1599 |
-
|
1600 |
-
#~ msgid "Dropdown Target"
|
1601 |
-
#~ msgstr "Cible du menu déroulant"
|
1602 |
-
|
1603 |
-
#~ msgid "Choose your opening target for your submenus"
|
1604 |
-
#~ msgstr "Choisissez votre cible d'ouverture pour vos sous-menus"
|
1605 |
-
|
1606 |
-
#~ msgid "Icon"
|
1607 |
-
#~ msgstr "Icône"
|
1608 |
-
|
1609 |
-
#~ msgid "Link"
|
1610 |
-
#~ msgstr "Lien"
|
1611 |
-
|
1612 |
-
#~ msgid "Menu Items Border Color"
|
1613 |
-
#~ msgstr "Couleur de bordure des éléments de menu"
|
1614 |
-
|
1615 |
-
#~ msgid "Sub Menu Background Color"
|
1616 |
-
#~ msgstr "Couleur d’arrière-plan des sous-menu"
|
1617 |
-
|
1618 |
-
#~ msgid "Sub Menu Links Color"
|
1619 |
-
#~ msgstr "Couleur des liens de sous-menu"
|
1620 |
-
|
1621 |
-
#~ msgid "Sub Menu Links Color: Hover"
|
1622 |
-
#~ msgstr "Couleur des liens de sous-menu au survol"
|
1623 |
-
|
1624 |
-
#~ msgid "Sub Menu Links Background Color"
|
1625 |
-
#~ msgstr "Couleur d’arrière-plan des liens de sous-menu"
|
1626 |
-
|
1627 |
-
#~ msgid "Sub Menu Links Background Color: Hover"
|
1628 |
-
#~ msgstr "Couleur d’arrière-plan des liens de sous-menu au survol"
|
1629 |
-
|
1630 |
-
#~ msgid "Display Search Form"
|
1631 |
-
#~ msgstr "Afficher le formulaire de recherche"
|
1632 |
-
|
1633 |
-
#~ msgid "Border Width"
|
1634 |
-
#~ msgstr "Largeur de la bordure"
|
1635 |
-
|
1636 |
-
#~ msgid "Add a custom border radius. px - em - %."
|
1637 |
-
#~ msgstr "Ajouter un rayon de bordure personnalisé. px - em - %."
|
1638 |
-
|
1639 |
-
#~ msgid "Border Radius"
|
1640 |
-
#~ msgstr "Rayon de bordure"
|
1641 |
-
|
1642 |
-
#~ msgid "Button Color: Hover"
|
1643 |
-
#~ msgstr "Couleur du texte du bouton au survol"
|
1644 |
-
|
1645 |
-
#~ msgid "Header Media"
|
1646 |
-
#~ msgstr "Média d’entête"
|
1647 |
-
|
1648 |
-
#~ msgid "Retina Logo"
|
1649 |
-
#~ msgstr "Logo rétina"
|
1650 |
-
|
1651 |
-
#, fuzzy
|
1652 |
-
#~| msgid "Select a custom retina logo when the menu is opened."
|
1653 |
-
#~ msgid "Select a retina logo twice the normal logo size."
|
1654 |
-
#~ msgstr ""
|
1655 |
-
#~ "Sélectionnez un logo personnalisé de Rétina lorsque le menu est ouvert."
|
1656 |
-
|
1657 |
-
#~ msgid "Max Width (px)"
|
1658 |
-
#~ msgstr "Largeur maxi (px)"
|
1659 |
-
|
1660 |
-
#~ msgid "Max Height (px)"
|
1661 |
-
#~ msgstr "Hauteur maxi (px)"
|
1662 |
-
|
1663 |
-
#, fuzzy
|
1664 |
-
#~| msgid ""
|
1665 |
-
#~| "Choose a template created in Theme Panel > My Library to replace the "
|
1666 |
-
#~| "content."
|
1667 |
-
#~ msgid ""
|
1668 |
-
#~ "Choose a template created in Theme Panel > My Library to replace the "
|
1669 |
-
#~ "navigation."
|
1670 |
-
#~ msgstr ""
|
1671 |
-
#~ "Choisissez un modèle créé dans Panneau du thème > Ma bibliothèque pour "
|
1672 |
-
#~ "remplacer le contenu."
|
1673 |
-
|
1674 |
-
#~ msgid "Top Level Dropdown Icon"
|
1675 |
-
#~ msgstr "Icône menu déroulant haut de page"
|
1676 |
-
|
1677 |
-
#~ msgid "Second+ Level Dropdown Icon"
|
1678 |
-
#~ msgstr "Icône menu déroulant de deuxième niveau"
|
1679 |
-
|
1680 |
-
#~ msgid "Dropdown Top Border"
|
1681 |
-
#~ msgstr "Bordure supérieure du menu déroulant"
|
1682 |
-
|
1683 |
-
#~ msgid "Links Effect"
|
1684 |
-
#~ msgstr "Effet de lien du menu"
|
1685 |
-
|
1686 |
-
#~ msgid "No Effect"
|
1687 |
-
#~ msgstr "Pas d'effet"
|
1688 |
-
|
1689 |
-
#~ msgid "Underline From Left"
|
1690 |
-
#~ msgstr "Souligné depuis la gauche"
|
1691 |
-
|
1692 |
-
#~ msgid "Underline Up"
|
1693 |
-
#~ msgstr "Souligner en haut"
|
1694 |
-
|
1695 |
-
#~ msgid "Underline Down"
|
1696 |
-
#~ msgstr "Souligné en bas"
|
1697 |
-
|
1698 |
-
#~ msgid "Brackets"
|
1699 |
-
#~ msgstr "Entre parenthèses"
|
1700 |
-
|
1701 |
-
#~ msgid "Overline & Fixed Underline"
|
1702 |
-
#~ msgstr "Souligné depuis haut fixe bas"
|
1703 |
-
|
1704 |
-
#~ msgid "Circular Reveal"
|
1705 |
-
#~ msgstr "Cercles révélés"
|
1706 |
-
|
1707 |
-
#~ msgid "Tripple Dot Under"
|
1708 |
-
#~ msgstr "Pointillés en bas"
|
1709 |
-
|
1710 |
-
#~ msgid "X Marks The Spot"
|
1711 |
-
#~ msgstr "Croisée en X"
|
1712 |
-
|
1713 |
-
#~ msgid "Underline & Overline"
|
1714 |
-
#~ msgstr "Souligné depuis haut/bas"
|
1715 |
-
|
1716 |
-
#~ msgid "Backlighting"
|
1717 |
-
#~ msgstr "Bloc ombré"
|
1718 |
-
|
1719 |
-
#~ msgid "Links Effect: Color"
|
1720 |
-
#~ msgstr "Couleur des liens"
|
1721 |
-
|
1722 |
-
#~ msgid "Main Styling"
|
1723 |
-
#~ msgstr "Style principal"
|
1724 |
-
|
1725 |
-
#~ msgid "Left/Right Padding (px)"
|
1726 |
-
#~ msgstr "Marge interne gauche/droite (px)"
|
1727 |
-
|
1728 |
-
#~ msgid "Link Color: Current Menu Item"
|
1729 |
-
#~ msgstr "Couleur texte du lien : menu actif"
|
1730 |
-
|
1731 |
-
#~ msgid "Link Background"
|
1732 |
-
#~ msgstr "Arrière-plan du lien"
|
1733 |
-
|
1734 |
-
#~ msgid "Link Background: Hover"
|
1735 |
-
#~ msgstr "Arrière-plan du lien au survol"
|
1736 |
-
|
1737 |
-
#~ msgid "Link Background: Current Menu Item"
|
1738 |
-
#~ msgstr "Arrière-plan du lien : menu actif"
|
1739 |
-
|
1740 |
-
#~ msgid "Dropdowns Styling"
|
1741 |
-
#~ msgstr "Style du menu déroulant"
|
1742 |
-
|
1743 |
-
#~ msgid "Top Border Color"
|
1744 |
-
#~ msgstr "Couleur de la bordure supérieure"
|
1745 |
-
|
1746 |
-
#~ msgid "Search Icon"
|
1747 |
-
#~ msgstr "Icône de recherche"
|
1748 |
-
|
1749 |
-
#~ msgid "Search Icon Style"
|
1750 |
-
#~ msgstr "Style de l’icône de recherche"
|
1751 |
-
|
1752 |
-
#~ msgid "Disabled"
|
1753 |
-
#~ msgstr "Désactivé"
|
1754 |
-
|
1755 |
-
#~ msgid "Drop Down"
|
1756 |
-
#~ msgstr "Menu déroulant"
|
1757 |
-
|
1758 |
-
#~ msgid "Header Replace"
|
1759 |
-
#~ msgstr "Remplacer l’entête"
|
1760 |
-
|
1761 |
-
#~ msgid "Overlay"
|
1762 |
-
#~ msgstr "Superposition"
|
1763 |
-
|
1764 |
-
#~ msgid "Input Border Color"
|
1765 |
-
#~ msgstr "Couleur de bordure de champ"
|
1766 |
-
|
1767 |
-
#~ msgid "Input Border Color: Focus"
|
1768 |
-
#~ msgstr "Couleur de bordure de champ : focus"
|
1769 |
-
|
1770 |
-
#~ msgid "Overlay Background Color"
|
1771 |
-
#~ msgstr "Couleur d’arrière-plan de la superposition"
|
1772 |
-
|
1773 |
-
#~ msgid "Input Placeholder Color"
|
1774 |
-
#~ msgstr "Couleur du terme factice"
|
1775 |
-
|
1776 |
-
#~ msgid "Input Border Color: Hover"
|
1777 |
-
#~ msgstr "Couleur de bordure de champ : survol"
|
1778 |
-
|
1779 |
-
#~ msgid "Close Button Color"
|
1780 |
-
#~ msgstr "Couleur du texte du bouton de fermeture"
|
1781 |
-
|
1782 |
-
#~ msgid "Dropdowns Categories Posts"
|
1783 |
-
#~ msgstr "Menus déroulants de catégories d’articles"
|
1784 |
-
|
1785 |
-
#~ msgid "Category Title: Background"
|
1786 |
-
#~ msgstr "Titre de catégorie : arrière-plan"
|
1787 |
-
|
1788 |
-
#~ msgid "Category Title: Color"
|
1789 |
-
#~ msgstr "Titre de catégorie : couleur"
|
1790 |
-
|
1791 |
-
#~ msgid "Posts Links: Color"
|
1792 |
-
#~ msgstr "Couleur des liens d’article"
|
1793 |
-
|
1794 |
-
#~ msgid "Posts Links Hover: Color"
|
1795 |
-
#~ msgstr "Couleur des liens d’article au survol"
|
1796 |
-
|
1797 |
-
#~ msgid "Posts Date: Color"
|
1798 |
-
#~ msgstr "Date d’article : couleur"
|
1799 |
-
|
1800 |
-
#~ msgid "Social Menu"
|
1801 |
-
#~ msgstr "Menu des réseaux sociaux"
|
1802 |
-
|
1803 |
-
#~ msgid "Enable Social Menu"
|
1804 |
-
#~ msgstr "Activer le menu des réseaux sociaux"
|
1805 |
-
|
1806 |
-
#~ msgid "Social Link Style"
|
1807 |
-
#~ msgstr "Style des liens sociaux"
|
1808 |
-
|
1809 |
-
#~ msgid "Simple"
|
1810 |
-
#~ msgstr "Simple"
|
1811 |
-
|
1812 |
-
#~ msgid "Colored"
|
1813 |
-
#~ msgstr "Coloré"
|
1814 |
-
|
1815 |
-
#~ msgid "Dark"
|
1816 |
-
#~ msgstr "Sombre"
|
1817 |
-
|
1818 |
-
#~ msgid "Social Link Target"
|
1819 |
-
#~ msgstr "Cible des liens sociaux"
|
1820 |
-
|
1821 |
-
#~ msgid "New Window"
|
1822 |
-
#~ msgstr "Nouvelle fenêtre"
|
1823 |
-
|
1824 |
-
#~ msgid "Same Window"
|
1825 |
-
#~ msgstr "Même fenêtre"
|
1826 |
-
|
1827 |
-
#~ msgid "Margin (px)"
|
1828 |
-
#~ msgstr "Marge externe (px)"
|
1829 |
-
|
1830 |
-
#~ msgid "Social: Background Color"
|
1831 |
-
#~ msgstr "Couleur d’arrière-plan des liens sociaux"
|
1832 |
-
|
1833 |
-
#~ msgid "Social Hover: Background Color"
|
1834 |
-
#~ msgstr "Couleur d'arrière-plan des liens sociaux au survol"
|
1835 |
-
|
1836 |
-
#~ msgid "Social: Color"
|
1837 |
-
#~ msgstr "Couleur des liens sociaux"
|
1838 |
-
|
1839 |
-
#~ msgid "Social Hover: Color"
|
1840 |
-
#~ msgstr "Couleur des liens sociaux au survol"
|
1841 |
-
|
1842 |
-
#~ msgid "Mobile Menu"
|
1843 |
-
#~ msgstr "Menu Mobile"
|
1844 |
-
|
1845 |
-
#~ msgid "Breakpoints"
|
1846 |
-
#~ msgstr "Points de rupture"
|
1847 |
-
|
1848 |
-
#~ msgid "Choose the media query where you want to display the mobile menu."
|
1849 |
-
#~ msgstr ""
|
1850 |
-
#~ "Choisissez la règle responsive à partir de laquelle s'affiche le menu "
|
1851 |
-
#~ "mobile."
|
1852 |
-
|
1853 |
-
#~ msgid "From 1280px"
|
1854 |
-
#~ msgstr "Depuis 1280px"
|
1855 |
-
|
1856 |
-
#~ msgid "From 1080px"
|
1857 |
-
#~ msgstr "Depuis 1080px"
|
1858 |
-
|
1859 |
-
#~ msgid "From 959px"
|
1860 |
-
#~ msgstr "Depuis 959px"
|
1861 |
-
|
1862 |
-
#~ msgid "From 767px"
|
1863 |
-
#~ msgstr "Depuis 767px"
|
1864 |
-
|
1865 |
-
#~ msgid "From 480px"
|
1866 |
-
#~ msgstr "Depuis 480px"
|
1867 |
-
|
1868 |
-
#~ msgid "From 320px"
|
1869 |
-
#~ msgstr "Depuis 320px"
|
1870 |
-
|
1871 |
-
#~ msgid "Custom media query"
|
1872 |
-
#~ msgstr "Règle responsive personnalisée"
|
1873 |
-
|
1874 |
-
#~ msgid "Select a custom responsive logo for tablet and mobile."
|
1875 |
-
#~ msgstr "Sélectionnez un logo responsif pour la tablette et le mobile."
|
1876 |
-
|
1877 |
-
#~ msgid "Logo Max Height (px)"
|
1878 |
-
#~ msgstr "Hauteur maxi (px) du logo"
|
1879 |
-
|
1880 |
-
#~ msgid "Enter a max height for your responsive logo."
|
1881 |
-
#~ msgstr "Entrez une hauteur maximale pour votre logo responsif."
|
1882 |
-
|
1883 |
-
#~ msgid "Custom Media Query"
|
1884 |
-
#~ msgstr "Règle responsive personnalisée."
|
1885 |
-
|
1886 |
-
#~ msgid ""
|
1887 |
-
#~ "Enter your custom media query where you want to display the mobile menu."
|
1888 |
-
#~ msgstr ""
|
1889 |
-
#~ "Entrez votre règle responsive à partir de laquelle s'affiche le menu "
|
1890 |
-
#~ "mobile."
|
1891 |
-
|
1892 |
-
#~ msgid "Mobile Menu Style"
|
1893 |
-
#~ msgstr "Style de menu Mobile"
|
1894 |
-
|
1895 |
-
#~ msgid "Sidebar"
|
1896 |
-
#~ msgstr "Barre latérale"
|
1897 |
-
|
1898 |
-
#~ msgid "Display Menu Text"
|
1899 |
-
#~ msgstr "Afficher le texte du menu"
|
1900 |
-
|
1901 |
-
#~ msgid "Menu Text"
|
1902 |
-
#~ msgstr "Texte du menu"
|
1903 |
-
|
1904 |
-
#~ msgid "Close"
|
1905 |
-
#~ msgstr "Fermer"
|
1906 |
-
|
1907 |
-
#~ msgid "Close Menu Text"
|
1908 |
-
#~ msgstr "Texte de fermeture du menu"
|
1909 |
-
|
1910 |
-
#~ msgid "Hamburger Icon Class"
|
1911 |
-
#~ msgstr "Classe de l’icône du menu hamburger"
|
1912 |
-
|
1913 |
-
#~ msgid "Enter the full icon class"
|
1914 |
-
#~ msgstr "Entrez la classe complète de l’icône"
|
1915 |
-
|
1916 |
-
#~ msgid "Custom Hamburger Button"
|
1917 |
-
#~ msgstr "Bouton de menu mobile personnalisé"
|
1918 |
-
|
1919 |
-
#~ msgid "Custom Hamburger Button: Color"
|
1920 |
-
#~ msgstr "Couleur du bouton de menu mobile personnalisé"
|
1921 |
-
|
1922 |
-
#~ msgid "Direction"
|
1923 |
-
#~ msgstr "Direction"
|
1924 |
-
|
1925 |
-
#~ msgid "Drop Down Max Height (px)"
|
1926 |
-
#~ msgstr "Hauteur maxi du menu déroulant (px)"
|
1927 |
-
|
1928 |
-
#~ msgid ""
|
1929 |
-
#~ "Add the height from which you want to display the scrollbar in the drop "
|
1930 |
-
#~ "down"
|
1931 |
-
#~ msgstr ""
|
1932 |
-
#~ "Ajoutez la hauteur à partir de laquelle vous souhaitez afficher la barre "
|
1933 |
-
#~ "de défilement dans la liste déroulante"
|
1934 |
-
|
1935 |
-
#~ msgid "Displace"
|
1936 |
-
#~ msgstr "Déplacer"
|
1937 |
-
|
1938 |
-
#~ msgid "Close Menu Button"
|
1939 |
-
#~ msgstr "Bouton de fermeture menu"
|
1940 |
-
|
1941 |
-
#~ msgid "Close Menu Button Icon Class"
|
1942 |
-
#~ msgstr "Classe de l’icône du bouton de fermeture"
|
1943 |
-
|
1944 |
-
#~ msgid "Close Menu"
|
1945 |
-
#~ msgstr "Fermer le menu"
|
1946 |
-
|
1947 |
-
#~ msgid "Close Menu Button Text"
|
1948 |
-
#~ msgstr "Texte du bouton de fermeture"
|
1949 |
-
|
1950 |
-
#~ msgid "Mobile Menu Search"
|
1951 |
-
#~ msgstr "Menu de recherche Mobile"
|
1952 |
-
|
1953 |
-
#~ msgid "Styling: Mobile Menu"
|
1954 |
-
#~ msgstr "Style du menu Mobile"
|
1955 |
-
|
1956 |
-
#~ msgid "Close Button Background"
|
1957 |
-
#~ msgstr "Couleur d’arrière-plan du bouton de fermeture"
|
1958 |
-
|
1959 |
-
#~ msgid "Links Background Color: Hover"
|
1960 |
-
#~ msgstr "Couleur d'arrière-plan au survol des liens"
|
1961 |
-
|
1962 |
-
#~ msgid "Dropdowns Menus: Background"
|
1963 |
-
#~ msgstr "Menus déroulants : arrière-plan"
|
1964 |
-
|
1965 |
-
#~ msgid "Searchbar Background"
|
1966 |
-
#~ msgstr "Arrière plan de la barre de recherche"
|
1967 |
-
|
1968 |
-
#~ msgid "Searchbar Color"
|
1969 |
-
#~ msgstr "Couleur de la barre de recherche"
|
1970 |
-
|
1971 |
-
#~ msgid "Searchbar Border Color"
|
1972 |
-
#~ msgstr "Couleur de bordure de la barre de recherche"
|
1973 |
-
|
1974 |
-
#~ msgid "Searchbar Border Color: Hover"
|
1975 |
-
#~ msgstr "Couleur de la bordure au survol de la barre de recherche"
|
1976 |
-
|
1977 |
-
#~ msgid "Searchbar Border Color: Focus"
|
1978 |
-
#~ msgstr "Couleur de bordure de la barre de recherche : focus"
|
1979 |
-
|
1980 |
-
#~ msgid "Searchbar Button Color"
|
1981 |
-
#~ msgstr "Couleur du bouton de barre de recherche"
|
1982 |
-
|
1983 |
-
#~ msgid "Searchbar Button Color: Hover"
|
1984 |
-
#~ msgstr "Couleur du bouton de barre de recherche au survol"
|
1985 |
-
|
1986 |
-
#~ msgid "Select Your Menu"
|
1987 |
-
#~ msgstr "Sélectionner votre menu"
|
1988 |
-
|
1989 |
-
#~ msgid "Widgets"
|
1990 |
-
#~ msgstr "Widgets"
|
1991 |
-
|
1992 |
-
#~ msgid "Margin Bottom (px)"
|
1993 |
-
#~ msgstr "Marge inférieure (px)"
|
1994 |
-
|
1995 |
-
#~ msgid "Titles Border Color"
|
1996 |
-
#~ msgstr "Couleur de bordure des titres"
|
1997 |
-
|
1998 |
-
#~ msgid "Titles Margin Bottom (px)"
|
1999 |
-
#~ msgstr "Marge interne inférieure des titres (px)"
|
2000 |
-
|
2001 |
-
#~ msgid "Enable Top Bar"
|
2002 |
-
#~ msgstr "Activer la barre haute d’entête"
|
2003 |
-
|
2004 |
-
#~ msgid "Top Bar Full Width"
|
2005 |
-
#~ msgstr "Barre supérieure pleine largeur"
|
2006 |
-
|
2007 |
-
#~ msgid "Left Content & Right Social"
|
2008 |
-
#~ msgstr "Contenu à gauche & réseaux sociaux à droite"
|
2009 |
-
|
2010 |
-
#~ msgid "Left Social & Right Content"
|
2011 |
-
#~ msgstr "Réseaux sociaux à gauche & contenu à droite"
|
2012 |
-
|
2013 |
-
#~ msgid "Centered Content & Social"
|
2014 |
-
#~ msgstr "Contenu et social centrés"
|
2015 |
-
|
2016 |
-
#~ msgid "Content"
|
2017 |
-
#~ msgstr "Contenu"
|
2018 |
-
|
2019 |
-
#~ msgid ""
|
2020 |
-
#~ "Choose a template created in Theme Panel > My Library to replace the "
|
2021 |
-
#~ "content."
|
2022 |
-
#~ msgstr ""
|
2023 |
-
#~ "Choisissez un modèle créé dans Panneau du thème > Ma bibliothèque pour "
|
2024 |
-
#~ "remplacer le contenu."
|
2025 |
-
|
2026 |
-
#, fuzzy
|
2027 |
-
#~| msgid "Before Content Inner"
|
2028 |
-
#~ msgid "Place your content here"
|
2029 |
-
#~ msgstr "Avant l’intérieur du contenu"
|
2030 |
-
|
2031 |
-
#~ msgid "Social"
|
2032 |
-
#~ msgstr "Réseaux sociaux"
|
2033 |
-
|
2034 |
-
#~ msgid "Enable Social"
|
2035 |
-
#~ msgstr "Activer les réseaux sociaux"
|
2036 |
-
|
2037 |
-
#~ msgid "Social Alternative"
|
2038 |
-
#~ msgstr "Programmes sociaux"
|
2039 |
-
|
2040 |
-
#~ msgid "Social Links Color"
|
2041 |
-
#~ msgstr "Couleur des liens sociaux"
|
2042 |
-
|
2043 |
-
#~ msgid "Social Links Color: Hover"
|
2044 |
-
#~ msgstr "Couleur des liens sociaux au survol"
|
2045 |
-
|
2046 |
-
#~ msgid "Body"
|
2047 |
-
#~ msgstr "Corps de page"
|
2048 |
-
|
2049 |
-
#~ msgid "All Headings"
|
2050 |
-
#~ msgstr "Style générique titrages"
|
2051 |
-
|
2052 |
-
#~ msgid "Heading 1 (H1)"
|
2053 |
-
#~ msgstr "Titrage 1 (h1)"
|
2054 |
-
|
2055 |
-
#~ msgid "Heading 2 (H2)"
|
2056 |
-
#~ msgstr "Titrage 2 (h2)"
|
2057 |
-
|
2058 |
-
#~ msgid "Heading 3 (H3)"
|
2059 |
-
#~ msgstr "Titrage 3 (h3)"
|
2060 |
-
|
2061 |
-
#~ msgid "Heading 4 (H4)"
|
2062 |
-
#~ msgstr "Titrage 4 (h4)"
|
2063 |
-
|
2064 |
-
#~ msgid "Main Menu"
|
2065 |
-
#~ msgstr "Menu principal"
|
2066 |
-
|
2067 |
-
#~ msgid "Main Menu: Dropdowns"
|
2068 |
-
#~ msgstr "Sous-menu déroulant"
|
2069 |
-
|
2070 |
-
#~ msgid "Page Title Subheading"
|
2071 |
-
#~ msgstr "Sous-titre de la page"
|
2072 |
-
|
2073 |
-
#~ msgid "Blog Entry Title"
|
2074 |
-
#~ msgstr "Titre de l'entrée du blog"
|
2075 |
-
|
2076 |
-
#~ msgid "Blog Post Title"
|
2077 |
-
#~ msgstr "Titre d’article du blog"
|
2078 |
-
|
2079 |
-
#~ msgid "Sidebar Widget Heading"
|
2080 |
-
#~ msgstr "Titre Widget barre latérale"
|
2081 |
-
|
2082 |
-
#~ msgid "Footer Widget Heading"
|
2083 |
-
#~ msgstr "Titre Widget pied de page"
|
2084 |
-
|
2085 |
-
#~ msgid "Footer Copyright"
|
2086 |
-
#~ msgstr "Copyright du pied de page"
|
2087 |
-
|
2088 |
-
#~ msgid "Footer Menu"
|
2089 |
-
#~ msgstr "Menu du pied de page"
|
2090 |
-
|
2091 |
-
#~ msgid "Typography"
|
2092 |
-
#~ msgstr "Typographie"
|
2093 |
-
|
2094 |
-
#~ msgid "Font Subsets"
|
2095 |
-
#~ msgstr "Sous-ensembles de police"
|
2096 |
-
|
2097 |
-
#~ msgid "Important: Not all fonts support every font-weight."
|
2098 |
-
#~ msgstr ""
|
2099 |
-
#~ "Important : toutes les polices ne sont pas compatibles avec toutes les "
|
2100 |
-
#~ "graisses de caractère."
|
2101 |
-
|
2102 |
-
#~ msgid "None"
|
2103 |
-
#~ msgstr "Aucun"
|
2104 |
-
|
2105 |
-
#~ msgid "Letter Spacing (px)"
|
2106 |
-
#~ msgstr "Interlettrage (px)"
|
2107 |
-
|
2108 |
-
#~ msgid "Font Color"
|
2109 |
-
#~ msgstr "Couleur de police"
|
2110 |
-
|
2111 |
-
#~ msgid "WooCommerce"
|
2112 |
-
#~ msgstr "WooCommerce"
|
2113 |
-
|
2114 |
-
#~ msgid ""
|
2115 |
-
#~ "For some options, you must save and refresh your live site to preview "
|
2116 |
-
#~ "changes."
|
2117 |
-
#~ msgstr ""
|
2118 |
-
#~ "Pour certaines options, vous devez enregistrer et actualiser votre site "
|
2119 |
-
#~ "en direct pour prévisualiser les modifications."
|
2120 |
-
|
2121 |
-
#~ msgid "Custom WooCommerce Sidebar"
|
2122 |
-
#~ msgstr "Barre latérale personnalisée pour Woocommerce"
|
2123 |
-
|
2124 |
-
#~ msgid "Category Page"
|
2125 |
-
#~ msgstr "Catégorie de page"
|
2126 |
-
|
2127 |
-
#~ msgid "Display Featured Image"
|
2128 |
-
#~ msgstr "Afficher l'image à la Une"
|
2129 |
-
|
2130 |
-
#~ msgid "Display the categories featured images before the product archives."
|
2131 |
-
#~ msgstr ""
|
2132 |
-
#~ "Afficher les images à la une des catégories avant les archives de produit."
|
2133 |
-
|
2134 |
-
#~ msgid "Yes"
|
2135 |
-
#~ msgstr "Oui"
|
2136 |
-
|
2137 |
-
#~ msgid "No"
|
2138 |
-
#~ msgstr "Non"
|
2139 |
-
|
2140 |
-
#~ msgid "Cart Page"
|
2141 |
-
#~ msgstr "Page du panier "
|
2142 |
-
|
2143 |
-
#~ msgid "Cross-Sells Count"
|
2144 |
-
#~ msgstr "Compteur des ventes croisées"
|
2145 |
-
|
2146 |
-
#~ msgid "Cross-Sells Columns"
|
2147 |
-
#~ msgstr "Colonnes des ventes croisées"
|
2148 |
-
|
2149 |
-
#~ msgid "Menu Cart"
|
2150 |
-
#~ msgstr "Menu du panier"
|
2151 |
-
|
2152 |
-
#~ msgid "Hide If Empty Cart"
|
2153 |
-
#~ msgstr "Masquer si le panier est vide"
|
2154 |
-
|
2155 |
-
#~ msgid "Display"
|
2156 |
-
#~ msgstr "Afficher"
|
2157 |
-
|
2158 |
-
#~ msgid "Icon And Cart Total"
|
2159 |
-
#~ msgstr "Icône et total du panier"
|
2160 |
-
|
2161 |
-
#~ msgid "Icon And Cart Count"
|
2162 |
-
#~ msgstr "Icône et compteur du panier"
|
2163 |
-
|
2164 |
-
#~ msgid "Icon And Cart Count + Total"
|
2165 |
-
#~ msgstr "Icône et compteur panier + total"
|
2166 |
-
|
2167 |
-
#~ msgid "Drop-Down"
|
2168 |
-
#~ msgstr "Menu déroulant"
|
2169 |
-
|
2170 |
-
#~ msgid "Go To Cart"
|
2171 |
-
#~ msgstr "Voir au panier"
|
2172 |
-
|
2173 |
-
#~ msgid "Custom Link"
|
2174 |
-
#~ msgstr "Lien personnalisé"
|
2175 |
-
|
2176 |
-
#~ msgid "The Custom Link style need to be selected"
|
2177 |
-
#~ msgstr "Le style de lien personnalisé doit être sélectionné"
|
2178 |
-
|
2179 |
-
#~ msgid "Cart Icon"
|
2180 |
-
#~ msgstr "Icône du panier"
|
2181 |
-
|
2182 |
-
#~ msgid "Custom Icon"
|
2183 |
-
#~ msgstr "Icône personnalisée"
|
2184 |
-
|
2185 |
-
#~ msgid "Enter your full icon class"
|
2186 |
-
#~ msgstr "Entrez votre classe complète de l’icône"
|
2187 |
-
|
2188 |
-
#~ msgid "Center Vertically"
|
2189 |
-
#~ msgstr "Centrer verticalement"
|
2190 |
-
|
2191 |
-
#~ msgid "Use this field to center your icon vertically"
|
2192 |
-
#~ msgstr "Utilisez ce champ pour centrer votre icône verticalement"
|
2193 |
-
|
2194 |
-
#~ msgid "Cart Dropdown Styling"
|
2195 |
-
#~ msgstr "Style du menu déroulant du panier"
|
2196 |
-
|
2197 |
-
#~ msgid "Cart Dropdowns Width (px)"
|
2198 |
-
#~ msgstr "Largeur du menu déroulant du panier (px)"
|
2199 |
-
|
2200 |
-
#~ msgid "Dropdown Borders Color"
|
2201 |
-
#~ msgstr "Couleur de bordure du menu déroulant"
|
2202 |
-
|
2203 |
-
#~ msgid "Remove Link Color"
|
2204 |
-
#~ msgstr "Supprimer la couleur de lien"
|
2205 |
-
|
2206 |
-
#~ msgid "Remove Link Color: Hover"
|
2207 |
-
#~ msgstr "Supprimer la couleur de lien ausurvol"
|
2208 |
-
|
2209 |
-
#~ msgid "Quantity Color"
|
2210 |
-
#~ msgstr "Couleur du chiffre de quantité"
|
2211 |
-
|
2212 |
-
#~ msgid "Price Color"
|
2213 |
-
#~ msgstr "Couleur du prix"
|
2214 |
-
|
2215 |
-
#~ msgid "Subtotal Color"
|
2216 |
-
#~ msgstr "Couleur du sous-total"
|
2217 |
-
|
2218 |
-
#~ msgid "Checkout Button Background"
|
2219 |
-
#~ msgstr "Arrière-plan du bouton commander"
|
2220 |
-
|
2221 |
-
#~ msgid "Checkout Button Background: Hover"
|
2222 |
-
#~ msgstr "Arrière-plan du bouton commander au survol"
|
2223 |
-
|
2224 |
-
#~ msgid "Checkout Button Color"
|
2225 |
-
#~ msgstr "Couleur du texte bouton commander"
|
2226 |
-
|
2227 |
-
#~ msgid "Checkout Button Color: Hover"
|
2228 |
-
#~ msgstr "Couleur du texte bouton commander au survol"
|
2229 |
-
|
2230 |
-
#~ msgid "Shop Posts Per Page"
|
2231 |
-
#~ msgstr "Nombre de produits par page"
|
2232 |
-
|
2233 |
-
#~ msgid "Shop Columns"
|
2234 |
-
#~ msgstr "Colonnes de la boutique"
|
2235 |
-
|
2236 |
-
#~ msgid "Toolbar"
|
2237 |
-
#~ msgstr "Barre d'outils"
|
2238 |
-
|
2239 |
-
#~ msgid "Grid/List Buttons"
|
2240 |
-
#~ msgstr "Grille/Liste boutons"
|
2241 |
-
|
2242 |
-
#~ msgid "Default Catalog View"
|
2243 |
-
#~ msgstr "Vue en catalogue par défaut"
|
2244 |
-
|
2245 |
-
#~ msgid "Grid View"
|
2246 |
-
#~ msgstr "Vue en grille"
|
2247 |
-
|
2248 |
-
#~ msgid "List View"
|
2249 |
-
#~ msgstr "Vue en liste"
|
2250 |
-
|
2251 |
-
#~ msgid "Length of the short description of the list view."
|
2252 |
-
#~ msgstr "Longueur de la courte description de la vue en liste."
|
2253 |
-
|
2254 |
-
#~ msgid "Shop Sort"
|
2255 |
-
#~ msgstr "Tri de la boutique"
|
2256 |
-
|
2257 |
-
#~ msgid "Shop Result Count"
|
2258 |
-
#~ msgstr "Compteur des résultats boutique"
|
2259 |
-
|
2260 |
-
#~ msgid "Products"
|
2261 |
-
#~ msgstr "Produits"
|
2262 |
-
|
2263 |
-
#~ msgid "Title"
|
2264 |
-
#~ msgstr "Titre"
|
2265 |
-
|
2266 |
-
#~ msgid "Price/Rating"
|
2267 |
-
#~ msgstr "Prix/Notation"
|
2268 |
-
|
2269 |
-
#~ msgid "Description"
|
2270 |
-
#~ msgstr "Description"
|
2271 |
-
|
2272 |
-
#~ msgid "Add To Cart Button"
|
2273 |
-
#~ msgstr "Bouton ajouter au panier"
|
2274 |
-
|
2275 |
-
#~ msgid "Product Entry Media"
|
2276 |
-
#~ msgstr "Media d’entrée de produit"
|
2277 |
-
|
2278 |
-
#~ msgid "Featured Image"
|
2279 |
-
#~ msgstr "Image à la Une"
|
2280 |
-
|
2281 |
-
#~ msgid "Image Swap"
|
2282 |
-
#~ msgstr "Image alternative"
|
2283 |
-
|
2284 |
-
#~ msgid "Gallery Slider"
|
2285 |
-
#~ msgstr "Diaporama de galerie"
|
2286 |
-
|
2287 |
-
#, fuzzy
|
2288 |
-
#~| msgid "Blog Pagination Style"
|
2289 |
-
#~ msgid "Pagination Style"
|
2290 |
-
#~ msgstr "Style de pagination"
|
2291 |
-
|
2292 |
-
#~ msgid "Single"
|
2293 |
-
#~ msgstr "Individuel"
|
2294 |
-
|
2295 |
-
#~ msgid "Summary Elements Positioning"
|
2296 |
-
#~ msgstr "Positionnement des éléments du sommaire"
|
2297 |
-
|
2298 |
-
#~ msgid "Rating"
|
2299 |
-
#~ msgstr "Notation"
|
2300 |
-
|
2301 |
-
#~ msgid "Price"
|
2302 |
-
#~ msgstr "Prix"
|
2303 |
-
|
2304 |
-
#~ msgid "Excerpt"
|
2305 |
-
#~ msgstr "Extrait"
|
2306 |
-
|
2307 |
-
#~ msgid "Quantity & Add To Cart"
|
2308 |
-
#~ msgstr "Quantité et ajouter au panier"
|
2309 |
-
|
2310 |
-
#~ msgid "Product Meta"
|
2311 |
-
#~ msgstr "Meta du produit"
|
2312 |
-
|
2313 |
-
#~ msgid "Tabs Position"
|
2314 |
-
#~ msgstr "Position des onglets"
|
2315 |
-
|
2316 |
-
#~ msgid "Up-Sells Count"
|
2317 |
-
#~ msgstr "Compteur des meilleures ventes"
|
2318 |
-
|
2319 |
-
#~ msgid "Up-Sells Columns"
|
2320 |
-
#~ msgstr "Colonnes meilleures ventes"
|
2321 |
-
|
2322 |
-
#~ msgid "Display Related Items"
|
2323 |
-
#~ msgstr "Afficher les éléments en relation"
|
2324 |
-
|
2325 |
-
#~ msgid "Related Items Count"
|
2326 |
-
#~ msgstr "Nombre d’éléments en relation"
|
2327 |
-
|
2328 |
-
#~ msgid "Related Products Columns"
|
2329 |
-
#~ msgstr "Colonnes de produits en relation"
|
2330 |
-
|
2331 |
-
#~ msgid "Advanced Styling"
|
2332 |
-
#~ msgstr "Style avancé"
|
2333 |
-
|
2334 |
-
#~ msgid "On Sale Background"
|
2335 |
-
#~ msgstr "Couleur d’arrière-plan du badge promo"
|
2336 |
-
|
2337 |
-
#~ msgid "On Sale Color"
|
2338 |
-
#~ msgstr "Couleur du texte du badge promo"
|
2339 |
-
|
2340 |
-
#~ msgid "Out of Stock Background"
|
2341 |
-
#~ msgstr "Couleur d’arrière-plan Produit épuisé"
|
2342 |
-
|
2343 |
-
#~ msgid "Out of Stock Color"
|
2344 |
-
#~ msgstr "Couleur du texte Produit épuisé"
|
2345 |
-
|
2346 |
-
#~ msgid "Stars Color Before"
|
2347 |
-
#~ msgstr "Couleur des étoiles avant"
|
2348 |
-
|
2349 |
-
#~ msgid "Stars Color"
|
2350 |
-
#~ msgstr "Couleur des étoiles"
|
2351 |
-
|
2352 |
-
#~ msgid "Product Entry: Toolbar"
|
2353 |
-
#~ msgstr "Fiche produit : barre d’outils"
|
2354 |
-
|
2355 |
-
#~ msgid "Border Top/Bottom Color"
|
2356 |
-
#~ msgstr "Couleur de bordure supérieure/inférieure"
|
2357 |
-
|
2358 |
-
#~ msgid "Grid/List Color"
|
2359 |
-
#~ msgstr "Grille/Liste couleur"
|
2360 |
-
|
2361 |
-
#~ msgid "Grid/List Border Color"
|
2362 |
-
#~ msgstr "Grille/Liste couleur bordure active"
|
2363 |
-
|
2364 |
-
#~ msgid "Grid/List Hover Color"
|
2365 |
-
#~ msgstr "Grille/Liste couleur au survol"
|
2366 |
-
|
2367 |
-
#~ msgid "Grid/List Active Color"
|
2368 |
-
#~ msgstr "Grille/Liste couleur active"
|
2369 |
-
|
2370 |
-
#~ msgid "Select Color"
|
2371 |
-
#~ msgstr "Choisir une couleur"
|
2372 |
-
|
2373 |
-
#~ msgid "Select Border Color"
|
2374 |
-
#~ msgstr "Couleur de la bordure"
|
2375 |
-
|
2376 |
-
#~ msgid "Number of Products Color"
|
2377 |
-
#~ msgstr "Couleur du nombre de produits"
|
2378 |
-
|
2379 |
-
#~ msgid "Number of Products Inactive Color"
|
2380 |
-
#~ msgstr "Couleur du nombre de produits inactifs"
|
2381 |
-
|
2382 |
-
#~ msgid "Number of Products Border Color"
|
2383 |
-
#~ msgstr "Couleur de la bordure du nombre de produits"
|
2384 |
-
|
2385 |
-
#~ msgid "Product Entry"
|
2386 |
-
#~ msgstr "Entrée produit"
|
2387 |
-
|
2388 |
-
#~ msgid "Category Color: Hover"
|
2389 |
-
#~ msgstr "Catégorie : couleur au survol"
|
2390 |
-
|
2391 |
-
#~ msgid "Title Color"
|
2392 |
-
#~ msgstr "Couleur du titre"
|
2393 |
-
|
2394 |
-
#~ msgid "Title Color: Hover"
|
2395 |
-
#~ msgstr "Couleur du titre au survol "
|
2396 |
-
|
2397 |
-
#~ msgid "Del Price Color"
|
2398 |
-
#~ msgstr "Couleur de prix barré"
|
2399 |
-
|
2400 |
-
#~ msgid "Product Entry: Add To Cart"
|
2401 |
-
#~ msgstr "Entrée de produit : Ajouter au panier"
|
2402 |
-
|
2403 |
-
#~ msgid "Add To Cart Background Color"
|
2404 |
-
#~ msgstr "Couleur d'arrière-plan ajouter au panier"
|
2405 |
-
|
2406 |
-
#~ msgid "Add To Cart Background Color: Hover"
|
2407 |
-
#~ msgstr "Couleur d'arrière-plan au survol ajouter au panier"
|
2408 |
-
|
2409 |
-
#~ msgid "Add To Cart Color"
|
2410 |
-
#~ msgstr "Ajouter au panier : couleur"
|
2411 |
-
|
2412 |
-
#~ msgid "Add To Cart Color: Hover"
|
2413 |
-
#~ msgstr "Ajouter au panier : couleur au survol"
|
2414 |
-
|
2415 |
-
#~ msgid "Add To Cart Border Color"
|
2416 |
-
#~ msgstr "Ajouter au panier : couleur de bordure"
|
2417 |
-
|
2418 |
-
#~ msgid "Add To Cart Border Color: Hover"
|
2419 |
-
#~ msgstr "Ajouter au panier : couleur de bordure au survol"
|
2420 |
-
|
2421 |
-
#~ msgid "Add To Cart Border: Style"
|
2422 |
-
#~ msgstr "Style de bordure ajouter au panier"
|
2423 |
-
|
2424 |
-
#~ msgid "Solid"
|
2425 |
-
#~ msgstr "Solide"
|
2426 |
-
|
2427 |
-
#~ msgid "Double"
|
2428 |
-
#~ msgstr "Double"
|
2429 |
-
|
2430 |
-
#~ msgid "Dashed"
|
2431 |
-
#~ msgstr "En pointillés"
|
2432 |
-
|
2433 |
-
#~ msgid "Dotted"
|
2434 |
-
#~ msgstr "Pointillés"
|
2435 |
-
|
2436 |
-
#~ msgid "Add To Cart Border: Size"
|
2437 |
-
#~ msgstr "Taille de bordure ajouter au panier"
|
2438 |
-
|
2439 |
-
#~ msgid "Add a custom border size. px - em - %."
|
2440 |
-
#~ msgstr "Ajouter une taille de bordure personnalisée. px - em - %."
|
2441 |
-
|
2442 |
-
#~ msgid "Add To Cart Border: Radius"
|
2443 |
-
#~ msgstr "Bords arrondis ajouter au panier"
|
2444 |
-
|
2445 |
-
#~ msgid "Single Product"
|
2446 |
-
#~ msgstr "Produit individuel"
|
2447 |
-
|
2448 |
-
#~ msgid "Description Color"
|
2449 |
-
#~ msgstr "Couleur de la description"
|
2450 |
-
|
2451 |
-
#~ msgid "Quantity Border Color"
|
2452 |
-
#~ msgstr "Couleur de bordure de quantité"
|
2453 |
-
|
2454 |
-
#~ msgid "Quantity Border Color Focus"
|
2455 |
-
#~ msgstr "Couleur de bordure de quantité au focus"
|
2456 |
-
|
2457 |
-
#~ msgid "Quantity Plus/Minus Color"
|
2458 |
-
#~ msgstr "Couleur du bouton de quantité +/-"
|
2459 |
-
|
2460 |
-
#~ msgid "Quantity Plus/Minus Color: Hover"
|
2461 |
-
#~ msgstr "Couleur du bouton de quantité +/- au survol"
|
2462 |
-
|
2463 |
-
#~ msgid "Quantity Plus/Minus Border Color: Hover"
|
2464 |
-
#~ msgstr "Couleur de bordure du bouton de quantité +/- au survol"
|
2465 |
-
|
2466 |
-
#~ msgid "Meta Title Color"
|
2467 |
-
#~ msgstr "Couleur du titre Méta"
|
2468 |
-
|
2469 |
-
#~ msgid "Meta Link Color"
|
2470 |
-
#~ msgstr "Couleur des liens Méta"
|
2471 |
-
|
2472 |
-
#~ msgid "Meta Link Color: Hover"
|
2473 |
-
#~ msgstr "Couleur des liens Méta au survol"
|
2474 |
-
|
2475 |
-
#~ msgid "Single Product: Thumbnails"
|
2476 |
-
#~ msgstr "Produit individuel : vignettes"
|
2477 |
-
|
2478 |
-
#~ msgid "Next/Prev Background: Hover"
|
2479 |
-
#~ msgstr "Arrière-plan Suiv/Préc. au survol"
|
2480 |
-
|
2481 |
-
#~ msgid "Next/Prev Color"
|
2482 |
-
#~ msgstr "Couleur Préc./Suiv."
|
2483 |
-
|
2484 |
-
#~ msgid "Single Product: Tabs"
|
2485 |
-
#~ msgstr "Produit individuel : onglets"
|
2486 |
-
|
2487 |
-
#~ msgid "Text Color: Hover"
|
2488 |
-
#~ msgstr "Couleur du texte au survol"
|
2489 |
-
|
2490 |
-
#~ msgid "Active Text Color"
|
2491 |
-
#~ msgstr "Couleur du texte actif"
|
2492 |
-
|
2493 |
-
#~ msgid "Active Text Borders Color"
|
2494 |
-
#~ msgstr "Couleur de bordure du texte actif"
|
2495 |
-
|
2496 |
-
#~ msgid "Product Description: Title Color"
|
2497 |
-
#~ msgstr "Description du produit : couleur du titre"
|
2498 |
-
|
2499 |
-
#~ msgid "Product Description: Color"
|
2500 |
-
#~ msgstr "Description du produit : couleur"
|
2501 |
-
|
2502 |
-
#~ msgid "Account"
|
2503 |
-
#~ msgstr "Mon compte"
|
2504 |
-
|
2505 |
-
#~ msgid "Navigation: Borders Color"
|
2506 |
-
#~ msgstr "Navigation : couleur de bordure"
|
2507 |
-
|
2508 |
-
#~ msgid "Navigation: Icons Color"
|
2509 |
-
#~ msgstr "Navigation : couleur des icônes"
|
2510 |
-
|
2511 |
-
#~ msgid "Navigation: Links Color"
|
2512 |
-
#~ msgstr "Navigation : couleur des liens"
|
2513 |
-
|
2514 |
-
#~ msgid "Navigation: Links Color: Hover"
|
2515 |
-
#~ msgstr "Navigation : couleur des liens au survol"
|
2516 |
-
|
2517 |
-
#~ msgid "Addresses: Box Background"
|
2518 |
-
#~ msgstr "Adresses : arrière-plan"
|
2519 |
-
|
2520 |
-
#~ msgid "Addresses: Box Title Color"
|
2521 |
-
#~ msgstr "Adresses : couleur du titre"
|
2522 |
-
|
2523 |
-
#~ msgid "Addresses: Box Title Border Bottom Color"
|
2524 |
-
#~ msgstr "Adresses : couleur de bordure inférieure titre"
|
2525 |
-
|
2526 |
-
#~ msgid "Addresses: Box Content Color"
|
2527 |
-
#~ msgstr "Adresses : couleur du texte de contenu"
|
2528 |
-
|
2529 |
-
#~ msgid "Addresses: Box Button Background"
|
2530 |
-
#~ msgstr "Adresses : arrière-plan du bouton"
|
2531 |
-
|
2532 |
-
#~ msgid "Addresses: Box Button Background: Hover"
|
2533 |
-
#~ msgstr "Adresses : arrière-plan au survol du bouton"
|
2534 |
-
|
2535 |
-
#~ msgid "Addresses: Box Button color"
|
2536 |
-
#~ msgstr "Adresses : couleur du texte bouton"
|
2537 |
-
|
2538 |
-
#~ msgid "Addresses: Box Button color: Hover"
|
2539 |
-
#~ msgstr "Adresses : couleur du texte au survol bouton"
|
2540 |
-
|
2541 |
-
#~ msgid "Cart"
|
2542 |
-
#~ msgstr "Panier"
|
2543 |
-
|
2544 |
-
#~ msgid "Head Background"
|
2545 |
-
#~ msgstr "Arrière plan de l’entête"
|
2546 |
-
|
2547 |
-
#~ msgid "Head Titles Color"
|
2548 |
-
#~ msgstr "Couleur des titres d’entête"
|
2549 |
-
|
2550 |
-
#~ msgid "Cart Totals Table: Titles Color"
|
2551 |
-
#~ msgstr "Tableau des totaux du panier : couleur des titres"
|
2552 |
-
|
2553 |
-
#~ msgid "Remove Button Color"
|
2554 |
-
#~ msgstr "Supprimer la couleur de bouton"
|
2555 |
-
|
2556 |
-
#~ msgid "Remove Button Color: Hover"
|
2557 |
-
#~ msgstr "Supprimer la couleur de bouton au survol"
|
2558 |
-
|
2559 |
-
#~ msgid "Checkout"
|
2560 |
-
#~ msgstr "Commander"
|
2561 |
-
|
2562 |
-
#~ msgid "Notices: Borders Color"
|
2563 |
-
#~ msgstr "Couleur de la bordure des avis"
|
2564 |
-
|
2565 |
-
#~ msgid "Notices: Icon Color"
|
2566 |
-
#~ msgstr "Couleur de l’icône des avis"
|
2567 |
-
|
2568 |
-
#~ msgid "Notices: Color"
|
2569 |
-
#~ msgstr "Couleur du texte des avis"
|
2570 |
-
|
2571 |
-
#~ msgid "Notices: Link Color"
|
2572 |
-
#~ msgstr "Couleur du lien des avis"
|
2573 |
-
|
2574 |
-
#~ msgid "Notices: Link Color: Hover"
|
2575 |
-
#~ msgstr "Couleur du lien des avis au survol"
|
2576 |
-
|
2577 |
-
#~ msgid "Notices Form: Border Color"
|
2578 |
-
#~ msgstr "Couleur de la bordure des avis de formulaire"
|
2579 |
-
|
2580 |
-
#~ msgid "Titles Color"
|
2581 |
-
#~ msgstr "Couleur des titres"
|
2582 |
-
|
2583 |
-
#~ msgid "Titles Border Bottom Color"
|
2584 |
-
#~ msgstr "Couleur de bordure inférieure des titres"
|
2585 |
-
|
2586 |
-
#~ msgid "Table Main Background"
|
2587 |
-
#~ msgstr "Arrière-plan principal de tableau"
|
2588 |
-
|
2589 |
-
#~ msgid "Table Titles Color"
|
2590 |
-
#~ msgstr "Couleur des titres de tableau"
|
2591 |
-
|
2592 |
-
#~ msgid "Table Borders Color"
|
2593 |
-
#~ msgstr "Couleur de bordure de tableau"
|
2594 |
-
|
2595 |
-
#~ msgid "Payment Methods Background"
|
2596 |
-
#~ msgstr "Arrière-plan des méthodes de paiement"
|
2597 |
-
|
2598 |
-
#~ msgid "Payment Methods Borders Color"
|
2599 |
-
#~ msgstr "Couleur de bordure des méthodes de paiement"
|
2600 |
-
|
2601 |
-
#~ msgid "Payment Box Background"
|
2602 |
-
#~ msgstr "Arrière-plan de la boîte de paiement"
|
2603 |
-
|
2604 |
-
#~ msgid "Payment Box Color"
|
2605 |
-
#~ msgstr "Couleur de la boîte de paiement"
|
2606 |
-
|
2607 |
-
#~ msgid "Type your search"
|
2608 |
-
#~ msgstr "Saisissez votre recherche"
|
2609 |
-
|
2610 |
-
#~ msgid "Recent Posts"
|
2611 |
-
#~ msgstr "Articles récents"
|
2612 |
-
|
2613 |
-
#~ msgid "Search Results Found"
|
2614 |
-
#~ msgstr "Résultats trouvés pour la recherche"
|
2615 |
-
|
2616 |
-
#~ msgid "Daily Archives: %s"
|
2617 |
-
#~ msgstr "Archives quotidiennes : %s"
|
2618 |
-
|
2619 |
-
#~ msgid "Monthly Archives: %s"
|
2620 |
-
#~ msgstr "Archives mensuelles : %s"
|
2621 |
-
|
2622 |
-
#~ msgid "Yearly Archives: %s"
|
2623 |
-
#~ msgstr "Archives annuelles : %s"
|
2624 |
-
|
2625 |
-
#~ msgid "404: Page Not Found"
|
2626 |
-
#~ msgstr "404 : page introuvable"
|
2627 |
-
|
2628 |
-
#~ msgid "You searched for:"
|
2629 |
-
#~ msgstr "Votre recherche pour : "
|
2630 |
-
|
2631 |
-
#~ msgid "This author has written"
|
2632 |
-
#~ msgstr "Cet auteur a écrit"
|
2633 |
-
|
2634 |
-
#~ msgid "articles"
|
2635 |
-
#~ msgstr "articles"
|
2636 |
-
|
2637 |
-
#~ msgid "Read More"
|
2638 |
-
#~ msgstr "Lire la suite"
|
2639 |
-
|
2640 |
-
#~ msgid "Tags"
|
2641 |
-
#~ msgstr "Étiquettes"
|
2642 |
-
|
2643 |
-
#~ msgid "Social Share"
|
2644 |
-
#~ msgstr "Partage réseaux sociaux"
|
2645 |
-
|
2646 |
-
#~ msgid "Next/Prev Links"
|
2647 |
-
#~ msgstr "Liens Préc./Suiv."
|
2648 |
-
|
2649 |
-
#~ msgid "Author Box"
|
2650 |
-
#~ msgstr "Encart sur l’auteur"
|
2651 |
-
|
2652 |
-
#~ msgid "Related Posts"
|
2653 |
-
#~ msgstr "Articles similaires"
|
2654 |
-
|
2655 |
-
#~ msgid "Pingback:"
|
2656 |
-
#~ msgstr "Pingback : "
|
2657 |
-
|
2658 |
-
#~ msgid "(Edit)"
|
2659 |
-
#~ msgstr "(Éditer)"
|
2660 |
-
|
2661 |
-
#~ msgid "%s "
|
2662 |
-
#~ msgstr "%s "
|
2663 |
-
|
2664 |
-
#~ msgid "edit"
|
2665 |
-
#~ msgstr "éditer"
|
2666 |
-
|
2667 |
-
#~ msgid "Your comment is awaiting moderation."
|
2668 |
-
#~ msgstr "Votre commentaire est en attente de modération."
|
2669 |
-
|
2670 |
-
#~ msgid "Name (required)"
|
2671 |
-
#~ msgstr "Nom (requis)"
|
2672 |
-
|
2673 |
-
#~ msgid "Email (required)"
|
2674 |
-
#~ msgstr "Courriel (requis)"
|
2675 |
-
|
2676 |
-
#~ msgid "Website"
|
2677 |
-
#~ msgstr "Site Web"
|
2678 |
-
|
2679 |
-
#~ msgid "Newer Posts"
|
2680 |
-
#~ msgstr "Nouveaux articles"
|
2681 |
-
|
2682 |
-
#~ msgid "Older Posts"
|
2683 |
-
#~ msgstr "Anciens articles"
|
2684 |
-
|
2685 |
-
#~ msgid "OceanWP"
|
2686 |
-
#~ msgstr "OceanWP"
|
2687 |
-
|
2688 |
-
#~ msgid "Default Icon"
|
2689 |
-
#~ msgstr "Icône par défaut"
|
2690 |
-
|
2691 |
-
#~ msgid "3D X"
|
2692 |
-
#~ msgstr "3D Xv"
|
2693 |
-
|
2694 |
-
#~ msgid "3D X Reverse"
|
2695 |
-
#~ msgstr "3D X inversé"
|
2696 |
-
|
2697 |
-
#~ msgid "3D Y"
|
2698 |
-
#~ msgstr "3D Y"
|
2699 |
-
|
2700 |
-
#~ msgid "3D Y Reverse"
|
2701 |
-
#~ msgstr "3D Y inversé"
|
2702 |
-
|
2703 |
-
#~ msgid "3D XY"
|
2704 |
-
#~ msgstr "3D XY"
|
2705 |
-
|
2706 |
-
#~ msgid "3D XY Reverse"
|
2707 |
-
#~ msgstr "3D XY inversé"
|
2708 |
-
|
2709 |
-
#~ msgid "Arrow"
|
2710 |
-
#~ msgstr "Flèche"
|
2711 |
-
|
2712 |
-
#~ msgid "Arrow Reverse"
|
2713 |
-
#~ msgstr "Flèche inversé"
|
2714 |
-
|
2715 |
-
#~ msgid "Arrowalt"
|
2716 |
-
#~ msgstr "Flèche pivotante"
|
2717 |
-
|
2718 |
-
#~ msgid "Arrowalt Reverse"
|
2719 |
-
#~ msgstr "Flèche pivotante inversée"
|
2720 |
-
|
2721 |
-
#~ msgid "Arrowturn"
|
2722 |
-
#~ msgstr "Flèche tournante"
|
2723 |
-
|
2724 |
-
#~ msgid "Arrowturn Reverse"
|
2725 |
-
#~ msgstr "Tournant inversé"
|
2726 |
-
|
2727 |
-
#~ msgid "Collapse"
|
2728 |
-
#~ msgstr "Réduire"
|
2729 |
-
|
2730 |
-
#~ msgid "Collapse Reverse"
|
2731 |
-
#~ msgstr "Réduire inversé"
|
2732 |
-
|
2733 |
-
#~ msgid "Elastic"
|
2734 |
-
#~ msgstr "Élastique"
|
2735 |
-
|
2736 |
-
#~ msgid "Elastic Reverse"
|
2737 |
-
#~ msgstr "Élastique inversé"
|
2738 |
-
|
2739 |
-
#~ msgid "Minus"
|
2740 |
-
#~ msgstr "Moins"
|
2741 |
-
|
2742 |
-
#~ msgid "Slider"
|
2743 |
-
#~ msgstr "Glissé"
|
2744 |
-
|
2745 |
-
#~ msgid "Slider Reverse"
|
2746 |
-
#~ msgstr "Glissé inversé"
|
2747 |
-
|
2748 |
-
#~ msgid "Spin"
|
2749 |
-
#~ msgstr "Tourner"
|
2750 |
-
|
2751 |
-
#~ msgid "Spin Reverse"
|
2752 |
-
#~ msgstr "Tourner inversé"
|
2753 |
-
|
2754 |
-
#, fuzzy
|
2755 |
-
#~ msgid "Stand"
|
2756 |
-
#~ msgstr "Si coché la première entrée se démarquera avec une grande image"
|
2757 |
-
|
2758 |
-
#~ msgid "Vortex"
|
2759 |
-
#~ msgstr "Vortex"
|
2760 |
-
|
2761 |
-
#~ msgid "Vortex Reverse"
|
2762 |
-
#~ msgstr "Vortex inversé"
|
2763 |
-
|
2764 |
-
#~ msgid "Copyright [oceanwp_date] - OceanWP Theme by Nick"
|
2765 |
-
#~ msgstr "© [oceanwp_date] - OceanWP thème par Nick"
|
2766 |
-
|
2767 |
-
#~ msgid "Twitter"
|
2768 |
-
#~ msgstr "Twitter"
|
2769 |
-
|
2770 |
-
#~ msgid "Facebook"
|
2771 |
-
#~ msgstr "Facebook"
|
2772 |
-
|
2773 |
-
#~ msgid "Google Plus"
|
2774 |
-
#~ msgstr "Google +"
|
2775 |
-
|
2776 |
-
#~ msgid "Pinterest"
|
2777 |
-
#~ msgstr "Pinterest"
|
2778 |
-
|
2779 |
-
#~ msgid "Dribbble"
|
2780 |
-
#~ msgstr "Dribbble"
|
2781 |
-
|
2782 |
-
#~ msgid "VK"
|
2783 |
-
#~ msgstr "VK"
|
2784 |
-
|
2785 |
-
#~ msgid "Instagram"
|
2786 |
-
#~ msgstr "Instagram"
|
2787 |
-
|
2788 |
-
#~ msgid "LinkedIn"
|
2789 |
-
#~ msgstr "LinkedIn"
|
2790 |
-
|
2791 |
-
#~ msgid "Tumblr"
|
2792 |
-
#~ msgstr "Tumblr"
|
2793 |
-
|
2794 |
-
#~ msgid "Github"
|
2795 |
-
#~ msgstr "Github"
|
2796 |
-
|
2797 |
-
#~ msgid "Flickr"
|
2798 |
-
#~ msgstr "Flickr"
|
2799 |
-
|
2800 |
-
#~ msgid "Skype"
|
2801 |
-
#~ msgstr "Skype"
|
2802 |
-
|
2803 |
-
#~ msgid "Youtube"
|
2804 |
-
#~ msgstr "YouTube"
|
2805 |
-
|
2806 |
-
#~ msgid "Vimeo"
|
2807 |
-
#~ msgstr "Vimeo"
|
2808 |
-
|
2809 |
-
#~ msgid "Vine"
|
2810 |
-
#~ msgstr "Vine"
|
2811 |
-
|
2812 |
-
#~ msgid "Xing"
|
2813 |
-
#~ msgstr "Xing"
|
2814 |
-
|
2815 |
-
#~ msgid "Yelp"
|
2816 |
-
#~ msgstr "Yelp"
|
2817 |
-
|
2818 |
-
#~ msgid "Tripadvisor"
|
2819 |
-
#~ msgstr "Tripadvisor"
|
2820 |
-
|
2821 |
-
#~ msgid "RSS"
|
2822 |
-
#~ msgstr "RSS"
|
2823 |
-
|
2824 |
-
#~ msgid "Email"
|
2825 |
-
#~ msgstr "Courriel "
|
2826 |
-
|
2827 |
-
#~ msgid "Install Required Plugins"
|
2828 |
-
#~ msgstr "Installation des extensions requises"
|
2829 |
-
|
2830 |
-
#~ msgid "Install Plugins"
|
2831 |
-
#~ msgstr "Installer des extensions"
|
2832 |
-
|
2833 |
-
#~ msgid "Installing Plugin: %s"
|
2834 |
-
#~ msgstr "Installation de l’extension : %s"
|
2835 |
-
|
2836 |
-
#~ msgid "Updating Plugin: %s"
|
2837 |
-
#~ msgstr "Mise à jour de l’extension : %s"
|
2838 |
-
|
2839 |
-
#~ msgid "Something went wrong with the plugin API."
|
2840 |
-
#~ msgstr "Une erreur s’est produite avec l’API de l’extension."
|
2841 |
-
|
2842 |
-
#~ msgid "Return to Required Plugins Installer"
|
2843 |
-
#~ msgstr "Retour à l’installateur des extensions obligatoires"
|
2844 |
-
|
2845 |
-
#~ msgid "Return to the Dashboard"
|
2846 |
-
#~ msgstr "Retourner au tableau de bord"
|
2847 |
-
|
2848 |
-
#~ msgid "Plugin activated successfully."
|
2849 |
-
#~ msgstr "Extension activée avec succès."
|
2850 |
-
|
2851 |
-
#~ msgid "The following plugin was activated successfully:"
|
2852 |
-
#~ msgstr "L’extension suivante a été activée avec succès : "
|
2853 |
-
|
2854 |
-
#~ msgid "No action taken. Plugin %1$s was already active."
|
2855 |
-
#~ msgstr "Pas d'action requise. L’extension %1$s est déjà activée."
|
2856 |
-
|
2857 |
-
#~ msgid ""
|
2858 |
-
#~ "Plugin not activated. A higher version of %s is needed for this theme. "
|
2859 |
-
#~ "Please update the plugin."
|
2860 |
-
#~ msgstr ""
|
2861 |
-
#~ "Extension non activée. Une version supérieure à %s est nécessaire pour "
|
2862 |
-
#~ "ce thème. Merci de mettre à jour l’extension."
|
2863 |
-
|
2864 |
-
#~ msgid "All plugins installed and activated successfully. %1$s"
|
2865 |
-
#~ msgstr "Toutes les extensions installées et activées avec succès. %1$s"
|
2866 |
-
|
2867 |
-
#~ msgid ""
|
2868 |
-
#~ "There are one or more required or recommended plugins to install, update "
|
2869 |
-
#~ "or activate."
|
2870 |
-
#~ msgstr ""
|
2871 |
-
#~ "Il existe une ou plusieurs extensions requises ou recommandées pour "
|
2872 |
-
#~ "l'installation, la mise à jour ou l'activation."
|
2873 |
-
|
2874 |
-
#~ msgid "Please contact the administrator of this site for help."
|
2875 |
-
#~ msgstr ""
|
2876 |
-
#~ "Veuillez contacter l’administrateur de ce site pour obtenir de l’aide."
|
2877 |
-
|
2878 |
-
#~ msgid "Update Required"
|
2879 |
-
#~ msgstr "Mise à jour requise"
|
2880 |
-
|
2881 |
-
#~ msgid ""
|
2882 |
-
#~ "The remote plugin package does not contain a folder with the desired slug "
|
2883 |
-
#~ "and renaming did not work."
|
2884 |
-
#~ msgstr ""
|
2885 |
-
#~ "Le pack à distance d’extensions ne contient pas de dossier avec le "
|
2886 |
-
#~ "déterminant souhaitée et le renommage n'a pas fonctionné."
|
2887 |
-
|
2888 |
-
#~ msgid ""
|
2889 |
-
#~ "Please contact the plugin provider and ask them to package their plugin "
|
2890 |
-
#~ "according to the WordPress guidelines."
|
2891 |
-
#~ msgstr ""
|
2892 |
-
#~ "Veuillez contacter le développeur de l’extension pour lui demander de la "
|
2893 |
-
#~ "rendre conforme aux directives de WordPress."
|
2894 |
-
|
2895 |
-
#~ msgid ""
|
2896 |
-
#~ "The remote plugin package consists of more than one file, but the files "
|
2897 |
-
#~ "are not packaged in a folder."
|
2898 |
-
#~ msgstr ""
|
2899 |
-
#~ "Le pack à distance d’extensions se compose de plus d'un fichier, mais les "
|
2900 |
-
#~ "fichiers ne sont pas installés dans un dossier."
|
2901 |
-
|
2902 |
-
#~ msgid "TGMPA v%s"
|
2903 |
-
#~ msgstr "TGMPA v%s"
|
2904 |
-
|
2905 |
-
#~ msgid "Required"
|
2906 |
-
#~ msgstr "Requis"
|
2907 |
-
|
2908 |
-
#~ msgid "Recommended"
|
2909 |
-
#~ msgstr "Recommandé"
|
2910 |
-
|
2911 |
-
#~ msgid "WordPress Repository"
|
2912 |
-
#~ msgstr "Dépôt de WordPress"
|
2913 |
-
|
2914 |
-
#~ msgid "External Source"
|
2915 |
-
#~ msgstr "Source externe"
|
2916 |
-
|
2917 |
-
#~ msgid "Pre-Packaged"
|
2918 |
-
#~ msgstr "Pré-installé"
|
2919 |
-
|
2920 |
-
#~ msgid "Not Installed"
|
2921 |
-
#~ msgstr "Non installé"
|
2922 |
-
|
2923 |
-
#~ msgid "Installed But Not Activated"
|
2924 |
-
#~ msgstr "Installée mais non activée"
|
2925 |
-
|
2926 |
-
#~ msgid "Active"
|
2927 |
-
#~ msgstr "Activé"
|
2928 |
-
|
2929 |
-
#~ msgid "Required Update not Available"
|
2930 |
-
#~ msgstr "Mise à jour requise non disponible"
|
2931 |
-
|
2932 |
-
#~ msgid "Requires Update"
|
2933 |
-
#~ msgstr "Requiert une mise à jour"
|
2934 |
-
|
2935 |
-
#~ msgid "Update recommended"
|
2936 |
-
#~ msgstr "Mise à jour recommandée"
|
2937 |
-
|
2938 |
-
#~ msgid "Installed version:"
|
2939 |
-
#~ msgstr "Version installée : "
|
2940 |
-
|
2941 |
-
#~ msgid "Minimum required version:"
|
2942 |
-
#~ msgstr "Requiert au minimum la version : "
|
2943 |
-
|
2944 |
-
#~ msgid "Available version:"
|
2945 |
-
#~ msgstr "Version disponible : "
|
2946 |
-
|
2947 |
-
#~ msgid "No plugins to install, update or activate."
|
2948 |
-
#~ msgstr "Pas d’extension à installer, à mettre à jour ou à activer."
|
2949 |
-
|
2950 |
-
#~ msgid "Plugin"
|
2951 |
-
#~ msgstr "Extension"
|
2952 |
-
|
2953 |
-
#~ msgid "Type"
|
2954 |
-
#~ msgstr "Type"
|
2955 |
-
|
2956 |
-
#~ msgid "Version"
|
2957 |
-
#~ msgstr "Version "
|
2958 |
-
|
2959 |
-
#~ msgid "Install %2$s"
|
2960 |
-
#~ msgstr "Installer %2$s"
|
2961 |
-
|
2962 |
-
#~ msgid "Update %2$s"
|
2963 |
-
#~ msgstr "Mettre à jour %2$s"
|
2964 |
-
|
2965 |
-
#~ msgid "Activate %2$s"
|
2966 |
-
#~ msgstr "Activer %2$s"
|
2967 |
-
|
2968 |
-
#~ msgid "Upgrade message from the plugin author:"
|
2969 |
-
#~ msgstr "Message de mise à niveau de l’auteur de l’extension : "
|
2970 |
-
|
2971 |
-
#~ msgid "Install"
|
2972 |
-
#~ msgstr "Installer"
|
2973 |
-
|
2974 |
-
#~ msgid "Update"
|
2975 |
-
#~ msgstr "Mettre à jour"
|
2976 |
-
|
2977 |
-
#~ msgid "Activate"
|
2978 |
-
#~ msgstr "Activer"
|
2979 |
-
|
2980 |
-
#~ msgid "No plugins were selected to be installed. No action taken."
|
2981 |
-
#~ msgstr ""
|
2982 |
-
#~ "Aucune extension n’a été sélectionnée pour être installée. Aucune action "
|
2983 |
-
#~ "effective."
|
2984 |
-
|
2985 |
-
#~ msgid "No plugins were selected to be updated. No action taken."
|
2986 |
-
#~ msgstr ""
|
2987 |
-
#~ "Aucune extension n’a été sélectionnée pour être mise à jour. Aucune "
|
2988 |
-
#~ "action effective."
|
2989 |
-
|
2990 |
-
#~ msgid "No plugins are available to be installed at this time."
|
2991 |
-
#~ msgstr "Aucune extension n'est disponible pour être installée en ce moment."
|
2992 |
-
|
2993 |
-
#~ msgid "No plugins are available to be updated at this time."
|
2994 |
-
#~ msgstr ""
|
2995 |
-
#~ "Aucune extension n'est disponible pour être mise à jour en ce moment."
|
2996 |
-
|
2997 |
-
#~ msgid "No plugins were selected to be activated. No action taken."
|
2998 |
-
#~ msgstr ""
|
2999 |
-
#~ "Aucune extension n'a été sélectionnée pour être activée. Aucune action "
|
3000 |
-
#~ "effective."
|
3001 |
-
|
3002 |
-
#~ msgid "No plugins are available to be activated at this time."
|
3003 |
-
#~ msgstr "Aucune extension n'est disponible pour être activée en ce moment."
|
3004 |
-
|
3005 |
-
#~ msgid "Plugin activation failed."
|
3006 |
-
#~ msgstr "L’activation de l’extension a écouhé."
|
3007 |
-
|
3008 |
-
#~ msgid "Updating Plugin %1$s (%2$d/%3$d)"
|
3009 |
-
#~ msgstr "Mise à jour de l’extension %1$s (%2$d/%3$d)"
|
3010 |
-
|
3011 |
-
#~ msgid "An error occurred while installing %1$s: <strong>%2$s</strong>."
|
3012 |
-
#~ msgstr ""
|
3013 |
-
#~ "Une erreur s'est produite lors de l'installation de %1$s : <strong>%2$s</"
|
3014 |
-
#~ "strong>."
|
3015 |
-
|
3016 |
-
#~ msgid "The installation of %1$s failed."
|
3017 |
-
#~ msgstr "L’installation de %1$s a échouée."
|
3018 |
-
|
3019 |
-
#~ msgid ""
|
3020 |
-
#~ "The installation and activation process is starting. This process may "
|
3021 |
-
#~ "take a while on some hosts, so please be patient."
|
3022 |
-
#~ msgstr ""
|
3023 |
-
#~ "Le processus d'installation et d'activation démarre. Ce processus peut "
|
3024 |
-
#~ "prendre un certain temps sur certains hébergeurs, soyez patient."
|
3025 |
-
|
3026 |
-
#~ msgid "%1$s installed and activated successfully."
|
3027 |
-
#~ msgstr "%1$s a été installé et activé avec succès."
|
3028 |
-
|
3029 |
-
#~ msgid "Show Details"
|
3030 |
-
#~ msgstr "Afficher les détails"
|
3031 |
-
|
3032 |
-
#~ msgid "Hide Details"
|
3033 |
-
#~ msgstr "Masquer les détails"
|
3034 |
-
|
3035 |
-
#~ msgid "All installations and activations have been completed."
|
3036 |
-
#~ msgstr ""
|
3037 |
-
#~ "Toutes les installations et les activations ont été effectuées avec "
|
3038 |
-
#~ "succès."
|
3039 |
-
|
3040 |
-
#~ msgid "Installing and Activating Plugin %1$s (%2$d/%3$d)"
|
3041 |
-
#~ msgstr "Installation et activation de l’extension %1$s (%2$d/%3$d)"
|
3042 |
-
|
3043 |
-
#~ msgid ""
|
3044 |
-
#~ "The installation process is starting. This process may take a while on "
|
3045 |
-
#~ "some hosts, so please be patient."
|
3046 |
-
#~ msgstr ""
|
3047 |
-
#~ "Le processus d'installation démarre. Ce processus peut prendre un certain "
|
3048 |
-
#~ "temps sur certains hôtes, soyez patient."
|
3049 |
-
|
3050 |
-
#~ msgid "%1$s installed successfully."
|
3051 |
-
#~ msgstr "%1$s installé avec succès."
|
3052 |
-
|
3053 |
-
#~ msgid "All installations have been completed."
|
3054 |
-
#~ msgstr "Toutes les installations sont terminées."
|
3055 |
-
|
3056 |
-
#~ msgid "Installing Plugin %1$s (%2$d/%3$d)"
|
3057 |
-
#~ msgstr "Installation de l’extension %1$s (%2$d/%3$d)"
|
3058 |
-
|
3059 |
-
#~ msgid "Page"
|
3060 |
-
#~ msgstr "Page"
|
3061 |
-
|
3062 |
-
#~ msgid "Before Page"
|
3063 |
-
#~ msgstr "Avant la page"
|
3064 |
-
|
3065 |
-
#~ msgid "After Page"
|
3066 |
-
#~ msgstr "Après la page"
|
3067 |
-
|
3068 |
-
#~ msgid "Before Top Bar"
|
3069 |
-
#~ msgstr "Avant la barre supérieure"
|
3070 |
-
|
3071 |
-
#~ msgid "Before Top Bar Inner"
|
3072 |
-
#~ msgstr "Avant l’intérieur de la barre supérieure"
|
3073 |
-
|
3074 |
-
#~ msgid "After Top Bar Inner"
|
3075 |
-
#~ msgstr "Après l’intérieur de la barre supérieure"
|
3076 |
-
|
3077 |
-
#~ msgid "After Top Bar"
|
3078 |
-
#~ msgstr "Après la barre supérieure"
|
3079 |
-
|
3080 |
-
#~ msgid "Before Header"
|
3081 |
-
#~ msgstr "Avant l’entête"
|
3082 |
-
|
3083 |
-
#~ msgid "Before Header Inner"
|
3084 |
-
#~ msgstr "Avant l’intérieur de l’entête de page"
|
3085 |
-
|
3086 |
-
#~ msgid "After Header Inner"
|
3087 |
-
#~ msgstr "Après l’intérieur de l’entête"
|
3088 |
-
|
3089 |
-
#~ msgid "After Header"
|
3090 |
-
#~ msgstr "Après l’entête"
|
3091 |
-
|
3092 |
-
#~ msgid "Page Header"
|
3093 |
-
#~ msgstr "Entête de page"
|
3094 |
-
|
3095 |
-
#~ msgid "Before Page Header"
|
3096 |
-
#~ msgstr "Avant l'entête de la page"
|
3097 |
-
|
3098 |
-
#~ msgid "Before Page Header Inner"
|
3099 |
-
#~ msgstr "Avant l’intérieur du titre de page"
|
3100 |
-
|
3101 |
-
#~ msgid "After Page Header Inner"
|
3102 |
-
#~ msgstr "Après l’intérieur du titre de page"
|
3103 |
-
|
3104 |
-
#~ msgid "After Page Header"
|
3105 |
-
#~ msgstr "Après le titre de page"
|
3106 |
-
|
3107 |
-
#~ msgid "Before Content"
|
3108 |
-
#~ msgstr "Avant le contenu"
|
3109 |
-
|
3110 |
-
#~ msgid "Before Content Inner"
|
3111 |
-
#~ msgstr "Avant l’intérieur du contenu"
|
3112 |
-
|
3113 |
-
#~ msgid "After Content Inner"
|
3114 |
-
#~ msgstr "Après l’intérieur du contenu"
|
3115 |
-
|
3116 |
-
#~ msgid "After Content"
|
3117 |
-
#~ msgstr "Après le contenu"
|
3118 |
-
|
3119 |
-
#~ msgid "Before Sidebar"
|
3120 |
-
#~ msgstr "Avant la barre latérale"
|
3121 |
-
|
3122 |
-
#~ msgid "Before Sidebar Inner"
|
3123 |
-
#~ msgstr "Avant l’intérieur de la barre latérale"
|
3124 |
-
|
3125 |
-
#~ msgid "After Sidebar Inner"
|
3126 |
-
#~ msgstr "Après l’intérieur de la barre latérale"
|
3127 |
-
|
3128 |
-
#~ msgid "After Sidebar"
|
3129 |
-
#~ msgstr "Après la barre latérale"
|
3130 |
-
|
3131 |
-
#~ msgid "Before Footer"
|
3132 |
-
#~ msgstr "Avant le pied de page"
|
3133 |
-
|
3134 |
-
#~ msgid "Before Footer Inner"
|
3135 |
-
#~ msgstr "Avant l’intérieur du pied de page"
|
3136 |
-
|
3137 |
-
#~ msgid "After Footer Inner"
|
3138 |
-
#~ msgstr "Après l’intérieur du pied de page"
|
3139 |
-
|
3140 |
-
#~ msgid "After Footer"
|
3141 |
-
#~ msgstr "Après le pied de page"
|
3142 |
-
|
3143 |
-
#~ msgid "Template"
|
3144 |
-
#~ msgstr "Modèle"
|
3145 |
-
|
3146 |
-
#~ msgid "Theme Panel > My Library"
|
3147 |
-
#~ msgstr "Theme Panel > ma bibliothèque"
|
3148 |
-
|
3149 |
-
#~ msgid "Select A Template"
|
3150 |
-
#~ msgstr "Choisissez un modèle"
|
3151 |
-
|
3152 |
-
#~ msgid "Disable link"
|
3153 |
-
#~ msgstr "Désactiver le lien"
|
3154 |
-
|
3155 |
-
#~ msgid "Display Latest Posts"
|
3156 |
-
#~ msgstr "Afficher les derniers articles"
|
3157 |
-
|
3158 |
-
#~ msgid "Enable megamenu"
|
3159 |
-
#~ msgstr "Activer le méga-menu"
|
3160 |
-
|
3161 |
-
#~ msgid "Megamenu auto width?"
|
3162 |
-
#~ msgstr "Hauteur automatique du méga menu ?"
|
3163 |
-
|
3164 |
-
#~ msgid "Megamenu columns (from 1 to 6)"
|
3165 |
-
#~ msgstr "Colonnes du Méga menu (de 1 à 6)"
|
3166 |
-
|
3167 |
-
#~ msgid "Hide Mega menu heading?"
|
3168 |
-
#~ msgstr "Masquer les titres du Mega menu ?"
|
3169 |
-
|
3170 |
-
#~ msgid "Mega Menu Widget Area"
|
3171 |
-
#~ msgstr "Zone de Widget du Méga Menu"
|
3172 |
-
|
3173 |
-
#~ msgid "Select Widget Area"
|
3174 |
-
#~ msgstr "Choisir la zone des Widgets"
|
3175 |
-
|
3176 |
-
#, fuzzy
|
3177 |
-
#~ msgid "Latest in"
|
3178 |
-
#~ msgstr "Dernier [ themes ]"
|
3179 |
-
|
3180 |
-
#~ msgid "WooCommerce Sidebar"
|
3181 |
-
#~ msgstr "Barre latérale Woocommerce"
|
3182 |
-
|
3183 |
-
#~ msgid "Grid view"
|
3184 |
-
#~ msgstr "Vue en grille"
|
3185 |
-
|
3186 |
-
#~ msgid "List view"
|
3187 |
-
#~ msgstr "Vue en liste"
|
3188 |
-
|
3189 |
-
#~ msgid "Out of Stock"
|
3190 |
-
#~ msgstr "Produit épuisé"
|
3191 |
-
|
3192 |
-
#~ msgid "Welcome!"
|
3193 |
-
#~ msgstr "Bienvenue !"
|
3194 |
-
|
3195 |
-
#~ msgid "Logout"
|
3196 |
-
#~ msgstr "Déconnexion"
|
3197 |
-
|
3198 |
-
#~ msgid "Your cart"
|
3199 |
-
#~ msgstr "Votre panier"
|
3200 |
-
|
3201 |
-
#~ msgid "WooCommerce Product Title"
|
3202 |
-
#~ msgstr "Titre produit Woocommerce"
|
3203 |
-
|
3204 |
-
#, fuzzy
|
3205 |
-
#~| msgid "WooCommerce Product Title"
|
3206 |
-
#~ msgid "WooCommerce Product Price"
|
3207 |
-
#~ msgstr ""
|
3208 |
-
#~ "Changez automatiquement le prix et la devise du produit WooCommerce par "
|
3209 |
-
#~ "pays du client."
|
3210 |
-
|
3211 |
-
#~ msgid "WooCommerce Product Add To Cart"
|
3212 |
-
#~ msgstr "Ajouter au panier produit WooCommerce"
|
3213 |
-
|
3214 |
-
#~ msgid "Placeholder Image"
|
3215 |
-
#~ msgstr "Image générique"
|
3216 |
-
|
3217 |
-
#~ msgid "0 Comments"
|
3218 |
-
#~ msgstr "0 commentaire"
|
3219 |
-
|
3220 |
-
#~ msgid "1 Comment"
|
3221 |
-
#~ msgstr "1 commentaire"
|
3222 |
-
|
3223 |
-
#~ msgid "% Comments"
|
3224 |
-
#~ msgstr "% commentaires"
|
3225 |
-
|
3226 |
-
#~ msgid "Continue Reading"
|
3227 |
-
#~ msgstr "Continuer la lecture"
|
3228 |
-
|
3229 |
-
#~ msgid "Type your text and hit enter to search"
|
3230 |
-
#~ msgstr "Saisir votre texte et appuyer sur Entrée pour rechercher…"
|
3231 |
-
|
3232 |
-
#~ msgid "Type then hit enter to search..."
|
3233 |
-
#~ msgstr "Saisir et appuyer sur Entrée pour rechercher…"
|
3234 |
-
|
3235 |
-
#~ msgid "Search..."
|
3236 |
-
#~ msgstr "Rechercher…"
|
3237 |
-
|
3238 |
-
#~ msgid "Search"
|
3239 |
-
#~ msgstr "Rechercher"
|
3240 |
-
|
3241 |
-
#~ msgid "Ready to publish your first post? %1$sGet started here%2$s."
|
3242 |
-
#~ msgstr "Prêt à publier votre premier article ? %1$sCommencez ici%2$s."
|
3243 |
-
|
3244 |
-
#~ msgid ""
|
3245 |
-
#~ "Sorry, but nothing matched your search terms. Please try again with "
|
3246 |
-
#~ "different keywords."
|
3247 |
-
#~ msgstr ""
|
3248 |
-
#~ "Aucun résultat ne correspond à vos critères de recherche. Essayez de "
|
3249 |
-
#~ "nouveau avec des mots clés différents."
|
3250 |
-
|
3251 |
-
#~ msgid "There aren't any posts currently published in this category."
|
3252 |
-
#~ msgstr "Il n’y a aucun article publié actuellement dans cette catégorie."
|
3253 |
-
|
3254 |
-
#~ msgid "There aren't any posts currently published under this taxonomy."
|
3255 |
-
#~ msgstr "Il n’y a aucun article publié actuellement pour cette taxinomie."
|
3256 |
-
|
3257 |
-
#~ msgid "There aren't any posts currently published under this tag."
|
3258 |
-
#~ msgstr "Il n’y a aucun article publié actuellement sous cette étiquette."
|
3259 |
-
|
3260 |
-
#~ msgid "It seems we can’t find what you’re looking for."
|
3261 |
-
#~ msgstr "Il semble que nous ne pouvons pas trouver ce que vous recherchez."
|
3262 |
-
|
3263 |
-
#~ msgid "Pages:"
|
3264 |
-
#~ msgstr "Pages : "
|
3265 |
-
|
3266 |
-
#~ msgid "Previous Post"
|
3267 |
-
#~ msgstr "Article précédent"
|
3268 |
-
|
3269 |
-
#~ msgid "Next Post"
|
3270 |
-
#~ msgstr "Article suivant"
|
3271 |
-
|
3272 |
-
#~ msgid "You Might Also Like"
|
3273 |
-
#~ msgstr "Vous aimerez peut-être aussi"
|
3274 |
-
|
3275 |
-
#~ msgid "Have a coupon?"
|
3276 |
-
#~ msgstr "Avez-vous un code promo ?"
|
3277 |
-
|
3278 |
-
#~ msgid "Click here to enter your code"
|
3279 |
-
#~ msgstr "Cliquez ici pour entrer votre code"
|
3280 |
-
|
3281 |
-
#~ msgid "View:"
|
3282 |
-
#~ msgstr "Visualiser : "
|
3283 |
-
|
3284 |
-
#~ msgid "All"
|
3285 |
-
#~ msgstr "Tous"
|
3286 |
-
|
3287 |
-
#~ msgid "Custom CSS/JS"
|
3288 |
-
#~ msgstr "CSS/JS personnalisés"
|
3289 |
-
|
3290 |
-
#~ msgid "Custom JS"
|
3291 |
-
#~ msgstr "Scripts JS personnalisés"
|
3292 |
-
|
3293 |
-
#~ msgid ""
|
3294 |
-
#~ "You need to reload to see the changes. No need to add the <script> tags."
|
3295 |
-
#~ msgstr ""
|
3296 |
-
#~ "Vous devez recharger pour voir les modifications. Pas besoin d'ajouter "
|
3297 |
-
#~ "les balises <script>."
|
3298 |
-
|
3299 |
-
#~ msgid "Visit Author Page"
|
3300 |
-
#~ msgstr "Visitez la page de l’auteur"
|
3301 |
-
|
3302 |
-
#~ msgid "Coupon code"
|
3303 |
-
#~ msgstr "Code promo"
|
3304 |
-
|
3305 |
-
#~ msgid "Apply coupon"
|
3306 |
-
#~ msgstr "Appliquer le code promo"
|
3307 |
-
|
3308 |
-
#~ msgid "g:i a"
|
3309 |
-
#~ msgstr "g:i a"
|
3310 |
-
|
3311 |
-
#~ msgid "i"
|
3312 |
-
#~ msgstr "i"
|
3313 |
-
|
3314 |
-
#~ msgid "g a"
|
3315 |
-
#~ msgstr "g a"
|
3316 |
-
|
3317 |
-
#~ msgid "Y"
|
3318 |
-
#~ msgstr "Y"
|
3319 |
-
|
3320 |
-
#~ msgid "F"
|
3321 |
-
#~ msgstr "F"
|
3322 |
-
|
3323 |
-
#~ msgid "j"
|
3324 |
-
#~ msgstr "j"
|
3325 |
-
|
3326 |
-
#~ msgid "W"
|
3327 |
-
#~ msgstr "W"
|
3328 |
-
|
3329 |
-
#~ msgid "Page ID"
|
3330 |
-
#~ msgstr "ID de la page"
|
3331 |
-
|
3332 |
-
#~ msgid ""
|
3333 |
-
#~ "Deprecated, this field is no longer supported. Please use the Select "
|
3334 |
-
#~ "Template field below instead."
|
3335 |
-
#~ msgstr ""
|
3336 |
-
#~ "Déconseillé, ce champ n'est plus pris en charge. Utilisez plutôt le champ "
|
3337 |
-
#~ "Sélectionner le modèle ci-dessous."
|
3338 |
-
|
3339 |
-
#~ msgid "Elementor Templates"
|
3340 |
-
#~ msgstr "Modèles Elementor"
|
3341 |
-
|
3342 |
-
#~ msgid ""
|
3343 |
-
#~ "Deprecated, this field is no longer supported. If you want a different "
|
3344 |
-
#~ "logo when scrolling, go to Sticky Header > Logo."
|
3345 |
-
#~ msgstr ""
|
3346 |
-
#~ "Déconseillé, ce champ n'est plus pris en charge. Si vous voulez un logo "
|
3347 |
-
#~ "différent lors du défilement, allez à Entête collante > Logo."
|
3348 |
-
|
3349 |
-
#~ msgid ""
|
3350 |
-
#~ "Deprecated, this field is no longer supported. If you want a different "
|
3351 |
-
#~ "retina logo when scrolling, go to Sticky Header > Retina Logo."
|
3352 |
-
#~ msgstr ""
|
3353 |
-
#~ "Déconseillé, ce champ n'est plus pris en charge. Si vous voulez un logo "
|
3354 |
-
#~ "de rétina différent lors du défilement, allez à Entête collante > Logo "
|
3355 |
-
#~ "rétina."
|
3356 |
-
|
3357 |
-
#~ msgid "Enter the height of your normal logo, used for retina."
|
3358 |
-
#~ msgstr "Saisir la hauteur de votre logo normal, utilisé pour le rétina."
|
3359 |
-
|
3360 |
-
#~ msgid "Effect 1"
|
3361 |
-
#~ msgstr "Filet bas progressif"
|
3362 |
-
|
3363 |
-
#~ msgid "Effect 2"
|
3364 |
-
#~ msgstr "Filet bas montant"
|
3365 |
-
|
3366 |
-
#~ msgid "Effect 3"
|
3367 |
-
#~ msgstr "Filet bas descendant"
|
3368 |
-
|
3369 |
-
#~ msgid "Effect 4"
|
3370 |
-
#~ msgstr "Parenthèses ouvrantes"
|
3371 |
-
|
3372 |
-
#~ msgid "Effect 5"
|
3373 |
-
#~ msgstr "Souligné filet montant"
|
3374 |
-
|
3375 |
-
#~ msgid "Effect 6"
|
3376 |
-
#~ msgstr "Double cercle filet"
|
3377 |
-
|
3378 |
-
#~ msgid "Effect 7"
|
3379 |
-
#~ msgstr "3 points centrés"
|
3380 |
-
|
3381 |
-
#~ msgid "Effect 8"
|
3382 |
-
#~ msgstr "Double filet en croix"
|
3383 |
-
|
3384 |
-
#~ msgid "Effect 9"
|
3385 |
-
#~ msgstr "Double filet fermant"
|
3386 |
-
|
3387 |
-
#~ msgid "Effect 10"
|
3388 |
-
#~ msgstr "Bloc ombré"
|
3389 |
-
|
3390 |
-
#~ msgid "Menu Social"
|
3391 |
-
#~ msgstr "Menu Social"
|
3392 |
-
|
3393 |
-
#~ msgid "Enable Menu Social"
|
3394 |
-
#~ msgstr "Activer le menu réseaux sociaux"
|
3395 |
-
|
3396 |
-
#~ msgid "Simple Social Links Color"
|
3397 |
-
#~ msgstr "Couleur des liens sociaux individuels"
|
3398 |
-
|
3399 |
-
#~ msgid "Simple Social Links Color: Hover"
|
3400 |
-
#~ msgstr "Couleur des liens sociaux individuels au survol"
|
3401 |
-
|
3402 |
-
#~ msgid ""
|
3403 |
-
#~ "Deprecated, this field is no longer supported. Please use the Social "
|
3404 |
-
#~ "Alternative field below instead."
|
3405 |
-
#~ msgstr ""
|
3406 |
-
#~ "Déconseillé, ce champ n'est plus pris en charge. Veuillez utiliser le "
|
3407 |
-
#~ "champ Social alternatif ci-dessous."
|
3408 |
-
|
3409 |
-
#~ msgid "F Y"
|
3410 |
-
#~ msgstr "F Y"
|
3411 |
-
|
3412 |
-
#~ msgid "This theme requires the following plugin: %1$s."
|
3413 |
-
#~ msgid_plural "This theme requires the following plugins: %1$s."
|
3414 |
-
#~ msgstr[0] "Ce thème nécessite l’extension suivante : %1$s."
|
3415 |
-
#~ msgstr[1] "Ce thème nécessite les extension suivantes : %1$s."
|
3416 |
-
|
3417 |
-
#~ msgid "This theme recommends the following plugin: %1$s."
|
3418 |
-
#~ msgid_plural "This theme recommends the following plugins: %1$s."
|
3419 |
-
#~ msgstr[0] "Ce thème recommande l’extension suivante : %1$s."
|
3420 |
-
#~ msgstr[1] "Ce thème recommande les extensions suivantes : %1$s."
|
3421 |
-
|
3422 |
-
#~ msgid ""
|
3423 |
-
#~ "The following plugin needs to be updated to its latest version to ensure "
|
3424 |
-
#~ "maximum compatibility with this theme: %1$s."
|
3425 |
-
#~ msgid_plural ""
|
3426 |
-
#~ "The following plugins need to be updated to their latest version to "
|
3427 |
-
#~ "ensure maximum compatibility with this theme: %1$s."
|
3428 |
-
#~ msgstr[0] ""
|
3429 |
-
#~ "Afin d'assurer une compatibilité maximale avec ce thème, l’extension "
|
3430 |
-
#~ "suivante doit être mise à jour dans sa dernière version : %1$s."
|
3431 |
-
#~ msgstr[1] ""
|
3432 |
-
#~ "Afin d'assurer une compatibilité maximale avec ce thème, les extensions "
|
3433 |
-
#~ "suivantes doivent être mises à jour dans leur dernière version : %1$s."
|
3434 |
-
|
3435 |
-
#~ msgid "There is an update available for: %1$s."
|
3436 |
-
#~ msgid_plural "There are updates available for the following plugins: %1$s."
|
3437 |
-
#~ msgstr[0] "Il y a une mise à jour disponible pour : %1$s."
|
3438 |
-
#~ msgstr[1] "Il y a des mises à jour disponibles pour : %1$s."
|
3439 |
-
|
3440 |
-
#~ msgid "The following required plugin is currently inactive: %1$s."
|
3441 |
-
#~ msgid_plural "The following required plugins are currently inactive: %1$s."
|
3442 |
-
#~ msgstr[0] "L’extension requise suivante est actuellement inactive : %1$s."
|
3443 |
-
#~ msgstr[1] ""
|
3444 |
-
#~ "Les extensions requises suivantes sont actuellement inactives : %1$s."
|
3445 |
-
|
3446 |
-
#~ msgid "The following recommended plugin is currently inactive: %1$s."
|
3447 |
-
#~ msgid_plural ""
|
3448 |
-
#~ "The following recommended plugins are currently inactive: %1$s."
|
3449 |
-
#~ msgstr[0] ""
|
3450 |
-
#~ "L’extension recommandée suivante est actuellement inactive : %1$s."
|
3451 |
-
#~ msgstr[1] ""
|
3452 |
-
#~ "Les extensions recommandées suivantes sont actuellement inactives : %1$s."
|
3453 |
-
|
3454 |
-
#~ msgid "Begin installing plugin"
|
3455 |
-
#~ msgid_plural "Begin installing plugins"
|
3456 |
-
#~ msgstr[0] "Commencez à installer l’extension"
|
3457 |
-
#~ msgstr[1] "Commencez à installer les extensions"
|
3458 |
-
|
3459 |
-
#~ msgid "Begin updating plugin"
|
3460 |
-
#~ msgid_plural "Begin updating plugins"
|
3461 |
-
#~ msgstr[0] "Commercer la mise à jour de l’extension"
|
3462 |
-
#~ msgstr[1] "Commercer la mise à jour des extensions"
|
3463 |
-
|
3464 |
-
#~ msgid "Begin activating plugin"
|
3465 |
-
#~ msgid_plural "Begin activating plugins"
|
3466 |
-
#~ msgstr[0] "Avant d’activer l’extension"
|
3467 |
-
#~ msgstr[1] "Avant d’activer les extensions"
|
3468 |
-
|
3469 |
-
#~ msgid "and"
|
3470 |
-
#~ msgstr "et"
|
3471 |
-
|
3472 |
-
#~ msgctxt "Install/Update Status"
|
3473 |
-
#~ msgid "%1$s, %2$s"
|
3474 |
-
#~ msgstr "%1$s, %2$s"
|
3475 |
-
|
3476 |
-
#~ msgctxt "plugins"
|
3477 |
-
#~ msgid "All <span class=\"count\">(%s)</span>"
|
3478 |
-
#~ msgid_plural "All <span class=\"count\">(%s)</span>"
|
3479 |
-
#~ msgstr[0] "Tout <span class=\"count\">(%s)</span>"
|
3480 |
-
#~ msgstr[1] "Tous <span class=\"count\">(%s)</span>"
|
3481 |
-
|
3482 |
-
#~ msgid "To Install <span class=\"count\">(%s)</span>"
|
3483 |
-
#~ msgid_plural "To Install <span class=\"count\">(%s)</span>"
|
3484 |
-
#~ msgstr[0] "Pour installer <span class=\"count\">(%s)</span>"
|
3485 |
-
#~ msgstr[1] "Pour installer <span class=\"count\">(%s)</span>"
|
3486 |
-
|
3487 |
-
#~ msgid "Update Available <span class=\"count\">(%s)</span>"
|
3488 |
-
#~ msgid_plural "Update Available <span class=\"count\">(%s)</span>"
|
3489 |
-
#~ msgstr[0] "Mise à jour disponible <span class=\"count\">(%s)</span>"
|
3490 |
-
#~ msgstr[1] "Mises à jour disponibles <span class=\"count\">(%s)</span>"
|
3491 |
-
|
3492 |
-
#~ msgid "To Activate <span class=\"count\">(%s)</span>"
|
3493 |
-
#~ msgid_plural "To Activate <span class=\"count\">(%s)</span>"
|
3494 |
-
#~ msgstr[0] "Pour activer <span class=\"count\">(%s)</span>"
|
3495 |
-
#~ msgstr[1] "Pour activer <span class=\"count\">(%s)</span>"
|
3496 |
-
|
3497 |
-
#~ msgctxt "as in: \"version nr unknown\""
|
3498 |
-
#~ msgid "unknown"
|
3499 |
-
#~ msgstr "inconnu"
|
3500 |
-
|
3501 |
-
#~ msgid "Elementor Template"
|
3502 |
-
#~ msgstr "Modèle Elementor"
|
3503 |
-
|
3504 |
-
#~ msgid ""
|
3505 |
-
#~ "Deprecated, this field is no longer supported. Please use the Select A "
|
3506 |
-
#~ "Template field below instead."
|
3507 |
-
#~ msgstr ""
|
3508 |
-
#~ "Déconseillé, ce champ n'est plus pris en charge. Veuillez utiliser le "
|
3509 |
-
#~ "champ Sélectionner un modèle ci-dessous."
|
3510 |
-
|
3511 |
-
#~ msgid "Enter Icon Class (Deprecated)"
|
3512 |
-
#~ msgstr "Entrer une classe d'icône (déprécié)"
|
3513 |
-
|
3514 |
-
#~ msgid "If you want to display a different logo for this style (optional)"
|
3515 |
-
#~ msgstr ""
|
3516 |
-
#~ "Si vous souhaitez afficher un logo différent pour ce style (optionnel)"
|
3517 |
-
|
3518 |
-
#~ msgid "Mobile Sidebar Menu"
|
3519 |
-
#~ msgstr "Menu de la barre latérale mobile"
|
3520 |
-
|
3521 |
-
#~ msgid "Mobile Menu: Dropdowns"
|
3522 |
-
#~ msgstr "Menu mobile déroulant"
|
3523 |
-
|
3524 |
-
#~ msgid ""
|
3525 |
-
#~ "The following shortcodes can be added:%1$s %2$s[oceanwp_date]%3$s To show "
|
3526 |
-
#~ "a dynamic date.%1$s %2$s[oceanwp_site_url]%3$s To add a homepage link."
|
3527 |
-
#~ msgstr ""
|
3528 |
-
#~ "Les codes courts suivants peuvent être ajoutés : %1$s "
|
3529 |
-
#~ "%2$s[oceanwp_date]%3$s pour afficher une date dynamique. %1$s "
|
3530 |
-
#~ "%2$s[oceanwp_site_url]%3$s pour ajouter un lien de page d'accueil."
|
3531 |
-
|
3532 |
-
#~ msgid "Padding (DECREPITATED)"
|
3533 |
-
#~ msgstr "Marge interne (déprécié)"
|
3534 |
-
|
3535 |
-
#~ msgid ""
|
3536 |
-
#~ "This field will be removed in OceanWP 1.2.0, add your value(s) in the "
|
3537 |
-
#~ "dimensions control below"
|
3538 |
-
#~ msgstr ""
|
3539 |
-
#~ "Ce champ sera supprimé dans OceanWP 1.2.0, saisissez vos valeurs dans le "
|
3540 |
-
#~ "contrôle des dimensions ci-dessous"
|
3541 |
-
|
3542 |
-
#~ msgid "Choose a page to replace the widgets by this page."
|
3543 |
-
#~ msgstr "Choisissez une page pour remplacer les widgets par cette page."
|
3544 |
-
|
3545 |
-
#~ msgid "Border Width (DECREPITATED)"
|
3546 |
-
#~ msgstr "Largeur de la bordure (déprécié)"
|
3547 |
-
|
3548 |
-
#~ msgid "Choose a page where the content will be displayed in the header."
|
3549 |
-
#~ msgstr "Choisissez une page où le contenu sera affiché dans l'entête."
|
3550 |
-
|
3551 |
-
#~ msgid "Used for retina."
|
3552 |
-
#~ msgstr "Utilisé pour le Rétina."
|
3553 |
-
|
3554 |
-
#~ msgid ""
|
3555 |
-
#~ "The following shortcodes can be added:%1$s %2$s[oceanwp_login]%3$s To add "
|
3556 |
-
#~ "a login/logout link.%1$s %2$s[oceanwp_search]%3$s To show a search form."
|
3557 |
-
#~ msgstr ""
|
3558 |
-
#~ "Les codes courts suivants peuvent être ajoutés : %1$s "
|
3559 |
-
#~ "%2$s[oceanwp_login]%3$s pour ajouter un lien connexion / connexion, %1$s "
|
3560 |
-
#~ "%2$s[oceanwp_search]%3$s pour afficher un formulaire de recherche."
|
3561 |
-
|
3562 |
-
#~ msgid "Choose a page to display the content of such page."
|
3563 |
-
#~ msgstr "Choisissez une page pour afficher le contenu de cette page."
|
3564 |
-
|
3565 |
-
#~ msgid "Menu Cart: Display"
|
3566 |
-
#~ msgstr "Menu panier : afficher"
|
3567 |
-
|
3568 |
-
#~ msgid "Menu Cart: Custom Link"
|
3569 |
-
#~ msgstr "Lien personnalisé du menu panier"
|
3570 |
-
|
3571 |
-
#~ msgid "Styling: Cart Dropdowns"
|
3572 |
-
#~ msgstr "Style du menu panier déroulant"
|
3573 |
-
|
3574 |
-
#~ msgid ""
|
3575 |
-
#~ "Enter your extension license keys here to receive updates for purchased "
|
3576 |
-
#~ "extensions. If your license key has expired, please %1$srenew your license"
|
3577 |
-
#~ "%2$s."
|
3578 |
-
#~ msgstr ""
|
3579 |
-
#~ "Entrez vos clés de licence d'extension ici pour recevoir des mises à jour "
|
3580 |
-
#~ "pour les extensions achetées. Si votre clé de licence a expirée, merci de "
|
3581 |
-
#~ "%1$srenouveler votre license%2$s."
|
3582 |
-
|
3583 |
-
#~ msgid ""
|
3584 |
-
#~ "Your license key expired on %1$s. Please <a href=\"%2$s\" target=\"_blank"
|
3585 |
-
#~ "\">renew your license key</a>."
|
3586 |
-
#~ msgstr ""
|
3587 |
-
#~ "Votre clé de licence a expirée à %1$s. Merci de <a href=\"%2$s\" target="
|
3588 |
-
#~ "\"_blank\">renouveler votre clé de licence</a>."
|
3589 |
-
|
3590 |
-
#~ msgid ""
|
3591 |
-
#~ "Your license key has been disabled. Please <a href=\"%1$s\" target="
|
3592 |
-
#~ "\"_blank\">contact support</a> for more information."
|
3593 |
-
#~ msgstr ""
|
3594 |
-
#~ "Votre clé de licence a été désactivée. Merci de a href=« %1$s\" target="
|
3595 |
-
#~ "\"_blank\">renouveler votre clé de licence</a>."
|
3596 |
-
|
3597 |
-
#~ msgid ""
|
3598 |
-
#~ "Invalid license. Please <a href=\"%1$s\" target=\"_blank\">visit your "
|
3599 |
-
#~ "account page</a> and verify it."
|
3600 |
-
#~ msgstr ""
|
3601 |
-
#~ "Licence invalide. Merci de <a href=\"%1$s\" target=\"_blank\">visiter "
|
3602 |
-
#~ "votre page de compte</a> et vérifiez-le."
|
3603 |
-
|
3604 |
-
#~ msgid ""
|
3605 |
-
#~ "Your %1$s is not active for this URL. Please <a href=\"%2$s\" target="
|
3606 |
-
#~ "\"_blank\">visit your account page</a> to manage your license key URLs."
|
3607 |
-
#~ msgstr ""
|
3608 |
-
#~ "Votre %1$s n'est pas actif pour cette URL. Merci de <a href=\"%2$s\" "
|
3609 |
-
#~ "target=\"_blank\">consulter votre page de compte</a> pour gérer vos URL "
|
3610 |
-
#~ "de clé de licence."
|
3611 |
-
|
3612 |
-
#~ msgid "This appears to be an invalid license key for %1$s."
|
3613 |
-
#~ msgstr "Cela semble être une clé de licence invalide pour %1$s."
|
3614 |
-
|
3615 |
-
#~ msgid ""
|
3616 |
-
#~ "Your license key has reached its activation limit. <a href=\"%1$s\">View "
|
3617 |
-
#~ "possible upgrades</a> now."
|
3618 |
-
#~ msgstr ""
|
3619 |
-
#~ "Votre clé de licence a atteint sa limite d'activation. <a href=\"%1$s"
|
3620 |
-
#~ "\">Voir les améliorations possibles</a> maintenant."
|
3621 |
-
|
3622 |
-
#~ msgid ""
|
3623 |
-
#~ "The key you entered belongs to a bundle, please use the product specific "
|
3624 |
-
#~ "license key."
|
3625 |
-
#~ msgstr ""
|
3626 |
-
#~ "La clé que vous avez entrée appartient à un pack, merci d’utilisez la clé "
|
3627 |
-
#~ "de licence spécifique au produit."
|
3628 |
-
|
3629 |
-
#~ msgid "unknown_error"
|
3630 |
-
#~ msgstr "unknown_error"
|
3631 |
-
|
3632 |
-
#~ msgid ""
|
3633 |
-
#~ "There was an error with this license key: %1$s. Please <a href=\"%2$s"
|
3634 |
-
#~ "\">contact our support team</a>."
|
3635 |
-
#~ msgstr ""
|
3636 |
-
#~ "Une erreur s'est produite avec cette clé de licence de : %1$s. Merci de "
|
3637 |
-
#~ "<a href=\"%2$s\">contacter notre équipe de support</a>."
|
3638 |
-
|
3639 |
-
#~ msgid "License key never expires."
|
3640 |
-
#~ msgstr "La clé de licence n'expire jamais."
|
3641 |
-
|
3642 |
-
#~ msgid ""
|
3643 |
-
#~ "Your license key expires soon! It expires on %1$s. <a href=\"%2$s\" "
|
3644 |
-
#~ "target=\"_blank\">Renew your license key</a>."
|
3645 |
-
#~ msgstr ""
|
3646 |
-
#~ "Votre clé de licence expire bientôt ! Elle expire le %1$s. <a href=\"%2$s"
|
3647 |
-
#~ "\" target=\"_blank\">Renouvelez votre clé de licence</a>."
|
3648 |
-
|
3649 |
-
#~ msgid "Your license key expires on %1$s."
|
3650 |
-
#~ msgstr "Votre clé de licence expire le %1$s."
|
3651 |
-
|
3652 |
-
#~ msgid "To receive updates, please enter your valid %1$s license key."
|
3653 |
-
#~ msgstr ""
|
3654 |
-
#~ "Pour recevoir des mises à jour, entrez une clé de licence %1$s valide."
|
3655 |
-
|
3656 |
-
#~ msgid "%1$s License Key"
|
3657 |
-
#~ msgstr "Clé de licence %1$s "
|
3658 |
-
|
3659 |
-
#~ msgid "Deactivate License"
|
3660 |
-
#~ msgstr "Désactiver la Licence"
|
3661 |
-
|
3662 |
-
#~ msgid ""
|
3663 |
-
#~ "There is a new version of %1$s available. <a target=\"_blank\" class="
|
3664 |
-
#~ "\"thickbox\" href=\"%2$s\">View version %3$s details</a>."
|
3665 |
-
#~ msgstr ""
|
3666 |
-
#~ "Il existe une nouvelle version disponible de %1$s. <a target=\"_blank\" "
|
3667 |
-
#~ "class=\"thickbox\" href=\"%2$s\">Voir les détails de la version %3$s</a>."
|
3668 |
-
|
3669 |
-
#~ msgid ""
|
3670 |
-
#~ "There is a new version of %1$s available. <a target=\"_blank\" class="
|
3671 |
-
#~ "\"thickbox\" href=\"%2$s\">View version %3$s details</a> or <a href=\"%4$s"
|
3672 |
-
#~ "\">update now</a>."
|
3673 |
-
#~ msgstr ""
|
3674 |
-
#~ "Il existe une nouvelle version disponible de %1$s. <a target=\"_blank\" "
|
3675 |
-
#~ "class=\"thickbox\" href=\"%2$s\">Voir les détails de la version %3$s</a> "
|
3676 |
-
#~ "ou <a href=\"%4$s\">mettre à jour maintenant</a>."
|
3677 |
-
|
3678 |
-
#~ msgid "You do not have permission to install plugin updates"
|
3679 |
-
#~ msgstr ""
|
3680 |
-
#~ "Vous n'avez pas la permission d'installer des mises à jour d’extension"
|
3681 |
-
|
3682 |
-
#~ msgid ""
|
3683 |
-
#~ "Thanks for choosing OceanWP! You can read hints and tips on how get the "
|
3684 |
-
#~ "most out of your new theme on the %1$swelcome screen%2$s."
|
3685 |
-
#~ msgstr ""
|
3686 |
-
#~ "Merci d'avoir choisi OceanWP ! Vous pouvez lire des conseils et astuces "
|
3687 |
-
#~ "sur la façon d'obtenir le meilleur de votre nouveau thème sur l'écran "
|
3688 |
-
#~ "%1$sde bienvenuen%2$s."
|
3689 |
-
|
3690 |
-
#~ msgid "Get started with OceanWP"
|
3691 |
-
#~ msgstr "Commencer avec OceanWP"
|
3692 |
-
|
3693 |
-
#~ msgid "Theme"
|
3694 |
-
#~ msgstr "Thème"
|
3695 |
-
|
3696 |
-
#~ msgid "Join us on Twitter"
|
3697 |
-
#~ msgstr "Nous retrouver sur Twitter"
|
3698 |
-
|
3699 |
-
#~ msgid "Join us on Facebook"
|
3700 |
-
#~ msgstr "Nous retrouver sur Facebook"
|
3701 |
-
|
3702 |
-
#~ msgid "Find us on GitHub"
|
3703 |
-
#~ msgstr "Nous trouver sur GitHub"
|
3704 |
-
|
3705 |
-
#~ msgid ""
|
3706 |
-
#~ "OceanWP is the perfect theme for your project. Lightweight and highly "
|
3707 |
-
#~ "extendible, it will enable you to create almost any type of site with a "
|
3708 |
-
#~ "beautiful & professional design. There are several options to personalise "
|
3709 |
-
#~ "your website, multiple widget regions, a responsive design and much more. "
|
3710 |
-
#~ "Developers will love his extensible codebase making it a joy to customise "
|
3711 |
-
#~ "and extend."
|
3712 |
-
#~ msgstr ""
|
3713 |
-
#~ "OceanWP est le thème parfait pour votre projet. Léger et hautement "
|
3714 |
-
#~ "extensible, il vous permettra de créer presque n'importe quel type de "
|
3715 |
-
#~ "site avec un design magnifique et professionnel. Il existe plusieurs "
|
3716 |
-
#~ "options pour personnaliser votre site Web, plusieurs zones de widgets, un "
|
3717 |
-
#~ "design responsif et bien plus encore. Les développeurs aimeront sa base "
|
3718 |
-
#~ "de code extensible, ce qui permet de le personnaliser facilement."
|
3719 |
-
|
3720 |
-
#~ msgid "The perfect theme to use with your favorite page builder!"
|
3721 |
-
#~ msgstr ""
|
3722 |
-
#~ "Le thème parfait à utiliser avec votre constructeur de pages préféré !"
|
3723 |
-
|
3724 |
-
#~ msgid "Extend his functionalities with our extensions"
|
3725 |
-
#~ msgstr "Étendre ses fonctionnalités avec nos extensions"
|
3726 |
-
|
3727 |
-
#~ msgid ""
|
3728 |
-
#~ "Check our free and premium extensions that extend OceanWP’s "
|
3729 |
-
#~ "functionality and make it more powerful."
|
3730 |
-
#~ msgstr ""
|
3731 |
-
#~ "Consultez nos extensions gratuites et Premium qui étendent la "
|
3732 |
-
#~ "fonctionnalité d'OceanWP et le rendent plus performant."
|
3733 |
-
|
3734 |
-
#~ msgid "Ocean Extra"
|
3735 |
-
#~ msgstr "Extras OceanWP"
|
3736 |
-
|
3737 |
-
#~ msgid "free"
|
3738 |
-
#~ msgstr "gratuit"
|
3739 |
-
|
3740 |
-
#~ msgid ""
|
3741 |
-
#~ "Add extra features like metaboxes, import/export and a panel to activate "
|
3742 |
-
#~ "the extensions."
|
3743 |
-
#~ msgstr ""
|
3744 |
-
#~ "Ajoutez des fonctionnalités supplémentaires comme métabox, import/export "
|
3745 |
-
#~ "et un panneau pour activer les extensions."
|
3746 |
-
|
3747 |
-
#~ msgid ""
|
3748 |
-
#~ "Add some awesome new widgets to the popular free page builder Elementor."
|
3749 |
-
#~ msgstr ""
|
3750 |
-
#~ "Ajoutez de nouveaux widgets géniaux au populaire Créateur de Pages "
|
3751 |
-
#~ "Elementor (gratuit)."
|
3752 |
-
|
3753 |
-
#~ msgid ""
|
3754 |
-
#~ "Generates an unlimited number of sidebars and place them on any page or "
|
3755 |
-
#~ "post."
|
3756 |
-
#~ msgstr ""
|
3757 |
-
#~ "Gérez un nombre illimité de barres latérales et placez-les sur n'importe "
|
3758 |
-
#~ "quelle page ou article."
|
3759 |
-
|
3760 |
-
#~ msgid "Sticky Header"
|
3761 |
-
#~ msgstr "Entête collant"
|
3762 |
-
|
3763 |
-
#~ msgid ""
|
3764 |
-
#~ "A simple extension to attach the header at the top of your screen with an "
|
3765 |
-
#~ "animation."
|
3766 |
-
#~ msgstr ""
|
3767 |
-
#~ "Une extension simple pour joindre l'entête en haut de votre écran avec "
|
3768 |
-
#~ "une animation."
|
3769 |
-
|
3770 |
-
#~ msgid "Footer Callout"
|
3771 |
-
#~ msgstr "Bloc d’appel en pied de page"
|
3772 |
-
|
3773 |
-
#~ msgid ""
|
3774 |
-
#~ "Add some relevant/important information about your company or product in "
|
3775 |
-
#~ "your footer."
|
3776 |
-
#~ msgstr ""
|
3777 |
-
#~ "Ajoutez des informations pertinentes ou importantes sur votre entreprise "
|
3778 |
-
#~ "ou votre produit dans votre pied de page."
|
3779 |
-
|
3780 |
-
#~ msgid "Side Panel"
|
3781 |
-
#~ msgstr "Panneau latéral"
|
3782 |
-
|
3783 |
-
#~ msgid ""
|
3784 |
-
#~ "Display a panel on the right or left with your favorite widgets by "
|
3785 |
-
#~ "clicking on an icon in the menu."
|
3786 |
-
#~ msgstr ""
|
3787 |
-
#~ "Affiche un panneau à droite ou à gauche avec vos widgets favoris en "
|
3788 |
-
#~ "cliquant sur une icône dans le menu."
|
3789 |
-
|
3790 |
-
#~ msgid ""
|
3791 |
-
#~ "Import the OceanWP demo content, widgets and customizer settings with one "
|
3792 |
-
#~ "click."
|
3793 |
-
#~ msgstr ""
|
3794 |
-
#~ "Importez le contenu de démonstration OceanWP, les widgets et les "
|
3795 |
-
#~ "paramètres personnalisés en un clic."
|
3796 |
-
|
3797 |
-
#~ msgid "Social Sharing"
|
3798 |
-
#~ msgstr "Partage social"
|
3799 |
-
|
3800 |
-
#~ msgid ""
|
3801 |
-
#~ "A simple extension to add your prefered social sharing buttons to your "
|
3802 |
-
#~ "single posts."
|
3803 |
-
#~ msgstr ""
|
3804 |
-
#~ "Une extension simple pour ajouter vos boutons de partage social préférés "
|
3805 |
-
#~ "à vos articles."
|
3806 |
-
|
3807 |
-
#~ msgid "View all OceanWP extensions"
|
3808 |
-
#~ msgstr "Voir toutes les extensions OceanWP"
|
3809 |
-
|
3810 |
-
#~ msgid "Create your WordPress site quickly with Themecloud"
|
3811 |
-
#~ msgstr "Créez votre site WordPress rapidement avec Themecloud"
|
3812 |
-
|
3813 |
-
#~ msgid "What is Themecloud?"
|
3814 |
-
#~ msgstr "Qu'est-ce que Themecloud ?"
|
3815 |
-
|
3816 |
-
#~ msgid ""
|
3817 |
-
#~ "It’s a better way to build WordPress websites, instant setup, no "
|
3818 |
-
#~ "coding required. They are removed all of the technical hurdles standing "
|
3819 |
-
#~ "between you and your ideal site. Don’t worry about installations, "
|
3820 |
-
#~ "configurations, migrations and maintenance. Focus on creating stellar "
|
3821 |
-
#~ "content – and watch your business skyrocket! Not convinced yet?"
|
3822 |
-
#~ msgstr ""
|
3823 |
-
#~ "C'est une meilleure façon de créer des sites Web WordPress, une "
|
3824 |
-
#~ "configuration instantanée, aucun codage requis. Tous les obstacles "
|
3825 |
-
#~ "techniques sont simplifiés entre vous et votre site idéal. Ne vous "
|
3826 |
-
#~ "inquiétez pas pour les installations, les configurations, les migrations "
|
3827 |
-
#~ "et la maintenance. Concentrez-vous sur la création de contenu, et "
|
3828 |
-
#~ "regardez votre notoriété progresser en flèche ! Pas encore convaincu ?"
|
3829 |
-
|
3830 |
-
#~ msgid "Look at this great review from WPKube"
|
3831 |
-
#~ msgstr "Regardez cette excellente critique de WPKube"
|
3832 |
-
|
3833 |
-
#~ msgid "( 15-day free trial, no credit card required )"
|
3834 |
-
#~ msgstr "(15 jours d’essai gratuit, sans carte de crédit requise)"
|
3835 |
-
|
3836 |
-
#~ msgid "Learn more about Themecloud"
|
3837 |
-
#~ msgstr "En savoir plus sur Themecloud"
|
3838 |
-
|
3839 |
-
#~ msgid "Getting started with OceanWP"
|
3840 |
-
#~ msgstr "Pour commencer avec OceanWP"
|
3841 |
-
|
3842 |
-
#~ msgid ""
|
3843 |
-
#~ "Take a look in the options of the Customizer and see yourself how easy "
|
3844 |
-
#~ "and quick to customize the theme as you wish."
|
3845 |
-
#~ msgstr ""
|
3846 |
-
#~ "Jetez un coup d'oeil dans les options du Customizer et voyez comment vous "
|
3847 |
-
#~ "pouvez simplifier et personnaliser le thème comme vous le souhaitez."
|
3848 |
-
|
3849 |
-
#~ msgid "Upload your logo"
|
3850 |
-
#~ msgstr "Télécharger votre logo"
|
3851 |
-
|
3852 |
-
#~ msgid "Add your own logo and retina logo used for the mobile design."
|
3853 |
-
#~ msgstr ""
|
3854 |
-
#~ "Ajoutez votre propre logo et logo rétina utilisé pour la conception "
|
3855 |
-
#~ "mobile."
|
3856 |
-
|
3857 |
-
#~ msgid "Go to the option"
|
3858 |
-
#~ msgstr "Aller à l’option"
|
3859 |
-
|
3860 |
-
#~ msgid "Add your favicon"
|
3861 |
-
#~ msgstr "Télécharger votre favicon"
|
3862 |
-
|
3863 |
-
#~ msgid "The favicon is used as a browser and app icon for your website."
|
3864 |
-
#~ msgstr ""
|
3865 |
-
#~ "Le favicon est utilisé comme icône de navigateur et d'application pour "
|
3866 |
-
#~ "votre site."
|
3867 |
-
|
3868 |
-
#~ msgid "Choose your primary color"
|
3869 |
-
#~ msgstr "Choisissez votre couleur primaire"
|
3870 |
-
|
3871 |
-
#~ msgid "Replace the default primary and hover color by your own colors."
|
3872 |
-
#~ msgstr ""
|
3873 |
-
#~ "Remplacez la couleur par défaut et la couleur au survol par vos propres "
|
3874 |
-
#~ "couleurs."
|
3875 |
-
|
3876 |
-
#~ msgid "Change the links color"
|
3877 |
-
#~ msgstr "Changer la couleur des liens"
|
3878 |
-
|
3879 |
-
#~ msgid "Choose the color and hover color of your links for the entire site."
|
3880 |
-
#~ msgstr ""
|
3881 |
-
#~ "Choisissez la couleur et couleur de survol des liens pour l'ensemble du "
|
3882 |
-
#~ "site."
|
3883 |
-
|
3884 |
-
#~ msgid "Choose your typography"
|
3885 |
-
#~ msgstr "Choisissez votre typographie"
|
3886 |
-
|
3887 |
-
#~ msgid "Choose your own typography for any parts of your website."
|
3888 |
-
#~ msgstr ""
|
3889 |
-
#~ "Choisissez votre propre typographie pour toutes les parties de votre site."
|
3890 |
-
|
3891 |
-
#~ msgid "Top bar options"
|
3892 |
-
#~ msgstr "Options barre supérieure"
|
3893 |
-
|
3894 |
-
#~ msgid "Enable/Disable the top bar, add your own paddings and colors."
|
3895 |
-
#~ msgstr ""
|
3896 |
-
#~ "Activer/Désactiver la barre supérieure, ajouter vos propres marges "
|
3897 |
-
#~ "internes et couleurs."
|
3898 |
-
|
3899 |
-
#~ msgid "Header options"
|
3900 |
-
#~ msgstr "Options de l’entête"
|
3901 |
-
|
3902 |
-
#~ msgid "Choose the style, the height and the colors for your site header."
|
3903 |
-
#~ msgstr ""
|
3904 |
-
#~ "Choisissez le style, la hauteur et les couleurs pour l'entête de votre "
|
3905 |
-
#~ "site."
|
3906 |
-
|
3907 |
-
#~ msgid "Footer bottom options"
|
3908 |
-
#~ msgstr "Options du Copyright"
|
3909 |
-
|
3910 |
-
#~ msgid "Add your copyright, paddings and colors for the footer bottom."
|
3911 |
-
#~ msgstr ""
|
3912 |
-
#~ "Ajoutez un Copyright, marge interne et couleurs pour le bas de page."
|
3913 |
-
|
3914 |
-
#~ msgid "Customize Your Site"
|
3915 |
-
#~ msgstr "Personnaliser votre site"
|
3916 |
-
|
3917 |
-
#~ msgid "Contribute to OceanWP"
|
3918 |
-
#~ msgstr "Contribuer à OceanWP"
|
3919 |
-
|
3920 |
-
#~ msgid ""
|
3921 |
-
#~ "You’ve found a bug? Want to contribute a patch, create a new "
|
3922 |
-
#~ "feature or extension?"
|
3923 |
-
#~ msgstr ""
|
3924 |
-
#~ "Vous avez trouvé un bogue ? Voulez-vous contribuer un correctif, créer "
|
3925 |
-
#~ "une nouvelle fonctionnalité ou une extension ?"
|
3926 |
-
|
3927 |
-
#~ msgid "GitHub is the place to go!"
|
3928 |
-
#~ msgstr "GitHub est l'endroit où aller !"
|
3929 |
-
|
3930 |
-
#~ msgid ""
|
3931 |
-
#~ "You can find a wide range of information on how to use and customise "
|
3932 |
-
#~ "OceanWP in our"
|
3933 |
-
#~ msgstr ""
|
3934 |
-
#~ "Vous pouvez trouver un large éventail d'informations sur la façon "
|
3935 |
-
#~ "d'utiliser et de personnaliser OceanWP dans notre"
|
3936 |
-
|
3937 |
-
#~ msgid "If you need help?"
|
3938 |
-
#~ msgstr "Si vous avez besoin d'aide ?"
|
3939 |
-
|
3940 |
-
#~ msgid "open a support ticket"
|
3941 |
-
#~ msgstr "Ouvrir un ticket de support"
|
3942 |
-
|
3943 |
-
#~ msgid "Recommended plugins"
|
3944 |
-
#~ msgstr "Extensions recommandées"
|
3945 |
-
|
3946 |
-
#~ msgid ""
|
3947 |
-
#~ "Below you will find links to plugins I personally like and recommend. "
|
3948 |
-
#~ "None of these plugins are required for your theme to work, they simply "
|
3949 |
-
#~ "add additional functionality."
|
3950 |
-
#~ msgstr ""
|
3951 |
-
#~ "Vous trouverez ci-dessous des liens vers des extensions que j'aime "
|
3952 |
-
#~ "personnellement et je vous recommande. Aucune de ces extensions n'est "
|
3953 |
-
#~ "nécessaire pour que votre thème fonctionne, elles ajoutent simplement des "
|
3954 |
-
#~ "fonctionnalités supplémentaires."
|
3955 |
-
|
3956 |
-
#~ msgid ""
|
3957 |
-
#~ "Manage multiple contact forms and customize the form and the mail "
|
3958 |
-
#~ "contents with markups."
|
3959 |
-
#~ msgstr ""
|
3960 |
-
#~ "Gérez les formulaires de contact multiples et personnalisez le formulaire "
|
3961 |
-
#~ "et les contenus du courrier avec des balises."
|
3962 |
-
|
3963 |
-
#~ msgid ""
|
3964 |
-
#~ "Gravity Forms is the easiest tool to create advanced forms for your "
|
3965 |
-
#~ "WordPress powered website."
|
3966 |
-
#~ msgstr ""
|
3967 |
-
#~ "GravityForms est l'outil le plus simple pour créer des formulaires "
|
3968 |
-
#~ "avancés pour votre site Web WordPress."
|
3969 |
-
|
3970 |
-
#~ msgid ""
|
3971 |
-
#~ "The most advanced frontend drag & drop page builder. Create high-end, "
|
3972 |
-
#~ "pixel perfect websites."
|
3973 |
-
#~ msgstr ""
|
3974 |
-
#~ "Le constructeur de page par glisser/déposer le plus avancé. Créez des "
|
3975 |
-
#~ "sites Web modernes, précis et haut de gamme."
|
3976 |
-
|
3977 |
-
#~ msgid ""
|
3978 |
-
#~ "A drag and drop WordPress Page Builder. Create with ease beautiful & "
|
3979 |
-
#~ "professional pages."
|
3980 |
-
#~ msgstr ""
|
3981 |
-
#~ "Un créateur de pages par glissé/déposé pour WordPress. Créez facilement "
|
3982 |
-
#~ "des pages magnifiques et professionnelles."
|
3983 |
-
|
3984 |
-
#~ msgid ""
|
3985 |
-
#~ "Visual Composer is the ultimate plugin for building every WordPress site "
|
3986 |
-
#~ "without coding."
|
3987 |
-
#~ msgstr ""
|
3988 |
-
#~ "Visual Composer est l’extension ultime pour construire votre site "
|
3989 |
-
#~ "WordPress sans coder."
|
3990 |
-
|
3991 |
-
#~ msgid ""
|
3992 |
-
#~ "It’s not just a slider, build modern & mobile friendly "
|
3993 |
-
#~ "presentations for your website in no time."
|
3994 |
-
#~ msgstr ""
|
3995 |
-
#~ "Ce n’est pas seulement un diaporama, créez des présentations conviviales "
|
3996 |
-
#~ "modernes et mobiles pour votre site Web en un rien de temps."
|
3997 |
-
|
3998 |
-
#~ msgid ""
|
3999 |
-
#~ "A powerful and flexible plugin that makes it a breeze for users to sign-"
|
4000 |
-
#~ "up and become members."
|
4001 |
-
#~ msgstr ""
|
4002 |
-
#~ "Une extension puissante et flexible qui permet aux utilisateurs de "
|
4003 |
-
#~ "s'inscrire et de devenir membres."
|
4004 |
-
|
4005 |
-
#~ msgid ""
|
4006 |
-
#~ "WooCommerce is a free eCommerce plugin that allows you to sell anything, "
|
4007 |
-
#~ "beautifully."
|
4008 |
-
#~ msgstr ""
|
4009 |
-
#~ "WooCommerce est une extension de e-commerce gratuite qui vous permet de "
|
4010 |
-
#~ "vendre de tout, magnifiquement."
|
4011 |
-
|
4012 |
-
#~ msgid "More Recommended Plugins"
|
4013 |
-
#~ msgstr "Plus d’extensions recommandées"
|
4014 |
-
|
4015 |
-
#~ msgid "Sale!"
|
4016 |
-
#~ msgstr "Promo !"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
temp-import.csv → languages/wt-import-export-for-woo.pot
RENAMED
File without changes
|
public/class-wt-import-export-for-woo-public.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* The public-facing functionality of the plugin.
|
5 |
+
*
|
6 |
+
* @link https://www.webtoffee.com/
|
7 |
+
* @since 1.0.0
|
8 |
+
*
|
9 |
+
* @package Wt_Import_Export_For_Woo
|
10 |
+
* @subpackage Wt_Import_Export_For_Woo/public
|
11 |
+
*/
|
12 |
+
|
13 |
+
/**
|
14 |
+
* The public-facing functionality of the plugin.
|
15 |
+
*
|
16 |
+
* Defines the plugin name, version, and two examples hooks for how to
|
17 |
+
* enqueue the public-facing stylesheet and JavaScript.
|
18 |
+
*
|
19 |
+
* @package Wt_Import_Export_For_Woo
|
20 |
+
* @subpackage Wt_Import_Export_For_Woo/public
|
21 |
+
* @author Webtoffee <info@webtoffee.com>
|
22 |
+
*/
|
23 |
+
if(!class_exists('Wt_Import_Export_For_Woo_Public_Basic')){
|
24 |
+
class Wt_Import_Export_For_Woo_Public_Basic {
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The ID of this plugin.
|
28 |
+
*
|
29 |
+
* @since 1.0.0
|
30 |
+
* @access private
|
31 |
+
* @var string $plugin_name The ID of this plugin.
|
32 |
+
*/
|
33 |
+
private $plugin_name;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* The version of this plugin.
|
37 |
+
*
|
38 |
+
* @since 1.0.0
|
39 |
+
* @access private
|
40 |
+
* @var string $version The current version of this plugin.
|
41 |
+
*/
|
42 |
+
private $version;
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Initialize the class and set its properties.
|
46 |
+
*
|
47 |
+
* @since 1.0.0
|
48 |
+
* @param string $plugin_name The name of the plugin.
|
49 |
+
* @param string $version The version of this plugin.
|
50 |
+
*/
|
51 |
+
public function __construct( $plugin_name, $version ) {
|
52 |
+
|
53 |
+
$this->plugin_name = $plugin_name;
|
54 |
+
$this->version = $version;
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Register the stylesheets for the public-facing side of the site.
|
60 |
+
*
|
61 |
+
* @since 1.0.0
|
62 |
+
*/
|
63 |
+
public function enqueue_styles() {
|
64 |
+
|
65 |
+
/**
|
66 |
+
* This function is provided for demonstration purposes only.
|
67 |
+
*
|
68 |
+
* An instance of this class should be passed to the run() function
|
69 |
+
* defined in Wt_Import_Export_For_Woo_Loader as all of the hooks are defined
|
70 |
+
* in that particular class.
|
71 |
+
*
|
72 |
+
* The Wt_Import_Export_For_Woo_Loader will then create the relationship
|
73 |
+
* between the defined hooks and the functions defined in this
|
74 |
+
* class.
|
75 |
+
*/
|
76 |
+
|
77 |
+
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wt-import-export-for-woo-public.css', array(), $this->version, 'all' );
|
78 |
+
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Register the JavaScript for the public-facing side of the site.
|
83 |
+
*
|
84 |
+
* @since 1.0.0
|
85 |
+
*/
|
86 |
+
public function enqueue_scripts() {
|
87 |
+
|
88 |
+
/**
|
89 |
+
* This function is provided for demonstration purposes only.
|
90 |
+
*
|
91 |
+
* An instance of this class should be passed to the run() function
|
92 |
+
* defined in Wt_Import_Export_For_Woo_Loader as all of the hooks are defined
|
93 |
+
* in that particular class.
|
94 |
+
*
|
95 |
+
* The Wt_Import_Export_For_Woo_Loader will then create the relationship
|
96 |
+
* between the defined hooks and the functions defined in this
|
97 |
+
* class.
|
98 |
+
*/
|
99 |
+
|
100 |
+
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wt-import-export-for-woo-public.js', array( 'jquery' ), $this->version, false );
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
}
|
105 |
+
}
|
public/css/wt-import-export-for-woo-public.css
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* All of the CSS for your public-facing functionality should be
|
3 |
+
* included in this file.
|
4 |
+
*/
|
public/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Silence is golden
|
public/js/wt-import-export-for-woo-public.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function( $ ) {
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
/**
|
5 |
+
* All of the code for your public-facing JavaScript source
|
6 |
+
* should reside in this file.
|
7 |
+
*
|
8 |
+
* Note: It has been assumed you will write jQuery code here, so the
|
9 |
+
* $ function reference has been prepared for usage within the scope
|
10 |
+
* of this function.
|
11 |
+
*
|
12 |
+
* This enables you to define handlers, for when the DOM is ready:
|
13 |
+
*
|
14 |
+
* $(function() {
|
15 |
+
*
|
16 |
+
* });
|
17 |
+
*
|
18 |
+
* When the window is loaded:
|
19 |
+
*
|
20 |
+
* $( window ).load(function() {
|
21 |
+
*
|
22 |
+
* });
|
23 |
+
*
|
24 |
+
* ...and/or other possibilities.
|
25 |
+
*
|
26 |
+
* Ideally, it is not considered best practise to attach more than a
|
27 |
+
* single DOM-ready or window-load handler for a particular page.
|
28 |
+
* Although scripts in the WordPress core, Plugins and Themes may be
|
29 |
+
* practising this, we should strive to set a better example in our own work.
|
30 |
+
*/
|
31 |
+
|
32 |
+
})( jQuery );
|
public/partials/wt-import-export-for-woo-public-display.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Provide a public-facing view for the plugin
|
5 |
+
*
|
6 |
+
* This file is used to markup the public-facing aspects of the plugin.
|
7 |
+
*
|
8 |
+
* @link https://www.webtoffee.com/
|
9 |
+
* @since 1.0.0
|
10 |
+
*
|
11 |
+
* @package Wt_Import_Export_For_Woo
|
12 |
+
* @subpackage Wt_Import_Export_For_Woo/public/partials
|
13 |
+
*/
|
14 |
+
?>
|
15 |
+
|
16 |
+
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: user import, user export, export customers, import customers, export users
|
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 5.5
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag:
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -20,7 +20,7 @@ Import users and export users made fast and simple! Import Export WordPress User
|
|
20 |
|
21 |
🔸 Users Export - Export Users to CSV file.</li>
|
22 |
🔸 Users import - Import Users from CSV format to WordPress/WooCommerce Store.
|
23 |
-
🔸 Tested OK with WooCommerce 4.
|
24 |
🔸 Tested OK with PHP 7.3.5
|
25 |
|
26 |
Highlights: WordPress Users Export, WordPress Users CSV Import Suite, Export WordPress Users to CSV. Pro Version supports export and import of all additional user meta like WooCommerce details.
|
@@ -159,6 +159,18 @@ By default, admin and store manager are given access to export users. Please vis
|
|
159 |
|
160 |
== Changelog ==
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
= 1.4.4 =
|
163 |
* Tested OK with WC 4.5.0 and WP 5.5.1
|
164 |
= 1.4.3 =
|
@@ -269,5 +281,15 @@ By default, admin and store manager are given access to export users. Please vis
|
|
269 |
|
270 |
== Upgrade Notice ==
|
271 |
|
272 |
-
=
|
273 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 5.5
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 2.0.0
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
20 |
|
21 |
🔸 Users Export - Export Users to CSV file.</li>
|
22 |
🔸 Users import - Import Users from CSV format to WordPress/WooCommerce Store.
|
23 |
+
🔸 Tested OK with WooCommerce 4.6.0
|
24 |
🔸 Tested OK with PHP 7.3.5
|
25 |
|
26 |
Highlights: WordPress Users Export, WordPress Users CSV Import Suite, Export WordPress Users to CSV. Pro Version supports export and import of all additional user meta like WooCommerce details.
|
159 |
|
160 |
== Changelog ==
|
161 |
|
162 |
+
= 2.0.0 =
|
163 |
+
* Heads up! This version has been revamped majorly. The new version update will not automatically adopt the existing settings.
|
164 |
+
Please make sure you record/note the existing plugin settings and redo them in the new version after an update.
|
165 |
+
* Improved UI for better user experience
|
166 |
+
* Export/Import options: via a pre-saved template or a quick(standard columns) export/import
|
167 |
+
* Option to export/import selective columns
|
168 |
+
* Option to reorder columns during export
|
169 |
+
* Import: Support for different types of delimiters
|
170 |
+
* Export/Import options: Batch option with configurable batch count
|
171 |
+
* History of all the Import/Export process
|
172 |
+
* Dedicated logs for debugging failures
|
173 |
+
* Tested OK with WC 4.6.0
|
174 |
= 1.4.4 =
|
175 |
* Tested OK with WC 4.5.0 and WP 5.5.1
|
176 |
= 1.4.3 =
|
281 |
|
282 |
== Upgrade Notice ==
|
283 |
|
284 |
+
= 2.0.0 =
|
285 |
+
* Heads up! This version has been revamped majorly. The new version update will not automatically adopt the existing settings.
|
286 |
+
Please make sure you record/note the existing plugin settings and redo them in the new version after an update.
|
287 |
+
* Improved UI for better user experience
|
288 |
+
* Export/Import options: via a pre-saved template or a quick(standard columns) export/import
|
289 |
+
* Option to export/import selective columns
|
290 |
+
* Option to reorder columns during export
|
291 |
+
* Import: Support for different types of delimiters
|
292 |
+
* Export/Import options: Batch option with configurable batch count
|
293 |
+
* History of all the Import/Export process
|
294 |
+
* Dedicated logs for debugging failures
|
295 |
+
* Tested OK with WC 4.6.0 and WP 5.5.1
|
styles/wf-style.css
DELETED
@@ -1,156 +0,0 @@
|
|
1 |
-
#icon-woocommerce-importer {
|
2 |
-
background-image: url(../images/wf-import.png) !important;
|
3 |
-
background-position: -3px -5px;
|
4 |
-
}
|
5 |
-
.widefat_importer td {
|
6 |
-
vertical-align: middle;
|
7 |
-
padding: 5px 9px;
|
8 |
-
}
|
9 |
-
#import-progress {
|
10 |
-
width: 100%;
|
11 |
-
}
|
12 |
-
#import-progress td, #import-progress th {
|
13 |
-
padding: .5em 1em;
|
14 |
-
}
|
15 |
-
#import-progress td.status, #import-progress th.status {
|
16 |
-
width: 32px;
|
17 |
-
}
|
18 |
-
#import-progress td.row, #import-progress th.row {
|
19 |
-
width: 3em;
|
20 |
-
text-align: center;
|
21 |
-
}
|
22 |
-
#import-progress td.reason, #import-progress th.reason {
|
23 |
-
text-align: right;
|
24 |
-
}
|
25 |
-
#import-progress tr.importer-loading td {
|
26 |
-
background: url(../images/wf-ajax-loader.gif) no-repeat center center;
|
27 |
-
height: 32px;
|
28 |
-
}
|
29 |
-
#import-progress .merged td,
|
30 |
-
#import-progress .imported td {
|
31 |
-
}
|
32 |
-
#import-progress .skipped td {
|
33 |
-
border-bottom-color: #dbcb83;
|
34 |
-
background: #f2ecd2;
|
35 |
-
}
|
36 |
-
#import-progress .failed td {
|
37 |
-
border-bottom-color: #e6adaa;
|
38 |
-
background: #f2d3d2;
|
39 |
-
}
|
40 |
-
#import-progress mark.result {
|
41 |
-
height: 0;
|
42 |
-
display: block;
|
43 |
-
line-height: 16px;
|
44 |
-
overflow: hidden;
|
45 |
-
padding: 16px 0 0 0;
|
46 |
-
}
|
47 |
-
#import-progress .skipped mark.result {
|
48 |
-
background: url(../images/wf-notice.png) no-repeat center top;
|
49 |
-
}
|
50 |
-
#import-progress .merged mark.result,
|
51 |
-
#import-progress .imported mark.result {
|
52 |
-
background: url(../images/wf-success.png) no-repeat center top;
|
53 |
-
}
|
54 |
-
#import-progress .failed mark.result {
|
55 |
-
background: url(../images/wf-failed.png) no-repeat center top;
|
56 |
-
}
|
57 |
-
#import-progress .complete td {
|
58 |
-
background: #000;
|
59 |
-
border-color: #000;
|
60 |
-
border-top: 4px solid #000;
|
61 |
-
color: #fff;
|
62 |
-
font-size: 1.5em;
|
63 |
-
padding: .95em 1em 1em;
|
64 |
-
text-align: center;
|
65 |
-
}
|
66 |
-
#import-progress .regenerating td {
|
67 |
-
padding: 0;
|
68 |
-
}
|
69 |
-
#import-progress .regenerating div.progress {
|
70 |
-
background: #464646;
|
71 |
-
padding: .95em 1em 1em;
|
72 |
-
color: #fff;
|
73 |
-
overflow: hidden;
|
74 |
-
width: 0;
|
75 |
-
float: left;
|
76 |
-
text-align: left;
|
77 |
-
white-space: nowrap;
|
78 |
-
}
|
79 |
-
.update{
|
80 |
-
background: #fff;
|
81 |
-
border-left: 4px solid #fff;
|
82 |
-
padding: 1px 12px;
|
83 |
-
border-left-color: #46b450;
|
84 |
-
margin-top: 10px;
|
85 |
-
}
|
86 |
-
#datagrid { border-collapse: collapse; text-align: left; width: 80%; }
|
87 |
-
#datagrid {
|
88 |
-
background: #fff; overflow: hidden;
|
89 |
-
}
|
90 |
-
#datagrid td{ padding: 3px 10px; }
|
91 |
-
#datagrid th { padding: 8px 25px; color: #fff; background-color: #ccc; font-weight: bold;font-size: 15px; }
|
92 |
-
|
93 |
-
.woocommerce-message a.button-primary, .woocommerce-message button.button-primary{
|
94 |
-
background: #0085ba none repeat scroll 0 0 !important;
|
95 |
-
border-color: #0073aa #006799 #006799 !important;}
|
96 |
-
.woocommerce-message{border-left-color:#46b450 !important;}
|
97 |
-
.chosen-container-multi .chosen-choices li.search-field{
|
98 |
-
padding: 5px !important;
|
99 |
-
}
|
100 |
-
.chosen-container-multi .chosen-choices li.search-field input[type="text"]{
|
101 |
-
padding: 1px !important;
|
102 |
-
}
|
103 |
-
.order_actions .download_to_csv_wf {
|
104 |
-
display: block;
|
105 |
-
height: 2em !important;
|
106 |
-
padding: 0 !important;
|
107 |
-
position: relative;
|
108 |
-
text-indent: -9999px;
|
109 |
-
width: 2em;
|
110 |
-
}
|
111 |
-
.order_actions .download_to_csv_wf::after {
|
112 |
-
content: "";
|
113 |
-
font-family: "dashicons";
|
114 |
-
font-variant: normal;
|
115 |
-
font-weight: normal;
|
116 |
-
height: 100%;
|
117 |
-
left: 0;
|
118 |
-
margin: 0;
|
119 |
-
position: absolute;
|
120 |
-
text-align: center;
|
121 |
-
text-indent: 0;
|
122 |
-
text-transform: none;
|
123 |
-
top: 0;
|
124 |
-
width: 100%;
|
125 |
-
}
|
126 |
-
.pipe-view {
|
127 |
-
width: 65%;
|
128 |
-
float: left;
|
129 |
-
}
|
130 |
-
#datagrid td input {
|
131 |
-
margin-top: 4px;
|
132 |
-
box-shadow: none;
|
133 |
-
padding: 7px 10px;
|
134 |
-
}
|
135 |
-
|
136 |
-
#datagrid .input-text{
|
137 |
-
/* margin-left: auto; */
|
138 |
-
display: block;
|
139 |
-
width: 100%;
|
140 |
-
}
|
141 |
-
.bg-white{
|
142 |
-
background: #fff;
|
143 |
-
}
|
144 |
-
.p-20p{
|
145 |
-
padding: 20px;
|
146 |
-
}
|
147 |
-
.nav-tab-wrapper .nav-tab-premium {
|
148 |
-
background: #5ccc96;
|
149 |
-
color: white;
|
150 |
-
border-color: #5ccc96;
|
151 |
-
}
|
152 |
-
.wt-userimport-rating-link{color:yellow;}
|
153 |
-
.review-and-deactivate{color: #aa0073;}
|
154 |
-
#v_offset.input-text{width: 400px;padding: 6px}
|
155 |
-
#v_limit.input-text{width: 400px;padding: 6px}
|
156 |
-
#v_user_roles{width: 400px}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uninstall.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Fired when the plugin is uninstalled.
|
5 |
+
*
|
6 |
+
* When populating this file, consider the following flow
|
7 |
+
* of control:
|
8 |
+
*
|
9 |
+
* - This method should be static
|
10 |
+
* - Check if the $_REQUEST content actually is the plugin name
|
11 |
+
* - Run an admin referrer check to make sure it goes through authentication
|
12 |
+
* - Verify the output of $_GET makes sense
|
13 |
+
* - Repeat with other user roles. Best directly by using the links/query string parameters.
|
14 |
+
* - Repeat things for multisite. Once for a single site in the network, once sitewide.
|
15 |
+
*
|
16 |
+
* This file may be updated more in future version of the Boilerplate; however, this is the
|
17 |
+
* general skeleton and outline for how the file should work.
|
18 |
+
*
|
19 |
+
* For more information, see the following discussion:
|
20 |
+
* https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
|
21 |
+
*
|
22 |
+
* @link https://www.webtoffee.com/
|
23 |
+
* @since 1.0.0
|
24 |
+
*
|
25 |
+
* @package Wt_Import_Export_For_Woo
|
26 |
+
*/
|
27 |
+
|
28 |
+
// If uninstall not called from WordPress, then exit.
|
29 |
+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
30 |
+
exit;
|
31 |
+
}
|
users-customers-import-export-for-wp-woocommerce.php
CHANGED
@@ -6,249 +6,129 @@
|
|
6 |
Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
|
7 |
Author: WebToffee
|
8 |
Author URI: https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/
|
9 |
-
Version:
|
10 |
-
WC tested up to: 4.5.
|
11 |
Text Domain: users-customers-import-export-for-wp-woocommerce
|
12 |
License: GPLv3
|
13 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
14 |
*/
|
15 |
|
16 |
-
if (!defined('ABSPATH') || !is_admin()) {
|
17 |
-
return;
|
18 |
-
}
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
function wf_wordpress_user_import_export_premium_check(){
|
24 |
-
if ( is_plugin_active('customer-import-export-for-woocommerce/customer-import-export.php') ){
|
25 |
-
deactivate_plugins( basename( __FILE__ ) );
|
26 |
-
wp_die(__("You already have the Premium version installed. For any issues, kindly contact our <a target='_blank' href='https://www.webtoffee.com/support/'>support</a>.", "users-customers-import-export-for-wp-woocommerce"), "", array('back_link' => 1 ));
|
27 |
-
}
|
28 |
}
|
29 |
-
register_activation_hook( __FILE__, 'wf_wordpress_user_import_export_premium_check' );
|
30 |
|
31 |
|
32 |
-
|
33 |
-
{
|
34 |
-
|
35 |
}
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
40 |
}
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
{
|
45 |
-
define("HF_WORDPRESS_CUSTOMER_IM_EX", "hf_wordpress_customer_im_ex");
|
46 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
}
|
64 |
-
|
65 |
-
add_filter('woocommerce_screen_ids', array($this, 'woocommerce_screen_ids'));
|
66 |
-
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'wf_plugin_action_links'));
|
67 |
-
add_action('init', array($this, 'load_plugin_textdomain'));
|
68 |
-
add_action('init', array($this, 'catch_export_request'), 20);
|
69 |
-
add_action('admin_init', array($this, 'register_importers'));
|
70 |
-
|
71 |
-
add_filter('admin_footer_text', array($this, 'WT_admin_footer_text'), 100);
|
72 |
-
add_action('wp_ajax_ucie_wt_review_plugin', array($this, "review_plugin"));
|
73 |
-
|
74 |
-
// if (!get_option('UEIPF_Webtoffee_storefrog_admin_notices_dismissed')) {
|
75 |
-
// add_action('admin_notices', array($this, 'webtoffee_storefrog_admin_notices'));
|
76 |
-
// add_action('wp_ajax_UEIPF_webtoffee_storefrog_notice_dismiss', array($this, 'webtoffee_storefrog_notice_dismiss'));
|
77 |
-
// }
|
78 |
-
|
79 |
-
include_once( 'includes/class-wf-customerimpexpcsv-admin-screen.php' );
|
80 |
-
include_once( 'includes/importer/class-wf-customerimpexpcsv-importer.php' );
|
81 |
-
|
82 |
-
include_once ('includes/class-wt-userimport-uninstall-feedback.php');
|
83 |
-
// WT Security Helper
|
84 |
-
include_once ('includes/class-wt-security-helper.php');
|
85 |
-
|
86 |
-
if (defined('DOING_AJAX')) {
|
87 |
-
include_once( 'includes/class-wf-customerimpexpcsv-ajax-handler.php' );
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
public function wf_plugin_action_links($links) {
|
92 |
-
|
93 |
-
$plugin_links = array(
|
94 |
-
'<a href="' . admin_url('admin.php?page=hf_wordpress_customer_im_ex') . '">' . __('Import Export Users', 'users-customers-import-export-for-wp-woocommerce') . '</a>',
|
95 |
-
'<a target="_blank" href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/" style="color:#3db634;">' . __('Premium Upgrade', 'users-customers-import-export-for-wp-woocommerce') . '</a>',
|
96 |
-
'<a target="_blank" href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/">' . __('Support', 'users-customers-import-export-for-wp-woocommerce') . '</a>',
|
97 |
-
'<a target="_blank" href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews/">' . __('Review', 'users-customers-import-export-for-wp-woocommerce') . '</a>',
|
98 |
-
);
|
99 |
-
|
100 |
-
if (array_key_exists('deactivate', $links)) {
|
101 |
-
|
102 |
-
$links['deactivate'] = str_replace('<a', '<a class="userimport-deactivate-link"', $links['deactivate']);
|
103 |
-
}
|
104 |
-
return array_merge($plugin_links, $links);
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Add screen ID
|
109 |
-
*/
|
110 |
-
public function woocommerce_screen_ids($ids) {
|
111 |
-
$ids[] = 'admin'; // For import screen
|
112 |
-
return $ids;
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Handle localisation
|
117 |
-
*/
|
118 |
-
public function load_plugin_textdomain() {
|
119 |
-
load_plugin_textdomain('users-customers-import-export-for-wp-woocommerce', false, dirname(plugin_basename(__FILE__)) . '/lang/');
|
120 |
-
}
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Catches an export request and exports the data. This class is only loaded in admin.
|
124 |
-
*/
|
125 |
-
public function catch_export_request() {
|
126 |
-
if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'hf_wordpress_customer_im_ex') {
|
127 |
-
switch ($_GET['action']) {
|
128 |
-
case "export" :
|
129 |
-
$user_ok = self::hf_user_permission();
|
130 |
-
if ($user_ok) {
|
131 |
-
include_once( 'includes/exporter/class-wf-customerimpexpcsv-exporter.php' );
|
132 |
-
WF_CustomerImpExpCsv_Exporter::do_export();
|
133 |
-
} else {
|
134 |
-
if (is_admin()) {
|
135 |
-
add_action('admin_notices', array($this, 'wf_user_permission_ie_admin_notice'));
|
136 |
-
} else {
|
137 |
-
wp_redirect(wp_login_url());
|
138 |
-
}
|
139 |
-
}
|
140 |
-
break;
|
141 |
-
}
|
142 |
-
}
|
143 |
-
}
|
144 |
-
|
145 |
-
public function wf_user_permission_ie_admin_notice(){
|
146 |
-
echo '<div class="notice notice-error"><p>' . __('By default, admin and store manager are given access to export users. Please visit <a href="https://www.webtoffee.com/how-to-export-items-from-your-site-without-user-role-restriction/" target="_blank">here</a> for more details', 'users-customers-import-export-for-wp-woocommerce') . '</p></div>';
|
147 |
-
}
|
148 |
|
149 |
|
150 |
-
/**
|
151 |
-
* Register importers for use
|
152 |
-
*/
|
153 |
-
public function register_importers() {
|
154 |
-
register_importer('wordpress_hf_user_csv', 'WordPress User/Customers (CSV)', __('Import <strong>users/customers</strong> to your site via a csv file.', 'users-customers-import-export-for-wp-woocommerce'), 'WF_CustomerImpExpCsv_Importer::customer_importer');
|
155 |
-
}
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
$user_ok = false;
|
163 |
-
$wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));
|
164 |
-
if ($current_user instanceof WP_User) {
|
165 |
-
$can_users = array_intersect($wf_roles, $current_user->roles);
|
166 |
-
if (!empty($can_users) || is_super_admin($current_user->ID)) {
|
167 |
-
$user_ok = true;
|
168 |
-
}
|
169 |
-
}
|
170 |
-
return $user_ok;
|
171 |
-
}
|
172 |
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
return;
|
177 |
-
}
|
178 |
-
$screen = get_current_screen();
|
179 |
-
|
180 |
-
$allowed_screen_ids = array('users_page_hf_wordpress_customer_im_ex');
|
181 |
-
if (in_array($screen->id, $allowed_screen_ids)|| (isset($_GET['import']) && $_GET['import'] == 'wordpress_hf_user_csv')) {
|
182 |
-
|
183 |
-
$notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'users-customers-import-export-for-wp-woocommerce');
|
184 |
-
$notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'users-customers-import-export-for-wp-woocommerce');
|
185 |
-
|
186 |
-
$content = '<style>.webtoffee-storefrog-nav-tab.updated {z-index:2; display: flex;align-items: center;margin: 18px 20px 10px 0;padding:23px;border-left-color: #2c85d7!important}.webtoffee-storefrog-nav-tab ul {margin: 0;}.webtoffee-storefrog-nav-tab h3 {margin-top: 0;margin-bottom: 9px;font-weight: 500;font-size: 16px;color: #2880d3;}.webtoffee-storefrog-nav-tab h3:last-child {margin-bottom: 0;}.webtoffee-storefrog-banner {flex-basis: 20%;padding: 0 15px;margin-left: auto;} .webtoffee-storefrog-banner a:focus{box-shadow: none;}</style>';
|
187 |
-
$content .= '<div class="updated woocommerce-message webtoffee-storefrog-nav-tab notice is-dismissible"><ul>' . $notice . '</ul><div class="webtoffee-storefrog-banner"><a href="http://www.storefrog.com/" target="_blank"> <img src="' . plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/storefrog.png"/></a></div><div style="position: absolute;top: 0;right: 1px;z-index: 10000;" ><button type="button" id="webtoffee-storefrog-notice-dismiss" class="notice-dismiss"><span class="screen-reader-text">' . __('Dismiss this notice.', 'users-customers-import-export-for-wp-woocommerce') . '</span></button></div></div>';
|
188 |
-
echo $content;
|
189 |
|
190 |
-
|
191 |
-
|
192 |
-
jQuery.post( '" . admin_url("admin-ajax.php") . "', { action: 'UEIPF_webtoffee_storefrog_notice_dismiss' } );
|
193 |
-
jQuery('.webtoffee-storefrog-nav-tab').fadeOut();
|
194 |
-
});
|
195 |
-
";
|
196 |
-
$js = "<!-- User Import JavaScript -->\n<script type=\"text/javascript\">\njQuery(function($) { $user_js });\n</script>\n";
|
197 |
-
echo $js;
|
198 |
-
}
|
199 |
-
}
|
200 |
|
201 |
-
|
|
|
|
|
|
|
|
|
202 |
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
-
|
224 |
-
|
225 |
-
jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
|
226 |
-
});";
|
227 |
-
$js = "<!-- User Import JavaScript -->\n<script type=\"text/javascript\">\njQuery(function($) { $user_js });\n</script>\n";
|
228 |
-
echo $js;
|
229 |
-
|
230 |
-
|
231 |
-
} else {
|
232 |
-
$footer_text = __('Thank you for your review.', 'users-customers-import-export-for-wp-woocommerce');
|
233 |
-
}
|
234 |
-
}
|
235 |
|
236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
}
|
238 |
-
|
239 |
-
|
240 |
-
if (!self::hf_user_permission()) {
|
241 |
-
wp_die(-1);
|
242 |
-
}
|
243 |
-
update_option('ucie_wt_plugin_reviewed', 1);
|
244 |
-
wp_die();
|
245 |
-
}
|
246 |
-
|
247 |
-
}
|
248 |
-
|
249 |
-
endif;
|
250 |
-
|
251 |
-
new WF_Customer_Import_Export_CSV();
|
252 |
|
253 |
/*
|
254 |
* Displays update information for a plugin.
|
@@ -264,3 +144,18 @@ function wt_users_customers_import_export_for_wp_woocommerce_update_message( $da
|
|
264 |
}
|
265 |
}
|
266 |
add_action( 'in_plugin_update_message-users-customers-import-export-for-wp-woocommerce/users-customers-import-export-for-wp-woocommerce.php', 'wt_users_customers_import_export_for_wp_woocommerce_update_message', 10, 2 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
|
7 |
Author: WebToffee
|
8 |
Author URI: https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/
|
9 |
+
Version: 2.0.0
|
10 |
+
WC tested up to: 4.5.2
|
11 |
Text Domain: users-customers-import-export-for-wp-woocommerce
|
12 |
License: GPLv3
|
13 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
14 |
*/
|
15 |
|
|
|
|
|
|
|
16 |
|
17 |
+
|
18 |
+
if ( !defined( 'ABSPATH' ) || !is_admin() ) {
|
19 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
|
|
21 |
|
22 |
|
23 |
+
// If this file is called directly, abort.
|
24 |
+
if ( ! defined( 'WPINC' ) ) {
|
25 |
+
die;
|
26 |
}
|
27 |
|
28 |
+
define ( 'WT_U_IEW_PLUGIN_BASENAME', plugin_basename(__FILE__) );
|
29 |
+
define ( 'WT_U_IEW_PLUGIN_PATH', plugin_dir_path(__FILE__) );
|
30 |
+
define ( 'WT_U_IEW_PLUGIN_URL', plugin_dir_url(__FILE__));
|
31 |
+
define ( 'WT_U_IEW_PLUGIN_FILENAME', __FILE__);
|
32 |
+
if ( ! defined( 'WT_IEW_PLUGIN_ID_BASIC' ) ) {
|
33 |
+
define ( 'WT_IEW_PLUGIN_ID_BASIC', 'wt_import_export_for_woo_basic');
|
34 |
}
|
35 |
+
define ( 'WT_U_IEW_PLUGIN_NAME','User Import Export for WordPress/WooCommerce');
|
36 |
+
define ( 'WT_U_IEW_PLUGIN_DESCRIPTION','Import and Export User From and To your WordPress/WooCommerce Store.');
|
37 |
|
38 |
+
if ( ! defined( 'WT_IEW_DEBUG_BASIC' ) ) {
|
39 |
+
define ( 'WT_IEW_DEBUG_BASIC', false );
|
|
|
|
|
40 |
}
|
41 |
+
/**
|
42 |
+
* Currently plugin version.
|
43 |
+
* Start at version 1.0.0 and use SemVer - https://semver.org
|
44 |
+
* Rename this for your plugin and update it as you release new versions.
|
45 |
+
*/
|
46 |
+
define( 'WT_U_IEW_VERSION', '2.0.0' );
|
47 |
|
48 |
+
/**
|
49 |
+
* The code that runs during plugin activation.
|
50 |
+
* This action is documented in includes/class-wt-import-export-for-woo-activator.php
|
51 |
+
*/
|
52 |
+
function activate_wt_import_export_for_woo_basic_user() {
|
53 |
+
// if(is_plugin_active('wt-import-export-for-woo-user/wt-import-export-for-woo-user.php')){
|
54 |
+
// deactivate_plugins( basename( __FILE__ ) );
|
55 |
+
// wp_die(
|
56 |
+
// '<p>'.__("Is everything fine? You already have the Premium version installed in your website. For any issues, kindly raise a ticket via <a target='_blank' href='https://www.webtoffee.com/support/'>support</a>")
|
57 |
+
// . '</p> <a href="' . admin_url( 'plugins.php' ) . '">' . __( 'go back') . '</a>'
|
58 |
+
// );
|
59 |
+
// }
|
60 |
+
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wt-import-export-for-woo-activator.php';
|
61 |
+
Wt_Import_Export_For_Woo_Basic_Activator_User::activate();
|
62 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
+
/**
|
67 |
+
* The code that runs during plugin deactivation.
|
68 |
+
* This action is documented in includes/class-wt-import-export-for-woo-deactivator.php
|
69 |
+
*/
|
70 |
+
function deactivate_wt_import_export_for_woo_basic_user() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wt-import-export-for-woo-deactivator.php';
|
73 |
+
Wt_Import_Export_For_Woo_Basic_Deactivator_User::deactivate();
|
74 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
+
register_activation_hook( __FILE__, 'activate_wt_import_export_for_woo_basic_user' );
|
77 |
+
register_deactivation_hook( __FILE__, 'deactivate_wt_import_export_for_woo_basic_user' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
+
/**
|
80 |
+
* The core plugin class that is used to define internationalization,
|
81 |
+
* admin-specific hooks, and public-facing site hooks.
|
82 |
+
*/
|
83 |
+
require plugin_dir_path( __FILE__ ) . 'includes/class-wt-import-export-for-woo.php';
|
84 |
|
85 |
+
/**
|
86 |
+
* Begins execution of the plugin.
|
87 |
+
*
|
88 |
+
* Since everything within the plugin is registered via hooks,
|
89 |
+
* then kicking off the plugin from this point in the file does
|
90 |
+
* not affect the page life cycle.
|
91 |
+
*
|
92 |
+
* @since 1.0.0
|
93 |
+
*/
|
94 |
+
function run_wt_import_export_for_woo_basic_user() {
|
95 |
+
|
96 |
+
if ( ! defined( 'WT_IEW_BASIC_STARTED' ) ) {
|
97 |
+
define ( 'WT_IEW_BASIC_STARTED', 1);
|
98 |
+
$plugin = new Wt_Import_Export_For_Woo_Basic();
|
99 |
+
$plugin->run();
|
100 |
+
}
|
101 |
+
}
|
102 |
+
/** this added for a temporary when a plugin update with the option upload zip file. need to remove this after some version release */
|
103 |
+
if(!get_option('wt_u_iew_is_active'))
|
104 |
+
{
|
105 |
+
update_option('wt_user_show_legecy_menu',1);
|
106 |
+
activate_wt_import_export_for_woo_basic_user();
|
107 |
+
}
|
108 |
+
|
109 |
+
if(get_option('wt_u_iew_is_active'))
|
110 |
+
{
|
111 |
+
run_wt_import_export_for_woo_basic_user();
|
112 |
+
}
|
113 |
|
114 |
+
/* Plugin page links */
|
115 |
+
add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'wt_uiew_plugin_action_links_basic_user');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
function wt_uiew_plugin_action_links_basic_user($links)
|
118 |
+
{
|
119 |
+
if(defined('WT_IEW_PLUGIN_ID_BASIC')) /* main plugin is available */
|
120 |
+
{
|
121 |
+
$links[] = '<a href="'.admin_url('admin.php?page='.WT_IEW_PLUGIN_ID_BASIC).'">'.__('Settings').'</a>';
|
122 |
+
}
|
123 |
+
|
124 |
+
$links[] = '<a href="https://www.webtoffee.com/user-import-export-plugin-wordpress-user-guide/" target="_blank">'.__('Documentation').'</a>';
|
125 |
+
$links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/">' . __('Support') . '</a>';
|
126 |
+
$links[] = '<a target="_blank" href="https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/" style="color:#3db634;">' . __('Premium Upgrade') . '</a>';
|
127 |
+
if (array_key_exists('deactivate', $links)) {
|
128 |
+
$links['deactivate'] = str_replace('<a', '<a class="userimport-deactivate-link"', $links['deactivate']);
|
129 |
}
|
130 |
+
return $links;
|
131 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
|
133 |
/*
|
134 |
* Displays update information for a plugin.
|
144 |
}
|
145 |
}
|
146 |
add_action( 'in_plugin_update_message-users-customers-import-export-for-wp-woocommerce/users-customers-import-export-for-wp-woocommerce.php', 'wt_users_customers_import_export_for_wp_woocommerce_update_message', 10, 2 );
|
147 |
+
|
148 |
+
// uninstall feedback catch
|
149 |
+
include_once plugin_dir_path( __FILE__ ) . 'includes/class-wt-userimport-uninstall-feedback.php';
|
150 |
+
|
151 |
+
|
152 |
+
|
153 |
+
// add dismissble banner for legecy menu
|
154 |
+
include_once plugin_dir_path( __FILE__ ) . 'includes/class-wt-legecy-menu-moved.php';
|
155 |
+
$user_egecy_menu = new wt_legecy_menu_moved('user');
|
156 |
+
$user_egecy_menu->plugin_title = "User Import Export";
|
157 |
+
$user_egecy_menu->old_menu = "Users > User Import Export";
|
158 |
+
$user_egecy_menu->banner_message = sprintf(__("We have introduced a new main menu %sWebToffee Import Export(basic)%s for the %s plugin. Click the button below or dismiss this banner to remove the old menu from %s."),'<b>','</b>', $user_egecy_menu->plugin_title, $user_egecy_menu->old_menu);
|
159 |
+
$user_egecy_menu->old_menu_params = array(array('parent_slug'=>'users.php', 'menu_title'=>'User Import Export', 'capability'=>'list_users'),
|
160 |
+
array('parent_slug'=>'woocommerce', 'menu_title'=>'Customer Import Export', 'capability'=>'manage_woocommerce')
|
161 |
+
);
|