}
if (isset($_REQUEST["delete"]) and $_REQUEST["delete"] and isset($_REQUEST["calitemId"]) and $tiki_p_change_events == 'y') {
    // There is no check for valid antibot code if anonymous allowed to delete events since this comes from a JS button at the tpl and bots are not know to use JS
    $access->check_authenticity();
    $calitem = $calendarlib->get_item($_REQUEST['calitemId']);
    $calendarlib->drop_item($user, $_REQUEST["calitemId"]);
    if (empty($user)) {
        $logslib->add_log('calendar', 'Calendar item ' . $_REQUEST['calitemId'] . ' deleted');
    }
    $_REQUEST["calitemId"] = 0;
    header('Location: tiki-calendar.php?todate=' . $calitem['start']);
    exit;
} elseif (isset($_REQUEST["delete"]) and $_REQUEST["delete"] and isset($_REQUEST["recurrenceId"]) and $tiki_p_change_events == 'y') {
    // There is no check for valid antibot code if anonymous allowed to delete events since this comes from a JS button at the tpl and bots are not know to use JS
    $calRec = new CalRecurrence($_REQUEST['recurrenceId']);
    $calRec->delete();
    if (empty($user)) {
        $logslib->add_log('calendar', 'Recurrent calendar items (recurrenceId = ' . $_REQUEST["recurrenceId"] . ') deleted');
    }
    $_REQUEST["recurrenceTypeId"] = 0;
    $_REQUEST["calitemId"] = 0;
    header('Location: tiki-calendar.php');
    die;
} elseif (isset($_REQUEST['drop']) and $tiki_p_change_events == 'y') {
    check_ticket('calendar');
    if (is_array($_REQUEST['drop'])) {
        foreach ($_REQUEST['drop'] as $dropme) {
            $calendarlib->drop_item($user, $dropme);
        }
    } else {
        $calendarlib->drop_item($user, $_REQUEST['drop']);