Пример #1
0
 function execute($caveID, $caves)
 {
     // get model
     $model = new CaveBookmarks_Model($caveID, $caves);
     // init error
     $error = CAVEBOOKMARKS_NOERROR;
     // add CaveBookmark
     if (Request::getVar('name', '')) {
         $error = $model->addCaveBookmarkByName(Request::getVar('name', ''));
     } else {
         $error = $model->addCaveBookmarkByCoord(Request::getVar('xCoord', 0), Request::getVar('yCoord', 0));
     }
     // return Show Controller
     $controller = new CaveBookmarks_Controller_Show($error);
     return $controller->execute($caveID, $caves);
 }
Пример #2
0
 function execute($caveID, $caves)
 {
     global $params, $config;
     // get model
     $model = new CaveBookmarks_Model($caveID, $caves);
     // init error
     $error = CAVEBOOKMARKS_NOERROR;
     // add CaveBookmark
     if (isset($params->POST->name)) {
         $error = $model->addCaveBookmarkByName($params->POST->name);
     } else {
         $error = $model->addCaveBookmarkByCoord($params->POST->xCoord, $params->POST->yCoord);
     }
     // return Show Controller
     $controller = new CaveBookmarks_Controller_Show($error);
     return $controller->execute($caveID, $caves);
 }