diff options
author | Jonas Kohl | 2024-09-06 17:01:01 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-06 17:01:01 +0200 |
commit | 3d22cc3333e1265a222425a4ede9c464234e3632 (patch) | |
tree | 7acd1379c752913f12168cc75583e68b14278288 /includes/desktop | |
parent | 0540e04c77864186ce48193456634b897a11f5aa (diff) |
Small fixes; Add component system
Diffstat (limited to 'includes/desktop')
-rw-r--r-- | includes/desktop/components/alert.php | 27 | ||||
-rw-r--r-- | includes/desktop/template_head_start.php | 2 |
2 files changed, 28 insertions, 1 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() { |