Ejemplo n.º 1
0
    }
}
//check the user has permission to edit maptypes in general
$gBitSystem->verifyPermission('p_gmap_update');
//Preview mode is handled by javascript on the client side.
//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;
}