Exemplo n.º 1
0
 function admin_groups($module)
 {
     include dirname(__FILE__) . '/models/pager.php';
     if (isset($_POST['add']) && check_admin_referer('redirection-add_group')) {
         if (Red_Group::create(stripslashes_deep($_POST))) {
             $this->render_message(__('Your group was added successfully', 'redirection'));
             Red_Module::flush($module);
         } else {
             $this->render_error(__('Please specify a group name', 'redirection'));
         }
     }
     if ($module == 0) {
         $module = Red_Module::get_first_id();
     }
     $pager = new RE_Pager($_GET, $_SERVER['REQUEST_URI'], 'position', 'ASC');
     $items = Red_Group::get_all($module, $pager);
     $this->render_admin('group_list', array('groups' => $items, 'pager' => $pager, 'modules' => Red_Module::get_for_select(), 'module' => Red_Module::get($module)));
 }