mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
show events in year calendar, get rid of some div.well
This commit is contained in:
parent
fad908cbe0
commit
4443b80631
|
@ -133,14 +133,29 @@ class SeedDMS_View_Calendar extends SeedDMS_Bootstrap_Style {
|
|||
// Make sure we know when today is, so that we can use a different CSS style
|
||||
$today = getdate(time());
|
||||
|
||||
$events = getEventsInInterval(mktime(0,0,0, $month, 1, $year), mktime(23,59,59, $month+1, 0, $year));
|
||||
$eventdays = array();
|
||||
if($events) {
|
||||
for($i=1; $i<$daysInMonth; $i++)
|
||||
$eventdays[$i] = 0;
|
||||
foreach($events as $event) {
|
||||
for($i = date('d', $event['start']); $i <= date('d', $event['stop']); $i++) {
|
||||
$eventdays[$i]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while ($d <= $daysInMonth)
|
||||
{
|
||||
$s .= "<tr>\n";
|
||||
|
||||
for ($i = 0; $i < 7; $i++){
|
||||
|
||||
$class = ($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "today" : "";
|
||||
$s .= "<td class=\"$class\">";
|
||||
$class = '';
|
||||
if($eventdays && $eventdays[$d])
|
||||
$class = 'event';
|
||||
$class = ($year == $today["year"] && $month == $today["mon"] && $d == $today["mday"]) ? "today" : $class;
|
||||
$s .= "<td".($class ? " class=\"$class\"" : "").">";
|
||||
|
||||
if ($d > 0 && $d <= $daysInMonth){
|
||||
|
||||
|
@ -160,7 +175,7 @@ class SeedDMS_View_Calendar extends SeedDMS_Bootstrap_Style {
|
|||
} /* }}} */
|
||||
|
||||
function printYearTable($year) { /* {{{ */
|
||||
print "<table class=\"table-condensed\">\n";
|
||||
print "<table class=\"table\" style=\"max-width: 700px;\">\n";
|
||||
print "<tr>";
|
||||
print "<td valign=\"top\">" . $this->getMonthHTML(1 , $year) ."</td>\n";
|
||||
print "<td valign=\"top\">" . $this->getMonthHTML(2 , $year) ."</td>\n";
|
||||
|
@ -214,9 +229,9 @@ class SeedDMS_View_Calendar extends SeedDMS_Bootstrap_Style {
|
|||
echo "</ul>";
|
||||
echo "</div>";
|
||||
|
||||
$this->contentContainerStart();
|
||||
// $this->contentContainerStart();
|
||||
$this->printYearTable($year);
|
||||
$this->contentContainerEnd();
|
||||
// $this->contentContainerEnd();
|
||||
|
||||
}else if ($mode=="m"){
|
||||
|
||||
|
@ -320,9 +335,9 @@ class SeedDMS_View_Calendar extends SeedDMS_Bootstrap_Style {
|
|||
print "<li><a href=\"../out/out.Calendar.php?mode=w&year=".($year)."&month=".($month)."&day=".($day+7)."\"><i style=\"color: black;\" class=\"icon-arrow-right\"></i></a></li>";
|
||||
echo "</ul>";
|
||||
echo "</div>";
|
||||
$this->contentContainerStart();
|
||||
// $this->contentContainerStart();
|
||||
|
||||
echo "<table class='table table-condensed'>\n";
|
||||
echo "<table class='table _table-condensed' style=\"max-width: 700px;\">\n";
|
||||
|
||||
for ($i=$starttime; $i<$stoptime; $i += 86400){
|
||||
|
||||
|
@ -359,7 +374,7 @@ class SeedDMS_View_Calendar extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
echo "</table>\n";
|
||||
|
||||
$this->contentContainerEnd();
|
||||
// $this->contentContainerEnd();
|
||||
}
|
||||
|
||||
$this->contentEnd();
|
||||
|
|
Loading…
Reference in New Issue
Block a user