diff options
author | Chad Little <clittle@users.sourceforge.net> | 2004-01-31 22:59:28 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2004-01-31 22:59:28 +0000 |
commit | 7cade3b04274ecc2d3583a0602cc5de3643e81a6 (patch) | |
tree | ec2b28c307671a3d19f421f1b9cbe42762b2dfc7 /year.php | |
parent | c143f2891418cb0f0ae0f80f7d2d58e69879a722 (diff) | |
download | phpicalendar-7cade3b04274ecc2d3583a0602cc5de3643e81a6.tar.gz phpicalendar-7cade3b04274ecc2d3583a0602cc5de3643e81a6.tar.bz2 phpicalendar-7cade3b04274ecc2d3583a0602cc5de3643e81a6.zip |
More template work.
Diffstat (limited to 'year.php')
-rw-r--r-- | year.php | 184 |
1 files changed, 34 insertions, 150 deletions
@@ -1,7 +1,9 @@ <?php -$current_view = 'year'; + define('BASE', './'); -include(BASE.'functions/ical_parser.php'); +include_once(BASE.'functions/ical_parser.php'); +require_once(BASE.'functions/template.php'); +$current_view = 'year'; ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2); $this_day = $day_array2[3]; @@ -20,152 +22,34 @@ $prev_year = date ("Ymd", $prev_year); $thisday2 = localizeDate($dateFormat_week_list, $unix_time); -include (BASE.'includes/header.inc.php'); +$page = new Page(BASE.'templates/'.$template.'/year.tpl'); + +$page->replace_tags(array( + 'header' => BASE.'templates/'.$template.'/header.tpl', + 'footer' => BASE.'templates/'.$template.'/footer.tpl', + 'template' => $template, + 'cal' => $cal, + 'getdate' => $getdate, + 'calendar_name' => $calendar_name, + 'display_date' => $display_date, + 'rss_powered' => $rss_powered, + 'rss_available' => '', + 'rss_valid' => '', + 'todo_available' => '', + 'show_search' => '', + 'next_month' => $next_month, + 'prev_month' => $prev_month, + 'show_goto' => '', + 'is_logged_in' => '', + 'list_icals' => $list_icals, + 'list_years' => $list_years, + 'list_months' => $list_months, + 'list_weeks' => $list_weeks, + 'style_select' => $style_select, + 'generated' => $generated + + )); + +$page->output(); -?> -<center> -<table width="676" border="0" cellspacing="0" cellpadding="0" class="calborder"> - <tr> - <td align="center" valign="middle" bgcolor="white"> - <table width="100%" border="0" cellspacing="0" cellpadding="0"> - <tr> - <td align="left" width="120" class="navback"> </td> - <td class="navback"> - <table width="100%" border="0" cellspacing="0" cellpadding="0"> - <tr> - <td align="right" width="45%" class="navback"><?php echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$prev_year\"><img src=\"styles/$style_sheet/left_day.gif\" alt=\"[$last_year_lang]\" border=\"0\" align=\"right\"></a>"; ?></td> - <td align="center" width="10%" class="navback" nowrap valign="middle"><font class="H20"><?php echo $display_date; ?></font></td> - <td align="left" width="45%" class="navback"><?php echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$next_year\"><img src=\"styles/$style_sheet/right_day.gif\" alt=\"[$next_year_lang]\" border=\"0\" align=\"left\"></a>"; ?></td> - </tr> - </table> - </td> - <td align="right" width="120" class="navback"> - <table width="120" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td><?php echo '<a class="psf" href="day.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/day_on.gif" alt="'.$day_view_lang.'" border="0"></a></td>'; ?> - <td><?php echo '<a class="psf" href="week.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/week_on.gif" alt="'.$week_view_lang.'" border="0"></a></td>'; ?> - <td><?php echo '<a class="psf" href="month.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/month_on.gif" alt="'.$month_view_lang.'" border="0"></a></td>'; ?> - <td><?php echo '<a class="psf" href="year.php?cal='.$cal.'&getdate='.$getdate.'"><img src="styles/'.$style_sheet.'/year_on.gif" alt="'.$year_view_lang.'" border="0"></a></td>'; ?> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> -</table> -<br> -<table border="0" width="670" cellspacing="0" cellpadding="0"> - <tr> - <?php - $m=0; - $n=0; - do { - - ?> - <td width="210" valign="top" align="left"> - <table border="0" width="210" cellspacing="0" cellpadding="0" class="calborder"> - <tr> - <td colspan="7"> - <table border="0" width="210" cellspacing="0" cellpadding="0"> - <tr> - <td width="1" class="sideback"><img src="images/spacer.gif" width="1" height="20" alt=" "></td> - <?php - $monthlink = date("Ym", $startYear); - $monthlink = $monthlink . $this_day; - ?> - <td align="center" class="sideback"><?php echo '<a class="ps3" href="month.php?cal=' . $cal . '&getdate=' . $monthlink . '">'; ?><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, $startYear)); ?></font></a></td> - <td width="1" class="sideback"></td> - </tr> - </table> - </td> - </tr> - <tr> - <?php - $start_day = strtotime($week_start_day); - for ($i=0; $i<7; $i++) { - $day_num = date("w", $start_day); - $day = $daysofweekshort_lang[$day_num]; - print '<td width="30" height="14" class="dateback" align="center"><font class="V9BOLD">' . $day . '</font></td>' . "\n"; - $start_day = strtotime("+1 day", $start_day); - } - ?> - </tr> - <tr> - <td colspan="7"> - <table border="0" width="210" cellspacing="1" cellpadding="0" class="yearmonth"> - <?php - $minical_time = $startYear; - $minical_month = date("m", $minical_time); - $minical_year = date("Y", $minical_time); - $first_of_month = $minical_year.$minical_month."01"; - $start_day = strtotime(dateOfWeek($first_of_month, $week_start_day)); - $i = 0; - $whole_month = TRUE; - $num_of_events = 0; - do { - $day = date ("j", $start_day); - $daylink = date ("Ymd", $start_day); - $check_month = date ("m", $start_day); - if ($check_month != $minical_month) $day= "<font class=\"V9G\">$day</font>"; - if ($i == 0) echo '<tr height="30">'; - if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) { - foreach ($master_array[("$daylink")] as $event_times) { - foreach ($event_times as $val) { - if (!isset($val["event_start"])) $image1 = '<img src="styles/'. $style_sheet . '/allday_dot.gif" alt=" " width="11" height="10" border="0">'; - if (isset($val["event_start"])) $image2 = '<img src="styles/'. $style_sheet . '/event_dot.gif" alt=" " width="11" height="10" border="0">'; - } - } - if (isset($master_array[("$daylink")][-1])) $image2 = '<img src="styles/silver/allday_dot.gif" alt=" " border="0">'; - echo '<td width="30" height="30" align="right" valign="top" class="monthreg" onMouseOver=this.style.backgroundColor="#DDDDDD" onMouseOut=this.style.backgroundColor="#FFFFFF" onclick="window.location.href=\'day.php?cal=' . $cal . '&getdate=' . $daylink . '\'">' . "\n"; - echo '<table width="100%" border="0" cellspacing="0" cellpadding="1">' . "\n"; - echo '<tr>' . "\n"; - echo '<td align="right" valign="top" class="V9">' . "\n"; - echo '<a class="psf" href="day.php?cal=' . $cal . '&getdate=' . $daylink . '">' . $day . '</a>' . "\n"; - echo '</td>' . "\n"; - echo '</tr>' . "\n"; - echo '<tr>' . "\n"; - echo '<td align="center" valign="top">' . $image1 . $image2 . '</td>' . "\n"; - echo '</tr>' . "\n"; - echo '</table>' . "\n"; - } elseif ($check_month == $minical_month) { - echo '<td width="30" height="30" align="right" valign="top" class="monthreg" onMouseOver=this.style.backgroundColor="#DDDDDD" onMouseOut=this.style.backgroundColor="#FFFFFF" onclick="window.location.href=\'day.php?cal=' . $cal . '&getdate=' . $daylink . '\'">' . "\n"; - echo '<font class="V9"><a class="psf" href="day.php?cal=' . $cal . '&getdate=' . $daylink . '">' . $day . '</a></font></td>' . "\n"; - } else { - echo '<td width="30" height="30" align="right" valign="top" class="monthoff" onMouseOver=this.style.backgroundColor="#DDDDDD" onMouseOut=this.style.backgroundColor="#F2F2F2" onclick="window.location.href=\'day.php?cal=' . $cal . '&getdate=' . $daylink . '\'">' . "\n"; - echo '<a class="psf" href="day.php?cal=' . $cal . '&getdate=' . $daylink . '">' . $day . '</a></td>' . "\n"; - } - $start_day = strtotime("+1 day", $start_day); - $i++; - $image1 = ''; - $image2 = ''; - if ($i == 7) { - echo '</tr>'; - $i = 0; - $checkagain = date ("m", $start_day); - if ($checkagain != $minical_month) $whole_month = FALSE; - } - } while ($whole_month == TRUE); - $startYear = strtotime ("+1 month", $startYear); - ?> - </table> - </td> - </tr> - </table> - </td> - <?php - if ($m < 2) echo '<td width="20"><img src="images/spacer.gif" width="20" height="1" alt=" "></td>'; - $m++; - $n++; - if (($m == 3) && ($n < 12)) { - $m = 0; - echo '</tr><tr>'; - echo '<td colspan="5"><img src="images/spacer.gif" width="1" height="20" alt=" "></td>'; - echo '</tr><tr>'; - } - } while (($m < 3) && ($n < 12)); - ?> -</tr> -</table> -</center> -<?php include (BASE.'includes/footer.inc.php'); ?> +?>
\ No newline at end of file |