From: <ji...@us...> - 2006-03-18 01:04:22
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29756/phpicalendar/functions Modified Files: calendar_functions.php init.inc.php Log Message: should fix all_calendars_combined selection problems Index: calendar_functions.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/calendar_functions.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** calendar_functions.php 15 Dec 2005 03:26:31 -0000 1.20 --- calendar_functions.php 18 Mar 2006 01:04:15 -0000 1.21 *************** *** 197,201 **** // At this point, just pull the name off the file. ! return basename($cal_path, ".ics"); } --- 197,201 ---- // At this point, just pull the name off the file. ! return str_replace(".ics", '', basename($cal_path)); } *************** *** 242,246 **** // trying to figure out if this is the selected calendar. if($pick) { ! if (in_array($cal_encoded_tmp, explode(",", $cal))) { $return .= "<option value=\"$cal_encoded_tmp\" selected=\"selected\">$cal_displayname_tmp</option>\n"; } else { --- 242,246 ---- // trying to figure out if this is the selected calendar. if($pick) { ! if (in_array($cal_encoded_tmp, explode(",", $cal)) || count($cals) == count(explode(",", $cal))) { $return .= "<option value=\"$cal_encoded_tmp\" selected=\"selected\">$cal_displayname_tmp</option>\n"; } else { Index: init.inc.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/init.inc.php,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** init.inc.php 16 Mar 2006 00:28:54 -0000 1.87 --- init.inc.php 18 Mar 2006 01:04:15 -0000 1.88 *************** *** 5,12 **** error_reporting(0); // Older versions of PHP do not define $_SERVER. Define it here instead. ! if (!isset($_SERVER) && isset($_SERVER)) { ! $_SERVER = &$_SERVER; } ! // Define some magic strings. $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; --- 5,12 ---- error_reporting(0); // Older versions of PHP do not define $_SERVER. Define it here instead. ! if (!isset($_SERVER) && isset($HTTP_SERVER_VARS)) { ! $_SERVER = &$HTTP_SERVER_VARS; } ! #=================Initialize global variables================================= // Define some magic strings. $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; *************** *** 20,24 **** if (isset($phpicalendar['cookie_language'])) $language = $phpicalendar['cookie_language']; if (isset($phpicalendar['cookie_calendar'])) $default_cal_check = $phpicalendar['cookie_calendar']; ! if (isset($phpicalendar['cookie_cpath'])) $default_cpath_check = $phpicalendar['cookie_cpath']; if (isset($phpicalendar['cookie_view'])) $default_view = $phpicalendar['cookie_view']; if (isset($phpicalendar['cookie_style'])) $template = $phpicalendar['cookie_style']; --- 20,24 ---- if (isset($phpicalendar['cookie_language'])) $language = $phpicalendar['cookie_language']; if (isset($phpicalendar['cookie_calendar'])) $default_cal_check = $phpicalendar['cookie_calendar']; ! if (isset($phpicalendar['cookie_cpath'])) $default_cpath_check= $phpicalendar['cookie_cpath']; if (isset($phpicalendar['cookie_view'])) $default_view = $phpicalendar['cookie_view']; if (isset($phpicalendar['cookie_style'])) $template = $phpicalendar['cookie_style']; *************** *** 41,44 **** --- 41,45 ---- } #these need cpath to be set + #set up specific template folder for a particular cpath if (isset($user_template["$cpath"])){ $template = $user_template["$cpath"]; *************** *** 76,81 **** $lang_file = BASE.'languages/'.$language.'.inc.php'; ! unset($lang); ! if (include($lang_file)) { include($lang_file); } else { --- 77,82 ---- $lang_file = BASE.'languages/'.$language.'.inc.php'; ! unset($lang); #$lang is array of phrases in appropriate language ! if (is_file($lang_file)) { include($lang_file); } else { *************** *** 123,127 **** } } ! // Separate the calendar identifiers into web calendars and local // calendars. --- 124,131 ---- } } ! //load cal_filenames if $ALL_CALENDARS_COMBINED ! if ($cal_filenames[0] == $ALL_CALENDARS_COMBINED){ ! $cal_filenames = availableCalendars($username, $password, $ALL_CALENDARS_COMBINED); ! } // Separate the calendar identifiers into web calendars and local // calendars. *************** *** 144,148 **** exit(error($lang['l_error_restrictedcal'], $cal_filename)); } ! $local_cals[] = $cal_filename; } } --- 148,152 ---- exit(error($lang['l_error_restrictedcal'], $cal_filename)); } ! $local_cals[] = str_replace(".ics", '', basename($cal_filename)); } } *************** *** 239,242 **** --- 243,261 ---- return ((float)$usec + (float)$sec); } + #uncomment for diagnostics + #echo "after init.inc.ics<pre>"; + #echo "cals"; + #print_r($cals);echo"\n\n"; + #echo "cal_filenames"; + #print_r($cal_filenames);echo"\n\n"; + #echo "web_cals"; + #print_r($web_cals);echo"\n\n"; + #echo "local_cals"; + #print_r($local_cals);echo"\n\n"; + #echo "cal_filelist"; + #print_r($cal_filelist); + #echo "cal_displaynames"; + #print_r($cal_displaynames); + #echo "</pre><hr>"; ?> |