4 * SquirrelMail NewMail plugin
8 * @copyright © 2001-2007 The SquirrelMail Project Team
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
13 * @todo add midi support
17 /** file type defines */
18 define('SM_NEWMAIL_FILETYPE_WAV',2);
19 define('SM_NEWMAIL_FILETYPE_MP3',3);
20 define('SM_NEWMAIL_FILETYPE_OGG',4);
21 define('SM_NEWMAIL_FILETYPE_SWF',5);
22 define('SM_NEWMAIL_FILETYPE_SVG',6);
24 /** load default config */
25 if (file_exists(SM_PATH
. 'plugins/newmail/config_default.php')) {
26 include_once(SM_PATH
. 'plugins/newmail/config_default.php');
30 if (file_exists(SM_PATH
. 'config/newmail_config.php')) {
31 include_once(SM_PATH
. 'config/newmail_config.php');
32 } elseif (file_exists(SM_PATH
. 'plugins/newmail/config.php')) {
33 include_once(SM_PATH
. 'plugins/newmail/config.php');
36 // ----- hooked functions -----
39 * Register newmail option block
41 function newmail_optpage_register_block_function() {
42 // Gets added to the user's OPTIONS page.
43 global $optpage_blocks;
45 /* Register Squirrelspell with the $optionpages array. */
46 $optpage_blocks[] = array(
47 'name' => _("NewMail Options"),
48 'url' => sqm_baseuri() . 'plugins/newmail/newmail_opt.php',
49 'desc' => _("This configures settings for playing sounds and/or showing popup windows when new mail arrives."),
55 * Save newmail plugin settings
57 function newmail_sav_function() {
58 global $data_dir, $username, $_FILES, $newmail_uploadsounds;
60 if ( sqgetGlobalVar('submit_newmail', $submit, SQ_POST
) ) {
64 $media_changetitle = '';
69 sqgetGlobalVar('media_enable', $media_enable, SQ_POST
);
70 sqgetGlobalVar('media_popup', $media_popup, SQ_POST
);
71 sqgetGlobalVar('media_recent', $media_recent, SQ_POST
);
72 sqgetGlobalVar('media_changetitle', $media_changetitle, SQ_POST
);
73 sqgetGlobalVar('popup_width', $popup_width, SQ_POST
);
74 sqgetGlobalVar('popup_height', $popup_height, SQ_POST
);
76 // sanitize height and width
77 $popup_width = (int) $popup_width;
78 if ($popup_width<=0) $popup_width=200;
79 $popup_height = (int) $popup_height;
80 if ($popup_height<=0) $popup_height=130;
82 setPref($data_dir,$username,'newmail_enable',$media_enable);
83 setPref($data_dir,$username,'newmail_popup', $media_popup);
84 setPref($data_dir,$username,'newmail_recent',$media_recent);
85 setPref($data_dir,$username,'newmail_changetitle',$media_changetitle);
86 setPref($data_dir,$username,'newmail_popup_width',$popup_width);
87 setPref($data_dir,$username,'newmail_popup_height',$popup_height);
89 if (sqgetGlobalVar('newmail_unseen_notify', $newmail_unseen_notify, SQ_POST
)) {
90 $newmail_unseen_notify = (int) $newmail_unseen_notify;
91 setPref($data_dir,$username,'newmail_unseen_notify',$newmail_unseen_notify);
94 if( sqgetGlobalVar('media_sel', $media_sel, SQ_POST
) &&
95 $media_sel == '(none)' ) {
96 removePref($data_dir,$username,'newmail_media');
98 setPref($data_dir,$username,'newmail_media',$media_sel);
101 // process uploaded file
102 if ($newmail_uploadsounds && isset($_FILES['media_file']['tmp_name']) && $_FILES['media_file']['tmp_name']!='') {
103 // set temp file and get media file name
104 $newmail_tempmedia=getHashedDir($username, $data_dir) . "/$username.tempsound";
105 $newmail_mediafile=getHashedFile($username, $data_dir, $username . '.sound');
106 if (move_uploaded_file($_FILES['media_file']['tmp_name'], $newmail_tempmedia)) {
107 // new media file is in $newmail_tempmedia
108 if (file_exists($newmail_mediafile)) unlink($newmail_mediafile);
109 if (! rename($newmail_tempmedia,$newmail_mediafile)) {
110 // remove (userfile), if file rename fails
111 removePref($data_dir,$username,'newmail_media');
114 if (isset($_FILES['media_file']['type']) && isset($_FILES['media_file']['name'])) {
115 setPref($data_dir,$username,'newmail_userfile_type',
116 newmail_get_mediatype($_FILES['media_file']['type'],$_FILES['media_file']['name']));
118 removePref($data_dir,$username,'newmail_userfile_type');
121 if (isset($_FILES['media_file']['name'])) {
122 setPref($data_dir,$username,'newmail_userfile_name',basename($_FILES['media_file']['name']));
124 setPref($data_dir,$username,'newmail_userfile_name','mediafile.unknown');
133 * Load newmail plugin settings
135 function newmail_pref_function() {
136 global $username,$data_dir;
137 global $newmail_media,$newmail_media_enable,$newmail_popup;
138 global $newmail_recent, $newmail_changetitle;
139 global $newmail_userfile_type, $newmail_userfile_name;
140 global $newmail_popup_width, $newmail_popup_height;
141 global $newmail_unseen_notify;
143 $newmail_recent = getPref($data_dir,$username,'newmail_recent');
144 $newmail_media_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_changetitle = getPref($data_dir, $username, 'newmail_changetitle');
155 $newmail_userfile_type = getPref($data_dir, $username, 'newmail_userfile_type');
156 $newmail_userfile_name = getPref($data_dir,$username,'newmail_userfile_name','');
158 $newmail_unseen_notify = getPref($data_dir,$username,'newmail_unseen_notify',0);
164 * Used by option page when saving settings.
166 function newmail_set_loadinfo_function() {
167 global $optpage, $optpage_name;
168 if ($optpage=='newmail') {
169 $optpage_name=_("NewMail Options");
174 /* Receive the status of the folder and do something with it */
175 function newmail_folder_status($statusarr) {
176 global $newmail_media_enable,$newmail_popup,$newmail_changetitle,$trash_folder,
177 $sent_folder,$totalNewArr, $newmail_unseen_notify, $unseen_notify, $newmail_recent;
179 /* if $newmail_unseen_notify is set to zero, plugin follows $unseen_notify */
180 if ($newmail_unseen_notify == 0)
181 $newmail_unseen_notify = $unseen_notify;
183 $mailbox=$statusarr['MAILBOX'];
185 if (($newmail_media_enable == 'on' ||
186 $newmail_popup == 'on' ||
187 $newmail_changetitle == 'on') &&
189 * make sure that $newmail_unseen_notify is set to supported value,
190 * currently (1.5.2cvs) SMPREF_UNSEEN_NORMAL has highest integer value
191 * in SMPREF_UNSEEN constants
193 ($newmail_unseen_notify > SMPREF_UNSEEN_NONE
&& $newmail_unseen_notify <= SMPREF_UNSEEN_NORMAL
)) {
195 // Skip folders for Sent and Trash
196 // TODO: make this optional
197 if ($statusarr['MAILBOX'] == $sent_folder ||
$statusarr['MAILBOX'] == $trash_folder) {
201 if ((($mailbox == 'INBOX') && ($newmail_unseen_notify == SMPREF_UNSEEN_INBOX
)) ||
202 ($newmail_unseen_notify == SMPREF_UNSEEN_SPECIAL
&& isSpecialMailbox($mailbox)) ||
203 ($newmail_unseen_notify == SMPREF_UNSEEN_NORMAL
&& ! isSpecialMailbox($mailbox)) ||
204 ($newmail_unseen_notify == SMPREF_UNSEEN_ALL
)) {
205 if (($newmail_recent == 'on') && (!empty($statusarr['RECENT']))) {
206 $totalNewArr[$mailbox] = $statusarr['RECENT'];
207 } elseif ($newmail_recent != 'on' && !empty($statusarr['UNSEEN'])) {
208 $totalNewArr[$mailbox] = $statusarr['UNSEEN'];
215 * Insert needed data in left_main
217 function newmail_plugin_function() {
218 global $username, $newmail_media, $newmail_media_enable, $newmail_popup,
219 $newmail_recent, $newmail_changetitle, $imapConnection;
220 global $newmail_mmedia, $newmail_allowsound;
221 global $newmail_userfile_type;
222 global $newmail_popup_width, $newmail_popup_height;
225 if ($newmail_media_enable == 'on' ||
226 $newmail_popup == 'on' ||
227 $newmail_changetitle) {
229 if (!empty($totalNewArr)) { $totalNew=array_sum($totalNewArr); }
230 else { $totalNew=0; }
232 // If we found unseen messages, then we
233 // will play the sound as follows:
235 if ($newmail_changetitle) {
236 echo "<script type=\"text/javascript\">\n" .
237 "function ChangeTitleLoad() {\n" .
238 "var BeforeChangeTitle;\n";
239 echo 'window.parent.document.title = "' .
240 sprintf(ngettext("%s New Message","%s New Messages",$totalNew), $totalNew) .
242 echo "if (BeforeChangeTitle != null)\n".
243 "BeforeChangeTitle();\n".
245 "BeforeChangeTitle = window.onload;\n".
246 "window.onload = ChangeTitleLoad;\n".
250 // create media output if there are new email messages
251 if ($newmail_allowsound && $totalNew > 0
252 && $newmail_media_enable == 'on'
253 && $newmail_media != '' ) {
254 echo newmail_create_media_tags($newmail_media);
257 if ($totalNew > 0 && $newmail_popup == 'on') {
258 // Idea by: Nic Wolfe (Nic@TimelapseProductions.com)
259 // Web URL: http://fineline.xs.mw
260 // More code from Tyler Akins
261 echo "<script type=\"text/javascript\">\n".
263 "function PopupScriptLoad() {\n".
264 'window.open("'.sqm_baseuri().'plugins/newmail/newmail.php?numnew='.$totalNew.
266 "\"width=$newmail_popup_width,height=$newmail_popup_height,scrollbars=no\");\n".
267 "if (BeforePopupScript != null)\n".
268 "BeforePopupScript();\n".
270 "BeforePopupScript = window.onload;\n".
271 "window.onload = PopupScriptLoad;\n".
278 // ----- end of hooked functions -----
283 * Function tries to detect if file contents match declared file type
285 * Function returns default extension for detected mime type or 'false'
287 * TODO: use $contents to check if file is in specified type
288 * @param string $contents file contents
289 * @param string $type file mime type
292 function newmail_detect_filetype($contents,$type) {
293 // convert $type to lower case
294 $type=strtolower($type);
305 case 'application/ogg':
308 case 'application/x-shockwave-flash':
311 case 'image/svg+xml':
321 * Function tries to detect uploaded file type
322 * @param string $type
323 * @param string $filename
324 * @return integer One of SM_NEWMAIL_FILETYPE_* defines or false.
326 function newmail_get_mediatype($type,$filename) {
328 // fix for browser's that upload file as application/octet-stream
329 case 'application/octet-stream':
330 $ret=newmail_get_mediatype_by_ext($filename);
333 $ret=SM_NEWMAIL_FILETYPE_WAV
;
336 $ret=SM_NEWMAIL_FILETYPE_MP3
;
338 case 'application/ogg':
339 $ret=SM_NEWMAIL_FILETYPE_OGG
;
341 case 'application/x-shockwave-flash':
342 $ret=SM_NEWMAIL_FILETYPE_SWF
;
344 case 'image/svg+xml':
345 $ret=SM_NEWMAIL_FILETYPE_SVG
;
354 * Function provides filetype detection for browsers, that
355 * upload files with application/octet-stream file type.
356 * Ex. some version of Opera.
357 * @param string $filename
358 * @return integer One of SM_NEWMAIL_FILETYPE_* defines or false.
360 function newmail_get_mediatype_by_ext($filename) {
361 if (preg_match("/\.wav$/i",$filename)) return SM_NEWMAIL_FILETYPE_WAV
;
362 if (preg_match("/\.mp3$/i",$filename)) return SM_NEWMAIL_FILETYPE_MP3
;
363 if (preg_match("/\.ogg$/i",$filename)) return SM_NEWMAIL_FILETYPE_OGG
;
364 if (preg_match("/\.swf$/i",$filename)) return SM_NEWMAIL_FILETYPE_SWF
;
365 if (preg_match("/\.svg$/i",$filename)) return SM_NEWMAIL_FILETYPE_SVG
;
370 * Creates html object tags of multimedia object
372 * Main function that creates multimedia object tags
373 * @param string $object object name
374 * @param integer $type media object type
375 * @param string $path URL to media object
376 * @param array $args media object attributes
377 * @param string $extra tags that have to buried deep inside object tags
378 * @param bool $addsuffix controls addition of suffix to media object url
379 * @return string object html tags and attributes required by selected media type.
381 function newmail_media_objects($object,$types,$path,$args=array(),$extra='',$addsuffix=true) {
382 global $newmail_mediacompat_mode;
384 // first prepare single object for IE
385 $ret = newmail_media_object_ie($object,$types[0],$path,$args,$addsuffix);
387 // W3.org nested objects
388 $ret.= "<!--[if !IE]> <-->\n"; // not for IE
390 foreach ($types as $type) {
391 $ret.= newmail_media_object($object,$type,$path,$args,$addsuffix);
394 if (isset($newmail_mediacompat_mode) && $newmail_mediacompat_mode)
395 $ret.= newmail_media_embed($object,$types[0],$path,$args,$addsuffix);
396 // add $extra code inside objects
401 if (isset($newmail_mediacompat_mode) && $newmail_mediacompat_mode)
402 $ret.= newmail_media_embed_close($types[0]);
404 // close w3.org nested objects
405 foreach (array_reverse($types) as $type) {
406 $ret.= newmail_media_object_close($type);
408 $ret.= "<!--> <![endif]-->\n"; // end non-IE mode
410 $ret.= newmail_media_object_ie_close($types[0]);
416 * Creates object tags of multimedia object for browsers that comply to w3.org
421 * <li>Returned string does not contain html closing tag.
422 * <li>This is internal function, use newmail_media_objects() instead
424 * @link http://www.w3.org/TR/html4/struct/objects.html#edef-OBJECT W3.org specs
425 * @param string $object object name
426 * @param integer $type media object type
427 * @param string $path URL to media object
428 * @param array $args media object attributes
429 * @param bool $addsuffix controls addition of suffix to media object url
430 * @return string object html tags and attributes required by selected media type.
432 function newmail_media_object($object,$type,$path,$args=array(),$addsuffix=true) {
435 $sArgs=newmail_media_prepare_args($args);
438 case SM_NEWMAIL_FILETYPE_SWF
:
439 if ($addsuffix) $suffix='.swf';
440 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
442 .'type="application/x-shockwave-flash">' . "\n";
444 case SM_NEWMAIL_FILETYPE_WAV
:
445 if ($addsuffix) $suffix='.wav';
446 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
448 .'type="audio/x-wav">' . "\n";
450 case SM_NEWMAIL_FILETYPE_OGG
:
451 if ($addsuffix) $suffix='.ogg';
452 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
454 .'type="application/ogg">' . "\n";
456 case SM_NEWMAIL_FILETYPE_MP3
:
457 if ($addsuffix) $suffix='.mp3';
458 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
460 .'type="audio/mpeg">' . "\n";
462 case SM_NEWMAIL_FILETYPE_SVG
:
463 if ($addsuffix) $suffix='.svg';
464 $ret_w3 = '<object data="' . $path . $object . $suffix . '" '
466 .'type="image/svg+xml">' . "\n";
475 * Creates multimedia object tags for Internet Explorer (Win32)
478 * * Returned string does not contain html closing tag, because
479 * this multimedia object can include other media objects.
480 * * This is internal function, use newmail_media_objects() instead
482 * @param string $object object name
483 * @param integer $type media object type
484 * @param string $path URL to media object
485 * @param array $args media object attributes
486 * @param bool $addsuffix controls addition of suffix to media object url
487 * @return string object html tags and attributes required by selected media type.
488 * @todo add ogg and svg support
490 function newmail_media_object_ie($object,$type,$path,$args=array(),$addsuffix) {
493 $sArgs=newmail_media_prepare_args($args);
496 case SM_NEWMAIL_FILETYPE_SWF
:
497 if ($addsuffix) $suffix='.swf';
498 $ret_ie ='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
499 .'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" '
500 . $sArgs . 'id="' . $object ."\">\n"
501 .'<param name="movie" value="' . $path . $object . $suffix . "\">\n"
502 .'<param name="hidden" value="true">' . "\n";
504 case SM_NEWMAIL_FILETYPE_WAV
:
505 if ($addsuffix) $suffix='.wav';
506 $ret_ie ='<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" '
507 .'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,0902" '
508 . $sArgs . 'id="' . $object ."\" \n"
509 .'type="audio/x-wav">' ."\n"
510 .'<param name="FileName" value="' . $path . $object . $suffix . "\">\n";
512 case SM_NEWMAIL_FILETYPE_MP3
:
513 if ($addsuffix) $suffix='.mp3';
514 $ret_ie ='<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" '
515 .'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,0902" '
516 . $sArgs . 'id="' . $object ."\" \n"
517 .'type="audio/mpeg">' ."\n"
518 .'<param name="FileName" value="' . $path . $object . $suffix . "\">\n";
520 case SM_NEWMAIL_FILETYPE_OGG
:
521 case SM_NEWMAIL_FILETYPE_SVG
:
529 * Creates embed tags of multimedia object
532 * Apple: http://www.apple.com/quicktime/authoring/embed.html
535 * * Returned string does not contain html closing tag.
536 * * embed tags will be created by newmail_media_objects() only
537 * when $newmail_mediacompat_mode option is enabled. Option is not
538 * enabled by default in order to comply to w3.org specs.
539 * * This is internal function, use newmail_media_objects() instead
540 * @link http://www.apple.com/quicktime/authoring/embed.html Info about embed tag
541 * @param string $object object name
542 * @param integer $type media object type
543 * @param string $path URL to media object
544 * @param array $args media object attributes
545 * @param bool $addsuffix controls addition of suffix to media object url
546 * @return string embed html tags and attributes required by selected media type.
548 function newmail_media_embed($object,$type,$path,$args=array(),$addsuffix=true) {
551 $sArgs=newmail_media_prepare_args($args);
554 case SM_NEWMAIL_FILETYPE_SWF
:
555 if ($addsuffix) $suffix='.swf';
556 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
557 .'hidden="true" autostart="true" '. "\n"
559 .'name="' . $object .'" ' . "\n"
560 .'type="application/x-shockwave-flash" ' . "\n"
561 .'pluginspage="http://www.macromedia.com/go/getflashplayer">' . "\n";
563 case SM_NEWMAIL_FILETYPE_WAV
:
564 if ($addsuffix) $suffix='.wav';
565 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
566 .' hidden="true" autostart="true" '. "\n"
568 .' name="' . $object .'" ' . "\n"
569 .' type="audio/x-wav">' . "\n";
571 case SM_NEWMAIL_FILETYPE_SVG
:
572 if ($addsuffix) $suffix='.svg';
573 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
574 .'hidden="true" autostart="true" '. "\n"
576 .'name="' . $object .'" ' . "\n"
577 .'type="image/svg-xml" ' . "\n"
578 .'pluginspage="http://www.adobe.com/svg/viewer/install/">' . "\n";
580 case SM_NEWMAIL_FILETYPE_OGG
:
581 if ($addsuffix) $suffix='.ogg';
582 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
583 .' hidden="true" autostart="true" '. "\n"
585 .' name="' . $object .'" ' . "\n"
586 .' type="application/ogg">' . "\n";
588 case SM_NEWMAIL_FILETYPE_MP3
:
589 if ($addsuffix) $suffix='.mp3';
590 $ret_embed='<embed src="' . $path . $object . $suffix . '" '. "\n"
591 .' hidden="true" autostart="true" '. "\n"
593 .' name="' . $object .'" ' . "\n"
594 .' type="audio/mpeg">' . "\n";
603 * Adds closing tags for ie object
605 * * This is internal function, use newmail_media_objects() instead
606 * @param integer $type media object type
607 * @return string closing tag of media object
609 function newmail_media_object_ie_close($type) {
612 case SM_NEWMAIL_FILETYPE_SWF
:
613 case SM_NEWMAIL_FILETYPE_WAV
:
614 case SM_NEWMAIL_FILETYPE_MP3
:
615 $ret_end="</object>\n";
617 case SM_NEWMAIL_FILETYPE_OGG
:
618 case SM_NEWMAIL_FILETYPE_SVG
:
626 * Adds closing tags for object
628 * * This is internal function, use newmail_media_objects() instead
629 * @param integer $type media object type
630 * @return string closing tag of media object
632 function newmail_media_object_close($type) {
635 case SM_NEWMAIL_FILETYPE_SWF
:
636 case SM_NEWMAIL_FILETYPE_WAV
:
637 case SM_NEWMAIL_FILETYPE_OGG
:
638 case SM_NEWMAIL_FILETYPE_MP3
:
639 case SM_NEWMAIL_FILETYPE_SVG
:
640 $ret_end="</object>\n";
649 * Adds closing tags for object
651 * * This is internal function, use newmail_media_objects() instead
652 * @param integer $type media object type
653 * @return string closing tag of media object
655 function newmail_media_embed_close($type) {
658 case SM_NEWMAIL_FILETYPE_SWF
:
659 case SM_NEWMAIL_FILETYPE_WAV
:
660 case SM_NEWMAIL_FILETYPE_OGG
:
661 case SM_NEWMAIL_FILETYPE_MP3
:
662 case SM_NEWMAIL_FILETYPE_SVG
:
663 $ret_end="</embed>\n";
672 * Converts media attributes to string
674 * * attribute values are automatically sanitized by htmlspecialchars()
675 * * This is internal function, use newmail_media_objects() instead
676 * @param array $args array with object attributes
677 * @return string string with object attributes
679 function newmail_media_prepare_args($args) {
681 foreach ($args as $arg => $value) {
682 $ret_args.= $arg . '="' . htmlspecialchars($value) . '" ';
688 * Detects used media type and creates all need tags
689 * @param string $newmail_media
690 * @return string html tags with media objects
692 function newmail_create_media_tags($newmail_media) {
693 global $newmail_mmedia, $newmail_userfile_type;
695 if (preg_match("/^mmedia_+/",$newmail_media)) {
696 $ret_media = "<!-- newmail mmedia option -->\n";
698 $newmail_mmedia_short=preg_replace("/^mmedia_/",'',$newmail_media);
699 // check if media option is not removed
700 if (isset($newmail_mmedia[$newmail_mmedia_short])) {
701 $ret_media.= newmail_media_objects($newmail_mmedia_short,
702 $newmail_mmedia[$newmail_mmedia_short]['types'],
703 sqm_baseuri() . 'plugins/newmail/media/',
704 $newmail_mmedia[$newmail_mmedia_short]['args']);
706 $ret_media.= "<!-- end of newmail mmedia option -->\n";
707 } elseif ($newmail_media=='(userfile)') {
708 $ret_media = "<!-- newmail usermedia option -->\n";
709 $ret_media.= newmail_media_objects('loadfile.php',
710 array($newmail_userfile_type),
711 sqm_baseuri() . 'plugins/newmail/',
712 array('width'=>0,'height'=>0),
714 $ret_media.= "<!-- end of newmail usermedia option -->\n";
716 $ret_media = "<!-- newmail sounds from sounds/*.wav -->\n";
717 $ret_media.= newmail_media_objects(basename($newmail_media),
718 array(SM_NEWMAIL_FILETYPE_WAV
),
719 sqm_baseuri() . 'plugins/newmail/sounds/',
720 array('width'=>0,'height'=>0),
722 $ret_media.= "<!-- end of newmail sounds from sounds/*.wav -->\n";