egroupware/calendar/inc/class.bopreferences.inc.php

82 lines
2.5 KiB
PHP
Raw Normal View History

<?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
{
var $public_functions = Array(
'preferences' => True
);
var $prefs;
var $debug = False;
function bopreferences()
{
$GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs');
$this->prefs['calendar'] = $GLOBALS['phpgw_info']['user']['preferences']['calendar'];
}
function preferences()
{
2001-11-06 02:49:16 +01:00
if (isset($GLOBALS['HTTP_POST_VARS']['submit']))
{
$GLOBALS['phpgw']->preferences->read_repository();
2002-04-18 01:43:29 +02:00
$pref_list = Array(
'weekdaystarts',
'workdaystarts',
'workdayends',
'defaultcalendar',
'defaultfilter',
'interval'
);
2002-04-18 01:43:29 +02:00
for($i=0;$i<count($pref_list);$i++)
{
2002-04-18 01:43:29 +02:00
$GLOBALS['phpgw']->preferences->add('calendar',$pref_list[$i],$GLOBALS['HTTP_POST_VARS']['prefs'][$pref_list[$i]]);
}
2002-04-18 01:43:29 +02:00
$pref_list = Array(
'mainscreen_showevents',
'send_updates',
'display_status',
'default_private',
'display_minicals',
'print_black_white',
'weekdays_only'
);
2002-04-18 01:43:29 +02:00
for($i=0;$i<count($pref_list);$i++)
{
2002-04-18 01:43:29 +02:00
if ($GLOBALS['HTTP_POST_VARS']['prefs'][$pref_list[$i]] == True)
{
$GLOBALS['phpgw']->preferences->add('calendar',$pref_list[$i],$GLOBALS['HTTP_POST_VARS']['prefs'][$pref_list[$i]]);
}
else
{
$GLOBALS['phpgw']->preferences->delete('calendar',$pref_list[$i]);
}
}
$GLOBALS['phpgw']->preferences->save_repository(True);
Header('Location: '.$GLOBALS['phpgw']->link('/preferences/index.php'));
$GLOBALS['phpgw']->common->phpgw_exit();
}
}
}
2002-04-18 01:43:29 +02:00
?>