PluginProbe
WP Directory Kit / 1.5.5
WP Directory Kit v1.5.5
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
wpdirectorykit / application / views / wdk_demo_import / step_2.php

step_2.php in WP Directory Kit 1.5.5, at application/views/wdk_demo_import/step_2.php

318 lines 10.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Settings.
4 *
5 * This is the template that edit form settings
6 *
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12 ?>
13 <!-- This file should primarily consist of HTML with a little bit of PHP. -->
14
15 <div class="wrap wdk-wrap">
16 <h1 class="wp-heading-inline"><?php echo __('WDK Demo Import', 'wpdirectorykit'); ?></h1>
17 <br />
18 <div class="wdk-body">
19 <div class="postbox" style="display: block;">
20 <div class="postbox-header">
21 <h3><?php echo __('Step 2 Import for theme:', 'wpdirectorykit'); ?> <?php echo esc_html($current_theme->get( 'Name' )); ?></h3>
22 </div>
23 <div class="inside">
24 <div class="wdk-install-plugins-content-header">
25 <h2><?php echo __('Importing Demo Content', 'wpdirectorykit'); ?></h2>
26 <p><?php echo __('Now we importing demo content like Pages/Posts/Menus and Listings', 'wpdirectorykit'); ?></p>
27 </div>
28 <label slug="" source="" class="plugin-item install_content">
29 <div class="plugin-item-content">
30 <div class="plugin-item-content-title">
31 <h3><img src="<?php echo WPDIRECTORYKIT_URL; ?>admin/img/loader.svg" class="wdk-loading wdk-loading-md hidden" alt="Loading..."><?php echo __('Importing Pages/Posts/Menus','wpdirectorykit'); ?></h3>
32 </div>
33 <div class="plugin-item-error js-wdk-plugin-item-error"></div>
34 <div class="plugin-item-info js-wdk-plugin-item-info"></div>
35 </div>
36 </label>
37
38 <label slug="" source="" class="plugin-item install_listings">
39 <div class="plugin-item-content">
40 <div class="plugin-item-content-title">
41 <h3><img src="<?php echo WPDIRECTORYKIT_URL; ?>admin/img/loader.svg" class="wdk-loading wdk-loading-md hidden" alt="Loading..."><?php echo __('Importing Listings and Configurations','wpdirectorykit'); ?></h3>
42 </div>
43 <div class="plugin-item-error js-wdk-plugin-item-error"></div>
44 <div class="plugin-item-info js-wdk-plugin-item-info"></div>
45 </div>
46 </label>
47 </div>
48 </div>
49 <p class="wdk_button-container">
50 <a href="<?php echo get_home_url();?>" class="install_button wdk_button button button-hero button-primary" disabled="disabled"><?php echo __('Visit Website', 'wpdirectorykit'); ?></a>
51 </p>
52 </div>
53 <br/>
54 <div class="alert alert-info" role="alert"><a href="<?php echo esc_html($current_theme->get( 'ThemeURI' )); ?>" target="_blank"><?php echo __('Theme Data will be downloaded from API:','wpdirectorykit'); ?> <?php echo esc_html($current_theme->get( 'AuthorURI' )); ?> <?php echo __('On any trouble contact us via website contact page.','wpdirectorykit'); ?></a></div>
55 </div>
56
57 <script>
58
59 jQuery( document ).ready(function($) {
60
61 function install_content(){
62
63 var ajax_nonce = '<?php echo wp_create_nonce( 'updates' ); ?>';
64
65 var that = $('.install_content');
66
67 var ajax_param = {
68 "page": 'wdk_backendajax',
69 "function": 'install_content',
70 "action": 'wdk_public_action',
71 "_wpnonce": '<?php echo esc_js(wp_create_nonce( 'wdk-install_content'));?>',
72 };
73
74 var ajax_indicator = that.find('.wdk-loading');
75 ajax_indicator.show();
76
77 var jqxhr = $.post( "<?php echo admin_url( 'admin-ajax.php' ); ?>", ajax_param, function(data)
78 {
79 if(data.success == true)
80 {
81 that.find('h3').css('color', 'green');
82 } else if(typeof(data.message) != "undefined") {
83 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data.message+"</b></div>");
84 }
85 else
86 {
87 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data+"</b></div>");
88 }
89
90 })
91 .done(function(data) {
92 })
93 .fail(function(data) {
94
95 if(typeof(data.responseText) != "undefined")
96 {
97 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data.responseText+"</b></div>");
98 }
99 else
100 {
101 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data+"</b></div>");
102 }
103
104 //alert( "Error: " + data );
105 is_failed=true;
106 })
107 .always(function(data) {
108 ajax_indicator.hide();
109 that.removeClass('active');
110 });
111
112 }
113
114 function install_listings(){
115
116 var ajax_nonce = '<?php echo wp_create_nonce( 'updates' ); ?>';
117
118 var that = $('.install_listings');
119
120 var ajax_param = {
121 "page": 'wdk_backendajax',
122 "function": 'install_listings',
123 "action": 'wdk_public_action',
124 "_wpnonce": '<?php echo esc_js(wp_create_nonce( 'wdk-install_listings'));?>',
125 };
126
127 var ajax_indicator = that.find('.wdk-loading');
128 ajax_indicator.show();
129
130 var jqxhr = $.post( "<?php echo admin_url( 'admin-ajax.php' ); ?>", ajax_param, function(data)
131 {
132 if(data.success == true)
133 {
134 that.find('h3').css('color', 'green');
135 } else if(typeof(data.message) != "undefined") {
136 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data.message+"</b></div>");
137 }
138 else
139 {
140 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data+"</b></div>");
141 }
142
143 })
144 .done(function(data) {
145 })
146 .fail(function(data) {
147 if(typeof(data.responseText) != "undefined")
148 {
149 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data.responseText+"</b></div>");
150 }
151 else
152 {
153 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data+"</b></div>");
154 }
155 is_failed=true;
156 })
157 .always(function(data) {
158 ajax_indicator.hide();
159 that.removeClass('active');
160 });
161
162 }
163
164 $.ajaxSetup({async: false});
165
166 install_content();
167
168 install_listings();
169
170 $('.install_button').removeAttr('disabled');
171
172 $.ajaxSetup({async: true});
173
174
175
176
177
178
179
180
181
182
183
184
185
186 /*
187 $('.install_button').click(function (event) {
188
189 // Don't follow the link
190 event.preventDefault();
191
192 if($(this)[0].hasAttribute("disabled"))
193 {
194 alert('Wait until proccess complete or if takes to long (more then 10 mins) then refresh');
195 return false;
196 }
197
198 $(this).attr('disabled','disabled');
199
200 var is_failed=false;
201
202 $( ".plugin-item" ).each(function() {
203 var slug = $( this ).attr('slug');
204 var source = $( this ).attr('source');
205
206 if (typeof source == "undefined" ) {
207 source = '';
208 }
209
210 if(!$(this).find('input[type="checkbox"]').is(':checked'))
211 return;
212
213 var ajax_nonce = '<?php echo wp_create_nonce( 'updates' ); ?>';
214
215 var that = $(this);
216
217 var ajax_param = {
218 "page": 'wdk_backendajax',
219 "function": 'plugin_upgrader',
220 "action": 'wdk_public_action',
221 "slug": slug,
222 "source": source,
223 };
224
225 that.attr("disabled", "disabled");
226
227 that.addClass('active');
228 var jqxhr = $.post( "<?php echo admin_url( 'admin-ajax.php' ); ?>", ajax_param, function(data) {
229
230 if(data.success == true)
231 {
232 that.find('h3').css('color', 'green');
233 } else {
234 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data.slug+" "+data.message+"</b></div>");
235 }
236
237 })
238 .done(function(data) {
239 })
240 .fail(function(data) {
241 that.after("<div class=\"alert alert-danger\" role=\"alert\"><?php echo __('Error:', 'wpdirectorykit'); ?> <b style=\"color:red;\">"+data+"</b></div>");
242 is_failed=true;
243 })
244 .always(function(data) {
245 ajax_indicator.hide();
246 that.removeClass('active');
247 });
248
249 });
250
251 $.ajaxSetup({async: true});
252
253 if(is_failed == false)
254 window.location.replace($(this).attr('href'));
255 else
256 $(this).removeAttr('disabled');
257 });*/
258 });
259
260
261 </script>
262
263 <style>
264
265 .wdk-install-plugins-content-header {
266 padding: 30px;
267 border-bottom: 1px solid #dddddd;
268 }
269
270 .inside .plugin-item{
271 display: -webkit-box;
272 display: -ms-flexbox;
273 display: flex;
274 -webkit-box-pack: justify;
275 -ms-flex-pack: justify;
276 justify-content: space-between;
277 -webkit-box-align: center;
278 -ms-flex-align: center;
279 align-items: center;
280 margin: 0 30px;
281 padding: 0px 0;
282 border-bottom: 1px solid #eeeeee;
283 }
284
285 .wdk-loading-md {
286 width: 32px;
287 height: 32px;
288 }
289
290 .wdk-loading {
291 -webkit-animation: 0.65s linear infinite wdk-rotation;
292 animation: 0.65s linear infinite wdk-rotation;
293 height:18px;
294 margin-right: 5px;
295 }
296
297 .wdk-loading.hidden
298 {
299 display:none;
300 }
301
302 @keyframes wdk-rotation {
303 from {
304 transform: rotate(0deg);
305 }
306 to {
307 transform: rotate(359deg);
308 }
309 }
310
311 span.green
312 {
313 color: green;
314 }
315
316 </style>
317
318 <?php $this->view('general/footer', $data); ?>