diff options
author | Chad Little <clittle@users.sourceforge.net> | 2003-06-30 22:37:52 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2003-06-30 22:37:52 +0000 |
commit | 014ccb1db7b5f5ff0b652e650ee67d1a931e40f9 (patch) | |
tree | e2ab68d0b6f4cec189aa4056aa34bc9dc58f8c3e /includes | |
parent | aa11132f1b421ce9ff64d0b22886c3e833b30a86 (diff) | |
download | phpicalendar-014ccb1db7b5f5ff0b652e650ee67d1a931e40f9.tar.gz phpicalendar-014ccb1db7b5f5ff0b652e650ee67d1a931e40f9.tar.bz2 phpicalendar-014ccb1db7b5f5ff0b652e650ee67d1a931e40f9.zip |
Multiple Calendar support.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/calendar_nav.php | 22 | ||||
-rw-r--r-- | includes/event.php | 17 | ||||
-rw-r--r-- | includes/sidebar.php | 21 | ||||
-rw-r--r-- | includes/todo.php | 270 |
4 files changed, 179 insertions, 151 deletions
diff --git a/includes/calendar_nav.php b/includes/calendar_nav.php index f7bf389..01afb56 100644 --- a/includes/calendar_nav.php +++ b/includes/calendar_nav.php @@ -1,6 +1,10 @@ <?php - $cal_displayname2 = $calendar_name . " $calendar_lang"; + if ($cal == 'all_calenders_combined971') { + $cal_displayname2 = $all_cal_comb_lang; + } else { + $cal_displayname2 = $calendar_name . " $calendar_lang"; + } if (strlen($cal_displayname2) > 24) { $cal_displayname2 = substr("$cal_displayname2", 0, 21); $cal_displayname2 = $cal_displayname2 . "..."; @@ -8,7 +12,11 @@ $next_day = date("Ymd", strtotime("+1 day", $unix_time)); $prev_day = date("Ymd", strtotime("-1 day", $unix_time)); - + + // Get the real date to display as "go to today", not the date displayed in the calendar + $really_unix_time = strtotime(date('Ymd')); + $really_today_today = date ('Ymd', $really_unix_time); + $fake_getdate_time = strtotime($this_year.'-'.$this_month.'-15'); ?> <br> @@ -192,13 +200,13 @@ <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=" "></td> <td colspan="6" class="G10B"> <?php - echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$today_today\">$goday_lang</a><br>\n"; - echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$today_today\">$goweek_lang</a><br>\n"; - echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$today_today\">$gomonth_lang</a><br>\n"; - echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$today_today\">$goyear_lang</a><br>\n"; + echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$really_today_today\">$goday_lang</a><br>\n"; + echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$really_today_today\">$goweek_lang</a><br>\n"; + echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$really_today_today\">$gomonth_lang</a><br>\n"; + echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$really_today_today\">$goyear_lang</a><br>\n"; echo "<a class=\"psf\" href=\"print.php?cal=$cal&getdate=$getdate&printview=$current_view\">$goprint_lang</a><br>\n"; if ($allow_preferences != 'no') echo "<a class=\"psf\" href=\"preferences.php?cal=$cal&getdate=$getdate\">$preferences_lang</a><br>\n"; - echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a> | <a class=\"psf\" href=\"$download_filename\">$download_lang</a>\n"; + if ($cal != 'all_calenders_combined971') echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a> | <a class=\"psf\" href=\"$download_filename\">$download_lang</a>\n"; ?> </td> </tr> diff --git a/includes/event.php b/includes/event.php index 8cc84fb..bb7c2a8 100644 --- a/includes/event.php +++ b/includes/event.php @@ -81,14 +81,27 @@ $calendar_name2 = str_replace('\\', '', $calendar_name2); <html> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8"> - <title><?php echo $calendar_name2; ?></title> + <title><?php + if ($calendar_name == 'all_calenders_combined971') { + echo "$all_cal_comb_lang"; + } else { + echo "$calendar_name2"; + }?></title> <link rel="stylesheet" type="text/css" href="<?php echo BASE."styles/$style_sheet/default.css"; ?>"> </head> <body bgcolor="#eeeeee"><center> <table border="0" width="430" cellspacing="0" cellpadding="0" class="calborder"> <tr> <td align="left" valign="top" width="1%" class="sideback"><img src="images/spacer.gif" width="1" height="20" alt=" "></td> - <td align="center" width="98%" class="sideback"><font class="G10BOLD"><?php echo "$calendar_name2 $calendar_lang"; ?></font></td> + <td align="center" width="98%" class="sideback"><font class="G10BOLD"> + <?php + if ($calendar_name == 'all_calenders_combined971') { + echo "$all_cal_comb_lang"; + } else { + echo "$calendar_name2 $calendar_lang"; + } + ?> + </font></td> <td align="right" valign="top" width="1%" class="sideback"></td> </tr> <tr> diff --git a/includes/sidebar.php b/includes/sidebar.php index 5b69789..f68cfcb 100644 --- a/includes/sidebar.php +++ b/includes/sidebar.php @@ -1,11 +1,18 @@ <?php + // Get the real date to display in the sidebar, not the date displayed in the calendar + $really_unix_time = strtotime(date('Ymd')); + $really_today_today = date ('Ymd', $really_unix_time); - $cal_displayname2 = $calendar_name . " $calendar_lang"; + if ($cal == 'all_calenders_combined971') { + $cal_displayname2 = $all_cal_comb_lang; + } else { + $cal_displayname2 = $calendar_name . " $calendar_lang"; + } if (strlen($cal_displayname2) > 24) { $cal_displayname2 = substr("$cal_displayname2", 0, 21); $cal_displayname2 = $cal_displayname2 . "..."; } - + $search_box = '<form action="search.php" method="GET"><input type="hidden" name="cal" value="'.$cal.'"><input type="hidden" name="getdate" value="'.$getdate.'"><input type="text" size="15" class="search_style" name="query" value="'.$search_lang.'" onfocus="javascript:if(this.value==\''.$search_lang.'\') {this.value=\'\';}" onblur="javascript:if(this.value==\'\') {this.value=\''.$search_lang.'\'}"><INPUT type="image" src="styles/'.$style_sheet.'/search.gif" name="submit" value="Search"></form>'; ?> @@ -33,13 +40,13 @@ <td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=" "></td> <td colspan="6" class="G10B"> <?php - echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$today_today\">$goday_lang</a><br>\n"; - echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$today_today\">$goweek_lang</a><br>\n"; - echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$today_today\">$gomonth_lang</a><br>\n"; - echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$today_today\">$goyear_lang</a><br>\n"; + echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$really_today_today\">$goday_lang</a><br>\n"; + echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$really_today_today\">$goweek_lang</a><br>\n"; + echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$really_today_today\">$gomonth_lang</a><br>\n"; + echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$really_today_today\">$goyear_lang</a><br>\n"; echo "<a class=\"psf\" href=\"print.php?cal=$cal&getdate=$getdate&printview=$current_view\">$goprint_lang</a><br>\n"; if ($allow_preferences != 'no') echo "<a class=\"psf\" href=\"preferences.php?cal=$cal&getdate=$getdate\">$preferences_lang</a><br>\n"; - echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a> | <a class=\"psf\" href=\"$download_filename\">$download_lang</a>\n"; + if ($cal != 'all_calenders_combined971') echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a> | <a class=\"psf\" href=\"$download_filename\">$download_lang</a>\n"; ?> </td> </tr> diff --git a/includes/todo.php b/includes/todo.php index 3c39515..ec84a02 100644 --- a/includes/todo.php +++ b/includes/todo.php @@ -1,135 +1,135 @@ -<?php
-
-define('BASE', '../');
-include (BASE.'functions/init.inc.php');
-include (BASE.'functions/date_functions.php');
-
-// Unserialize the array so that we can use it.
-$vtodo_array = unserialize(base64_decode($HTTP_GET_VARS['vtodo_array']));
-
-// Set the variables from the array
-if (isset($vtodo_array['vtodo_text']) && ($vtodo_array['vtodo_text'] !== '') ) {
- $vtodo_text = $vtodo_array['vtodo_text'];
-} else {
- $vtodo_text = '';
-}
-
-if (isset($vtodo_array['description']) && ($vtodo_array['description'] !== '') ) {
- $description = $vtodo_array['description'];
-} else {
- $description = '';
-}
-
-if (isset($vtodo_array['completed_date']) && ($vtodo_array['completed_date'] !== '') ) {
- $completed_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['completed_date']));
-}
-
-if (isset($vtodo_array['status']) && ($vtodo_array['status'] !== '') ) {
- $status = $vtodo_array['status'];
-}
-if ((!isset($status) || $status == "COMPLETED") && isset($completed_date)) {
- $status = "$completed_date_lang $completed_date";
-} else if ($status == "COMPLETED") {
- $status = $completed_lang;
-} else {
- $status = $unfinished_lang;
-}
-
-if (isset($vtodo_array['cal']) && ($vtodo_array['cal'] !== '') ) {
- $calendar_name = $vtodo_array['cal'];
-} else {
- $calendar_name = '';
-}
-
-if (isset($vtodo_array['start_date']) && ($vtodo_array['start_date'] !== '') ) {
- $start_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['start_date']));
-}
-
-if (isset($vtodo_array['due_date']) && ($vtodo_array['due_date'] !== '') && strtotime($vtodo_array['due_date']) != strtotime("+1 year", strtotime($start_date))) {
- $due_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['due_date']));
-} else {
- $due_date = '';
-}
-
-if (isset($vtodo_array['priority']) && ($vtodo_array['priority'] !== '')) {
- $priority = $vtodo_array['priority'];
-
- if ($priority >= 1 && $priority <= 4) {
- $priority = $priority_high_lang;
- } else if ($priority == 5) {
- $priority = $priority_medium_lang;
- } else if ($priority >= 6 && $priority <= 9) {
- $priority = $priority_low_lang;
- } else {
- $priority = $priority_none_lang;
- }
-} else {
- $priority = $priority_none_lang;
-}
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
-<html>
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8">
- <title><?php echo $calendar_name; ?></title>
- <link rel="stylesheet" type="text/css" href="<?php echo BASE."styles/$style_sheet/default.css"; ?>">
-</head>
-<body bgcolor="#eeeeee"><center>
-<table border="0" width="430" cellspacing="0" cellpadding="0" class="calborder">
- <tr>
- <td align="left" valign="top" width="1%" class="sideback"><img src="images/spacer.gif" width="1" height="20" alt=" "></td>
- <td align="center" width="98%" class="sideback"><font class="G10BOLD"><?php echo "$calendar_name $calendar_lang"; ?></font></td>
- <td align="right" valign="top" width="1%" class="sideback"></td>
- </tr>
- <tr>
- <td colspan="3"><img src="images/spacer.gif" width="1" height="6" alt=" "></td>
- </tr>
- <tr>
- <td colspan="3">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="1%"><img src="images/spacer.gif" width="6" height="1" alt=" "></td>
- <td align="left" colspan="2" class="V12"><?php echo ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$vtodo_text).'<br /><br />'; ?></td>
- </tr>
-
- <?php if ($description) { ?>
- <tr>
- <td width="1%"><img src="images/spacer.gif" width="6" height="1" alt=" "></td>
- <td align="left" colspan="2" class="V12">
- <?php echo ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", '<a target="_new" href="\0">\0</a>', $description); ?></td>
- </tr>
- <?php } ?>
-
- <?php if ($status) { ?>
- <tr>
- <td></td>
- <td align="left" colspan="2" class="V12"><?php echo "$status_lang $status"; ?></td>
- </tr>
- <?php } ?>
-
- <tr>
- <td></td>
- <td align="left" colspan="2" class="V12"><?php echo "$priority_lang $priority"; ?></td>
- </tr>
-
- <tr>
- <td></td>
- <td align="left" colspan="2" class="V12"><?php echo "$created_lang $start_date"; ?></td>
- </tr>
-
- <?php if ($due_date) { ?>
- <tr>
- <td></td>
- <td align="left" colspan="2" class="V12"><?php echo "$due_lang $due_date"; ?></td>
- </tr>
- <?php } ?>
-
- </table>
- </td>
- </tr>
-</table>
-</center>
-</body>
-</html>
+<?php + +define('BASE', '../'); +include (BASE.'functions/init.inc.php'); +include (BASE.'functions/date_functions.php'); + +// Unserialize the array so that we can use it. +$vtodo_array = unserialize(base64_decode($HTTP_GET_VARS['vtodo_array'])); + +// Set the variables from the array +if (isset($vtodo_array['vtodo_text']) && ($vtodo_array['vtodo_text'] !== '') ) { + $vtodo_text = $vtodo_array['vtodo_text']; +} else { + $vtodo_text = ''; +} + +if (isset($vtodo_array['description']) && ($vtodo_array['description'] !== '') ) { + $description = $vtodo_array['description']; +} else { + $description = ''; +} + +if (isset($vtodo_array['completed_date']) && ($vtodo_array['completed_date'] !== '') ) { + $completed_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['completed_date'])); +} + +if (isset($vtodo_array['status']) && ($vtodo_array['status'] !== '') ) { + $status = $vtodo_array['status']; +} +if ((!isset($status) || $status == "COMPLETED") && isset($completed_date)) { + $status = "$completed_date_lang $completed_date"; +} else if ($status == "COMPLETED") { + $status = $completed_lang; +} else { + $status = $unfinished_lang; +} + +if (isset($vtodo_array['cal']) && ($vtodo_array['cal'] !== '') ) { + $calendar_name = $vtodo_array['cal']; +} else { + $calendar_name = ''; +} + +if (isset($vtodo_array['start_date']) && ($vtodo_array['start_date'] !== '') ) { + $start_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['start_date'])); +} + +if (isset($vtodo_array['due_date']) && ($vtodo_array['due_date'] !== '') && strtotime($vtodo_array['due_date']) != strtotime("+1 year", strtotime($start_date))) { + $due_date = localizeDate ($dateFormat_day, strtotime($vtodo_array['due_date'])); +} else { + $due_date = ''; +} + +if (isset($vtodo_array['priority']) && ($vtodo_array['priority'] !== '')) { + $priority = $vtodo_array['priority']; + + if ($priority >= 1 && $priority <= 4) { + $priority = $priority_high_lang; + } else if ($priority == 5) { + $priority = $priority_medium_lang; + } else if ($priority >= 6 && $priority <= 9) { + $priority = $priority_low_lang; + } else { + $priority = $priority_none_lang; + } +} else { + $priority = $priority_none_lang; +} + +?> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html;charset=UTF-8"> + <title><?php echo $calendar_name; ?></title> + <link rel="stylesheet" type="text/css" href="<?php echo BASE."styles/$style_sheet/default.css"; ?>"> +</head> +<body bgcolor="#eeeeee"><center> +<table border="0" width="430" cellspacing="0" cellpadding="0" class="calborder"> + <tr> + <td align="left" valign="top" width="1%" class="sideback"><img src="images/spacer.gif" width="1" height="20" alt=" "></td> + <td align="center" width="98%" class="sideback"><font class="G10BOLD"><?php echo "$calendar_name $calendar_lang"; ?></font></td> + <td align="right" valign="top" width="1%" class="sideback"></td> + </tr> + <tr> + <td colspan="3"><img src="images/spacer.gif" width="1" height="6" alt=" "></td> + </tr> + <tr> + <td colspan="3"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td width="1%"><img src="images/spacer.gif" width="6" height="1" alt=" "></td> + <td align="left" colspan="2" class="V12"><?php echo ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$vtodo_text).'<br /><br />'; ?></td> + </tr> + + <?php if ($description) { ?> + <tr> + <td width="1%"><img src="images/spacer.gif" width="6" height="1" alt=" "></td> + <td align="left" colspan="2" class="V12"> + <?php echo ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", '<a target="_new" href="\0">\0</a>', $description); ?></td> + </tr> + <?php } ?> + + <?php if ($status) { ?> + <tr> + <td></td> + <td align="left" colspan="2" class="V12"><?php echo "$status_lang $status"; ?></td> + </tr> + <?php } ?> + + <tr> + <td></td> + <td align="left" colspan="2" class="V12"><?php echo "$priority_lang $priority"; ?></td> + </tr> + + <tr> + <td></td> + <td align="left" colspan="2" class="V12"><?php echo "$created_lang $start_date"; ?></td> + </tr> + + <?php if ($due_date) { ?> + <tr> + <td></td> + <td align="left" colspan="2" class="V12"><?php echo "$due_lang $due_date"; ?></td> + </tr> + <?php } ?> + + </table> + </td> + </tr> +</table> +</center> +</body> +</html> |