3 * SquirrelMail NewMail plugin
9 * @todo add midi support
13 if (! defined('SM_PATH')) define('SM_PATH','../../');
16 * sqm_baseuri() function for setups that don't load it by default
18 include_once(SM_PATH
. 'functions/display_messages.php');
20 /** file type defines */
21 define('SM_NEWMAIL_FILETYPE_WAV',2);
22 define('SM_NEWMAIL_FILETYPE_MP3',3);
23 define('SM_NEWMAIL_FILETYPE_OGG',4);
24 define('SM_NEWMAIL_FILETYPE_SWF',5);
25 define('SM_NEWMAIL_FILETYPE_SVG',6);
27 /** load default config */
28 if (file_exists(SM_PATH
. 'plugins/newmail/config_default.php')) {
29 include_once(SM_PATH
. 'plugins/newmail/config_default.php');
33 if (file_exists(SM_PATH
. 'config/newmail_config.php')) {
34 include_once(SM_PATH
. 'config/newmail_config.php');
35 } elseif (file_exists(SM_PATH
. 'plugins/newmail/config.php')) {
36 include_once(SM_PATH
. 'plugins/newmail/config.php');
39 // ----- hooked functions -----
42 * Register newmail option block
44 function newmail_optpage_register_block_function() {
45 // Gets added to the user's OPTIONS page.
46 global $optpage_blocks;
48 /* Register Squirrelspell with the $optionpages array. */
49 $optpage_blocks[] = array(
50 'name' => _("NewMail Options"),
51 'url' => sqm_baseuri() . 'plugins/newmail/newmail_opt.php',
52 'desc' => _("This configures settings for playing sounds and/or showing popup windows when new mail arrives."),
58 * Save newmail plugin settings
60 function newmail_sav_function() {
61 global $data_dir, $username, $_FILES, $newmail_uploadsounds;
63 if ( sqgetGlobalVar('submit_newmail', $submit, SQ_POST
) ) {
68 $media_changetitle = '';
73 sqgetGlobalVar('media_enable', $media_enable, SQ_POST
);
74 sqgetGlobalVar('media_popup', $media_popup, SQ_POST
);
75 sqgetGlobalVar('media_allbox', $media_allbox, SQ_POST
);
76 sqgetGlobalVar('media_recent', $media_recent, SQ_POST
);
77 sqgetGlobalVar('media_changetitle', $media_changetitle, SQ_POST
);
78 sqgetGlobalVar('popup_width', $popup_width, SQ_POST
);
79 sqgetGlobalVar('popup_height', $popup_height, SQ_POST
);
81 // sanitize height and width
82 $popup_width = (int) $popup_width;
83 if ($popup_width<=0) $popup_width=200;
84 $popup_height = (int) $popup_height;
85 if ($popup_height<=0) $popup_height=130;
87 setPref($data_dir,$username,'newmail_enable',$media_enable);
88 setPref($data_dir,$username,'newmail_popup', $media_popup);
89 setPref($data_dir,$username,'newmail_allbox',$media_allbox);
90 setPref($data_dir,$username,'newmail_recent',$media_recent);
91 setPref($data_dir,$username,'newmail_changetitle',$media_changetitle);
92 setPref($data_dir,$username,'newmail_popup_width',$popup_width);
93 setPref($data_dir,$username,'newmail_popup_height',$popup_height);
95 if( sqgetGlobalVar('media_sel', $media_sel, SQ_POST
) &&
96 $media_sel == '(none)' ) {
97 removePref($data_dir,$username,'newmail_media');
99 setPref($data_dir,$username,'newmail_media',$media_sel);
102 // process uploaded file
103 if ($newmail_uploadsounds && isset($_FILES['media_file']['tmp_name']) && $_FILES['media_file']['tmp_name']!='') {
104 // set temp file and get media file name
105 $newmail_tempmedia=getHashedDir($username, $data_dir) . "/$username.tempsound";
106 $newmail_mediafile=getHashedFile($username, $data_dir, $username . '.sound');
107 if (move_uploaded_file($_FILES['media_file']['tmp_name'], $newmail_tempmedia)) {
108 // new media file is in $newmail_tempmedia
109 if (file_exists($newmail_mediafile)) unlink($newmail_mediafile);
110 if (! rename($newmail_tempmedia,$newmail_mediafile)) {
111 // remove (userfile), if file rename fails
112 removePref($data_dir,$username,'newmail_media');
115 if (isset($_FILES['media_file']['type']) && isset($_FILES['media_file']['name'])) {
116 setPref($data_dir,$username,'newmail_userfile_type',
117 newmail_get_mediatype($_FILES['media_file']['type'],$_FILES['media_file']['name']));
119 removePref($data_dir,$username,'newmail_userfile_type');
122 if (isset($_FILES['media_file']['name'])) {
123 setPref($data_dir,$username,'newmail_userfile_name',basename($_FILES['media_file']['name']));
125 setPref($data_dir,$username,'newmail_userfile_name','mediafile.unknown');
134 * Load newmail plugin settings
136 function newmail_pref_function() {
137 global $username,$data_dir;
138 global $newmail_media,$newmail_enable,$newmail_popup,$newmail_allbox;
139 global $newmail_recent, $newmail_changetitle;
140 global $newmail_userfile_type, $newmail_userfile_name;
141 global $newmail_popup_width, $newmail_popup_height;
143 $newmail_recent = getPref($data_dir,$username,'newmail_recent');
144 $newmail_enable = getPref($data_dir,$username,'newmail_enable');
145 $newmail_media = getPref($data_dir, $username, 'newmail_media', '(none)');
146 // remove full location from setting (since SM 1.5.1 plugin uses only filename).
147 if ($newmail_media!='(none)')
148 $newmail_media = basename($newmail_media);
150 $newmail_popup = getPref($data_dir, $username, 'newmail_popup');
151 $newmail_popup_width = getPref($data_dir, $username, 'newmail_popup_width',200);
152 $newmail_popup_height = getPref($data_dir, $username, 'newmail_popup_height',130);
153 $newmail_allbox = getPref($data_dir, $username, 'newmail_allbox');
154 $newmail_changetitle = getPref($data_dir, $username, 'newmail_changetitle');
156 $newmail_userfile_type = getPref($data_dir, $username, 'newmail_userfile_type');
157 $newmail_userfile_name = getPref($data_dir,$username,'newmail_userfile_name','');
163 * Used by option page when saving settings.
165 function newmail_set_loadinfo_function() {
166 global $optpage, $optpage_name;
167 if ($optpage=='newmail') {
168 $optpage_name=_("NewMail Options");
173 * Insert needed data in left_main
175 function newmail_plugin_function() {
176 global $username, $newmail_media, $newmail_enable, $newmail_popup,
177 $newmail_recent, $newmail_changetitle, $imapConnection, $PHP_SELF;
178 global $newmail_mmedia, $newmail_allowsound;
179 global $newmail_userfile_type;
180 global $newmail_popup_width, $newmail_popup_height;
182 if ($newmail_enable == 'on' ||
183 $newmail_popup == 'on' ||
184 $newmail_changetitle) {
186 // open a connection on the imap port (143)
188 $boxes = sqimap_mailbox_list($imapConnection);
189 $delimeter = sqimap_get_delimiter($imapConnection);
194 for ($i = 0;$i < count($boxes); $i++
) {
196 $mailbox = $boxes[$i]['formatted'];
198 if (! isset($boxes[$i]['unseen'])) {
199 $boxes[$i]['unseen'] = '';
201 if ($boxes[$i]['flags']) {
203 for ($h = 0; $h < count($boxes[$i]['flags']); $h++
) {
204 if (strtolower($boxes[$i]["flags"][$h]) == 'noselect') {
209 $status +
= CheckNewMailboxSound($imapConnection,
211 $boxes[$i]['unformatted'],
213 $boxes[$i]['unseen'],
217 $status +
= CheckNewMailboxSound($imapConnection,
219 $boxes[$i]['unformatted'],
221 $boxes[$i]['unseen'],
226 // sqimap_logout($imapConnection);
228 // If we found unseen messages, then we
229 // will play the sound as follows:
231 if ($newmail_changetitle) {
232 echo "<script language=\"javascript\" type=\"text/javascript\">\n" .
233 "function ChangeTitleLoad() {\n";
234 echo 'window.parent.document.title = "' .
235 sprintf(ngettext("%s New Message","%s New Messages",$totalNew), $totalNew) .
237 echo "if (BeforeChangeTitle != null)\n".
238 "BeforeChangeTitle();\n".
240 "BeforeChangeTitle = window.onload;\n".
241 "window.onload = ChangeTitleLoad;\n".
245 // create media output if there are new email messages
246 if ($newmail_allowsound && $totalNew > 0 && $newmail_enable == 'on' && $newmail_media != '' ) {
247 echo newmail_create_media_tags($newmail_media);
250 if ($totalNew > 0 && $newmail_popup == 'on') {
251 // Idea by: Nic Wolfe (Nic@TimelapseProductions.com)
252 // Web URL: http://fineline.xs.mw
253 // More code from Tyler Akins
254 echo "<script language=\"JavaScript\">\n".
256 "function PopupScriptLoad() {\n".
257 'window.open("'.sqm_baseuri().'plugins/newmail/newmail.php?numnew='.$totalNew.
259 "\"width=$newmail_popup_width,height=$newmail_popup_height,scrollbars=no\");\n".
260 "if (BeforePopupScript != null)\n".
261 "BeforePopupScript();\n".
263 "BeforePopupScript = window.onload;\n".
264 "window.onload = PopupScriptLoad;\n".
271 // ----- end of hooked functions -----
274 * Checks if mailbox contains new messages.
276 * @param stream $imapConnection
277 * @param string $mailbox FIXME: option is not used
278 * @param string $real_box unformated mailbox name
279 * @param string $delimeter FIXME: option is not used
280 * @param string $unseen FIXME: option is not used
281 * @param integer $total_new number of new messages
282 * @return bool true, if there are new messages
284 function CheckNewMailboxSound($imapConnection, $mailbox, $real_box, $delimeter, $unseen, &$total_new) {
285 global $trash_folder, $sent_folder,
286 $unseen_notify, $newmail_allbox,
289 $mailboxURL = urlencode($real_box);
291 // Skip folders for Sent and Trash
292 if ($real_box == $sent_folder ||
293 $real_box == $trash_folder) {
297 if (($unseen_notify == 2 && $real_box == 'INBOX') ||
298 ($unseen_notify == 3 && ($newmail_allbox == 'on' ||
299 $real_box == 'INBOX'))) {
300 $status = sqimap_status_messages( $imapConnection, $real_box);
301 if($newmail_recent == 'on') {
302 $total_new +
= $status['RECENT'];
304 $total_new +
= $status['UNSEEN'];
314 * Function tries to detect if file contents match declared file type
316 * Function returns default extension for detected mime type or 'false'
318 * TODO: use $contents to check if file is in specified type
319 * @param string $contents file contents
320 * @param string $type file mime type
323 function newmail_detect_filetype($contents,$type) {
324 // convert $type to lower case
325 $type=strtolower($type);
336 case 'application/ogg':
339 case 'application/x-shockwave-flash':
342 case 'image/svg+xml':
352 * Function tries to detect uploaded file type
353 * @param string $type
354 * @param string $filename
355 * @return integer One of SM_NEWMAIL_FILETYPE_* defines or false.
357 function newmail_get_mediatype($type,$filename) {
359 // fix for browser's that upload file as application/octet-stream
360 case 'application/octet-stream':
361 $ret=newmail_get_mediatype_by_ext($filename);
364 $ret=SM_NEWMAIL_FILETYPE_WAV
;
367 $ret=SM_NEWMAIL_FILETYPE_MP3
;
369 case 'application/ogg':
370 $ret=SM_NEWMAIL_FILETYPE_OGG
;
372 case 'application/x-shockwave-flash':
373 $ret=SM_NEWMAIL_FILETYPE_SWF
;
375 case 'image/svg+xml':
376 $ret=SM_NEWMAIL_FILETYPE_SVG
;
385 * Function provides filetype detection for browsers, that
386 * upload files with application/octet-stream file type.
387 * Ex. some version of Opera.
388 * @param string $filename
389 * @return integer One of SM_NEWMAIL_FILETYPE_* defines or false.
391 function newmail_get_mediatype_by_ext($filename) {
392 if (preg_match("/\.wav$/i",$filename)) return SM_NEWMAIL_FILETYPE_WAV
;
393 if (preg_match("/\.mp3$/i",$filename)) return SM_NEWMAIL_FILETYPE_MP3
;
394 if (preg_match("/\.ogg$/i",$filename)) return SM_NEWMAIL_FILETYPE_OGG
;
395 if (preg_match("/\.swf$/i",$filename)) return SM_NEWMAIL_FILETYPE_SWF
;
396 if (preg_match("/\.svg$/i",$filename)) return SM_NEWMAIL_FILETYPE_SVG
;
401 * Creates html object tags of multimedia object
403 * Main function that creates multimedia object tags
404 * @param string $object object name
405 * @param integer $type media object type
406 * @param string $path URL to media object
407 * @param array $args media object attributes
408 * @param string $extra tags that have to buried deep inside object tags
409 * @param bool $addsuffix controls addition of suffix to media object url
410 * @return string object html tags and attributes required by selected media type.
412 function newmail_media_objects($object,$types,$path,$args=array(),$extra='',$addsuffix=true) {
413 global $newmail_mediacompat_mode;
415 // first prepare single object for IE
416 $ret = newmail_media_object_ie($object,$types[0],$path,$args,$addsuffix);
418 // W3.org nested objects
419 $ret.= "<!--[if !IE]> <-->\n"; // not for IE
421 foreach ($types as $type) {
422 $ret.= newmail_media_object($object,$type,$path,$args,$addsuffix);
425 if (isset($newmail_mediacompat_mode) && $newmail_mediacompat_mode)
426 $ret.= newmail_media_embed($object,$types[0],$path,$args,$addsuffix);
427 // add $extra code inside objects
432 if (isset($newmail_mediacompat_mode) && $newmail_mediacompat_mode)
433 $ret.= newmail_media_embed_close($types[0]);
435 // close w3.org nested objects
436 foreach (array_reverse($types) as $type) {
437 $ret.= newmail_media_object_close($type);
439 $ret.= "<!--> <![endif]-->\n"; // end non-IE mode
441 $ret.= newmail_media_object_ie_close($types[0]);
447 * Creates object tags of multimedia object for browsers that comply to w3.org
452 * <li>Returned string does not contain html closing tag.
453 * <li>This is internal function, use newmail_media_objects() instead
455 * @link http://www.w3.org/TR/html4/struct/objects.html#edef-OBJECT W3.org specs
456 * @param string $object object name
457 * @param integer $type media object type
458 * @param string $path URL to media object
459 * @param array $args media object attributes
460 * @param bool $addsuffix controls addition of suffix to media object url
461 * @return string object html tags and attributes required by selected media type.
463 function newmail_media_object($object,$type,$path,$args=array(),$addsuffix=true) {
466 $sArgs=newmail_media_prepare_args($args);
469 case SM_NEWMAIL_FILETYPE_SWF
:
470 if ($addsuffix) $suffix='.swf';
471 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
473 .'type="application/x-shockwave-flash">' . "\n";
475 case SM_NEWMAIL_FILETYPE_WAV
:
476 if ($addsuffix) $suffix='.wav';
477 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
479 .'type="audio/x-wav">' . "\n";
481 case SM_NEWMAIL_FILETYPE_OGG
:
482 if ($addsuffix) $suffix='.ogg';
483 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
485 .'type="application/ogg">' . "\n";
487 case SM_NEWMAIL_FILETYPE_MP3
:
488 if ($addsuffix) $suffix='.mp3';
489 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
491 .'type="audio/mpeg">' . "\n";
493 case SM_NEWMAIL_FILETYPE_SVG
:
494 if ($addsuffix) $suffix='.svg';
495 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
497 .'type="image/svg+xml">' . "\n";
506 * Creates multimedia object tags for Internet Explorer (Win32)
509 * * Returned string does not contain html closing tag, because
510 * this multimedia object can include other media objects.
511 * * This is internal function, use newmail_media_objects() instead
513 * @param string $object object name
514 * @param integer $type media object type
515 * @param string $path URL to media object
516 * @param array $args media object attributes
517 * @param bool $addsuffix controls addition of suffix to media object url
518 * @return string object html tags and attributes required by selected media type.
519 * @todo add ogg and svg support
521 function newmail_media_object_ie($object,$type,$path,$args=array(),$addsuffix) {
524 $sArgs=newmail_media_prepare_args($args);
527 case SM_NEWMAIL_FILETYPE_SWF
:
528 if ($addsuffix) $suffix='.swf';
529 $ret_ie ='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
530 .'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" '
531 . $sArgs . 'id="' . $object ."\">\n"
532 .'<param name="movie" value="' . $path . $object . $suffix . "\">\n"
533 .'<param name="hidden" value="true">' . "\n";
535 case SM_NEWMAIL_FILETYPE_WAV
:
536 if ($addsuffix) $suffix='.wav';
537 $ret_ie ='<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" '
538 .'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,0902" '
539 . $sArgs . 'id="' . $object ."\" \n"
540 .'type="audio/x-wav">' ."\n"
541 .'<param name="FileName" value="' . $path . $object . $suffix . "\">\n";
543 case SM_NEWMAIL_FILETYPE_MP3
:
544 if ($addsuffix) $suffix='.mp3';
545 $ret_ie ='<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" '
546 .'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,0902" '
547 . $sArgs . 'id="' . $object ."\" \n"
548 .'type="audio/mpeg">' ."\n"
549 .'<param name="FileName" value="' . $path . $object . $suffix . "\">\n";
551 case SM_NEWMAIL_FILETYPE_OGG
:
552 case SM_NEWMAIL_FILETYPE_SVG
:
560 * Creates embed tags of multimedia object
563 * Apple: http://www.apple.com/quicktime/authoring/embed.html
566 * * Returned string does not contain html closing tag.
567 * * embed tags will be created by newmail_media_objects() only
568 * when $newmail_mediacompat_mode option is enabled. Option is not
569 * enabled by default in order to comply to w3.org specs.
570 * * This is internal function, use newmail_media_objects() instead
571 * @link http://www.apple.com/quicktime/authoring/embed.html Info about embed tag
572 * @param string $object object name
573 * @param integer $type media object type
574 * @param string $path URL to media object
575 * @param array $args media object attributes
576 * @param bool $addsuffix controls addition of suffix to media object url
577 * @return string embed html tags and attributes required by selected media type.
579 function newmail_media_embed($object,$type,$path,$args=array(),$addsuffix=true) {
582 $sArgs=newmail_media_prepare_args($args);
585 case SM_NEWMAIL_FILETYPE_SWF
:
586 if ($addsuffix) $suffix='.swf';
587 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
588 .'hidden="true" autostart="true" '. "\n"
590 .'name="' . $object .'" ' . "\n"
591 .'type="application/x-shockwave-flash" ' . "\n"
592 .'pluginspage="http://www.macromedia.com/go/getflashplayer">' . "\n";
594 case SM_NEWMAIL_FILETYPE_WAV
:
595 if ($addsuffix) $suffix='.wav';
596 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
597 .' hidden="true" autostart="true" '. "\n"
599 .' name="' . $object .'" ' . "\n"
600 .' type="audio/x-wav">' . "\n";
602 case SM_NEWMAIL_FILETYPE_SVG
:
603 if ($addsuffix) $suffix='.svg';
604 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
605 .'hidden="true" autostart="true" '. "\n"
607 .'name="' . $object .'" ' . "\n"
608 .'type="image/svg-xml" ' . "\n"
609 .'pluginspage="http://www.adobe.com/svg/viewer/install/">' . "\n";
611 case SM_NEWMAIL_FILETYPE_OGG
:
612 if ($addsuffix) $suffix='.ogg';
613 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
614 .' hidden="true" autostart="true" '. "\n"
616 .' name="' . $object .'" ' . "\n"
617 .' type="application/ogg">' . "\n";
619 case SM_NEWMAIL_FILETYPE_MP3
:
620 if ($addsuffix) $suffix='.mp3';
621 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
622 .' hidden="true" autostart="true" '. "\n"
624 .' name="' . $object .'" ' . "\n"
625 .' type="audio/mpeg">' . "\n";
634 * Adds closing tags for ie object
636 * * This is internal function, use newmail_media_objects() instead
637 * @param integer $type media object type
638 * @return string closing tag of media object
640 function newmail_media_object_ie_close($type) {
643 case SM_NEWMAIL_FILETYPE_SWF
:
644 case SM_NEWMAIL_FILETYPE_WAV
:
645 case SM_NEWMAIL_FILETYPE_MP3
:
646 $ret_end="</object>\n";
648 case SM_NEWMAIL_FILETYPE_OGG
:
649 case SM_NEWMAIL_FILETYPE_SVG
:
657 * Adds closing tags for object
659 * * This is internal function, use newmail_media_objects() instead
660 * @param integer $type media object type
661 * @return string closing tag of media object
663 function newmail_media_object_close($type) {
666 case SM_NEWMAIL_FILETYPE_SWF
:
667 case SM_NEWMAIL_FILETYPE_WAV
:
668 case SM_NEWMAIL_FILETYPE_OGG
:
669 case SM_NEWMAIL_FILETYPE_MP3
:
670 case SM_NEWMAIL_FILETYPE_SVG
:
671 $ret_end="</object>\n";
680 * Adds closing tags for object
682 * * This is internal function, use newmail_media_objects() instead
683 * @param integer $type media object type
684 * @return string closing tag of media object
686 function newmail_media_embed_close($type) {
689 case SM_NEWMAIL_FILETYPE_SWF
:
690 case SM_NEWMAIL_FILETYPE_WAV
:
691 case SM_NEWMAIL_FILETYPE_OGG
:
692 case SM_NEWMAIL_FILETYPE_MP3
:
693 case SM_NEWMAIL_FILETYPE_SVG
:
694 $ret_end="</embed>\n";
703 * Converts media attributes to string
705 * * attribute values are automatically sanitized by htmlspecialchars()
706 * * This is internal function, use newmail_media_objects() instead
707 * @param array $args array with object attributes
708 * @return string string with object attributes
710 function newmail_media_prepare_args($args) {
712 foreach ($args as $arg => $value) {
713 $ret_args.= $arg . '="' . htmlspecialchars($value) . '" ';
719 * Detects used media type and creates all need tags
720 * @param string $newmail_media
721 * @return string html tags with media objects
723 function newmail_create_media_tags($newmail_media) {
724 global $newmail_mmedia, $newmail_userfile_type;
726 if (preg_match("/^mmedia_+/",$newmail_media)) {
727 $ret_media = "<!-- newmail mmedia option -->\n";
729 $newmail_mmedia_short=preg_replace("/^mmedia_/",'',$newmail_media);
730 // check if media option is not removed
731 if (isset($newmail_mmedia[$newmail_mmedia_short])) {
732 $ret_media.= newmail_media_objects($newmail_mmedia_short,
733 $newmail_mmedia[$newmail_mmedia_short]['types'],
734 sqm_baseuri() . 'plugins/newmail/media/',
735 $newmail_mmedia[$newmail_mmedia_short]['args']);
737 $ret_media.= "<!-- end of newmail mmedia option -->\n";
738 } elseif ($newmail_media=='(userfile)') {
739 $ret_media = "<!-- newmail usermedia option -->\n";
740 $ret_media.= newmail_media_objects('loadfile.php',
741 array($newmail_userfile_type),
742 sqm_baseuri() . 'plugins/newmail/',
743 array('width'=>0,'height'=>0),
745 $ret_media.= "<!-- end of newmail usermedia option -->\n";
747 $ret_media = "<!-- newmail sounds from sounds/*.wav -->\n";
748 $ret_media.= newmail_media_objects(basename($newmail_media),
749 array(SM_NEWMAIL_FILETYPE_WAV
),
750 sqm_baseuri() . 'plugins/newmail/sounds/',
751 array('width'=>0,'height'=>0),
753 $ret_media.= "<!-- end of newmail sounds from sounds/*.wav -->\n";