aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2004-02-05 04:59:19 +0000
committerChad Little <clittle@users.sourceforge.net>2004-02-05 04:59:19 +0000
commit540ca5a5233ce2195ebb85aaa920bc7670f6df59 (patch)
tree28da021106671bd1d3c9f12e29b6740ee6476699 /functions
parentdef8231c574d4698223d9ef5ed9545cdd9c01624 (diff)
downloadphpicalendar-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.php22
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) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy