diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-07-12 10:38:42 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-07-12 10:38:42 -0400 |
commit | bc98748c0d5b1e1c4d08f16b58db8aea9b5fb5ce (patch) | |
tree | b8eca28ff1546fe21f5d0ebb48f93e4b5988d92b /app/Controller/Base.php | |
parent | 7e94d0ca233d15d6124c0adf3f956a119c82ccae (diff) |
Start to implement url rewrite (nice urls)
Diffstat (limited to 'app/Controller/Base.php')
-rw-r--r-- | app/Controller/Base.php | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/app/Controller/Base.php b/app/Controller/Base.php index 9f5d6dc6..18187162 100644 --- a/app/Controller/Base.php +++ b/app/Controller/Base.php @@ -101,7 +101,7 @@ abstract class Base extends \Core\Base public function beforeAction($controller, $action) { // Start the session - $this->session->open(BASE_URL_DIRECTORY); + $this->session->open($this->helper->url->dir()); $this->sendHeaders($action); $this->container['dispatcher']->dispatch('session.bootstrap', new Event); @@ -223,17 +223,6 @@ abstract class Base extends \Core\Base } /** - * Redirection when there is no project in the database - * - * @access protected - */ - protected function redirectNoProject() - { - $this->session->flash(t('There is no active project, the first step is to create a new project.')); - $this->response->redirect('?controller=project&action=create'); - } - - /** * Common layout for task views * * @access protected @@ -301,7 +290,7 @@ abstract class Base extends \Core\Base if (empty($project)) { $this->session->flashError(t('Project not found.')); - $this->response->redirect('?controller=project'); + $this->response->redirect($this->helper->url->to('project', 'index')); } return $project; @@ -344,10 +333,10 @@ abstract class Base extends \Core\Base 'controller' => $controller, 'action' => $action, 'project_id' => $project['id'], - 'search' => $search, + 'search' => urldecode($search), ); - $this->userSession->setFilters($project['id'], $search); + $this->userSession->setFilters($project['id'], $filters['search']); return array( 'project' => $project, |