public function ajax_redirect_edit() { $this->check_ajax_referer('red-edit_' . intval($_POST['id'])); $redirect = Red_Item::get_by_id(intval($_POST['id'])); if ($redirect) { $json['html'] = $this->capture('item_edit', array('redirect' => $redirect, 'groups' => Red_Group::get_for_select())); } else { $json['error'] = __('Unable to perform action') . ' - could not find redirect'; } $this->output_ajax_response($json); }
<tr id="target"> <th align="right"><?php _e('Target URL', 'redirection'); ?> :</th> <td><input type="text" name="target" style="width: 95%"/></td> </tr> <tr> <th><?php _e('Group', 'redirection'); ?> :</th> <td> <select name="group_id"> <?php echo $this->select(Red_Group::get_for_select(), $group); ?> </select> </td> </tr> <tr> <th></th> <td> <input class="button-primary" type="submit" name="add" value="<?php esc_attr_e('Add Redirection', 'redirection'); ?> " id="submit"/> <?php if (isset($group)) { ?> <input type="hidden" name="group" value="<?php
"/> <span class="sub">(<?php _e('optional', 'redirection'); ?> )</span> </td> </tr> <tr class="advanced"> <th width="100"><?php _e('Group', 'redirection'); ?> :</th> <td> <select name="group_id"> <?php echo $this->select(Red_Group::get_for_select(), $redirect->get_group_id()); ?> </select> </td> </tr> <?php $redirect->match->show(); ?> <tr> <th></th> <td> <div class="table-actions"> <input class="button-primary" type="submit" name="save" value="<?php _e('Save', 'redirection');
<option value="delete"><?php _e('Delete'); ?></option> </select> <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="actionator" class="button-secondary action" /> <?php $pager->per_page ('redirection'); ?> <?php if (isset ($_GET['module'])) : ?> <?php _e ('Module', 'redirection'); ?>: <select name="module"> <?php echo $this->select (Red_Module::get_for_select (), intval ($_GET['module']))?> </select> <?php elseif (isset ($_GET['group'])) : ?> <?php _e ('Group', 'redirection'); ?>: <select name="group"> <?php echo $this->select (Red_Group::get_for_select (), intval ($_GET['group']))?> </select> <?php endif; ?> <input type="submit" value="<?php _e('Filter'); ?>" class="button-secondary" /> <br class="clear" /> </div> <div class="tablenav-pages"> <?php echo $pager->page_links (); ?> </div> </div> </form> <?php if (count ($logs) > 0) : ?>
function red_redirect_edit() { if (check_ajax_referer('redirection-items')) { $redirect = Red_Item::get_by_id(intval($_GET['id'])); if ($redirect) { $this->render_admin('item_edit', array('redirect' => $redirect, 'groups' => Red_Group::get_for_select())); } die; } }
function admin_redirects($group) { include dirname(__FILE__) . '/models/pager.php'; if ($group == 0) { $group = Red_Group::get_first_id(); } $pager = new RE_Pager($_GET, $_SERVER['REQUEST_URI'], 'position', 'ASC'); $items = Red_Item::get_by_group($group, $pager); $this->render_admin('item_list', array('items' => $items, 'pager' => $pager, 'group' => Red_Group::get($group), 'groups' => Red_Group::get_for_select(), 'date_format' => get_option('date_format'))); }
<th align="right"><?php _e('Target URL', 'redirection'); ?> :</th> <td><input type="text" name="target" style="width: 95%"/></td> </tr> <?php if (!isset($group)) { ?> <tr> <th><?php _e('Group', 'redirection'); ?> :</th> <td><select name="group"><?php echo $this->select(Red_Group::get_for_select(), isset($_GET['group']) ? intval($_GET['group']) : 0); ?> </select></td> </tr> <?php } ?> <tr> <th></th> <td> <input class="button-primary" type="submit" name="add" value="<?php esc_attr_e('Add Redirection', 'redirection'); ?> " id="submit"/> <?php if (isset($group)) {
<tr id="target"> <th align="right"><?php _e('Target URL', 'redirection'); ?> :</th> <td><input type="text" name="target" style="width: 95%"/></td> </tr> <tr> <th><?php _e('Group', 'redirection'); ?> :</th> <td> <select name="group_id"> <?php echo $this->select(Red_Group::get_for_select(), isset($group) ? intval($group) : ''); ?> </select> </td> </tr> <tr> <th></th> <td> <input class="button-primary" type="submit" name="add" value="<?php esc_attr_e('Add Redirection', 'redirection'); ?> " id="submit"/> <?php if (isset($group)) { ?> <input type="hidden" name="group" value="<?php
function admin_redirects($group) { include dirname(__FILE__) . '/models/pager.php'; if ($group == 0) { $group = Red_Group::get_first_id(); } $pager = new RE_Pager($_GET, admin_url(add_query_arg(array(), 'tools.php?page=redirection.php')), 'position', 'ASC'); $items = Red_Item::get_by_group($group, $pager); $this->render_admin('item_list', array('options' => $this->get_options(), 'items' => $items, 'pager' => $pager, 'group' => Red_Group::get($group), 'groups' => Red_Group::get_for_select(), 'date_format' => get_option('date_format'))); }
<strong><?php _e ('Action', 'redirection'); ?>:</strong> <select name="red_action" onchange="return change_add_redirect (this)"> <?php echo $this->select (Red_Item::actions (), 'url'); ?> </select> <label><?php _e ('Regular expression', 'redirection'); ?>: <input id="regex" type="checkbox" name="regex"/></label> </td> </tr> <tr id="target"> <th align="right"><?php _e ('Target URL', 'redirection') ?>:</th> <td><input type="text" name="target" style="width: 95%"/></td> </tr> <?php if (!isset($group)) : ?> <tr> <th><?php _e ('Group', 'redirection'); ?>:</th> <td><select name="group"><?php echo $this->select (Red_Group::get_for_select (), isset ($_GET['group']) ? intval ($_GET['group']) : 0)?></select></td> </tr> <?php endif; ?> <tr> <th></th> <td> <input class="button-primary" type="submit" name="add" value="<?php _e ('Add Redirection', 'redirection') ?>" id="submit"/> <?php if (isset($group)) : ?> <input type="hidden" name="group" value="<?php echo esc_attr( $group ) ?>"/> <?php endif; ?> <input type="hidden" name="action" value="red_redirect_add"/> <input type="hidden" name="_ajax_nonce" value="<?php echo wp_create_nonce( 'redirection-redirect_add' ); ?>"/> <div id="error"></div> </td>