From: <cl...@us...> - 2003-02-13 07:22:21
|
Update of /cvsroot/phpicalendar/phpicalendar In directory sc8-pr-cvs1:/tmp/cvs-serv20814 Modified Files: config.inc.php preferences.php Log Message: Basic unset prefs support. Ready for testing. Index: config.inc.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/config.inc.php,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** config.inc.php 7 Dec 2002 17:10:04 -0000 1.93 --- config.inc.php 13 Feb 2003 07:22:18 -0000 1.94 *************** *** 38,42 **** $header_always = 'no'; // Set to yes to have header on print.php $allow_preferences = 'yes'; // Allow visitors to change various preferences via cookies. ! $printview_default = 'yes'; // Set print view as the default view. day, week, and month only supported views for $default_view (listed well above). $show_todos = 'yes'; // Show your todo list on the side of day and week view. $show_completed = 'yes'; // Show completed todos on your todo list. --- 38,42 ---- $header_always = 'no'; // Set to yes to have header on print.php $allow_preferences = 'yes'; // Allow visitors to change various preferences via cookies. ! $printview_default = 'no'; // Set print view as the default view. day, week, and month only supported views for $default_view (listed well above). $show_todos = 'yes'; // Show your todo list on the side of day and week view. $show_completed = 'yes'; // Show completed todos on your todo list. Index: preferences.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/preferences.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** preferences.php 7 Dec 2002 17:10:04 -0000 1.21 --- preferences.php 13 Feb 2003 07:22:18 -0000 1.22 *************** *** 14,23 **** $cookie_style = $HTTP_POST_VARS['cookie_style']; $cookie_startday = $HTTP_POST_VARS['cookie_startday']; ! $cookie_time = $HTTP_POST_VARS['cookie_time']; $the_cookie = array ("cookie_language" => "$cookie_language", "cookie_calendar" => "$cookie_calendar", "cookie_view" => "$cookie_view", "cookie_startday" => "$cookie_startday", "cookie_style" => "$cookie_style", "cookie_time" => "$cookie_time"); $the_cookie = serialize($the_cookie); ! setcookie("phpicalendar","$the_cookie",time()+(60*60*24*7*12*10) ,"/","$cookie_uri",0); $HTTP_COOKIE_VARS['phpicalendar'] = $the_cookie; - #unset ($cookie_language, $cookie_calendar, $cookie_view, $cookie_style,$cookie_startday); } --- 14,27 ---- $cookie_style = $HTTP_POST_VARS['cookie_style']; $cookie_startday = $HTTP_POST_VARS['cookie_startday']; ! $cookie_time = $HTTP_POST_VARS['cookie_time']; ! $cookie_unset = $HTTP_POST_VARS['unset']; $the_cookie = array ("cookie_language" => "$cookie_language", "cookie_calendar" => "$cookie_calendar", "cookie_view" => "$cookie_view", "cookie_startday" => "$cookie_startday", "cookie_style" => "$cookie_style", "cookie_time" => "$cookie_time"); $the_cookie = serialize($the_cookie); ! if ($cookie_unset) { ! setcookie("phpicalendar","$the_cookie",time()-(60*60*24*7) ,"/","$cookie_uri",0); ! } else { ! setcookie("phpicalendar","$the_cookie",time()+(60*60*24*7*12*10) ,"/","$cookie_uri",0); ! } $HTTP_COOKIE_VARS['phpicalendar'] = $the_cookie; } *************** *** 30,33 **** --- 34,40 ---- $cookie_startday = $phpicalendar['cookie_startday']; $cookie_time = $phpicalendar['cookie_time']; + if ($cookie_unset) { + unset ($cookie_language, $cookie_calendar, $cookie_view, $cookie_style,$cookie_startday); + } } #echo "$cookie_uri"; *************** *** 36,40 **** include(BASE.'functions/ical_parser.php'); ! if (!isset($HTTP_COOKIE_VARS['phpicalendar'])) { # No cookie set -> use defaults from config file. $cookie_language = ucfirst($language); --- 43,47 ---- include(BASE.'functions/ical_parser.php'); ! if ((!isset($HTTP_COOKIE_VARS['phpicalendar'])) || ($cookie_unset)) { # No cookie set -> use defaults from config file. $cookie_language = ucfirst($language); *************** *** 94,104 **** <table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B"> <?php ! ! if ($action == 'setcookie') { ?> <tr> ! <td colspan="2" align="center"><font class="G10BOLD"><?php echo "$prefs_set_lang"; ?></font></td> </tr> <?php } ?> - <tr> <td width="2%"></td> --- 101,115 ---- <table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B"> <?php ! if ($action == 'setcookie') { ! if (!$cookie_unset) { ! $message = $prefs_set_lang; ! } else { ! $message = $prefs_unset_lang; ! } ! ?> <tr> ! <td colspan="2" align="center"><font class="G10BOLD"><?php echo "$message"; ?></font></td> </tr> <?php } ?> <tr> <td width="2%"></td> *************** *** 274,277 **** --- 285,295 ---- </td> </tr> + <?php if ($HTTP_COOKIE_VARS['phpicalendar']) { ?> + <tr> + <td align="left" valign="top" nowrap><?php echo "$unset_prefs_lang"; ?></td> + <td align="left" valign="top"><img src="images/spacer.gif" alt=" " width="20" height="1" border="0"></td> + <td align="left" valign="top"><INPUT TYPE="checkbox" NAME="unset" VALUE="true"></td> + </tr> + <?php } ?> <tr> <td align="left" valign="top" nowrap> </td> |