1: <?php
2: /**
3: * The Horde_Notification_Listener_Status:: class provides functionality for
4: * displaying messages from the message stack as a status line.
5: *
6: * Copyright 2001-2012 Horde LLC (http://www.horde.org/)
7: *
8: * See the enclosed file COPYING for license information (LGPL). If you
9: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
10: *
11: * @author Jan Schneider <jan@horde.org>
12: * @category Horde
13: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
14: * @package Notification
15: */
16: class Horde_Notification_Listener_Status extends Horde_Notification_Listener
17: {
18: /**
19: * Constructor.
20: */
21: public function __construct()
22: {
23: $this->_handles['status'] = 'Horde_Notification_Event_Status';
24: $this->_name = 'status';
25: }
26:
27: /**
28: * Outputs the status line if there are any messages on the 'status'
29: * message stack.
30: *
31: * @param array $events The list of events to handle.
32: * @param array $options An array of options. Not used.
33: */
34: public function notify($events, $options = array())
35: {
36: if (!count($events)) {
37: return;
38: }
39:
40: echo '<ul class="notices">';
41:
42: foreach ($events as $event) {
43: echo '<li>' . $event . '</li>';
44: }
45:
46: echo '</ul>';
47: }
48:
49: }
50: