2023-02-27 07:34:39 +00:00
|
|
|
<?php
|
2023-02-27 08:11:24 +00:00
|
|
|
|
2023-04-13 16:44:38 +00:00
|
|
|
require __DIR__ . '/vendor/autoload.php';
|
2023-04-17 14:45:44 +00:00
|
|
|
require __DIR__ . '/php/util.php';
|
2023-02-27 07:34:39 +00:00
|
|
|
|
2023-04-13 16:44:38 +00:00
|
|
|
use Twig\Environment;
|
|
|
|
use Twig\Loader\FilesystemLoader;
|
|
|
|
|
2023-04-17 14:45:44 +00:00
|
|
|
$util = new Util();
|
|
|
|
|
2023-04-13 16:44:38 +00:00
|
|
|
$pageloader = new FilesystemLoader(__DIR__ . '/pages');
|
|
|
|
$templateloader = new FilesystemLoader(__DIR__ . '/templates');
|
2023-04-17 14:45:44 +00:00
|
|
|
|
2023-04-13 16:44:38 +00:00
|
|
|
$twig_pages = new Environment($pageloader);
|
|
|
|
$twig_templates = new Environment($templateloader);
|
|
|
|
|
|
|
|
$title = '';
|
|
|
|
$content = '';
|
2023-04-17 14:45:44 +00:00
|
|
|
$head = '';
|
2023-04-13 16:44:38 +00:00
|
|
|
|
|
|
|
$topictreff = $twig_templates->render('topictreff.html.twig');
|
|
|
|
$nextevents = $twig_templates->render('nextevents.html.twig');
|
|
|
|
|
2023-04-17 14:45:44 +00:00
|
|
|
$raumstatus_b = $util->raumstatus();
|
|
|
|
$raumstatus = '<b>unbekannt</b>';
|
|
|
|
|
|
|
|
|
|
|
|
if(gettype($raumstatus_b) == "boolean") {
|
|
|
|
if($raumstatus_b)
|
|
|
|
$raumstatus = '<b class="green-text">offen</b>';
|
|
|
|
else
|
|
|
|
$raumstatus = '<b class="red-text">geschlossen</b>';
|
|
|
|
}
|
2023-04-13 16:44:38 +00:00
|
|
|
|
|
|
|
if(isset($_GET['page'])) {
|
|
|
|
$page = $_GET['page'];
|
2023-04-17 14:45:44 +00:00
|
|
|
$title = $page;
|
2023-04-13 16:44:38 +00:00
|
|
|
switch ($page) {
|
|
|
|
case 'index':
|
2023-04-17 14:45:44 +00:00
|
|
|
$content = $twig_pages->render('index.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css').$util->css_link('css/home.css').$util->css_link('css/events.css');
|
|
|
|
break;
|
|
|
|
case 'about':
|
|
|
|
$content = $twig_pages->render('about.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css').$util->css_link('css/about.css');
|
|
|
|
break;
|
|
|
|
case 'treff':
|
|
|
|
$content = $twig_pages->render('treff.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css');
|
|
|
|
break;
|
|
|
|
case 'events':
|
|
|
|
$content = $twig_pages->render('events.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css').$util->css_link('css/events.css');
|
|
|
|
break;
|
|
|
|
case 'kontakt':
|
|
|
|
$content = $twig_pages->render('kontakt.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css').$util->css_link('css/kontakt.css');
|
|
|
|
break;
|
|
|
|
case 'adresse':
|
|
|
|
$content = $twig_pages->render('kontakt/adresse.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css');
|
|
|
|
break;
|
|
|
|
case 'irc':
|
|
|
|
$content = $twig_pages->render('kontakt/irc.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css');
|
|
|
|
break;
|
|
|
|
case 'mail':
|
|
|
|
$content = $twig_pages->render('kontakt/mail.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css');
|
|
|
|
break;
|
|
|
|
case 'tel':
|
|
|
|
$content = $twig_pages->render('kontakt/tel.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css');
|
|
|
|
break;
|
|
|
|
case 'support':
|
|
|
|
$content = $twig_pages->render('support.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css');
|
|
|
|
break;
|
|
|
|
case 'verein':
|
|
|
|
$content = $twig_pages->render('verein.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css');
|
|
|
|
break;
|
|
|
|
case 'impressum':
|
|
|
|
$content = $twig_pages->render('impressum.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css');
|
|
|
|
break;
|
|
|
|
case 'datenschutz':
|
|
|
|
$content = $twig_pages->render('datenschutz.html.twig');
|
|
|
|
$head = $util->css_link('css/main.css');
|
2023-04-13 16:44:38 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$content = $twig_pages->render('404.html.twig', ['page' => $_GET['page']]);
|
|
|
|
break;
|
2023-02-27 07:34:39 +00:00
|
|
|
}
|
2023-04-13 16:44:38 +00:00
|
|
|
} else {
|
|
|
|
$title = 'index';
|
2023-04-17 14:45:44 +00:00
|
|
|
$content = $twig_pages->render('index.html.twig');
|
2023-04-13 16:44:38 +00:00
|
|
|
}
|
|
|
|
|
2023-04-17 14:45:44 +00:00
|
|
|
echo $twig_templates->render('html5struct.html.twig', ['title' => $title, 'head' => $head, 'raumstatus' => $raumstatus, 'main' => $content]);
|
2023-04-13 16:44:38 +00:00
|
|
|
?>
|