From 2c24099e934fcf577b9a38b3446c5ab0ab1b63bd Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Mon, 5 May 2014 14:27:38 +0200 Subject: [PATCH] [UPDATE] alert styles --- include/config/admin_settings.inc.php | 7 +++++++ include/smarty_globals.inc.php | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/include/config/admin_settings.inc.php b/include/config/admin_settings.inc.php index b5839ef7..2d8b0f6a 100644 --- a/include/config/admin_settings.inc.php +++ b/include/config/admin_settings.inc.php @@ -20,6 +20,13 @@ $aSettings['website'][] = array( 'name' => 'system_motd', 'value' => $setting->getValue('system_motd'), 'tooltip' => 'Display a message of the day as information popup if set.' ); +$aSettings['website'][] = array( + 'display' => 'MOTD Style', 'type' => 'select', + 'options' => array( 0 => 'Success', 1 => 'Information', 2 => 'Warning', 3 => 'Danger' ), + 'default' => 0, + 'name' => 'motd_style', 'value' => $setting->getValue('motd_style'), + 'tooltip' => 'Set the Style what MOTD looks like.' +); $aSettings['website'][] = array( 'display' => 'Website Name', 'type' => 'text', 'size' => 25, diff --git a/include/smarty_globals.inc.php b/include/smarty_globals.inc.php index 68e920b5..82207e97 100644 --- a/include/smarty_globals.inc.php +++ b/include/smarty_globals.inc.php @@ -188,7 +188,18 @@ if (@$_SESSION['USERDATA']['id']) { if ($setting->getValue('maintenance')) $_SESSION['POPUP'][] = array('CONTENT' => 'This pool is currently in maintenance mode.', 'TYPE' => 'alert alert-warning'); if ($motd = $setting->getValue('system_motd')) - $_SESSION['POPUP'][] = array('CONTENT' => $motd, 'DISMISS' => 'yes', 'ID' => 'motd', 'TYPE' => 'alert alert-info'); + if ($setting->getValue('motd_style') == 0) { + $motd_style = "alert-success"; + } else if ($setting->getValue('motd_style') == 1) { + $motd_style = "alert-info"; + } else if ($setting->getValue('motd_style') == 2) { + $motd_style = "alert-warning"; + } else if ($setting->getValue('motd_style') == 3) { + $motd_style = "alert-danger"; + } else { + $motd_style = "alert-info"; + } + $_SESSION['POPUP'][] = array('CONTENT' => $motd, 'DISMISS' => 'yes', 'ID' => 'motd', 'TYPE' => 'alert ' . $motd_style . ''); // check for deprecated theme if ($setting->getValue('website_theme') == "mpos")