示例#1
0
文件: index.php 项目: tedwp/porpoise
            break;
        case "layer":
            $layerProperties = DML::getLayerProperties($_REQUEST["layerName"]);
            if (empty($layerProperties->layer)) {
                $layerProperties = new LayarResponse();
                $layerProperties->layer = $_REQUEST["layerName"];
                DML::saveLayerProperties($_REQUEST["layerName"], $layerProperties);
            }
            GUI::printMessage("%s", GUI::createLayerScreen($_REQUEST["layerName"]));
            break;
        case "poi":
            $poi = DML::getPOI($_REQUEST["layerName"], $_REQUEST["poiID"]);
            if (empty($poi)) {
                throw new Exception(sprintf("POI not found: %s:%s", $_REQUEST["layerName"], $_REQUEST["poiID"]));
            }
            GUI::printMessage("%s", GUI::createPOIScreen($_REQUEST["layerName"], $poi));
            break;
        case "newPOI":
            GUI::printMessage("%s", GUI::createNewPOIScreen($_REQUEST["layerName"]));
            break;
        case "migrate":
            GUI::printMessage("%s", GUI::createMigrationScreen());
            break;
        default:
            throw new Exception(sprintf("Invalid action: %s", $_action));
    }
} catch (Exception $e) {
    GUI::printError("%s", $e->getMessage());
    GUI::printMessage("%s", GUI::createMainScreen());
}
exit;