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