public function get_index() { $this->layout->header_data = array('title' => LL('cms::title.roles', CMSLANG)); $this->layout->top_data = array('search' => '/cms/role/search', 'q' => ''); //GET DATA $data = CmsRole::order_by('level', 'desc')->get(); $this->layout->content = View::make('cms::interface.pages.role_list')->with('data', $data); }
public function action_search_role() { $auth = Auth::check(); if ($auth and is_numeric(AUTHORID)) { //LOAD JS LIBS Asset::container('footer')->add('pages', 'bundles/cms/js/sections/roles_list.js', 'cms'); if (Input::has('q')) { $q = Input::get('q'); $this->layout->header_data = array('title' => $q); $this->layout->top_data = array('search' => '/cms/role/search', 'q' => $q); //GET PAGE DATA $data = CmsRole::where('name', 'LIKE', '%' . $q . '%')->or_where('level', 'LIKE', '%' . $q . '%')->order_by('name', 'asc')->order_by('level', 'asc')->get(); $this->layout->content = View::make('cms::interface.pages.role_list')->with('data', $data); } else { $this->layout->header_data = array('title' => LL('cms::title.roles', CMSLANG)); $this->layout->top_data = array('search' => '/cms/role/search', 'q' => ''); //GET ALL PAGE DATA $data = CmsRole::order_by('level', 'desc')->get(); $this->layout->content = View::make('cms::interface.pages.role_list')->with('data', $data); } } }