예제 #1
0
//There is no callback to the server for previewing changes.
$format = 'xml';
if (!empty($_REQUEST["save_maptype"])) {
    $gBitUser->verifyTicket();
    if ($result = $gContent->storeMapType($_REQUEST)) {
        $gBitSmarty->assign_by_ref('maptypeInfo', $result);
    }
    //Check if this to remove from a set, or to delete completely
} elseif (!empty($_REQUEST["remove_maptype"])) {
    $gBitUser->verifyTicket();
    if ($gContent->removeMapTypeFromMap($_REQUEST)) {
        $gBitSmarty->assign('removeSucces', true);
    }
} elseif (!empty($_REQUEST["expunge_maptype"])) {
    $gBitUser->verifyTicket();
    if ($gContent->expungeMapType($_REQUEST)) {
        $gBitSmarty->assign('expungeSucces', true);
    }
} else {
    if (isset($_REQUEST["maptype_id"])) {
        $maptype = $gContent->getMapType($_REQUEST["maptype_id"]);
    }
    $gBitSmarty->assign_by_ref('maptypeInfo', $maptype);
    $gBitSystem->display('bitpackage:gmap/edit_maptype.tpl', NULL, array('format' => 'center_only', 'display_mode' => 'edit'));
    die;
}
if (count($gContent->mErrors) > 0) {
    $gBitThemes->setFormatHeader('center_only');
    $gBitSmarty->assign_by_ref('errors', $gContent->mErrors);
} else {
    $gBitSystem->display('bitpackage:gmap/edit_maptype_xml.tpl', null, array('format' => $format, 'display_mode' => 'edit'));