Added interpreter for pseudocode for displaying exhibitions, events.
Added basic search. Added object pages.
This commit is contained in:
37
index.php
37
index.php
@ -5,6 +5,10 @@
|
||||
* @author Joshua Ramon Enslin <joshua@jrenslin.de>
|
||||
*/
|
||||
|
||||
// Include functions and settings.
|
||||
|
||||
require_once __DIR__ . "/inc/functions.php";
|
||||
|
||||
// Check validity of request.
|
||||
|
||||
if (isset($_GET['id']) and !file_exists(__DIR__ . "/data/static/" . $_GET['id'] . ".json")) {
|
||||
@ -12,10 +16,6 @@ if (isset($_GET['id']) and !file_exists(__DIR__ . "/data/static/" . $_GET['id']
|
||||
return;
|
||||
}
|
||||
|
||||
// Include functions and settings.
|
||||
|
||||
require __DIR__ . "/inc/functions.php";
|
||||
|
||||
// Ensure working environment for frontend.
|
||||
|
||||
ensureEnvironment();
|
||||
@ -25,8 +25,6 @@ $pages = loadPublicPages(); // Load overview of pages.
|
||||
* Load data.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* @var array $tPage The variable contains the main data on the displayed page.
|
||||
*/
|
||||
@ -53,32 +51,11 @@ if (!$tPage['public']) {
|
||||
* Output
|
||||
*/
|
||||
|
||||
echo printPublicHead($id, $settings['pageTitle'], $settings['logo']);
|
||||
echo printPublicHead($settings, $id, $settings['pageTitle'], $settings['logo']);
|
||||
echo printPublicHeader($settings['pageTitle']);
|
||||
echo printStaticPagePart("banner", "header"); // Print aside (if need be)
|
||||
|
||||
echo '<nav>';
|
||||
echo buildPageOrder(
|
||||
$pages,
|
||||
function() {
|
||||
return "<ul>";
|
||||
},
|
||||
function() {
|
||||
return "</ul>";
|
||||
},
|
||||
function($inputs, string $toAdd) {
|
||||
$output = "
|
||||
<li";
|
||||
if (!$inputs['public']) $output .= " class='notPublic'";
|
||||
$output .= ">
|
||||
<a href='./?id=" . $inputs['id'] . "'>" . $inputs['title'] . "</a>
|
||||
$toAdd
|
||||
</li>
|
||||
";
|
||||
return $output;
|
||||
}
|
||||
);
|
||||
echo '</nav>';
|
||||
echo generatePublicNav($pages);
|
||||
|
||||
echo '
|
||||
<div id="mainWrapper">
|
||||
@ -89,7 +66,7 @@ echo '
|
||||
<main>';
|
||||
|
||||
echo '<h1>' . $tPage['title'] . '</h1>';
|
||||
echo checkForEmbeds($tPage['content']);
|
||||
echo checkForEmbeds($tPage['content'], $settings);
|
||||
|
||||
echo '
|
||||
</main>
|
||||
|
Reference in New Issue
Block a user