| 1 |
<?php if ( ! defined( 'ABSPATH' ) ) die( 'No direct access allowed' ); ?> |
| 2 |
|
| 3 |
<?php |
| 4 |
|
| 5 |
$expiry = array( |
| 6 |
-1 => __( 'No logs', 'redirection' ), |
| 7 |
1 => __( 'A day', 'redirection' ), |
| 8 |
7 => __( 'A week', 'redirection' ), |
| 9 |
30 => __( 'A month', 'redirection' ), |
| 10 |
60 => __( 'Two months', 'redirection' ), |
| 11 |
0 => __( 'Keep forever', 'redirection' ), |
| 12 |
); |
| 13 |
|
| 14 |
?> |
| 15 |
|
| 16 |
<div class="wrap"> |
| 17 |
<h2><?php _e( 'Options', 'redirection' ) ?></h2> |
| 18 |
<?php $this->render( 'submenu', array( 'options' => $options ) ); ?> |
| 19 |
|
| 20 |
<form method="post" action=""> |
| 21 |
<?php wp_nonce_field( 'redirection-update_options' ); ?> |
| 22 |
|
| 23 |
<table cellpadding="3" width="100%" class="form-table"> |
| 24 |
<tr> |
| 25 |
<th align="right"><?php _e( 'Plugin Support', 'redirection' ); ?>:</th> |
| 26 |
<td> |
| 27 |
<input type="checkbox" name="support" <?php echo checked( $options['support'] ) ?> id="support"/> |
| 28 |
<label for="support"><span class="sub"><?php _e( 'I\'m a nice person and I have helped support the author of this plugin', 'redirection' ); ?></span></label> |
| 29 |
</td> |
| 30 |
</tr> |
| 31 |
<tr> |
| 32 |
<th align="right"><?php _e( 'Redirect Logs', 'redirection' ); ?>:</th> |
| 33 |
<td> |
| 34 |
<select name="expire_redirect"> |
| 35 |
<?php echo $this->select( $expiry, intval( $options['expire_redirect'] ) ); ?> |
| 36 |
</select> |
| 37 |
|
| 38 |
<?php _e( '(time to keep logs for)', 'redirection' ); ?> |
| 39 |
</td> |
| 40 |
</tr> |
| 41 |
<tr> |
| 42 |
<th align="right"><?php _e( '404 Logs', 'redirection' ); ?>:</th> |
| 43 |
<td> |
| 44 |
<select name="expire_404"> |
| 45 |
<?php echo $this->select( $expiry, intval( $options['expire_404'] ) ); ?> |
| 46 |
</select> |
| 47 |
|
| 48 |
<?php _e( '(time to keep logs for)', 'redirection' ); ?> |
| 49 |
</td> |
| 50 |
</tr> |
| 51 |
<tr> |
| 52 |
<th><?php _e( 'Monitor changes to posts', 'redirection' ); ?>:</th> |
| 53 |
<td> |
| 54 |
<select name="monitor_post"> |
| 55 |
<option value="0"><?php _e( 'Don\'t monitor', 'redirection' ); ?></option> |
| 56 |
<?php echo $this->select( $groups, intval( $options['monitor_post'] ) );?> |
| 57 |
</select> |
| 58 |
</td> |
| 59 |
</tr> |
| 60 |
<tr> |
| 61 |
<th align="right"><?php _e( 'RSS Token', 'redirection' ); ?>:</th> |
| 62 |
<td> |
| 63 |
<input class="regular-text" size="5" type="text" name="token" value="<?php echo esc_attr( $options['token'] ) ?>"/><br/> |
| 64 |
<span class="sub"><?php _e( 'A unique token allowing feed readers access to Redirection log RSS (leave blank to auto-generate)', 'redirection' ); ?></span> |
| 65 |
</td> |
| 66 |
</tr> |
| 67 |
<tr> |
| 68 |
<th valign="top" align="right"><?php _e( 'Auto-generate URL', 'redirection' ) ?>:</th> |
| 69 |
<td> |
| 70 |
<input type="text" name="auto_target" style="width: 65%" value="<?php echo esc_attr( $options['auto_target'] ) ?>"/> |
| 71 |
<br/> |
| 72 |
<span class="sub"><?php _e( 'This will be used to auto-generate a URL if no URL is given. You can use the special tags <code>$dec$</code> or <code>$hex$</code> to have a unique ID inserted (either decimal or hex)', 'redirection' ); ?></span> |
| 73 |
</td> |
| 74 |
</tr> |
| 75 |
</table> |
| 76 |
|
| 77 |
<input class="button-primary" type="submit" name="update" value="<?php _e( 'Update', 'redirection' ) ?>"/> |
| 78 |
|
| 79 |
</form> |
| 80 |
</div> |
| 81 |
|
| 82 |
<div class="wrap"> |
| 83 |
<h2><?php _e( 'Import', 'redirection' ); ?></h2> |
| 84 |
|
| 85 |
<p><?php _e( 'Here you can import redirections from an existing <code>.htaccess</code> file, or a CSV file.', 'redirection' ); ?></p> |
| 86 |
|
| 87 |
<form action="" method="post" accept-charset="utf-8" enctype="multipart/form-data"> |
| 88 |
<?php wp_nonce_field( 'redirection-import' ); ?> |
| 89 |
|
| 90 |
<input type="file" name="upload" value=""/> |
| 91 |
|
| 92 |
<?php _e( 'Import into', 'redirection' ); ?>: <select name="group"> |
| 93 |
<?php echo $this->select( $groups );?> |
| 94 |
</select> |
| 95 |
<input class="button-primary" type="submit" name="import" value="<?php _e( 'Upload', 'redirection' ); ?>"/> |
| 96 |
</form> |
| 97 |
|
| 98 |
<h5>CSV Format</h5> |
| 99 |
<code> |
| 100 |
Source URL, Target URL, [Regex 0=false, 1=true], [HTTP Code] |
| 101 |
</code> |
| 102 |
</div> |
| 103 |
|
| 104 |
<div class="wrap"> |
| 105 |
<h2><?php _e( 'Delete Redirection', 'redirection' ); ?></h2> |
| 106 |
<p><?php _e( 'Selecting this option will delete all redirections, all logs, and any options associated with the Redirection plugin. Make sure this is what you want to do.', 'redirection' ); ?></p> |
| 107 |
|
| 108 |
<form action="" method="post" accept-charset="utf-8"> |
| 109 |
<?php wp_nonce_field( 'redirection-delete_plugin' ); ?> |
| 110 |
|
| 111 |
<input class="button-primary" type="submit" name="delete" value="<?php _e( 'Delete', 'redirection' ) ?>" onclick="return confirm( '<?php esc_attr_e( "Are you sure you want to delete everything?" );?>')"/> |
| 112 |
</form> |
| 113 |
</div> |
| 114 |
|