[UPDATE] notification dismiss motd/backend/lastlogin

This commit is contained in:
iAmShorty 2014-03-04 16:35:54 +01:00
parent c29bcf238f
commit d45e171977
4 changed files with 17 additions and 11 deletions

4
public/include/smarty_globals.inc.php Normal file → Executable file
View File

@ -178,7 +178,7 @@ 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, 'TYPE' => 'alert alert-info');
$_SESSION['POPUP'][] = array('CONTENT' => $motd, 'DISMISS' => 'yes', 'ID' => 'motd', 'TYPE' => 'alert alert-info');
// So we can display additional info
$smarty->assign('DEBUG', $config['DEBUG']);
@ -213,7 +213,7 @@ foreach ($aMonitorCrons as $strCron) {
}
}
if ($bMessage)
$_SESSION['POPUP'][] = array('CONTENT' => implode($aCronMessage, ''));
$_SESSION['POPUP'][] = array('CONTENT' => implode($aCronMessage, ''), 'DISMISS' => 'yes', 'ID' => 'backend', 'TYPE' => 'alert alert-warning');
// Make it available in Smarty
$smarty->assign('PATH', 'site_assets/' . THEME);

View File

@ -31,12 +31,26 @@ $(function() {
if( $.cookie('lastlogin-box') === 'closed' ){
$('#lastlogin').hide();
}
if( $.cookie('motd-box') === 'closed' ){
$('#motd').hide();
}
if( $.cookie('backend-box') === 'closed' ){
$('#backend').hide();
}
// Grab your button (based on your posted html)
$('.close').click(function( e ){
e.preventDefault();
//alert($(this).attr("id"));
$.cookie('lastlogin-box', 'closed', { path: '/' });
if ($(this).attr("id") === 'motd') {
$.cookie('motd-box', 'closed', { path: '/' });
} else if ($(this).attr("id") === 'lastlogin') {
$.cookie('lastlogin-box', 'closed', { path: '/' });
} else if ($(this).attr("id") === 'backend') {
$.cookie('backend-box', 'closed', { path: '/' });
} else {
//alert($(this).attr("id"));
}
});
});

8
public/templates/bootstrap/global/header.tpl Normal file → Executable file
View File

@ -8,7 +8,6 @@
</button>
<a class="navbar-brand" href="{$smarty.server.SCRIPT_NAME}">{$GLOBAL.website.name}</a>
</div>
<!-- /.navbar-header -->
<ul class="nav navbar-top-links navbar-right">
{if $smarty.session.AUTHENTICATED|default:"0" == 1 && $GLOBAL.userdata.lastnotifications|@count|default:"0" != 0}
@ -43,10 +42,8 @@
</a>
</li>
</ul>
<!-- /.dropdown-alerts -->
</li>
{/if}
<!-- /.dropdown -->
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw"></i> {if $GLOBAL.userdata.username|default}{$smarty.session.USERDATA.username|escape}{else}Guest{/if} <i class="fa fa-caret-down"></i>
@ -65,11 +62,6 @@
</li>
{/if}
</ul>
<!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
<!-- /.navbar-top-links -->
</nav>
<!-- /.navbar-static-top -->