[Comoblog-commit] comoblog/modules/mod_calendar mod_calendar.php,1.2,1.3
Status: Inactive
Brought to you by:
markwallis
|
From: Mark W. \(a. serialmonkey\) <mar...@us...> - 2005-10-07 15:15:05
|
Update of /cvsroot/comoblog/comoblog/modules/mod_calendar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13593/modules/mod_calendar Modified Files: mod_calendar.php Log Message: RFE: 1280305 - Ability to change first day in calendar module Index: mod_calendar.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/modules/mod_calendar/mod_calendar.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mod_calendar.php 2 Sep 2005 01:06:16 -0000 1.2 +++ mod_calendar.php 7 Oct 2005 15:14:57 -0000 1.3 @@ -29,6 +29,8 @@ $start_day = ($total_days_since_1901 + 2) % 7; + $start_day = $start_day - CFG_CALENDAR_DAY_OFFSET; + if ($start_day == 0) { $start_day = 7; } @@ -91,9 +93,47 @@ $mod_calendar_tpl->parse("main.calendar.next"); +/////////////////////////////////////////////////////////////////////////////// +// +// headers +// - +$cnt = 0; + +while ($cnt < 7) +{ + $val = ($cnt + CFG_CALENDAR_DAY_OFFSET) % 7; + + switch ($val) + { + case 0: + $header[$cnt] = $TXT['cal_Su'];; + break; + case 1: + $header[$cnt] = $TXT['cal_M']; + break; + case 2: + $header[$cnt] = $TXT['cal_Tu']; + break; + case 3: + $header[$cnt] = $TXT['cal_W']; + break; + case 4: + $header[$cnt] = $TXT['cal_Th']; + break; + case 5: + $header[$cnt] = $TXT['cal_F']; + break; + case 6: + $header[$cnt] = $TXT['cal_Sa']; + break; + } + $mod_calendar_tpl->assign("HEADER", $header[$cnt]); + $mod_calendar_tpl->parse("main.calendar.header"); + + $cnt += 1; +} /////////////////////////////////////////////////////////////////////////////// // @@ -194,4 +234,4 @@ // /////////////////////////////////////////////////////////////////////////////// -?> \ No newline at end of file +?> |