Merge pull request #2182 from iAmShorty/motd-dismiss

[FEATURE] MOTD dismiss
This commit is contained in:
Sebastian Grewe 2014-05-07 13:13:14 +02:00
commit f7f2358403
2 changed files with 13 additions and 1 deletions

View File

@ -27,6 +27,13 @@ $aSettings['website'][] = array(
'name' => 'system_motd_style', 'value' => $setting->getValue('system_motd_style'),
'tooltip' => 'Set the Style what MOTD looks like.'
);
$aSettings['website'][] = array(
'display' => 'MOTD Dismiss', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),
'default' => 0,
'name' => 'system_motd_dismiss', 'value' => $setting->getValue('system_motd_dismiss'),
'tooltip' => 'Set if users can hide MOTD.'
);
$aSettings['website'][] = array(
'display' => 'Website Name', 'type' => 'text',
'size' => 25,

View File

@ -188,6 +188,11 @@ 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')) {
if ($setting->getValue('system_motd_dismiss')) {
$motd_dismiss = "yes";
} else {
$motd_dismiss = "no";
}
switch ($setting->getValue('system_motd_style', 0)) {
case 0:
$motd_style = "alert-success";
@ -204,7 +209,7 @@ if ($motd = $setting->getValue('system_motd')) {
default:
$motd_style = "alert-info";
}
$_SESSION['POPUP'][] = array('CONTENT' => $motd, 'DISMISS' => 'yes', 'ID' => 'motd', 'TYPE' => 'alert ' . $motd_style . '');
$_SESSION['POPUP'][] = array('CONTENT' => $motd, 'DISMISS' => $motd_dismiss, 'ID' => 'motd', 'TYPE' => 'alert ' . $motd_style . '');
}
// check for deprecated theme