public function beforeFilter() { parent::beforeFilter(); $pid = $this->request->params['pass'][0]; $place = $this->checkPlaceValid($pid); if (!empty($this->request->params['pass'][1])) { $tid = $this->request->params['pass'][1]; $table = $this->checkTableValid($pid, $tid); } $cUser = $this->getCUser(); $this->cPlace = $place; $this->set('pid', $pid); $this->set('cUser', $cUser); // set pagers $level2 = array('view'); $level3 = array('merge', 'move'); $papers = array(); if (in_array($this->action, $level2)) { $papers = array(array('name' => $place['Place']['name'], 'link' => '/order/tables/index/' . $pid)); } else { if (in_array($this->action, $level3)) { $papers = array(array('name' => $place['Place']['name'], 'link' => '/order/tables/index/' . $pid)); if (!empty($table)) { $papers[] = array('name' => $table['Table']['name'], 'link' => '/order/tables/view/' . $pid . '/' . $tid); } } } $this->set('papers', $papers); }
public function beforeFilter() { parent::beforeFilter(); $pid = $this->request->params['pass'][0]; $place = $this->checkPlaceValid($pid); $cUser = $this->getCUser(); $this->cPlace = $place; $this->set('pid', $pid); // set pagers $level2 = array('index'); $level3 = array('add', 'edit', 'assign'); $papers = array(); if (in_array($this->action, $level2)) { $papers = array(array('name' => $place['Place']['name'], 'link' => '/order/tables/index/' . $pid)); } else { if (in_array($this->action, $level3)) { $papers = array(array('name' => $place['Place']['name'], 'link' => '/order/tables/index/' . $pid), array('name' => 'Reserve', 'link' => '/order/reserves/index/' . $pid)); } } $this->set('papers', $papers); }
public function beforeFilter() { parent::beforeFilter(); }