[geeklog-cvs] geeklog-1.3/public_html calendar.php,1.36,1.37
dhaun at iowaoutdoors.org
dhaun at iowaoutdoors.org
Mon Jul 26 10:32:45 EDT 2004
Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv21007/public_html
Modified Files:
calendar.php
Log Message:
The start of the week in the calendar can now be configured to be either Sunday or Monday (based on a patch by bond_anton).
Index: calendar.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/calendar.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** calendar.php 23 Jan 2004 21:16:38 -0000 1.36
--- calendar.php 26 Jul 2004 14:32:42 -0000 1.37
***************
*** 104,144 ****
function setCalendarLanguage (&$aCalendar)
{
! global $LANG30;
! $lang_days = array('sunday'=>$LANG30[1],
! 'monday'=>$LANG30[2],
! 'tuesday'=>$LANG30[3],
! 'wednesday'=>$LANG30[4],
! 'thursday'=>$LANG30[5],
! 'friday'=>$LANG30[6],
! 'saturday'=>$LANG30[7]);
! $lang_months = array('january'=>$LANG30[13],
! 'february'=>$LANG30[14],
! 'march'=>$LANG30[15],
! 'april'=>$LANG30[16],
! 'may'=>$LANG30[17],
! 'june'=>$LANG30[18],
! 'july'=>$LANG30[19],
! 'august'=>$LANG30[20],
! 'september'=>$LANG30[21],
! 'october'=>$LANG30[22],
! 'november'=>$LANG30[23],
! 'december'=>$LANG30[24]);
! $aCalendar->setLanguage($lang_days, $lang_months);
}
function makeDaysHeadline ()
{
! global $LANG30;
! $retval = '<tr><th>'
! . substr ($LANG30[1], 0, 2) . '</th><th>'
! . substr ($LANG30[2], 0, 2) . '</th><th>'
! . substr ($LANG30[3], 0, 2) . '</th><th>'
! . substr ($LANG30[4], 0, 2) . '</th><th>'
! . substr ($LANG30[5], 0, 2) . '</th><th>'
! . substr ($LANG30[6], 0, 2) . '</th><th>'
! . substr ($LANG30[7], 0, 2) . '</th></tr>';
return $retval;
--- 104,155 ----
function setCalendarLanguage (&$aCalendar)
{
! global $_CONF, $LANG30;
! $lang_days = array ('sunday' => $LANG30[1],
! 'monday' => $LANG30[2],
! 'tuesday' => $LANG30[3],
! 'wednesday' => $LANG30[4],
! 'thursday' => $LANG30[5],
! 'friday' => $LANG30[6],
! 'saturday' => $LANG30[7]);
! $lang_months = array ('january' => $LANG30[13],
! 'february' => $LANG30[14],
! 'march' => $LANG30[15],
! 'april' => $LANG30[16],
! 'may' => $LANG30[17],
! 'june' => $LANG30[18],
! 'july' => $LANG30[19],
! 'august' => $LANG30[20],
! 'september' => $LANG30[21],
! 'october' => $LANG30[22],
! 'november' => $LANG30[23],
! 'december' => $LANG30[24]);
!
! $aCalendar->setLanguage ($lang_days, $lang_months, $_CONF['week_start']);
}
function makeDaysHeadline ()
{
! global $_CONF, $LANG30;
! $retval = '<tr><th>';
! if ($_CONF['week_start'] == 'Mon') {
! $retval .= substr ($LANG30[2], 0, 2) . '</th><th>'
! . substr ($LANG30[3], 0, 2) . '</th><th>'
! . substr ($LANG30[4], 0, 2) . '</th><th>'
! . substr ($LANG30[5], 0, 2) . '</th><th>'
! . substr ($LANG30[6], 0, 2) . '</th><th>'
! . substr ($LANG30[7], 0, 2) . '</th><th>'
! . substr ($LANG30[1], 0, 2) . '</th></tr>';
! } else {
! $retval .= substr ($LANG30[1], 0, 2) . '</th><th>'
! . substr ($LANG30[2], 0, 2) . '</th><th>'
! . substr ($LANG30[3], 0, 2) . '</th><th>'
! . substr ($LANG30[4], 0, 2) . '</th><th>'
! . substr ($LANG30[5], 0, 2) . '</th><th>'
! . substr ($LANG30[6], 0, 2) . '</th><th>'
! . substr ($LANG30[7], 0, 2) . '</th></tr>';
! }
return $retval;
***************
*** 474,480 ****
if ($hourcols[$i] > 0) {
} else {
! $cal_templates->set_var('event_entry',' ');
! //$cal_templates->parse($i . '_cols','column',true);
! //$cal_templates->parse($i . '_cols','column');
}
if ($nrows > 0) {
--- 485,491 ----
if ($hourcols[$i] > 0) {
} else {
! $cal_templates->set_var('event_entry',' ');
! //$cal_templates->parse($i . '_cols','column',true);
! //$cal_templates->parse($i . '_cols','column');
}
if ($nrows > 0) {
***************
*** 503,510 ****
next($thedata);
}
$cal_templates->parse($i.'_cols','column',true);
if ($nrows > 0) {
next($hourcols);
! }
}
--- 514,522 ----
next($thedata);
}
+ $cal_templates->set_var ($i . '_time', strftime ($_CONF['timeonly'], mktime ($i, 0)));
$cal_templates->parse($i.'_cols','column',true);
if ($nrows > 0) {
next($hourcols);
! }
}
***************
*** 553,561 ****
$cal_templates->set_var ('lang_week', $LANG30[40]);
$cal_templates->set_var ('lang_month', $LANG30[41]);
! $start_mname = strftime('%B', mktime(0,0,0,$month,$day,$year));
! $eday = strftime('%e', mktime(0,0,0,$month,$day+6,$year));
! $end_mname = strftime('%B', mktime(0,0,0,$month,$day+6,$year));
! $end_ynum = strftime('%Y', mktime (0,0,0,$month,$day+6,$year));
! $date_range = $start_mname . ' ' . $day;
if ($year <> $end_ynum) {
$date_range .= ', ' . $year . ' - ';
--- 565,584 ----
$cal_templates->set_var ('lang_week', $LANG30[40]);
$cal_templates->set_var ('lang_month', $LANG30[41]);
! if ($_CONF['week_start'] == 'Mon') {
! $time_day1 = mktime (0, 0, 0, $month, $day + 1, $year);
! $time_day7 = mktime (0, 0, 0, $month, $day + 7, $year);
! $start_mname = strftime ('%B', $time_day1);
! $eday = strftime ('%e', $time_day7);
! $end_mname = strftime ('%B', $time_day7);
! $end_ynum = strftime ('%Y', $time_day7);
! $date_range = $start_mname . ' ' . strftime ('%e', $time_day1);
! } else {
! $start_mname = strftime ('%B', mktime (0, 0, 0, $month, $day, $year));
! $time_day6 = mktime (0, 0, 0, $month, $day + 6, $year);
! $eday = strftime ('%e', $time_day6);
! $end_mname = strftime ('%B', $time_day6);
! $end_ynum = strftime ('%Y', $time_day6);
! $date_range = $start_mname . ' ' . $day;
! }
if ($year <> $end_ynum) {
$date_range .= ', ' . $year . ' - ';
***************
*** 569,576 ****
}
$cal_templates->set_var('date_range', $date_range);
! $thedate = COM_getUserDateTimeFormat(mktime(0,0,0,$month,$day,$year));
$cal_templates->set_var('week_num',$thedate[1]);
for ($i = 1; $i <= 7; $i++) {
! $dayname = $cal->getDayName(date('w',$thedate[1]) + 1);
$monthnum = date('m', $thedate[1]);
$daynum = date('d', $thedate[1]);
--- 592,609 ----
}
$cal_templates->set_var('date_range', $date_range);
! if ($_CONF['week_start'] == 'Mon') {
! $thedate = COM_getUserDateTimeFormat (mktime (0, 0, 0, $month, $day + 1,$year));
! } else {
! $thedate = COM_getUserDateTimeFormat (mktime (0, 0, 0, $month, $day, $year));
! }
$cal_templates->set_var('week_num',$thedate[1]);
for ($i = 1; $i <= 7; $i++) {
! if ($_CONF['week_start'] == 'Mon') {
! $dayname = (date ('w', $thedate[1]) == 0)
! ? $cal->getDayName (7)
! : $cal->getDayName (date ('w', $thedate[1]));
! } else {
! $dayname = $cal->getDayName (date ('w', $thedate[1]) + 1);
! }
$monthnum = date('m', $thedate[1]);
$daynum = date('d', $thedate[1]);
***************
*** 670,680 ****
$cal_templates->set_var('cal_nextyr_num', $nextyear);
! $cal_templates->set_var('lang_sunday', $LANG30[1]);
! $cal_templates->set_var('lang_monday', $LANG30[2]);
! $cal_templates->set_var('lang_tuesday', $LANG30[3]);
! $cal_templates->set_var('lang_wednesday', $LANG30[4]);
! $cal_templates->set_var('lang_thursday', $LANG30[5]);
! $cal_templates->set_var('lang_friday', $LANG30[6]);
! $cal_templates->set_var('lang_saturday', $LANG30[7]);
$cal_templates->set_var('lang_january', $LANG30[13]);
--- 703,723 ----
$cal_templates->set_var('cal_nextyr_num', $nextyear);
! if ($_CONF['week_start'] == 'Mon') {
! $cal_templates->set_var('lang_sunday', $LANG30[2]);
! $cal_templates->set_var('lang_monday', $LANG30[3]);
! $cal_templates->set_var('lang_tuesday', $LANG30[4]);
! $cal_templates->set_var('lang_wednesday', $LANG30[5]);
! $cal_templates->set_var('lang_thursday', $LANG30[6]);
! $cal_templates->set_var('lang_friday', $LANG30[7]);
! $cal_templates->set_var('lang_saturday', $LANG30[1]);
! } else {
! $cal_templates->set_var('lang_sunday', $LANG30[1]);
! $cal_templates->set_var('lang_monday', $LANG30[2]);
! $cal_templates->set_var('lang_tuesday', $LANG30[3]);
! $cal_templates->set_var('lang_wednesday', $LANG30[4]);
! $cal_templates->set_var('lang_thursday', $LANG30[5]);
! $cal_templates->set_var('lang_friday', $LANG30[6]);
! $cal_templates->set_var('lang_saturday', $LANG30[7]);
! }
$cal_templates->set_var('lang_january', $LANG30[13]);
More information about the geeklog-cvs
mailing list