Пример #1
0
<?php

include_once "models/Blog_Entry_Table.class.php";
$entryTable = new Blog_Entry_Table($db);
$isEntryClicked = isset($_GET['id']);
if ($isEntryClicked) {
    $entryId = $_GET['id'];
    $entryData = $entryTable->getEntry($entryId);
    $blogOutput = (include_once "views/entry-html.php");
    $blogOutput .= (include_once "controllers/comments.php");
} else {
    $entries = $entryTable->getAllEntries();
    $blogOutput = (include_once "views/list-entries-html.php");
}
//$entries = $entryTable->getAllEntries();
//$blogOutput = include_once "views/list-entries-html.php";
return $blogOutput;
Пример #2
0
    } else {
        if ($updateEntry) {
            $entryTable->updateEntry($id, $title, $entry);
            $saveEntryId = $id;
            //
        } else {
            if ($deleteEntry) {
                $entryTable->deleteEntry($id);
            }
        }
    }
}
/*
**	Admin Post links list - a link is clicked 
**  to edit an existing post.  
*/
$entryRequested = isset($_GET['id']);
if ($entryRequested) {
    $id = $_GET['id'];
    $entryData = $entryTable->getEntry($id);
    $entryData->entry_id = $id;
    $entryData->message = "";
}
$entrySaved = isset($saveEntryId);
if ($entrySaved) {
    $entryData = $entryTable->getEntry($saveEntryId);
    $entryData->message = "Entry was saved";
}
//load relevant view
$editorOutput = (include_once "views/admin/editor-html.php");
return $editorOutput;