fixed warning if tagWholeDayOnTop($dayEvents) is called with no array, eg. false because no events found

This commit is contained in:
Ralf Becker 2010-01-20 23:21:00 +00:00
parent 8c1e245925
commit 74383ecb15

View File

@ -2207,6 +2207,9 @@ class calendar_uiviews extends calendar_ui
function tagWholeDayOnTop($dayEvents)
{
$this->extraRows = $this->extraRowsOriginal;
if (is_array($dayEvents))
{
foreach ($dayEvents as $day=>$oneDayEvents)
{
$extraRowsToAdd = 0;
@ -2229,9 +2232,12 @@ class calendar_uiviews extends calendar_ui
}
}
// check after every day if we have to increase $this->extraRows
if(($this->extraRowsOriginal+$extraRowsToAdd) > $this->extraRows) { $this->extraRows = ($this->extraRowsOriginal+$extraRowsToAdd); }
if(($this->extraRowsOriginal+$extraRowsToAdd) > $this->extraRows)
{
$this->extraRows = ($this->extraRowsOriginal+$extraRowsToAdd);
}
}
}
return $dayEvents;
}
}