<?php
  /**************************************************************************\
  * phpGroupWare - Calendar                                                  *
  * http://www.phpgroupware.org                                              *
  * Based on Webcalendar by Craig Knudsen <cknudsen@radix.net>               *
  *          http://www.radix.net/~cknudsen                                  *
  * Modified by Mark Peters <skeeter@phpgroupware.org>                       *
  * --------------------------------------------                             *
  *  This program is free software; you can 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.                                              *
  \**************************************************************************/

	/* $Id: class.bopreferences.inc.php,v 1.1.2.1 2002/04/28 19:17:59 skeeter Exp $ */

	class bopreferences
	{
		var $public_functions = Array(
			'preferences'  => True
		);

		var $prefs;
		var $debug = False;

		function bopreferences()
		{
			$GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs');
			$this->prefs['todo']    = $GLOBALS['phpgw_info']['user']['preferences']['todo'];
		}

		function preferences()
		{
			if (isset($GLOBALS['HTTP_POST_VARS']['submit']))
			{
				$GLOBALS['phpgw']->preferences->read_repository();
				if ($GLOBALS['HTTP_POST_VARS']['prefs']['mainscreen_showevents'] == True)
				{
					$GLOBALS['phpgw']->preferences->add('todo','mainscreen_showevents',$GLOBALS['HTTP_POST_VARS']['prefs']['mainscreen_showevents']);
				}
				else
				{
					$GLOBALS['phpgw']->preferences->delete('todo','mainscreen_showevents');
				}

				$GLOBALS['phpgw']->preferences->save_repository(True);

				Header('Location: '.$GLOBALS['phpgw']->link('/preferences/index.php'));
				$GLOBALS['phpgw']->common->phpgw_exit();
			}
		}
	}

