diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-09-26 15:45:31 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-09-26 15:45:31 +0000 |
commit | c0d6b2b33ebe7a02d7aa7863cbcf4922cb3e6527 (patch) | |
tree | c09bc1b9a8850b227d359dd3de8491f605bcf351 /functions | |
parent | e83d767bc9527ab20c7932ed359dc2d6a383d837 (diff) | |
download | phpicalendar-c0d6b2b33ebe7a02d7aa7863cbcf4922cb3e6527.tar.gz phpicalendar-c0d6b2b33ebe7a02d7aa7863cbcf4922cb3e6527.tar.bz2 phpicalendar-c0d6b2b33ebe7a02d7aa7863cbcf4922cb3e6527.zip |
Calendar moves with "This Month, This Week"
Diffstat (limited to 'functions')
-rw-r--r-- | functions/list_icals.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/functions/list_icals.php b/functions/list_icals.php new file mode 100644 index 0000000..c585780 --- /dev/null +++ b/functions/list_icals.php @@ -0,0 +1,39 @@ +<?php + +// start of <select> tag +if (isset($getdate)) { + $query="&getdate=$getdate"; +} else { + $query=""; +} +print "<form>\n<select name=\"action\" class=\"G10B\" onChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">\n"; +#print "<option value=\"null\">Select a Calendar</option>\n"; + +// open file +$dir_handle = @opendir($calendar_path) or die("Unable to open $calendar_path"); + +// build the <option> tags +while ($file = readdir($dir_handle)) { + if (strstr ($file, ".ics")) { + // $cal_filename is the filename of the calendar without .ics + // $cal is a urlencoded version of $cal_filename + // $cal_displayname is $cal_filename with occurrences of "32" replaced with " " + $cal_filename = substr($file,0,-4); + $cal_tmp = urlencode($cal_filename); + $cal_displayname = str_replace("32", " ", $cal_filename); + + if ($cal_tmp == $cal) { + print "<option value=\"$current_view.php?cal=$cal_tmp\" selected>$cal_displayname Calendar</option>\n"; + } else { + print "<option value=\"$current_view.php?cal=$cal_tmp\">$cal_filename Calendar</option>\n"; + } + + } +} + +// close file +closedir($dir_handle); + +// finish <select> +print "</select>\n</form>"; +?>
\ No newline at end of file |