1: <?php
2: /**
3: * The Ajax status class provides a method to display Growler messages using
4: * the DimpCore javascript notification framework.
5: *
6: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
7: *
8: * See the enclosed file COPYING for license information (GPL). If you
9: * did not receive this file, see http://www.horde.org/licenses/gpl.
10: *
11: * @author Michael Slusarz <slusarz@horde.org>
12: * @category Horde
13: * @license http://www.horde.org/licenses/gpl GPL
14: * @package IMP
15: */
16: class IMP_Notification_Listener_AjaxStatus extends Horde_Notification_Listener_Status
17: {
18: /**
19: * Outputs the status line if there are any messages on the 'status'
20: * message stack.
21: *
22: * @param array $events The list of events to handle.
23: * @param array $options An array of options. Not used.
24: */
25: public function notify($events, $options = array())
26: {
27: Horde::addInlineScript(array(
28: 'if (window.DimpCore || parent.DimpCore) { (window.DimpCore || parent.DimpCore).showNotifications(' . Horde_Serialize::serialize($events, Horde_Serialize::JSON) . ') }'
29: ), 'dom');
30: }
31:
32: }
33: