83 lines
2.0 KiB
PHP
83 lines
2.0 KiB
PHP
|
|
<?php
|
|
session_start();
|
|
ob_start();
|
|
|
|
$pfad = $_GET["pfad"] ?? "home";
|
|
|
|
/*
|
|
Controller für Aktionen werden vor der HTML-Ausgabe geladen,
|
|
damit Weiterleitungen mit header() funktionieren.
|
|
*/
|
|
if ($pfad === "login") {
|
|
include_once "php/controller/login-controller.php";
|
|
}
|
|
|
|
if ($pfad === "register") {
|
|
include_once "php/controller/register-controller.php";
|
|
}
|
|
|
|
if ($pfad === "logout") {
|
|
include_once "content/logout.php";
|
|
exit();
|
|
}
|
|
|
|
if ($pfad === "deleteAccount") {
|
|
include_once "content/deleteAccount.php";
|
|
exit();
|
|
}
|
|
?>
|
|
|
|
<!--
|
|
Seite: Index der Lernplattform
|
|
Funktion: Webseitengerüst, Anzeigen von Content
|
|
-->
|
|
<!DOCTYPE html>
|
|
<html lang="de">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="description" content="EduForge">
|
|
<meta name="author" content="Niklas Ortmann">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="icon" type="image/x-icon" href="images/logos/logo_icon.ico">
|
|
<link rel="stylesheet" href="css/main.css">
|
|
<link rel="stylesheet" href="css/navbar.css">
|
|
<link rel="stylesheet" href="css/footer.css">
|
|
<link rel="stylesheet" href="css/search-results.css">
|
|
<link rel="stylesheet" href="css/createArticle.css">
|
|
<link rel="stylesheet" href="css/profile.css">
|
|
<link rel="stylesheet" href="css/showArticle.css">
|
|
<link rel="stylesheet" href="css/message.css">
|
|
<title>EduForge</title>
|
|
</head>
|
|
|
|
|
|
<body>
|
|
<?php
|
|
include_once 'includes/navbar.php';
|
|
|
|
/*
|
|
Dynamischer Inhalt:
|
|
Je nach pfad-Parameter wird die passende Datei aus content geladen.
|
|
*/
|
|
if (isset($_GET["pfad"])) {
|
|
if (file_exists('content/' . $_GET["pfad"] . '.php')) {
|
|
include_once 'content/' . $_GET["pfad"] . '.php';
|
|
} else {
|
|
include_once 'content/404.php';
|
|
}
|
|
} else {
|
|
include_once 'content/home.php';
|
|
}
|
|
|
|
include_once 'includes/footer.php';
|
|
?>
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|
|
<?php
|
|
ob_end_flush();
|
|
?>
|