示例#1
0
文件: index.php 项目: robkaper/kiki
use Kiki\Article;
use Kiki\Album;
$this->title = "Articles";
if (!$user->isAdmin()) {
    $this->template = 'pages/admin-required';
    return;
}
$this->template = 'pages/admin';
ob_start();
if (isset($_GET['id'])) {
    $id = isset($_GET['id']) ? $_GET['id'] : 0;
    $article = new Article($id);
    $album = new Album($article->albumId());
    // Create album for this article if it doesn't exist yet.
    if (!$album->id()) {
        $album->setSystem(true);
        $album->setTitle($article->title());
        $album->save();
        $article->setAlbumId($album->id());
        if ($article->id()) {
            $article->save();
        }
    }
    echo $article->form();
    if ($album->id()) {
        echo $album->form();
    }
} else {
    echo "<table>\n";
    echo "<thead>\n";
示例#2
0
文件: index.php 项目: robkaper/kiki
use Kiki\Event;
use Kiki\Album;
$this->title = _("Events");
if (!$user->isAdmin()) {
    $this->template = 'pages/admin-required';
    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";