Example #1
0
<?php

// Include common functions and declarations
require_once "../../include/common.php";
// Create page object
$pageObject = new Page(getGetValue("pageId"));
// Determine if user has permission to edit page
if (!$pageObject->hasEditPermission()) {
    $login->printLoginForm();
    exit;
}
// Delete page
if (!empty($_POST["deletePage"])) {
    // Delete page
    $pageObject->deletePage($pageObject->id);
    // Redirect to page index
    redirect(scriptUrl . "/" . folderPage . "/" . filePageIndex);
} else {
    if (!empty($_GET["save"])) {
        $errors = $pageObject->savePage();
        // Redirect to page index if referer is empty
        if (!$errors->hasErrors()) {
            $referer = getPostValue("referer");
            redirect(!empty($referer) ? $referer : $pageObject->getPageLink());
        }
    }
}
// Add navigation links
$site->addNavigationLink(scriptUrl . "/" . folderAdmin, $lAdminIndex["Header"]);
$site->addNavigationLink(scriptUrl . "/" . folderPage, $lPageIndex["Header"]);
if (!empty($pageObject->id)) {
Example #2
0
// Comments
$comment = new Comment();
if ($login->isAdmin()) {
    $site->registerAdminIndexSection($lAdminIndex["Comments"], $lAdminIndex["CommentsText"], scriptUrl . "/" . folderComment, iconUrl . "/comments.jpg");
}
// Categories
if ($category->hasEditPermission()) {
    $site->registerAdminIndexSection($lAdminIndex["Categories"], $lAdminIndex["CategoriesText"], scriptUrl . "/" . folderCategory, iconUrl . "/log.jpg");
}
// Files
if ($login->isAdmin()) {
    $site->registerAdminIndexSection($lAdminIndex["SharedFiles"], $lAdminIndex["SharedFilesText"], scriptUrl . "/" . folderFilesAdmin, iconUrl . "/files.jpg");
}
// Pages
$page = new Page();
if ($page->hasEditPermission()) {
    $site->registerAdminIndexSection($lAdminIndex["Pages"], $lAdminIndex["PagesText"], scriptUrl . "/" . folderPage, iconUrl . "/pages.jpg");
}
// Sort by name
sort($site->adminIndexSections);
if (sizeof($site->adminIndexSections) != 0) {
    // Print subsection header
    $site->printSubsectionHeader($lAdminIndex["Content"], "", 1, 1, "adminContent");
    echo '<div id="adminContent">';
    foreach ($site->adminIndexSections as $content) {
        $site->printSectionItem($content["title"], $content["image"], $content["url"], 0, $content["description"]);
    }
    echo "</div>";
}
// Create admin settings array
$adminSettings = array();