Location: PHPKode > projects > ACollab > chat/prefs.php
<?php
/****************************************************************************************/
/* ACollab                                                                              */
/****************************************************************************************/
/* Copyright (c) 2002-2004  Adaptive Technology Resource Centre / University of Toronto */
/*                                                                                      */
/* http://atutor.ca/acollab                                                             */
/*                                                                                      */
/* This program is free software. You may redistribute it and/or                        */
/* modify it under the terms of the GNU General Public License                          */
/* as published by the Free Software Foundation; either version 2 of the License,       */
/* or (at your option) any later version.                                               */
/*                                                                                      */
/* This program is distributed in the hope that it will be useful, but                  */
/* WITHOUT ANY WARRANTY; without even the implied warranty of                           */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                                 */
/* See the GNU General Public License for more details.                                 */
/*                                                                                      */
/* You may access the GNU General Public License at:                                    */
/* http://www.opensource.org/licenses/gpl-license.php                                   */
/*                                                                                      */
/* You may contact the Adaptive Technology Resource Centre at                           */
/* Robarts Library, University of Toronto                                               */
/* 130 St. George Street, Toronto, Ontario, Canada M5S 1A5                              */
/* Further contact information is available at http://www.utoronto.ca/atrc/             */
/****************************************************************************************/
/* Programmer:                                                                          */
/* Joel Kronenberg - ATRC                                                               */
/****************************************************************************************/
// $Id: prefs.php 231 2004-06-07 18:55:02Z boonhau $

define('AC_INCLUDE_PATH', '../include/');

	require(AC_INCLUDE_PATH.'vitals.inc.php');
	authenticate(USER_CLIENT, USER_GROUP_ADMIN, USER_ADMIN);
	require('include/functions.inc.php');

	$myPrefs = getPrefs($_SESSION['login']);
	if ($_POST['submit'] || $_POST['submit_r']) {
		getAndWriteFormPrefs($myPrefs);

		if ($_POST['submit']) {
			$location = 'prefs2.php?firstLoginFlag='.$_POST['firstLoginFlag'];
		} else {
			$location = 'chat.php?firstLoginFlag='.$_POST['firstLoginFlag'];
		}
		
		Header('Location: '.$location);
		exit;
	}
	writePrefs($myPrefs, $_SESSION['login']);


require(AC_INCLUDE_PATH.'pub/header.inc.php');
?>
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
	<td align="left"><h4><?php echo _AC('chat_prefs_checking'); ?></h4></td>
</tr>
</table>

<form action="chat/prefs.php" name="f1" method="post" target="_top">
	<input type="hidden" name="firstLoginFlag" value="<?php echo $_GET['firstLoginFlag']; ?>" />
<?php
    if ($myPrefs['refresh'] == 'manual') {
       $mCManSelT = 'selected="selected"';
    } else if ($myPrefs['refresh'] > 100) {
       $mC180SelT = 'selected="selected"';
    } else if ($myPrefs['refresh'] > 30) {
       $mC60SelT = 'selected="selected"';
    } else if ($myPrefs['refresh'] > 10) {
       $mC20SelT = 'selected="selected"';
    } else {
       $mc5SelT = 'selected="selected"';
    }

?>
<p><b><?php echo _AC('chat_message_checking')  ?></b>
	<select name="refresh">
		<option value="5" <?php echo $mc5SelT; ?>><?php echo _AC('chat_auto5_checking');  ?></option>
		<option value="20" <?php echo $mC20SelT; ?>><?php echo _AC('chat_auto20_checking');  ?></option>
        <option value="60" <?php echo $mC60SelT; ?>><?php echo _AC('chat_auto60_checking');  ?></option>
        <option value="180" <?php echo $mC180SelT; ?>><?php echo _AC('chat_auto180_checking');  ?></option>
        <option value="manual" <?php echo $mCManSelT; ?>><?php echo _AC('chat_manual_checking');  ?></option>
	</select></p>
	<p><?php echo _AC('chat_message_check_help');  ?></p>

<!--p style="margin-left: 40;">When you send a message to the <?php echo $admin['chatName']; ?>, the message is not sent immediately to other participants. Instead, it is stored until each participant checks for new messages.</p>

<p style="margin-left: 40;">You may check for messages "Manually" by clicking the "Refresh Messages" link, or you may tell the <?php echo $admin['chatName']; ?> to check for new messages "Automatically" every few seconds.</p>

<p style="margin-left: 40;"><i>We suggest that people using screen readers should set the message checking option to "Manual Refresh", or use a longer automatic checking interval.</i></p -->

<?php
    if ($myPrefs['bingFlag'] > 0) {
       $bFSelT = 'selected="selected"';
    }
?>

<p><b><?php echo _AC('chat_message_chime') ?></b>
	<select name="bingFlag">
		<option value="0"><?php echo _AC('chat_chime_no'); ?></option>
		<option value="1" <?php echo $bFSelT; ?>><?php echo _AC('chat_chime_yes'); ?></option>
	</select></p>
<p><?php echo _AC('chat_chime_help');  ?></p>
<!--p style="margin-left: 40;">To let you know when new messages are available, set the new message chime to "Yes". If you have set the message checking to "Manual Refresh", the chime will let you know that a new message is waiting, and clicking "Refresh Messages" will let you see it. If you have set message checking to "automatic", the chime will let you know when new messages are put up on your screen.</p>

<p style="margin-left: 40;"><i>We suggest that people using screen readers should set the new message chime option to "Yes".</i></p>

<p style="margin-left: 40;"><i>Macintosh Users: Please note that the combination of Manual Refresh and New Message Chime does not work in all browsers.</i></p -->

<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
	<td align="left"><input type="submit" value="<?php echo _AC('chat_next'); ?>" name="submit" class="submit" onfocus="this.className='submit highlight'" onblur="this.className='submit'" />
                     <input type="submit" value="<?php echo _AC('chat_enter'); ?>" name="submit_r" class="submit" onfocus="this.className='submit highlight'" onblur="this.className='submit'" /></td>
</tr>
</table>
</form>
<?php
	require(AC_INCLUDE_PATH.'pub/footer.inc.php');
?>
Return current item: ACollab