";
$calendar .= '';
foreach($darray as $dheader)
{
$calendar .= "";
}
$calendar .= "
";
$calendar .= '';
$day_of_month = 1;
$tablerow = 1;
// take care of the first "empty" days of the month
if ($day_of_week-$ws > 0)
{
$calendar .= " | ";
}
// print the days of the month (take the $ws into account)
while ($day_of_month <= $last_day)
{
if ($day_of_week-$ws == 7)
{
#start a new week
$calendar .= "
";
$day_of_week = 0+$ws;
$tablerow++;
}
if ($day_of_month == $req_day)
{
$day_style = isset($links[$day_of_month]) ? "indent blogcalendar-day-active" : "forumheader3 blogcalendar-day";
}
else
{
$day_style = isset($links[$day_of_month]) ? "indent blogcalendar-day-active " : "forumheader3 blogcalendar-day";
}
$label_style = isset($links[$day_of_month]) ? 'label label-info' : ''; //TODO A pref in admin to choose between info, danger, etc.
$calendar .= "";
$calendar .= isset($links[$day_of_month]) ? "":"";
$calendar .= "";
$calendar .= $day_of_month;
$calendar .= "";
$calendar .= isset($links[$day_of_month]) ? "" : "";
$calendar .= " | ";
$day_of_month++;
$day_of_week++;
}
if ($day_of_week-$ws != 7)
{
$calendar .= ' | ';
}
$calendar .= "
";
if ($tablerow != 6)
{
$calendar .= " |
";
}
$calendar .= "";
// $calendar .= "tablerow = ".$tablerow;
if(deftrue('BOOTSTRAP'))
{
$active = date("n-Y") == ($req_month."-".$req_year) ? 'active' : '';
$text = "";
$text .= "
".$marray[$req_month]." ".$req_year."
";
$text .= $calendar;
$text .= "";
}
else // BC
{
$text = $calendar;
}
return $text;
}
?>