/** * Continue to the new page. * * @return bool True if the action was performed. */ public function taskContinue() { if ($this->view == 'users') { $this->setRedirect("{$this->view}/{$this->post['username']}"); return true; } if ($this->view == 'groups') { $this->setRedirect("{$this->view}/{$this->post['groupname']}"); return true; } if ($this->view != 'pages') { return false; } $data = $this->post; $route = $data['route'] != '/' ? $data['route'] : ''; $folder = ltrim($data['folder'], '_'); if (!empty($data['modular'])) { $folder = '_' . $folder; } $path = $route . '/' . $folder; $this->admin->session()->{$path} = $data; // Store the name and route of a page, to be used prefilled defaults of the form in the future $this->admin->session()->lastPageName = $data['name']; $this->admin->session()->lastPageRoute = $data['route']; $this->setRedirect("{$this->view}/" . ltrim($path, '/')); return true; }
/** * Continue to the new page. * * @return bool True if the action was performed. */ public function taskContinue() { if ($this->view == 'users') { $this->setRedirect("{$this->view}/{$this->post['username']}"); return true; } if ($this->view != 'pages') { return false; } $data = $this->post; $route = $data['route'] != '/' ? $data['route'] : ''; $folder = ltrim($data['folder'], '_'); if (!empty($data['modular'])) { $folder = '_' . $folder; } $path = $route . '/' . $folder; $this->admin->session()->{$path} = $data; $this->setRedirect("{$this->view}/" . ltrim($path, '/')); return true; }