public function editProcess($callbackId) { $vars =& PPostHandler::getVars($callbackId); if ($this->checkTripOwnership($vars['trip_id'])) { // Update the Tripdata $query = <<<SQL UPDATE `trip_data` SET `trip_name` = '{$this->dao->escape($vars['n'])}', `trip_descr` = '{$this->dao->escape($vars['d'])}', `edited` = NOW() WHERE `trip_id` = '{$this->dao->escape($vars['trip_id'])}' SQL; $this->dao->query($query); if (isset($vars['cg']) && $vars['cg']) { $Gallery = new GalleryModel(); $galleryId = $Gallery->createGallery($vars['n']); if (!$galleryId) { $vars['errors'][] = 'gallery_not_created'; } else { $this->assignGallery($vars['trip_id'], $galleryId); } } elseif (isset($vars['gallery']) && $vars['gallery']) { $this->assignGallery($vars['trip_id'], $vars['gallery']); } return PVars::getObj('env')->baseuri . 'trip/' . $vars['trip_id']; } }