This commit is contained in:
William 2021-10-11 10:34:32 +02:00
parent 3cc069773f
commit 97f9468cc1
4 changed files with 22 additions and 13 deletions

View File

@ -11,6 +11,8 @@ $_SESSION['alert'][] = ['info', 'Eksempel!'];
$_SESSION['alert'][] = ['success', 'Eksempel!']; $_SESSION['alert'][] = ['success', 'Eksempel!'];
$_SESSION['alert'][] = ['warning', 'Eksempel!']; $_SESSION['alert'][] = ['warning', 'Eksempel!'];
$_SESSION['alert'][] = ['danger', 'Eksempel!']; $_SESSION['alert'][] = ['danger', 'Eksempel!'];
$_SESSION['alert'][] = ['foo', 'Eksempel!'];
// Include the top of page // Include the top of page
require_once("template/_header.php"); require_once("template/_header.php");

View File

@ -7,7 +7,10 @@ $_SESSION = [];
// Destroy the session. // Destroy the session.
session_destroy(); session_destroy();
session_start();
$_SESSION['alert'][] = ['info', 'Du har blitt logget av.'];
// Redirect to login page // Redirect to login page
header("location: login.php"); header("location: login.php");
exit; exit;

View File

@ -1,5 +1,5 @@
html { html {
background-color: #fff; background-color: #e8e8e8;
background-image: url("../img/imagedoc-lightnoise.png"); background-image: url("../img/imagedoc-lightnoise.png");
} }
@ -13,6 +13,8 @@ body {
h1, h2, h3, h4 { h1, h2, h3, h4 {
margin: 0; margin: 0;
border-bottom: 1px solid #aaa;
margin-bottom: 12px;
} }
.navbar-top { .navbar-top {
@ -30,14 +32,14 @@ h1, h2, h3, h4 {
} }
.login-statusbar { .login-statusbar {
border-top: 2px solid #fff; border-top: 2px solid #f8f8f8;
background: rgb(54,148,37); background: rgb(54,148,37);
background: linear-gradient(0deg, rgba(54,148,37,1) 0%, rgba(62,162,34,1) 50%, rgba(63,177,43,1) 100%); background: linear-gradient(0deg, rgba(54,148,37,1) 0%, rgba(62,162,34,1) 50%, rgba(63,177,43,1) 100%);
} }
.login-statusbar .inner { .login-statusbar .inner {
max-width: 900px; max-width: 900px;
margin: 0 auto; margin: 0 auto;
color: #fff; color: #f8f8f8;
font-weight: bold; font-weight: bold;
font-size: 12px; font-size: 12px;
padding-left: 12px; padding-left: 12px;
@ -47,11 +49,11 @@ h1, h2, h3, h4 {
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
} }
.login-statusbar .inner > a { .login-statusbar .inner > a {
color: #fff; color: #f8f8f8;
} }
.footer { .footer {
background: #ddd; background: #d8d8d8;
border-top: 1px solid #aaa; border-top: 1px solid #aaa;
padding: 12px; padding: 12px;
} }
@ -61,11 +63,13 @@ h1, h2, h3, h4 {
} }
.grid-container { .grid-container {
background: #fff;
display: grid; display: grid;
grid-template-columns: max-content auto; grid-template-columns: max-content auto;
grid-gap: 12px; grid-gap: 12px;
max-width: 900px; max-width: 888px;
margin: 0 auto; margin: 0 auto;
padding: 12px; padding: 12px;
} }
@ -78,7 +82,7 @@ h1, h2, h3, h4 {
} }
.grid-container .nav-links { .grid-container .nav-links {
background: #e8e8e8; background: #eee;
border: 1px solid #aaa; border: 1px solid #aaa;
padding: 12px; padding: 12px;
} }

View File

@ -59,24 +59,24 @@ if ($templateParameters["render"] === FALSE) {
foreach ($_SESSION['alert'] as $alert) { foreach ($_SESSION['alert'] as $alert) {
switch ($alert[0]) { switch ($alert[0]) {
case 'success': case 'success':
$prefix = 'Suksess:'; $prefix = 'Suksess ';
break; break;
case 'info': case 'info':
$prefix = 'Info:'; $prefix = 'Info ';
break; break;
case 'warning': case 'warning':
$prefix = 'Advarsel:'; $prefix = 'Varsel ';
break; break;
case 'danger': case 'danger':
$prefix = 'Error:'; $prefix = 'Error ';
break; break;
default: default:
$alert[0] = 'danger'; $alert[0] = 'danger';
$prefix = 'Ukjent:'; $prefix = 'Ukjent ';
break; break;
} }
echo('<div class="alert alert-'.$alert[0].'"><b>'.$prefix.'</b> '.$alert[1].'</div>'); echo('<div class="alert alert-'.$alert[0].'"><b>'.$prefix.'</b> '.$alert[1].'</div>');