Exemple #1
0
    $templater->showWelcome($userHandler->getCurrentUser());
} else {
    $data = array('error' => 'Du bist nicht eingeloggt<br\\>', 'redirect' => 'kurse');
    $templater->loadTemplate('login.html')->data($data);
}
if (isset($_GET['coursenews'])) {
    header("Content-Type: text/plain; charset=utf-8");
    echo utf8_encode($courseHandler->generateCourseNews());
    exit;
}
if (isset($_GET['export'])) {
    $exporter = new Exporter($db);
    if ($_GET['export'] == "xml") {
        header("Content-Type: text/xml; charset=utf-8");
        header('Content-Disposition: filename="kurse.xml"');
        echo $exporter->exportCoursesToXML();
        exit;
    } else {
        header("Content-Type: text/javascript");
        header('Content-Disposition: filename="kurse.txt"');
        echo $exporter->exportCoursesToJSON();
        exit;
    }
}
if (isset($_GET['delete_course'])) {
    $courseHandler->deleteCourse((int) $_GET['delete_course']);
    if (!isset($_GET['ajax'])) {
        header("Location: kurse.php");
    }
    exit;
}