Esempio n. 1
0
$gContent = new BitGmap();
//Preview mode is handled by javascript on the client side.
//There is no callback to the server for previewing changes.
$format = 'xml';
$XMLContent = "";
$statusCode = 401;
if (!empty($_REQUEST["save_copyright"])) {
    $gBitUser->verifyTicket();
    if ($result = $gContent->storeCopyright($_REQUEST)) {
        $statusCode = 200;
        $gBitSmarty->assign_by_ref('copyrightInfo', $result);
    }
    //Check if this to remove from a set, or to delete completely
} elseif (!empty($_REQUEST["remove_copyright"])) {
    $gBitUser->verifyTicket();
    if ($gContent->removeCopyrightFromTilelayer($_REQUEST)) {
        $gBitSmarty->assign('removeSucces', true);
    } else {
        $XMLContent = tra("Sorry, there was an unknown error trying to remove the copyright.");
    }
} elseif (!empty($_REQUEST["expunge_copyright"])) {
    $gBitUser->verifyTicket();
    if ($gContent->expungeCopyright($_REQUEST)) {
        $statusCode = 200;
        $gBitSmarty->assign('expungeSucces', true);
    } else {
        $XMLContent = tra("Sorry, there was an unknown error trying to delete the copyright.");
    }
} else {
    if (isset($_REQUEST["copyright_id"])) {
        $copyright = $gContent->getCopyright($_REQUEST["copyright_id"]);