From: <cl...@us...> - 2004-02-05 05:01:48
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2028/functions Modified Files: template.php Log Message: Slight design change in day, wired up week days on day.php. Index: template.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** template.php 5 Feb 2004 00:15:37 -0000 1.19 --- template.php 5 Feb 2004 04:59:19 -0000 1.20 *************** *** 6,10 **** var $page; function draw_day($template_p) { ! global $template, $getdate, $cal, $master_array ; $replace = ''; if (is_array($master_array[$getdate]['-1'])) { --- 6,12 ---- var $page; function draw_day($template_p) { ! global $template, $getdate, $cal, $master_array, $daysofweek_lang, $week_start_day; ! ! // Replaces the allday events $replace = ''; if (is_array($master_array[$getdate]['-1'])) { *************** *** 24,27 **** --- 26,47 ---- } $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); + } |