diff options
author | Chad Little <clittle@users.sourceforge.net> | 2004-02-05 04:59:19 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2004-02-05 04:59:19 +0000 |
commit | 540ca5a5233ce2195ebb85aaa920bc7670f6df59 (patch) | |
tree | 28da021106671bd1d3c9f12e29b6740ee6476699 | |
parent | def8231c574d4698223d9ef5ed9545cdd9c01624 (diff) | |
download | phpicalendar-540ca5a5233ce2195ebb85aaa920bc7670f6df59.tar.gz phpicalendar-540ca5a5233ce2195ebb85aaa920bc7670f6df59.tar.bz2 phpicalendar-540ca5a5233ce2195ebb85aaa920bc7670f6df59.zip |
Slight design change in day, wired up week days on day.php.
-rw-r--r-- | day.php | 2 | ||||
-rw-r--r-- | functions/template.php | 22 | ||||
-rw-r--r-- | templates/default/day.tpl | 58 |
3 files changed, 36 insertions, 46 deletions
@@ -20,7 +20,7 @@ $today_today = date('Ymd', strtotime("now + $second_offset seconds")); $next_day = date('Ymd', strtotime("+1 day", $unix_time)); $prev_day = date('Ymd', strtotime("-1 day", $unix_time)); -$display_date = localizeDate($dateFormat_week_list, $unix_time); +$display_date = localizeDate($dateFormat_day, $unix_time); $start_week_time = strtotime(dateOfWeek($getdate, $week_start_day)); diff --git a/functions/template.php b/functions/template.php index d6e4a1e..acd7861 100644 --- a/functions/template.php +++ b/functions/template.php @@ -5,7 +5,9 @@ class Page { var $page; function draw_day($template_p) { - global $template, $getdate, $cal, $master_array ; + global $template, $getdate, $cal, $master_array, $daysofweek_lang, $week_start_day; + + // Replaces the allday events $replace = ''; if (is_array($master_array[$getdate]['-1'])) { preg_match("!<\!-- loop allday on -->(.*)<\!-- loop allday off -->!is", $this->page, $match1); @@ -23,6 +25,24 @@ class Page { } } $this->page = ereg_replace('<!-- loop allday on -->(.*)<!-- loop allday off -->', $replace, $this->page); + + // Replaces the daysofweek + preg_match("!<\!-- loop daysofweek on -->(.*)<\!-- loop daysofweek off -->!is", $this->page, $match1); + $loop_dof = trim($match1[1]); + $start_wt = strtotime(dateOfWeek($getdate, $week_start_day)); + $start_day = strtotime($week_start_day); + for ($i=0; $i<7; $i++) { + $day_num = date("w", $start_day); + $weekday = $daysofweek_lang[$day_num]; + $daylink = date('Ymd', $start_wt); + $start_day = strtotime("+1 day", $start_day); + $start_wt = strtotime("+1 day", $start_wt); + $loop_tmp = str_replace('{DAY}', $weekday, $loop_dof); + $loop_tmp = str_replace('{DAYLINK}', $daylink, $loop_tmp); + $weekday_loop .= $loop_tmp; + } + $this->page = ereg_replace('<!-- loop daysofweek on -->(.*)<!-- loop daysofweek off -->', $weekday_loop, $this->page); + } function draw_month($template_p, $offset = '+0', $type) { diff --git a/templates/default/day.tpl b/templates/default/day.tpl index 5738d9f..837e0f0 100644 --- a/templates/default/day.tpl +++ b/templates/default/day.tpl @@ -8,16 +8,7 @@ <td align="center" valign="middle"> <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="40%" class="navback"><a class="psf" href="day.php?cal={CAL}&getdate={PREV_DAY}"><img src="templates/{TEMPLATE}/images/left_day.gif" alt="{L_PREV}" border="0" align="right"></a></td> - <td align="center" width="20%" class="navback" nowrap valign="middle"><font class="H20">{DISPLAY_DATE}</font></td> - <td align="left" width="40%" class="navback"><a class="psf" href="day.php?cal={CAL}&getdate={NEXT_DAY}"><img src="templates/{TEMPLATE}/images/right_day.gif" alt="{L_NEXT}" border="0" align="left"></a></td> - </tr> - </table> - </td> + <td class="navback"><font class="H20"> {DISPLAY_DATE}</font></td> <td align="right" width="120" class="navback"> <table width="120" border="0" cellpadding="0" cellspacing="0"> <tr> @@ -29,6 +20,19 @@ </table> </td> </tr> + <tr> + <td colspan="2"> + <table width="100%" border="0" cellspacing="1" cellpadding="2"> + <tr> + <!-- loop daysofweek on --> + <td width="14%" align="center" class="sideback"> + <a class="psf" href="day.php?cal={CAL}&getdate={DAYLINK}"><span class="V9">{DAY}</span></a> + </td> + <!-- loop daysofweek off --> + </tr> + </table> + </td> + </tr> </table> </td> </tr> @@ -41,40 +45,6 @@ <!-- loop allday off --> </td> </tr> - <!-- switch showdays on --> - <tr> - <td> - <table width="100%" border="0" cellspacing="0" cellpadding="0"> - <tr> - <td colspan="7"><img src="images/spacer.gif" width="70" height="1" alt=" "></td> - </tr> - <tr> - <td width="74" valign="top" align="center" class="dateback"> - <font class="V9"><a class="psf" href="day.php?cal={CAL}&getdate={THISDAY}">{DAY}</a></font> - </td> - <td width="74" valign="top" align="center" class="dateback"> - <font class="V9"><a class="psf" href="day.php?cal={CAL}&getdate={THISDAY}">{DAY}</a></font> - </td> - <td width="74" valign="top" align="center" class="dateback"> - <font class="V9"><a class="psf" href="day.php?cal={CAL}&getdate={THISDAY}">{DAY}</a></font> - </td> - <td width="74" valign="top" align="center" class="dateback"> - <font class="V9"><a class="psf" href="day.php?cal={CAL}&getdate={THISDAY}">{DAY}</a></font> - </td> - <td width="74" valign="top" align="center" class="dateback"> - <font class="V9"><a class="psf" href="day.php?cal={CAL}&getdate={THISDAY}">{DAY}</a></font> - </td> - <td width="74" valign="top" align="center" class="dateback"> - <font class="V9"><a class="psf" href="day.php?cal={CAL}&getdate={THISDAY}">{DAY}</a></font> - </td> - <td width="74" valign="top" align="center" class="dateback"> - <font class="V9"><a class="psf" href="day.php?cal={CAL}&getdate={THISDAY}">{DAY}</a></font> - </td> - </tr> - </table> - </td> - </tr> - <!-- switch showdays off --> <tr> <td align="center" valign="top" colspan="3"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> |