1: <?php
2: /**
3: * The Ajax status class provides a method to display Growler messages using
4: * the KronolithCore 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: * @package Kronolith
13: */
14: class Kronolith_Notification_Listener_AjaxStatus extends Horde_Notification_Listener_Status
15: {
16: /**
17: * Outputs the status line if there are any messages on the 'status'
18: * message stack.
19: *
20: * @param array $events The list of events to handle.
21: * @param array $options An array of options. Not used.
22: */
23: public function notify($events, $options = array())
24: {
25: Horde::addInlineScript(array(
26: 'if (window.KronolithCore || parent.KronolithCore) { (window.KronolithCore || parent.KronolithCore).showNotifications(' . Horde_Serialize::serialize($events, Horde_Serialize::JSON) . ') }'
27: ), 'dom');
28: }
29:
30: }
31: