1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
17: class IMP_Mime_Viewer_Audio extends Horde_Mime_Viewer_Audio
18: {
19: 20: 21: 22: 23:
24: protected $_capability = array(
25: 'full' => true,
26: 'info' => true,
27: 'inline' => false,
28: 'raw' => false
29: );
30:
31: 32: 33: 34: 35:
36: protected function _renderInfo()
37: {
38: $mime_id = $this->_mimepart->getMimeId();
39: $headers = Horde_Mime_Headers::parseHeaders($this->getConfigParam('imp_contents')->getBodyPart($mime_id, array(
40: 'length' => 0,
41: 'mimeheaders' => true
42: )));
43:
44: if (($duration = $headers->getValue('content-duration')) === null) {
45: return array();
46: }
47:
48: $status = new IMP_Mime_Status(sprintf(_("This audio file is reported to be %d minutes, %d seconds in length."), floor($duration / 60), $duration % 60));
49: $status->icon('mime/audio.png');
50:
51: return array(
52: $this->_mimepart->getMimeId() => array(
53: 'data' => '',
54: 'status' => $status,
55: 'type' => 'text/html; charset=UTF-8'
56: )
57: );
58: }
59:
60: }
61: