| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template for Demo Import. |
| 4 |
* |
| 5 |
* This is the template that edit form |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
?> |
| 13 |
|
| 14 |
<!-- This file should primarily consist of HTML with a little bit of PHP. --> |
| 15 |
|
| 16 |
<div class="wrap wdk-wrap"> |
| 17 |
|
| 18 |
<h1 class="wp-heading-inline"><?php echo __('Demo Import', 'wpdirectorykit'); ?></h1> |
| 19 |
<div class="wdk-body"> |
| 20 |
<?php if($installed):?> |
| 21 |
<div class="notice notice-success"> |
| 22 |
<p> |
| 23 |
<?php echo __('Some data already exists, please remove all data if you want to full import again','wpdirectorykit'); ?> |
| 24 |
<a href="<?php echo get_admin_url() . "admin.php?page=wdk_settings&function=remove&redirect_url=on_install&multipurpose=".wmvc_show_data('multipurpose', $_GET, ''); ?>&_wpnonce=<?php echo esc_attr( wp_create_nonce( 'remove-data' )); ?>" onclick="return (prompt('<?php echo __('Are you sure? All Listings, fields, categories, locations will be completely removed, check url and type remove if you are sure', 'wpdirectorykit')?>', '') == '<?php echo __('remove', 'wpdirectorykit')?>');" class="button button-primary" id="reset_data_field_button"> |
| 25 |
<?php echo __('Remove all data','wpdirectorykit'); ?> |
| 26 |
</a> |
| 27 |
</p> |
| 28 |
</div> |
| 29 |
<?php endif;?> |
| 30 |
<?php if($required_plugins):?> |
| 31 |
<?php |
| 32 |
$tgma_link = ''; |
| 33 |
if(file_exists(get_template_directory().'/includes/tgm_pa/class-tgm-plugin-activation.php') || file_exists(get_template_directory().'/tgm_pa/class-tgm-plugin-activation.php')) { |
| 34 |
$tgma_link = get_admin_url() . "themes.php?page=tgmpa-install-plugins"; |
| 35 |
} else { |
| 36 |
$tgma_link = get_admin_url() . "plugins.php?page=tgmpa-install-plugins"; |
| 37 |
} |
| 38 |
?> |
| 39 |
<div class="notice notice-error"> |
| 40 |
<p> |
| 41 |
<?php echo __('First please install / activate required plugins','wpdirectorykit'); ?> |
| 42 |
<a href="<?php echo esc_url($tgma_link); ?>" class="button button-primary"> |
| 43 |
<?php echo __('Begin to install / activate','wpdirectorykit'); ?> |
| 44 |
</a> |
| 45 |
</p> |
| 46 |
</div> |
| 47 |
<?php endif;?> |
| 48 |
<form method="post" action="" novalidate="novalidate"> |
| 49 |
<?php wp_nonce_field( 'wdk-settings_import', '_wpnonce'); ?> |
| 50 |
<div class="postbox" style="display: block;"> |
| 51 |
<div class="postbox-header"> |
| 52 |
<h3><?php echo __('Demo Data Importer Tool', 'wpdirectorykit'); ?></h3> |
| 53 |
</div> |
| 54 |
<div class="inside"> |
| 55 |
<div class=""> |
| 56 |
<?php |
| 57 |
$max_time = ini_get("max_execution_time"); |
| 58 |
if($max_time < 120):?> |
| 59 |
<div class="alert alert-danger" role="alert"><?php echo __('For import max_execution_time should be more then 120s, please contact with admin host to increase','wpdirectorykit'); ?></div> |
| 60 |
<?php endif;?> |
| 61 |
</div> |
| 62 |
<?php echo wmvc_xss_clean($info_log_message);?> |
| 63 |
<?php echo wmvc_xss_clean($import_log);?> |
| 64 |
<?php echo wdk_generate_fields($fields, $db_data); ?> |
| 65 |
</div> |
| 66 |
</div> |
| 67 |
<?php if(!$installed || true):?> |
| 68 |
<input type="submit" name="submit" id="submit" class="button button-primary event-ajax-indicator" value="<?php echo __('Import demo data', 'wpdirectorykit'); ?>"> <span class="wdk-ajax-indicator wdk-infinity-load color-primary dashicons dashicons-update-alt hidden" style="margin-top: 4px;margin-left: 4px;"></span> |
| 69 |
<?php endif;?> |
| 70 |
<?php if(!empty($import_log) && stripos($import_log,'alert-succes') !== FALSE && stripos($import_log,'alert-danger') === FALSE):?> |
| 71 |
<a href="<?php echo esc_url(home_url());?>" class="button button-secondary" target="_blank"><?php echo __('Check your results page now', 'wpdirectorykit'); ?></a> |
| 72 |
<?php endif;?> |
| 73 |
</form> |
| 74 |
</div> |
| 75 |
</div> |
| 76 |
|
| 77 |
<script> |
| 78 |
jQuery(document).ready(function($) { |
| 79 |
$('form input[type="submit"]').on('click', function(){ |
| 80 |
var self = $(this); |
| 81 |
setTimeout(function(){ |
| 82 |
self.delay(2000).attr("disabled", true) |
| 83 |
},0) |
| 84 |
}) |
| 85 |
}) |
| 86 |
</script> |
| 87 |
|
| 88 |
<?php $this->view('general/footer', $data); ?> |