function admin_redirects($group_id)
 {
     if ($group_id == 0) {
         $group_id = Red_Group::get_first_id();
     }
     $group = Red_Group::get($group_id);
     if ($group === false) {
         $group = Red_Group::create(array('name' => 'Redirections', 'module_id' => 1));
     }
     $table = new Redirection_Table(Red_Group::get_for_select(), $group);
     $table->prepare_items();
     $this->render('item_list', array('options' => red_get_options(), 'group' => $group, 'table' => $table, 'date_format' => get_option('date_format')));
 }
Esempio n. 2
0
 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')));
 }
Esempio n. 3
0
 function admin_redirects($group_id)
 {
     if ($group_id == 0) {
         $group_id = Red_Group::get_first_id();
     }
     $group = Red_Group::get($group_id);
     if ($group === false) {
         $this->render_error(__('Invalid group ID', 'redirection'));
     } else {
         $table = new Redirection_Table(Red_Group::get_for_select(), $group);
         $table->prepare_items();
         $this->render_admin('item_list', array('options' => $this->get_options(), 'group' => $group, 'table' => $table, 'date_format' => get_option('date_format')));
     }
 }
 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')));
 }