mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Rename Notifiation::getMessages() to popMessages()
Because the call to popMessages()--before getMessages()--automatically resets the notification messages on the instance, popMessages() is a much better name for the method. refs #9660
This commit is contained in:
parent
d545e1f7d1
commit
81aad9d6a6
@ -51,7 +51,7 @@ if (Auth::getInstance()->isAuthenticated()):
|
||||
<ul id="notifications"><?php
|
||||
$notifications = Notification::getInstance();
|
||||
if ($notifications->hasMessages()) {
|
||||
foreach ($notifications->getMessages() as $m) {
|
||||
foreach ($notifications->popMessages() as $m) {
|
||||
echo '<li class="' . $m->type . '">' . $this->escape($m->message) . '</li>';
|
||||
}
|
||||
}
|
||||
|
@ -455,7 +455,7 @@ class ActionController extends Zend_Controller_Action
|
||||
$notifications = Notification::getInstance();
|
||||
if ($notifications->hasMessages()) {
|
||||
$notificationList = array();
|
||||
foreach ($notifications->getMessages() as $m) {
|
||||
foreach ($notifications->popMessages() as $m) {
|
||||
$notificationList[] = rawurlencode($m->type . ' ' . $m->message);
|
||||
}
|
||||
$resp->setHeader('X-Icinga-Notification', implode('&', $notificationList), true);
|
||||
|
@ -183,11 +183,11 @@ class Notification
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the notification messages
|
||||
* Pop the notification messages
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getMessages()
|
||||
public function popMessages()
|
||||
{
|
||||
$messages = $this->messages;
|
||||
$this->messages = array();
|
||||
|
@ -19,7 +19,7 @@ $maxProgress = @max(array_keys(array_filter(
|
||||
|
||||
$notifications = Notification::getInstance();
|
||||
if ($notifications->hasMessages()) {
|
||||
foreach ($notifications->getMessages() as $m) {
|
||||
foreach ($notifications->popMessages() as $m) {
|
||||
echo '<li class="' . $m->type . '">' . $this->escape($m->message) . '</li>';
|
||||
}
|
||||
}
|
||||
@ -135,4 +135,4 @@ if ($notifications->hasMessages()) {
|
||||
<?= $this->render('index/parts/wizard.phtml'); ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user