<?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.1.1 2003/06/12 18:56:56 kazuyan 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();
			}
		}
	}

