/** Print index of pages on the website. */ function printPageIndex($id, $level) { global $dbi, $login; global $lPageIndex; // Fetch pages $result = $dbi->query("SELECT id FROM " . pageTableName . " WHERE parentId=" . $id . " ORDER BY parentId,position"); if ($result->rows()) { // Print page index for ($i = 0; list($id) = $result->fetchrow_array(); $i++) { $page = new Page($id); include scriptPath . "/" . folderPage . "/include/template/pageIndex.php"; if (!empty($_GET["parentId"])) { if ($page->isParent($_GET["parentId"])) { $page->printPageIndex($id, $level + 1); } } } } else { echo "<p><i>" . $lPageIndex["NoPages"] . "</i></p>"; } }
redirect(scriptUrl . "/" . folderPage . "/" . filePageIndex); } else { if (!empty($_GET["down"])) { $pageObject->movePageDown($pageObject->id); redirect(scriptUrl . "/" . folderPage . "/" . filePageIndex); } else { if (isset($_GET["visible"])) { $pageObject->setVisible($pageObject->id, $_GET["visible"]); redirect(scriptUrl . "/" . folderPage . "/" . filePageIndex); } } } } } // Create page object for parent $pageObject->init(!empty($_GET["parentId"]) ? $_GET["parentId"] : 0); // Add navigation links $site->addNavigationLink(scriptUrl . "/" . folderAdmin, $lAdminIndex["Header"]); $site->addNavigationLink(scriptUrl . "/" . folderPage, $lPageIndex["Header"]); // Print header $site->printHeader(); // Print page description echo "<p>" . $lPageIndex["HeaderText"] . "</p>"; // Include index template header include scriptPath . "/" . folderPage . "/include/template/pageIndexHeader.php"; // Print page index $pageObject->printPageIndex(0, 0); // Include index template footer include scriptPath . "/" . folderPage . "/include/template/pageIndexFooter.php"; // Print common footer $site->printFooter();