| 1 |
<?php |
| 2 |
/** |
| 3 |
* Smart Links import/export view. |
| 4 |
* |
| 5 |
* @package King_Addons |
| 6 |
*/ |
| 7 |
|
| 8 |
if (!defined('ABSPATH')) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
$export_url = wp_nonce_url( |
| 13 |
add_query_arg([ |
| 14 |
'action' => 'kng_smart_links_export', |
| 15 |
], admin_url('admin-post.php')), |
| 16 |
'kng_smart_links_export' |
| 17 |
); |
| 18 |
?> |
| 19 |
|
| 20 |
<div class="ka-card"> |
| 21 |
<div class="ka-card-header"> |
| 22 |
<span class="dashicons dashicons-download green"></span> |
| 23 |
<h2><?php esc_html_e('Export Links', 'king-addons'); ?></h2> |
| 24 |
</div> |
| 25 |
<div class="ka-card-body"> |
| 26 |
<p><?php esc_html_e('Download all smart links as CSV.', 'king-addons'); ?></p> |
| 27 |
<a href="<?php echo esc_url($export_url); ?>" class="ka-btn ka-btn-primary"> |
| 28 |
<span class="dashicons dashicons-download"></span> |
| 29 |
<?php esc_html_e('Export CSV', 'king-addons'); ?> |
| 30 |
</a> |
| 31 |
</div> |
| 32 |
</div> |
| 33 |
|
| 34 |
<div class="ka-card"> |
| 35 |
<div class="ka-card-header"> |
| 36 |
<span class="dashicons dashicons-upload green"></span> |
| 37 |
<h2><?php esc_html_e('Import Links', 'king-addons'); ?></h2> |
| 38 |
</div> |
| 39 |
<div class="ka-card-body"> |
| 40 |
<p><?php esc_html_e('CSV columns: destination_url, slug (optional), title (optional), tags (optional).', 'king-addons'); ?></p> |
| 41 |
<form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>" enctype="multipart/form-data"> |
| 42 |
<input type="hidden" name="action" value="kng_smart_links_import"> |
| 43 |
<?php wp_nonce_field('kng_smart_links_import'); ?> |
| 44 |
<input type="file" name="import_file" accept=".csv" required> |
| 45 |
<button type="submit" class="ka-btn ka-btn-secondary ka-btn-sm" style="margin-left:12px;"> |
| 46 |
<?php esc_html_e('Import CSV', 'king-addons'); ?> |
| 47 |
</button> |
| 48 |
</form> |
| 49 |
</div> |
| 50 |
</div> |
| 51 |
|
| 52 |
<div class="ka-card ka-smart-links-pro-card"> |
| 53 |
<div class="ka-card-header"> |
| 54 |
<span class="dashicons dashicons-lock pink"></span> |
| 55 |
<h2><?php esc_html_e('JSON Export & API', 'king-addons'); ?></h2> |
| 56 |
<?php if (!$is_pro) : ?><span class="ka-pro-badge">PRO</span><?php endif; ?> |
| 57 |
</div> |
| 58 |
<div class="ka-card-body"> |
| 59 |
<p><?php esc_html_e('Export full settings, rules, and deep link templates as JSON. Create API keys for external integrations.', 'king-addons'); ?></p> |
| 60 |
</div> |
| 61 |
</div> |
| 62 |
|