Added interpreter for pseudocode for displaying exhibitions, events.

Added basic search.
Added object pages.
This commit is contained in:
2018-06-15 11:26:25 +02:00
committed by Stefan Rohde-Enslin
parent a49746ab10
commit 80485a98ab
19 changed files with 1573 additions and 82 deletions

66
object.php Normal file
View File

@@ -0,0 +1,66 @@
<?PHP
/**
* This file displays object detail pages as fetched from museum-digital.
*
* @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']) or !is_numeric($_GET['id'])) {
echo printErrorPage("Object does not exist.");
return;
}
// Ensure working environment for frontend.
ensureEnvironment();
$pages = loadPublicPages(); // Load overview of pages.
$contents = json_decode(queryCachePage($settings['mdVersion'] . "?t=objekt&oges=" . urlencode($_GET['id']) . "&output=json", "object", $settings), true);
if (!$contents || (isset($contents[0]) and $contents[0] == "There is no object with this ID yet.")) {
echo printErrorPage("Temporarily unavailable.");
return;
}
/*
* Output
*/
$addToHead = '
<link rel="canonical" href="' . $settings['mdVersion'] . 'index.php?t=objekt&oges=' . $contents['object_id'] . '" />';
echo printPublicHead($settings, $_GET['id'], $settings['pageTitle'] . " - " . $contents['object_name'], $settings['logo'], $addToHead);
echo printPublicHeader($settings['pageTitle']);
echo printStaticPagePart("banner", "header"); // Print aside (if need be)
echo generatePublicNav($pages);
echo '
<div id="mainWrapper">
';
// Print main content
echo '
<main>';
echo drawObjectDetails($contents, $settings);
echo '
</main>
';
echo printStaticPagePart("aside", "aside"); // Print aside (if need be)
echo '
</div>';
echo printStaticPagePart("footer", "footer"); // Print footer (if need be)
echo printPublicEnd();
?>