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 /functions | |
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.
Diffstat (limited to 'functions')
-rw-r--r-- | functions/template.php | 22 |
1 files changed, 21 insertions, 1 deletions
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) { |