Example #1
0
    return;
}
$this->template = 'pages/admin';
ob_start();
if (isset($_GET['id'])) {
    $id = isset($_GET['id']) ? $_GET['id'] : 0;
    $event = new Event($id);
    $album = new Album($event->albumId());
    // Create album for this event if it doesn't exist yet.
    if (!$album->id()) {
        $album->setSystem(true);
        $album->setTitle($event->title());
        $album->save();
        $event->setAlbumId($album->id());
        if ($event->id()) {
            $event->save();
        }
    }
    echo $event->form();
    if ($album->id()) {
        echo $album->form();
    }
} else {
    echo "<table>\n";
    echo "<thead>\n";
    echo "<tr>\n";
    echo "<td colspan=\"3\"><a href=\"?id=0\"><img src=\"/kiki/img/iconic/black/pen_alt_fill_16x16.png\" alt=\"New\"></a></td>\n";
    echo "<td colspan=\"2\">" . _("Create a new event") . "</td>\n";
    echo "</tr>\n";
    echo "<tr><th></th><th></th><th></th><th>Date</th><th>Title</th></tr>\n";
    echo "</thead>\n";