Beispiel #1
0
    EC_send_headers();
    $calendar = new EC_Calendar();
    $calendar->displayWidget($_GET['EC_year'], $_GET['EC_month']);
    exit;
}
// called from the large clendar through ajax. we need to send a header to
// make sure we respect the blog charset.
if (isset($_GET['EC_action']) && $_GET['EC_action'] == 'switchMonthLarge') {
    EC_send_headers();
    $calendar = new EC_Calendar();
    $calendar->displayLarge($_GET['EC_year'], $_GET['EC_month']);
    exit;
}
if (isset($_GET['EC_action']) && $_GET['EC_action'] == 'ajaxDelete') {
    $db = new EC_DB();
    $db->deleteEvent($_GET['EC_id']);
    exit;
}
/**
 * sends headers needed when ajax i used.
 */
function EC_send_headers()
{
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Pragma: no-cache");
    // HTTP/1.0
    header("Content-Type: text/html; charset=" . get_option('blog_charset'));