remove old readme
[atutor.git] / docs / mods / _standard / chat / prefs.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2010                                      */
6 /* Inclusive Design Institute                                   */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License  */
11 /* as published by the Free Software Foundation.                                */
12 /****************************************************************/
13
14 define('AT_INCLUDE_PATH', '../../../include/');
15         require(AT_INCLUDE_PATH.'vitals.inc.php');
16         //authenticate(USER_CLIENT, USER_ADMIN);
17 require(AT_INCLUDE_PATH.'../mods/_standard/chat/lib/chat.inc.php');
18
19         $myPrefs = getPrefs($_SESSION['login']);
20         if ($_POST['submit'] || $_POST['submit_r']) {
21                 getAndWriteFormPrefs($myPrefs);
22
23                 if ($_POST['submit']) {
24                         $location = 'prefs2.php?firstLoginFlag='.$addslashes($_POST['firstLoginFlag']);
25                 } else {
26                         $location = 'chat.php?firstLoginFlag='.$addslashes($_POST['firstLoginFlag']);
27                 }
28                 
29                 Header('Location: '.$location);
30                 exit;
31         }
32         writePrefs($myPrefs, $_SESSION['login']);
33
34
35 require('include/html/chat_header.inc.php');
36 ?>
37 <table width="100%" border="0" cellpadding="5" cellspacing="0">
38 <tr>
39         <th align="left"><h4><?php echo _AT('chat_prefs_checking'); ?></h4></th>
40 </tr>
41 </table>
42 <br />
43 <form action="prefs.php" name="f1" method="post" target="_top">
44         <input type="hidden" name="firstLoginFlag" value="<?php echo $_GET['firstLoginFlag']; ?>" />
45 <?php
46     if ($myPrefs['refresh'] == 'manual') {
47        $mCManSelT = 'selected';
48     } else if ($myPrefs['refresh'] > 100) {
49        $mC180SelT = 'selected';
50     } else if ($myPrefs['refresh'] > 30) {
51        $mC60SelT = 'selected';
52     } else if ($myPrefs['refresh'] > 10) {
53        $mC20SelT = 'selected';
54     } else {
55        $mc5SelT = 'selected';
56     }
57
58 ?>
59 <p><b><?php echo _AT('chat_message_checking')  ?></b>
60         <select name="refresh">
61                 <option value="5" <?php echo $mc5SelT; ?>><?php echo _AT('chat_auto5_checking');  ?></option>
62                 <option value="20" <?php echo $mC20SelT; ?>><?php echo _AT('chat_auto20_checking');  ?></option>
63         <option value="60" <?php echo $mC60SelT; ?>><?php echo _AT('chat_auto60_checking');  ?></option>
64         <option value="180" <?php echo $mC180SelT; ?>><?php echo _AT('chat_auto180_checking');  ?></option>
65         <option value="manual" <?php echo $mCManSelT; ?>><?php echo _AT('chat_manual_checking');  ?></option>
66         </select></p>
67         <p><?php echo _AT('chat_message_check_help');  ?></p>
68
69 <?php
70     if ($myPrefs['bingFlag'] > 0) {
71        $bFSelT = 'selected';
72     }
73 ?>
74
75 <p><b><?php echo _AT('chat_message_chime') ?></b>
76         <select name="bingFlag">
77                 <option value="0"><?php echo _AT('no'); ?></option>
78                 <option value="1" <?php echo $bFSelT; ?>><?php echo _AT('yes'); ?></option>
79         </select></p>
80 <p><?php echo _AT('chat_chime_help');  ?></p>
81
82 <table width="100%" border="0" cellpadding="5" cellspacing="0">
83 <tr>
84         <td align="left"><input type="submit" value="<?php echo _AT('next'); ?>" name="submit" class="submit" onFocus="this.className='submit highlight'" onBlur="this.className='submit'" />
85                      <input type="submit" value="<?php echo _AT('chat_enter'); ?>" name="submit_r" class="submit" onFocus="this.className='submit highlight'" onBlur="this.className='submit'" /></td>
86 </tr>
87 </table>
88 </form>
89 <?php require('include/html/chat_footer.inc.php'); ?>