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