1: <?php
2: /**
3: * Copyright 2010-2014 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (GPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/gpl.
7: *
8: * @category Horde
9: * @copyright 2010-2014 Horde LLC
10: * @license http://www.horde.org/licenses/gpl GPL
11: * @package IMP
12: */
13:
14: /**
15: * Add IMAP alert notifications to the stack.
16: *
17: * @author Michael Slusarz <slusarz@horde.org>
18: * @category Horde
19: * @copyright 2010-2014 Horde LLC
20: * @license http://www.horde.org/licenses/gpl GPL
21: * @package IMP
22: */
23: class IMP_Notification_Handler_Decorator_ImapAlerts
24: extends Horde_Core_Notification_Handler_Decorator_Base
25: {
26: /**
27: */
28: protected $_app = 'imp';
29:
30: /**
31: */
32: protected function _notify(
33: Horde_Notification_Handler $handler,
34: Horde_Notification_Listener $listener
35: )
36: {
37: if (($listener instanceof Horde_Notification_Listener_Status) &&
38: ($ob = $GLOBALS['injector']->getInstance('IMP_Factory_Imap'))) {
39: /* Display IMAP alerts. */
40: foreach ($ob->alerts() as $alert) {
41: $handler->push($alert, 'horde.warning');
42: }
43: }
44: }
45:
46: }
47: