예제 #1
0
파일: controller.php 프로젝트: clee03/metal
 /**
  * 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;
 }
예제 #2
0
 /**
  * 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;
 }