/** * Users index method * * @return void */ public function index() { $this->prepareView('index.phtml', array('assets' => $this->project->getAssets(), 'acl' => $this->project->getService('acl'), 'phireNav' => $this->project->getService('phireNav'))); $this->view->set('title', $this->view->i18n->__('Users')); $user = new Model\User(array('acl' => $this->project->getService('acl'))); // If type id is set, get users by type if (null !== $this->request->getPath(1) && is_numeric($this->request->getPath(1))) { $user->getAll($this->request->getPath(1), $this->project->module('Phire'), $this->request->getQuery('sort'), $this->request->getQuery('page')); $this->view->set('typeId', $this->request->getPath(1))->set('table', $user->table)->set('searchBy', $user->searchBy)->set('searchFor', $user->searchFor)->set('title', $this->view->title . ' ' . $this->view->separator . ' ' . $user->title); // Else, list user types to choose from } else { $this->view->set('typeId', null)->set('types', $user->getUserTypes()); } $this->send(); }