示例#1
0
文件: role.php 项目: neosin/tinyissue
 public static function dropdown()
 {
     $roles = array();
     foreach (Role::order_by('name', 'asc')->get() as $role) {
         $roles[$role->id] = $role->name;
     }
     return $roles;
 }
示例#2
0
 public function get_index()
 {
     $this->data[$this->views] = Role::order_by('id', 'asc')->get();
     return View::make('themes.modul.' . $this->views . '.index', $this->data);
 }
示例#3
0
 public function get_index()
 {
     //        $this->data[$this->views] = Role::order_by('id', 'asc')->get();
     $this->data[$this->views] = Role::order_by('id', 'asc')->paginate(PER_PAGE_MEDIUM);
     return View::make('admin.' . $this->views . '.index', $this->data);
 }
示例#4
0
 public function get_index()
 {
     return $this->layout->with('active', 'dashboard')->nest('content', 'administration.users.index', array('roles' => Role::order_by('id', 'DESC')->get()));
 }
示例#5
0
 /**
  * Displays list of roles
  *
  * @return str
  */
 public function get_index()
 {
     $roles = Role::order_by('id', 'asc')->get();
     return View::make('gotin::roles', array('roles' => $roles, 'flash' => $this->flash, 'active' => 'roles', 'b_links' => array("Roles")));
 }
示例#6
0
 function roles()
 {
     $role = new Role();
     $total_rows = $role->count();
     switch ($this->input->get('c')) {
         case "1":
             $data['col'] = "role_name";
             break;
         case "2":
             $data['col'] = "role_id";
             break;
         default:
             $data['col'] = "role_id";
     }
     if ($this->input->get('d') == "1") {
         $data['dir'] = "DESC";
     } else {
         $data['dir'] = "ASC";
     }
     $data['title'] = "Roles";
     $data['btn_add'] = anchor('users/add_role', 'Add New', "class='btn btn-primary'");
     $data['btn_home'] = anchor(base_url(), 'Home', "class='btn btn-home'");
     $uri_segment = 3;
     $offset = $this->uri->segment($uri_segment);
     $role->order_by($data['col'], $data['dir']);
     $data['role_list'] = $role->get($this->limit, $offset)->all;
     $config['base_url'] = site_url("users/roles");
     $config['total_rows'] = $total_rows;
     $config['per_page'] = $this->limit;
     $config['uri_segment'] = $uri_segment;
     $this->pagination->initialize($config);
     $data['pagination'] = $this->pagination->create_links();
     $this->load->view('users/index_roles', $data);
 }