Exemplo n.º 1
0
 public function edit($id)
 {
     if (!($fnb = Fnb::findById($id))) {
         Flash::set('error', __('Menu not found!'));
         redirect(get_url('fnb'));
     }
     // check if trying to save
     if (get_request_method() == 'POST') {
         return $this->_edit($id);
     }
     $fnbgalleries = FnbImage::findByFnbId($id);
     $locations = Location::findByFnbId($id);
     $this->display('fnb/edit', array('action' => 'edit', 'csrf_token' => SecureToken::generateToken(BASE_URL . 'fnb/edit/' . $id), 'fnb' => $fnb, 'fnbgalleries' => $fnbgalleries, 'locations' => $locations, 'id' => $id, 'pages' => Record::findAllFrom('Page', 'parent_id=1 order by parent_id,position')));
 }