1: <?php
2: /**
3: * The Horde_Notification_Listener_Audio:: class provides functionality for
4: * inserting embedded audio notifications from the stack into the page.
5: *
6: * Copyright 2005-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 Jason M. Felice <jason.m.felice@gmail.com>
12: * @category Horde
13: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
14: * @package Notification
15: */
16: class Horde_Notification_Listener_Audio extends Horde_Notification_Listener
17: {
18: /**
19: * Constructor.
20: */
21: public function __construct()
22: {
23: $this->_handles['audio'] = 'Horde_Notification_Event';
24: $this->_name = 'audio';
25: }
26:
27: /**
28: * Outputs the embedded audio code if there are any messages on the
29: * 'audio' 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: foreach ($events as $event) {
37: echo '<embed src="' . htmlspecialchars(strval($event)) . '" width="0" height="0" autostart="true" />';
38: }
39: }
40:
41: }
42: