| 1 |
<?php if ( !defined( 'ABSPATH' ) ) die( 'No direct access allowed' ); ?> |
| 2 |
<div class="wrap"> |
| 3 |
<?php screen_icon(); ?> |
| 4 |
|
| 5 |
<h2><?php _e( 'Groups', 'redirection' ); ?></a></h2> |
| 6 |
|
| 7 |
<?php $this->render( 'submenu', array( 'options' => $options ) ); ?> |
| 8 |
|
| 9 |
<form action="tools.php"> |
| 10 |
<input type="hidden" name="page" value="redirection.php"/> |
| 11 |
<input type="hidden" name="sub" value="groups"/> |
| 12 |
|
| 13 |
<?php $table->search_box( __( 'Search' ), 'search_id' ); ?> |
| 14 |
</form> |
| 15 |
|
| 16 |
<form method="POST" action=""> |
| 17 |
<?php $table->display(); ?> |
| 18 |
</form> |
| 19 |
</div> |
| 20 |
|
| 21 |
<div class="wrap"> |
| 22 |
<h2><?php _e( 'Add Group', 'redirection' ); ?></h2> |
| 23 |
|
| 24 |
<p><?php _e( 'Use groups to organise your redirects. Groups are assigned to a module, which affects how the redirects in that group work. If you are unsure then stick to the WordPress module.', 'redirection' ); ?></p> |
| 25 |
|
| 26 |
<form action="" method="post" accept-charset="utf-8"> |
| 27 |
<?php wp_nonce_field( 'redirection-add_group' ); ?> |
| 28 |
<table class="form-table"> |
| 29 |
<tr> |
| 30 |
<th style="width: 50px"><?php _e( 'Name', 'redirection' ); ?>:</th> |
| 31 |
<td> |
| 32 |
<input size="30" class="regular-text" type="text" name="name" value=""/> |
| 33 |
|
| 34 |
<select name="module_id"> |
| 35 |
<?php foreach ( Red_Module::get_for_select() AS $module ) : ?> |
| 36 |
<option value="<?php echo esc_attr( $module->get_id() ); ?>"><?php echo esc_html( $module->get_name() ); ?></option> |
| 37 |
<?php endforeach; ?> |
| 38 |
</select> |
| 39 |
</td> |
| 40 |
</tr> |
| 41 |
<tr> |
| 42 |
<th style="width: 50px"></th> |
| 43 |
<td> |
| 44 |
<input class="button-primary" type="submit" name="add" value="<?php esc_attr_e( 'Add', 'redirection' ); ?>"/> |
| 45 |
</td> |
| 46 |
</tr> |
| 47 |
</table> |
| 48 |
</form> |
| 49 |
</div> |
| 50 |
|
| 51 |
<script type="text/javascript"> |
| 52 |
( function( $ ) { |
| 53 |
$( document ).ready( function() { |
| 54 |
var items = new Redirection_Items( $ ); |
| 55 |
var adder = new Redirection_Add( $, '#target', true ); |
| 56 |
|
| 57 |
adder.setup( 'select[name=red_action]', '#add' ); |
| 58 |
items.setup( 'table.items' ); |
| 59 |
} ); |
| 60 |
} )( jQuery ); |
| 61 |
</script> |
| 62 |
|