| 1 |
<?php if ( !defined( 'ABSPATH' ) ) die( 'No direct access allowed' ); ?> |
| 2 |
|
| 3 |
<div class="wrap" id="add" <?php if ( $hidden ) echo ' style="display: none"' ?>> |
| 4 |
<h2><?php _e( 'Add new redirection', 'redirection' ) ?></h2> |
| 5 |
|
| 6 |
<div class="red-added"> |
| 7 |
<p><?php _e( 'Your redirection has been added.', 'redirection' ); ?></p> |
| 8 |
</div> |
| 9 |
|
| 10 |
<form method="post" action="<?php echo admin_url( 'admin-ajax.php' ); ?>"> |
| 11 |
<table width="100%"> |
| 12 |
<tr> |
| 13 |
<th align="right" width="100"><?php _e( 'Source URL', 'redirection' ) ?>:</th> |
| 14 |
<td><input type="text" name="source" style="width: 95%" id="old"/></td> |
| 15 |
</tr> |
| 16 |
<tr> |
| 17 |
<th align="right"><?php _e( 'Match', 'redirection' ) ?>:</th> |
| 18 |
<td> |
| 19 |
<select name="match"> |
| 20 |
<?php echo $this->select( Red_Match::all() ); ?> |
| 21 |
</select> |
| 22 |
|
| 23 |
<strong><?php _e( 'Action', 'redirection' ); ?>:</strong> |
| 24 |
<select name="red_action"> |
| 25 |
<?php echo $this->select( Red_Item::actions(), 'url' ); ?> |
| 26 |
</select> |
| 27 |
|
| 28 |
<label><?php _e( 'Regular expression', 'redirection' ); ?>: <input id="regex" type="checkbox" name="regex"/></label> |
| 29 |
</td> |
| 30 |
</tr> |
| 31 |
<tr id="target"> |
| 32 |
<th align="right"><?php _e( 'Target URL', 'redirection' ) ?>:</th> |
| 33 |
<td><input type="text" name="target" style="width: 95%"/></td> |
| 34 |
</tr> |
| 35 |
<tr> |
| 36 |
<th><?php _e( 'Group', 'redirection' ); ?>:</th> |
| 37 |
<td> |
| 38 |
<select name="group_id"> |
| 39 |
<?php echo $this->select( Red_Group::get_for_select(), $group )?> |
| 40 |
</select> |
| 41 |
</td> |
| 42 |
</tr> |
| 43 |
<tr> |
| 44 |
<th></th> |
| 45 |
<td> |
| 46 |
<input class="button-primary" type="submit" name="add" value="<?php esc_attr_e( 'Add Redirection', 'redirection' ) ?>" id="submit"/> |
| 47 |
<?php if ( isset( $group ) ) : ?> |
| 48 |
<input type="hidden" name="group" value="<?php echo esc_attr( $group ) ?>"/> |
| 49 |
<?php endif; ?> |
| 50 |
|
| 51 |
<input type="hidden" name="action" value="red_redirect_add"/> |
| 52 |
<?php wp_nonce_field( 'redirection-redirect_add' ) ?> |
| 53 |
|
| 54 |
<div class="red-error"></div> |
| 55 |
</td> |
| 56 |
</tr> |
| 57 |
</table> |
| 58 |
</form> |
| 59 |
</div> |
| 60 |
|