| 1 |
<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?> |
| 2 |
<div class="wrap"> |
| 3 |
<?php screen_icon(); ?> |
| 4 |
<?php $this->render_admin('annoy')?> |
| 5 |
|
| 6 |
<h2><?php _e ('Redirection Log', 'redirection'); ?></h2> |
| 7 |
|
| 8 |
<?php $this->render_admin( 'submenu' ); ?> |
| 9 |
|
| 10 |
<form method="get" action="<?php echo $this->url ($pager->url) ?>"> |
| 11 |
<input type="hidden" name="page" value="<?php echo esc_attr( $_GET['page'] ) ?>"/> |
| 12 |
<input type="hidden" name="curpage" value="<?php echo $pager->current_page () ?>"/> |
| 13 |
<input type="hidden" name="sub" value="<?php echo esc_attr( $_GET['sub'] ) ?>"/> |
| 14 |
|
| 15 |
<p class="search-box"> |
| 16 |
<label for="post-search-input" class="hidden"><?php _e ('Search', 'redirection') ?>:</label> |
| 17 |
|
| 18 |
<input type="text" class="search-input" name="search" value="<?php echo isset($_GET['search']) ? esc_attr( $_GET['search'] ) : ''?>"/> |
| 19 |
<?php if (isset ($_GET['search']) && $_GET['search'] != '') : ?> |
| 20 |
<input type="hidden" name="ss" value="<?php echo esc_attr( $_GET['search'] ) ?>"/> |
| 21 |
<?php endif;?> |
| 22 |
|
| 23 |
<input type="submit" class="button" value="<?php _e ('Search', 'redirection'); ?>"/> |
| 24 |
</p> |
| 25 |
|
| 26 |
<div id="pager" class="tablenav"> |
| 27 |
<div class="alignleft actions"> |
| 28 |
<select name="action2" id="action2_select"> |
| 29 |
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option> |
| 30 |
<option value="delete"><?php _e('Delete'); ?></option> |
| 31 |
</select> |
| 32 |
|
| 33 |
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="actionator" class="button-secondary action" /> |
| 34 |
|
| 35 |
<?php $pager->per_page ('redirection'); ?> |
| 36 |
|
| 37 |
<?php if (isset ($_GET['module'])) : ?> |
| 38 |
<?php _e ('Module', 'redirection'); ?>: |
| 39 |
<select name="module"> |
| 40 |
<?php echo $this->select (Red_Module::get_for_select (), intval ($_GET['module']))?> |
| 41 |
</select> |
| 42 |
<?php elseif (isset ($_GET['group'])) : ?> |
| 43 |
<?php _e ('Group', 'redirection'); ?>: |
| 44 |
<select name="group"> |
| 45 |
<?php echo $this->select (Red_Group::get_for_select (), intval ($_GET['group']))?> |
| 46 |
</select> |
| 47 |
<?php endif; ?> |
| 48 |
|
| 49 |
<input type="submit" value="<?php _e('Filter'); ?>" class="button-secondary" /> |
| 50 |
|
| 51 |
<br class="clear" /> |
| 52 |
</div> |
| 53 |
|
| 54 |
<div class="tablenav-pages"> |
| 55 |
<?php echo $pager->page_links (); ?> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
</form> |
| 59 |
|
| 60 |
<?php if (count ($logs) > 0) : ?> |
| 61 |
<table class="widefat post fixed" id="items" cellspacing="0" cellpadding="0"> |
| 62 |
<thead> |
| 63 |
<tr> |
| 64 |
<th width="16" id="cb" class="manage-column column-cb check-column"> |
| 65 |
<input type="checkbox" name="checkall" value=""/> |
| 66 |
</th> |
| 67 |
<th style="width:9em"<?php $pager->sortable_class ('created') ?>><?php echo $pager->sortable ('created', __ ('Date', 'redirection')) ?></th> |
| 68 |
<th><?php echo $pager->sortable ('url', __ ('Source URL', 'redirection')); ?></th> |
| 69 |
<th><?php echo $pager->sortable ('referrer', __ ('Referrer', 'redirection')); ?></th> |
| 70 |
<th style="width:9em" class="center<?php $pager->sortable_class ('ip', false) ?>"><?php echo $pager->sortable ('ip', __ ('IP', 'redirection')); ?></th> |
| 71 |
<th style="width:16px"></th> |
| 72 |
</tr> |
| 73 |
</thead> |
| 74 |
|
| 75 |
<tbody> |
| 76 |
<?php foreach ($logs AS $pos => $log) : ?> |
| 77 |
<tr id="item_<?php echo $log->id ?>" <?php if ($pos % 2 == 1) echo ' class="alt"' ?>> |
| 78 |
<?php $this->render_admin ('log_item', array ('log' => $log, 'pos' => $pos, 'lookup' => $lookup, 'pager' => $pager)); ?> |
| 79 |
</tr> |
| 80 |
<?php endforeach; ?> |
| 81 |
</tbody> |
| 82 |
</table> |
| 83 |
|
| 84 |
<?php else : ?> |
| 85 |
<p><?php _e ('There are no logs to display!', 'redirection'); ?></p> |
| 86 |
<?php endif; ?> |
| 87 |
|
| 88 |
<div style="clear: both"></div> |
| 89 |
</div> |
| 90 |
|
| 91 |
<?php $this->render_admin ('add', array ('hidden' => true))?> |
| 92 |
|
| 93 |
<div class="wrap"> |
| 94 |
<h2><?php _e ('Process Current Logs', 'redirection'); ?></h2> |
| 95 |
<p><?php _e ('These actions will affect all currently available logs (i.e. your search phrase will restrict the log items).', 'redirection'); ?></p> |
| 96 |
|
| 97 |
<form action="<?php echo $this->url ($_SERVER['REQUEST_URI']) ?>" method="post" accept-charset="utf-8"> |
| 98 |
<?php wp_nonce_field ('redirection-process_logs'); ?> |
| 99 |
|
| 100 |
<input class="button-primary" type="submit" name="deleteall" value="<?php _e ('Delete Logs', 'redirection'); ?>"/> |
| 101 |
</form> |
| 102 |
</div> |
| 103 |
|
| 104 |
<script type="text/javascript"> |
| 105 |
var redirection; |
| 106 |
|
| 107 |
jQuery(document).ready( function() { |
| 108 |
redirection = new Redirection( { |
| 109 |
progress: '<img src="<?php echo $this->url () ?>/images/progress.gif" alt="loading" width="50" height="16"/>', |
| 110 |
ajaxurl: '<?php echo admin_url( 'admin-ajax.php' ) ?>', |
| 111 |
nonce: '<?php echo wp_create_nonce( 'redirection-items' ); ?>', |
| 112 |
none_select: '<?php echo esc_js( __( 'No items have been selected', 'redirection' ) ); ?>', |
| 113 |
are_you_sure: '<?php echo esc_js( __( 'Are you sure?', 'redirection') ); ?>', |
| 114 |
}); |
| 115 |
redirection.logs(); |
| 116 |
}); |
| 117 |
</script> |
| 118 |
|