public function beforeFilter()
 {
     parent::beforeFilter();
     $pid = $this->request->params['pass'][0];
     $place = $this->checkPlaceValid($pid);
     $cUser = $this->getCUser();
     $this->set('pid', $pid);
     $this->set('cUser', $cUser);
     // set pagers
     $level2 = array('index');
     $level3 = array('add', 'view', 'copy');
     $level4 = array('images', 'edit', 'price');
     $papers = array();
     if (in_array($this->action, $level2)) {
         $papers = array(array('name' => 'Settings', 'link' => '/manager/places/dashboard/' . $pid));
     } else {
         if (in_array($this->action, $level3)) {
             $papers = array(array('name' => 'Settings', 'link' => '/manager/places/dashboard/' . $pid), array('name' => 'Menu', 'link' => '/manager/menu_items/index/' . $pid));
         } else {
             if (in_array($this->action, $level4)) {
                 $iid = $this->request->params['pass'][1];
                 $item = $this->MenuItem->findById($iid);
                 if (empty($item)) {
                     $this->redirect('/manager/menu_items/index/' . $pid);
                 }
                 $papers = array(array('name' => $place['Place']['name'], 'link' => '/manager/places/dashboard/' . $pid), array('name' => 'Menu', 'link' => '/manager/menu_items/index/' . $pid), array('name' => $item['MenuItem']['name'], 'link' => '/manager/menu_items/view/' . $pid . '/' . $iid));
             }
         }
     }
     $this->set('papers', $papers);
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
     // set pagers
     $level2 = array('add', 'edit');
     $papers = array();
     if (in_array($this->action, $level2)) {
         $papers = array(array('name' => 'Foods & Drinks', 'link' => '/manager/menu_items/index/'));
     }
     $this->set('papers', $papers);
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
     $cUser = $this->getCUser();
     $this->set('cUser', $cUser);
     // set pagers
     $level2 = array('avatar', 'edit', 'change_password');
     $papers = array();
     if (in_array($this->action, $level2)) {
         $papers = array(array('name' => 'Me', 'link' => '/manager/accounts/me'));
     }
     $this->set('papers', $papers);
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
     $cUser = $this->getCUser();
     $this->set('cUser', $cUser);
     // set pagers
     $level2 = array('pay', 'pay_thankyou', 'pay_success', 'pay_failed');
     $papers = array();
     if (in_array($this->action, $level2)) {
         $papers = array(array('name' => 'Plans & Upgrades', 'link' => '/manager/payments/index/'));
     }
     $this->set('papers', $papers);
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
     // set pagers
     $level2 = array('add', 'view');
     $level3 = array('images', 'edit', 'price');
     $papers = array();
     if (in_array($this->action, $level2)) {
         $papers = array(array('name' => 'Foods & Drinks', 'link' => '/manager/menu_items/index'));
     } else {
         if (in_array($this->action, $level3)) {
             $iid = $this->request->params['pass'][0];
             $this->MenuItem->contain();
             $item = $this->MenuItem->findById($iid);
             $papers = array(array('name' => 'Foods & Drinks', 'link' => '/manager/menu_items/index'), array('name' => $item['MenuItem']['name'], 'link' => '/manager/menu_items/view/' . $iid));
         }
     }
     $this->set('papers', $papers);
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
     $pid = $this->request->params['pass'][0];
     $place = $this->checkPlaceValid($pid);
     $cUser = $this->getCUser();
     $this->set('pid', $pid);
     $this->set('cUser', $cUser);
     // set pagers
     $level2 = array('index');
     $level3 = array('add', 'edit', 'delete', 'auto_add');
     $papers = array();
     if (in_array($this->action, $level2)) {
         $papers = array(array('name' => $place['Place']['name'] . ' - settings', 'link' => '/manager/places/dashboard/' . $pid));
     } else {
         if (in_array($this->action, $level3)) {
             $papers = array(array('name' => $place['Place']['name'] . ' - settings', 'link' => '/manager/places/dashboard/' . $pid), array('name' => 'Tables', 'link' => '/manager/tables/index/' . $pid));
         }
     }
     $this->set('papers', $papers);
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
     $cUser = $this->getCUser();
     $this->set('cUser', $cUser);
     if (!empty($this->params['pass'][0])) {
         $mid = $this->params['pass'][0];
     }
     // set pagers
     $level2 = array('add', 'view');
     $level3 = array('avatar', 'edit', 'reset_password', 'assign');
     $papers = array();
     if (in_array($this->action, $level2)) {
         $papers = array(array('name' => 'Members', 'link' => '/manager/user_members/'));
     } else {
         if (in_array($this->action, $level3)) {
             $papers = array(array('name' => 'Members', 'link' => '/manager/user_members/'));
             if (!empty($mid)) {
                 $papers[] = array('name' => 'Profile', 'link' => '/manager/user_members/view/' . $mid);
             }
         }
     }
     $this->set('papers', $papers);
 }
 public function beforeFilter()
 {
     parent::beforeFilter();
 }