diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/desktop/components/alert.php | 27 | ||||
-rw-r--r-- | includes/desktop/template_head_start.php | 2 | ||||
-rw-r--r-- | includes/mobile/components/alert.php | 8 | ||||
-rw-r--r-- | includes/mobile/template_end.php | 2 | ||||
-rw-r--r-- | includes/mobile/template_head_end.php | 14 | ||||
-rw-r--r-- | includes/mobile/template_head_start.php | 2 | ||||
-rw-r--r-- | includes/template_head_start.php | 11 |
7 files changed, 55 insertions, 11 deletions
diff --git a/includes/desktop/components/alert.php b/includes/desktop/components/alert.php new file mode 100644 index 0000000..fce6376 --- /dev/null +++ b/includes/desktop/components/alert.php @@ -0,0 +1,27 @@ +<?php +function c_alert(string $html_message, string $type, ?string $icon = null): void { + $type_colors = [ + "warning" => ["olive","yellow"], + "success" => ["green","lime"], + ][$type] ?? ["gray","white"]; + if ($icon !== null) + $icon = [ + "warning-sign" => "warn16", + ][$icon] ?? $icon; +?> +<center> +<table bgcolor="<?= htmlentities($type_colors[0]) ?>" cellspacing="0" cellpadding="2"><tr><td> +<table bgcolor="<?= htmlentities($type_colors[1]) ?>" cellspacing="0" cellpadding="12"><tr><td> +<?php if ($icon !== null): ?> +<table bgcolor="<?= htmlentities($type_colors[1]) ?>" cellspacing="0" cellpadding="0"><tr><td> +<nobr><img src="../images/<?= htmlentities(rawurlencode($icon)) ?>.gif"> </nobr> +</td><td width="100%"> +<?php endif; ?> +<font color="black"><?= $html_message ?></font> +<?php if ($icon !== null): ?> +</td></tr></table> +<?php endif; ?> +</td></tr></table> +</td></tr></table> +</center> +<?php } diff --git a/includes/desktop/template_head_start.php b/includes/desktop/template_head_start.php index 6d4a776..c0c12f4 100644 --- a/includes/desktop/template_head_start.php +++ b/includes/desktop/template_head_start.php @@ -4,7 +4,7 @@ <meta http-equiv="imagetoolbar" content="no"> <meta http-equiv="MSThemeCompatible" content="no"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> - <title><?= htmlentities($PAGE_TITLE ?? "") ?> - Mystic House Fansite</title> + <title><?= htmlentities($PAGE_TITLE ?? "") ?> - Mystic House Corner</title> <script language="JavaScript"> <!-- function getLocation() { diff --git a/includes/mobile/components/alert.php b/includes/mobile/components/alert.php new file mode 100644 index 0000000..fbc3482 --- /dev/null +++ b/includes/mobile/components/alert.php @@ -0,0 +1,8 @@ +<?php function c_alert(string $html_message, string $type, ?string $icon = null): void { ?> +<div class="alert alert-<?= htmlentities($type) ?>"> +<?php if ($icon !== null): ?> +<i class="glyphicon glyphicon-<?= htmlentities($icon) ?>"></i> +<?php endif; ?> +<?= $html_message ?> +</div> +<?php } diff --git a/includes/mobile/template_end.php b/includes/mobile/template_end.php index 1f3ad26..3746d82 100644 --- a/includes/mobile/template_end.php +++ b/includes/mobile/template_end.php @@ -1,6 +1,6 @@ </div> <footer class="footer"> -<div class="container"> +<div class="container-fluid"> <a href="/view.php?view=d&next=<?= htmlentities(urlencode($_SERVER["REQUEST_URI"])) ?>" target="_top">Desktop-Version</a> </div> </footer> diff --git a/includes/mobile/template_head_end.php b/includes/mobile/template_head_end.php index 6819603..28eef80 100644 --- a/includes/mobile/template_head_end.php +++ b/includes/mobile/template_head_end.php @@ -13,14 +13,14 @@ </div> <div class="collapse navbar-collapse" id="nav-collapse"> <ul class="nav navbar-nav"> - <li><a href="/pages/start.php">Startseite</a></li> - <li><a href="/pages/trivia.php">Trivia</a></li> - <li><a href="/pages/exklusiv.php">Exklusiv</a></li> - <li><a href="/pages/dekomp.php">Dekomp</a></li> - <li><a href="/pages/loesung.php">Lösung</a></li> - <li><a href="/pages/about.php">Über</a></li> + <li<?= ($NAV_LINK_ID ?? null) === "start" ? ' class="active"' : ''; ?>><a href="/pages/start.php">Startseite</a></li> + <li<?= ($NAV_LINK_ID ?? null) === "trivia" ? ' class="active"' : ''; ?>><a href="/pages/trivia.php">Trivia</a></li> + <li<?= ($NAV_LINK_ID ?? null) === "exklusiv" ? ' class="active"' : ''; ?>><a href="/pages/exklusiv.php">Exklusiv</a></li> + <li<?= ($NAV_LINK_ID ?? null) === "dekomp" ? ' class="active"' : ''; ?>><a href="/pages/dekomp.php">Dekomp</a></li> + <li<?= ($NAV_LINK_ID ?? null) === "loesung" ? ' class="active"' : ''; ?>><a href="/pages/loesung.php">Lösung</a></li> + <li<?= ($NAV_LINK_ID ?? null) === "about" ? ' class="active"' : ''; ?>><a href="/pages/about.php">Über</a></li> </ul> </div> </div> </nav> -<div class="container">
\ No newline at end of file +<div class="container-fluid">
\ No newline at end of file diff --git a/includes/mobile/template_head_start.php b/includes/mobile/template_head_start.php index 21c44f6..4a9e161 100644 --- a/includes/mobile/template_head_start.php +++ b/includes/mobile/template_head_start.php @@ -3,7 +3,7 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> - <title><?= htmlentities($PAGE_TITLE ?? "") ?> - Mystic House Fansite</title> + <title><?= htmlentities($PAGE_TITLE ?? "") ?> - Mystic House Corner</title> <link rel="stylesheet" href="/mobile/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="/mobile/site.css"> <script src="/mobile/jquery-1.12.4.min.js"></script> diff --git a/includes/template_head_start.php b/includes/template_head_start.php index 31a5fb4..271cb60 100644 --- a/includes/template_head_start.php +++ b/includes/template_head_start.php @@ -1,5 +1,14 @@ <?php $__mobile = include __DIR__ . "/mobile-detect.php"; +$__inc_dir = __DIR__ . "/" . ($__mobile ? "mobile" : "desktop"); -include __DIR__ . "/" . ($__mobile ? "mobile" : "desktop") . "/template_head_start.php"; +foreach (scandir($__inc_dir . "/components") as $ent) { + if ($ent[0] === "." || !is_file($__inc_dir . "/components/" . $ent) || strcasecmp(pathinfo($ent, PATHINFO_EXTENSION), "php") !== 0) + continue; + include $__inc_dir . "/components/" . $ent; +} + +include $__inc_dir . "/template_head_start.php"; + +unset($__inc_dir); |