Moved get message_id and reply_id to smtp.php because it's insane to get
[squirrelmail.git] / plugins / newmail / newmail_opt.php
CommitLineData
4508b1b6 1<?php
2d4c15d6 2
4508b1b6 3 /**
4 ** newmails_opt.php
15e6162e 5 **
6 ** Copyright (c) 1999-2002 The SquirrelMail Project Team
3d75ef16 7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
4508b1b6 8 **
9 ** Displays all options relating to new mail sounds
10 **
2d4c15d6 11 ** $Id$
3d75ef16 12 **
4508b1b6 13 **/
14
3d75ef16 15 chdir("..");
16 require_once('../src/validate.php');
17 require_once('../functions/page_header.php');
18 require_once('../functions/display_messages.php');
19 require_once('../functions/imap.php');
20 require_once('../functions/array.php');
21 require_once('../src/load_prefs.php');
22
23 displayPageHeader($color, 'None');
24
cc61478a 25 $media_enable = getPref($data_dir,$username, 'newmail_enable', 'FALSE' );
3d75ef16 26 $media_popup = getPref($data_dir, $username,'newmail_popup');
27 $media_allbox = getPref($data_dir,$username,'newmail_allbox');
28 $media_recent = getPref($data_dir,$username,'newmail_recent');
29 $media_changetitle = getPref($data_dir,$username,'newmail_changetitle');
cc61478a 30 $media = getPref($data_dir,$username,'newmail_media', '../plugins/newmail/sounds/Notify.wav');
3d75ef16 31
412303e0 32 // Set $allowsound to false if you don't want sound files available
33 $allowsound = "true";
34
3d75ef16 35 echo '<br>' .
36 "<table width=95% align=center border=0 cellpadding=2 cellspacing=0><tr><td bgcolor=\"$color[0]\">\n".
37 '<center><b>' . _("Options") . ' - ' . _("New Mail Notification") . '</b></center>'.
412303e0 38 '</td></tr><tr><td>';
39 if ($allowsound == "true") {
40 echo '<p>'.
41 _("Select <b>Enable Media Playing</b> to turn on playing a media file when unseen mail is in your folders. When enabled, you can specify the media file to play in the provided file box.") .
42 '</p>';
43 }
44 echo '<p>'.
3d75ef16 45_("The <b>Check all boxes, not just INBOX</b> option will check ALL of your folders for unseen mail, not just the inbox for notification.").
46 '</p><p>'.
47_("Selecting the <b>Show popup</b> option will enable the showing of a popup window when unseen mail is in your folders (requires JavaScript).") .
48 '</p><p>'.
49_("Use the <b>Check RECENT</b> to only check for messages that are recent. Recent messages are those that have just recently showed up and have not been \"viewed\" or checked yet. This can prevent being continuously annoyed by sounds or popups for unseen mail.").
50 '</p><p>'.
51_("Selecting the <b>Change title</b> option will change the title in some browsers to let you know when you have new mail (requires JavaScript, and only works in IE but you won't see errors with other browsers). This will always tell you if you have new mail, even if you have <b>Check RECENT</b> enabled.").
412303e0 52 '</p>';
53 if ($allowsound == "true") {
54 echo '<p>'.
3d75ef16 55_("Select from the list of <b>server files</b> the media file to play when new mail arrives. Selecting <b>local media</b> will play the file specified in the <b>local media file</b> box to play from the local computer. If no file is specified, the system will use a default from the server.") .
412303e0 56 '</p>';
3d75ef16 57 }
412303e0 58 echo '<form action="../../src/options.php" method=post>'.
59 '<table width=100% cellpadding=0 cellspacing=2 border=0>'.
3d75ef16 60 '<tr>'.
412303e0 61 '<td align=right nowrap>&nbsp</td>';
62 if ($allowsound == "true") {
63 echo '<td><input type=checkbox ';
64 if ($media_enable == 'on') {
65 echo 'checked ';
66 }
67 echo 'name=media_enable><b> ' . _("Enable Media Playing") . '</b></td>'.
68 '</tr>';
69 }
70 echo '<tr>'.
3d75ef16 71 '<td align=right nowrap>&nbsp</td>'.
72 '<td><input type=checkbox ';
73 if ($media_allbox == 'on') {
74 echo 'checked ';
75 }
76 echo 'name=media_allbox><b> ' . _("Check all boxes, not just INBOX") . '</b></td>'.
77 '</tr>'.
78 '<tr>'.
79 '<td align=right nowrap>&nbsp</td>'.
80 '<td><input type=checkbox ';
81 if ($media_recent == 'on') {
82 echo 'checked ';
83 }
84 echo 'name=media_recent><b> ' . _("Count only messages that are RECENT") . '</b></td>'.
85 '</tr>'.
86 '<tr>'.
87 '<td align=right nowrap>&nbsp</td>' .
88 '<td><input type=checkbox ';
89 if ($media_changetitle == 'on') {
90 echo 'checked ';
91 }
e697b6cc 92 echo 'name=media_changetitle><b> ' . _("Change title on supported browsers.") . '</b> &nbsp; (' . _("requires JavaScript to work") . ')</td>'.
3d75ef16 93 '</tr>'.
94 '<tr>'.
95 '<td align=right nowrap>&nbsp</td>'.
96 '<td><input type=checkbox ';
97 if($media_popup == 'on') {
98 echo 'checked ';
99 }
100 echo 'name=media_popup><b> ' . _("Show popup window on new mail") . '</b> &nbsp; (' . _("requires JavaScript to work") . ')</td>'.
412303e0 101 '</tr>';
102 if ($allowsound == "true") {
103 echo '<tr>'.
3d75ef16 104 '<td align=right nowrap>' . _("Select server file:") . '</td>'.
105 '<td><SELECT NAME=media_sel>'.
cc61478a 106 '<OPTION VALUE="(local media)">' . _("(local media)") . '</option>';
3d75ef16 107
108 // Iterate sound files for options
109
110 $d = dir('../plugins/newmail/sounds');
111 while($entry=$d->read()) {
112 $fname = $d->path . "/" . $entry;
cc61478a 113 if ($entry != '..' && $entry != '.') {
3d75ef16 114 echo "<OPTION ";
115 if ($fname == $media) {
116 echo "SELECTED ";
117 }
cc61478a 118 echo "VALUE=\"" . $fname . "\">" . $entry . "</option>\n";
3d75ef16 119 }
120 }
121 $d->close();
122 echo '</SELECT>'.
123 '<input type="submit" value=" ' . _("Try") . ' " name="test" onClick="'.
124 "window.open('testsound.php?sound='+media_sel.options[media_sel.selectedIndex].value, 'TestSound',".
125 "'width=150,height=30,scrollbars=no');".
126 'return false;'.
127 '">'.
128 '</td>'.
129 '</tr>'.
130 '<tr>'.
131 '<td align=right nowrap>' . _("Local Media File:") .
132 '</td><td>'.
133 '<input type=file size=40 name=media_file>'.
134 '</td>'.
135 '</tr>'.
136 '<tr>'.
137 '<td align=right nowrap>' . _("Current File:") .
138 '</td><td>'.
139 "<input type=hidden value=\"$media;\" name=media_default>$media;</td>".
412303e0 140 '</tr>';
141 }
142 echo '<tr>'.
3d75ef16 143 '<td>&nbsp;</td>'.
144 '<td>'.
cc61478a 145 '<INPUT TYPE=HIDDEN NAME=optmode VALUE=submit>'.
3d75ef16 146 '<input type="submit" value="' . _("Submit") . '" name="submit_newmail">'.
147 '</td>'.
148 '</tr>'.
149 '</table>'.
150 '</form>'.
151 '</td></tr></table>'.
152'</body></html>';
153
15e6162e 154?>