| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Adminimize |
| 4 |
* @subpackage Im/Export options |
| 5 |
* @author Frank Bültge |
| 6 |
*/ |
| 7 |
if ( ! function_exists( 'add_action' ) ) { |
| 8 |
echo "Hi there! I'm just a part of plugin, not much I can do when called directly."; |
| 9 |
exit; |
| 10 |
} |
| 11 |
?> |
| 12 |
<div id="poststuff" class="ui-sortable meta-box-sortables"> |
| 13 |
<div class="postbox"> |
| 14 |
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div> |
| 15 |
<h3 class="hndle" id="import"><?php esc_attr_e( 'Export/Import Options', 'adminimize' ) ?></h3> |
| 16 |
|
| 17 |
<div class="inside"> |
| 18 |
|
| 19 |
<h4><?php esc_attr_e( 'Export', 'adminimize' ) ?></h4> |
| 20 |
<p><?php esc_attr_e( |
| 21 |
'You can save a JSON formatted ".json" file with your settings.', 'adminimize' |
| 22 |
) ?></p> |
| 23 |
<form method="post"> |
| 24 |
<p><input type="hidden" name="_mw_adminimize_export" value="true" /></p> |
| 25 |
<p> |
| 26 |
<?php wp_nonce_field( 'mw_adminimize_export_nonce', 'mw_adminimize_export_nonce' ); ?> |
| 27 |
<?php |
| 28 |
$submit_text = esc_html__( 'Export »', 'adminimize' ); |
| 29 |
submit_button( $submit_text, 'primary', '_mw_adminimize_save', false ); ?> |
| 30 |
</p> |
| 31 |
</form> |
| 32 |
<br class="clear" /> |
| 33 |
|
| 34 |
<?php /* |
| 35 |
<form name="export_options" method="get" action=""> |
| 36 |
<p><?php esc_attr_e( |
| 37 |
'You can save a JSON formatted ".json" file with your settings.', 'adminimize' |
| 38 |
) ?></p> |
| 39 |
|
| 40 |
<p> |
| 41 |
<?php wp_nonce_field( 'mw_adminimize_export_nonce', 'mw_adminimize_export_nonce' ); ?> |
| 42 |
<input type="hidden" name="_mw_adminimize_export" value="true" /> |
| 43 |
<?php |
| 44 |
$submit_text = esc_html__( 'Export »', 'adminimize' ); |
| 45 |
submit_button( |
| 46 |
$text = $submit_text, $type = 'primary', $name = '_mw_adminimize_save', $wrap = FALSE, |
| 47 |
$other_attributes = NULL |
| 48 |
); |
| 49 |
?> |
| 50 |
</p> |
| 51 |
</form> |
| 52 |
*/ ?> |
| 53 |
<h4><?php esc_attr_e( 'Import', 'adminimize' ) ?></h4> |
| 54 |
<form name="import_options" enctype="multipart/form-data" method="post" action="?page=<?php echo esc_attr( |
| 55 |
$_GET[ 'page' ] |
| 56 |
); ?>"> |
| 57 |
<?php wp_nonce_field( 'mw_adminimize_nonce' ); ?> |
| 58 |
<p><?php _e( |
| 59 |
'Choose a Adminimize (<em>.json</em>) file to upload, then click <em>Upload file and import</em>.', |
| 60 |
'adminimize' |
| 61 |
); |
| 62 |
esc_html_e( 'After import please reload the page to display also all global values from WordPress.', 'adminimize' ); ?> |
| 63 |
</p> |
| 64 |
|
| 65 |
<p> |
| 66 |
<label for="datei_id"> |
| 67 |
<?php esc_html_e( |
| 68 |
'Choose a ".json" file from your computer:', 'adminimize' |
| 69 |
) ?> |
| 70 |
</label> |
| 71 |
<input name="import_file" id="datei_id" type="file" /> |
| 72 |
</p> |
| 73 |
|
| 74 |
<p> |
| 75 |
<?php wp_nonce_field( 'mw_adminimize_import_nonce', 'mw_adminimize_import_nonce' ); ?> |
| 76 |
<input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_import" /> |
| 77 |
<?php |
| 78 |
$submit_text = esc_html__( 'Upload file and import »', 'adminimize' ); |
| 79 |
submit_button( |
| 80 |
$text = $submit_text, $type = 'primary', $name = '_mw_adminimize_save', $wrap = FALSE, |
| 81 |
$other_attributes = NULL |
| 82 |
); |
| 83 |
?> |
| 84 |
</p> |
| 85 |
</form> |
| 86 |
|
| 87 |
<p> |
| 88 |
<a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"> |
| 89 |
<?php esc_html_e( |
| 90 |
'scroll to top', 'adminimize' |
| 91 |
); ?> |
| 92 |
</a><br class="clear" /> |
| 93 |
</p> |
| 94 |
|
| 95 |
</div> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
|
| 99 |
|