From 5a0d4f4a00c9162fbf773ca6b73d34354c6650fe Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 1 Feb 2025 09:54:32 +0200 Subject: feat(archive): Include topbar dynamically So now changes to views/archive/topbar.php and views/archive/topbar.css will "propagate" to all archives, no matter when they were made --- controllers/archive.php | 18 ++++++++---------- views/archive/topbar.php | 13 +++++-------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/controllers/archive.php b/controllers/archive.php index c1ff4a2..9b8ac16 100644 --- a/controllers/archive.php +++ b/controllers/archive.php @@ -354,13 +354,6 @@ class DownloadPage { } } - function getArchiveTop() : array { - return array( - file_get_contents(__DIR__ . '/../views/archive/topbar.php'), - file_get_contents(__DIR__ . '/../views/archive/topbar.css') - ); - } - function createArchive($simular_pages) : void { // Creates the folder with the correct resources and the main html page in a index.html tag $dom = new DOMDocument(); @@ -382,12 +375,17 @@ class DownloadPage { $this->changeHyperlinkToLocal($dom, 'a', 'href'); // Add the header for the archives - list($archive_top, $archive_top_style) = $this->getArchiveTop(); - $phpTag = $dom->createElement('script', $archive_top); + $phpTag = $dom->createElement('script', ' + + + - RequesterUID); + $requester = Database\User::fromDBuid($currentPage->RequesterUID); - $previousPageId = Database\Webpage::getPreviousPageId($currentPage->URL, $currentPage->Date); - $nextPageId = Database\Webpage::getNextPageId($currentPage->URL, $currentPage->Date); + $previousPageId = $currentPage->previousPageId(); + $nextPageId = $currentPage->nextPageId(); ?>