"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "calendar-bundle/src/Resources/contao/modules/ModuleCalendar.php" between
contao-4.11.3.tar.gz and contao-4.11.4.tar.gz

About: Contao (fka TYPOlight) is a content management system (CMS). Latest release.

ModuleCalendar.php  (contao-4.11.3):ModuleCalendar.php  (contao-4.11.4)
skipping to change at line 124 skipping to change at line 124
} }
catch (\OutOfBoundsException $e) catch (\OutOfBoundsException $e)
{ {
throw new PageNotFoundException('Page not found: ' . Envi ronment::get('uri')); throw new PageNotFoundException('Page not found: ' . Envi ronment::get('uri'));
} }
$time = Date::floorToMinute(); $time = Date::floorToMinute();
// Find the boundaries // Find the boundaries
$objMinMax = $this->Database->query("SELECT MIN(startTime) AS dat eFrom, MAX(endTime) AS dateTo, MAX(repeatEnd) AS repeatUntil FROM tl_calendar_ev ents WHERE pid IN(" . implode(',', array_map('\intval', $this->cal_calendar)) . ")" . (!BE_USER_LOGGED_IN ? " AND published='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'$time')" : "")); $objMinMax = $this->Database->query("SELECT MIN(startTime) AS dat eFrom, MAX(endTime) AS dateTo, MAX(repeatEnd) AS repeatUntil FROM tl_calendar_ev ents WHERE pid IN(" . implode(',', array_map('\intval', $this->cal_calendar)) . ")" . (!BE_USER_LOGGED_IN ? " AND published='1' AND (start='' OR start<='$time') AND (stop='' OR stop>'$time')" : ""));
$dateFrom = $objMinMax->dateFrom;
$dateTo = $objMinMax->dateTo;
$repeatUntil = $objMinMax->repeatUntil;
if (isset($GLOBALS['TL_HOOKS']['findCalendarBoundaries']) && \is_
array($GLOBALS['TL_HOOKS']['findCalendarBoundaries']))
{
foreach ($GLOBALS['TL_HOOKS']['findCalendarBoundaries'] a
s $callback)
{
$this->import($callback[0]);
$this->{$callback[0]}->{$callback[1]}($dateFrom,
$dateTo, $repeatUntil, $this);
}
}
// Store year and month // Store year and month
$intYear = date('Y', $this->Date->tstamp); $intYear = date('Y', $this->Date->tstamp);
$intMonth = date('m', $this->Date->tstamp); $intMonth = date('m', $this->Date->tstamp);
$objTemplate = new FrontendTemplate($this->cal_ctemplate ?: 'cal_ default'); $objTemplate = new FrontendTemplate($this->cal_ctemplate ?: 'cal_ default');
$objTemplate->intYear = $intYear; $objTemplate->intYear = $intYear;
$objTemplate->intMonth = $intMonth; $objTemplate->intMonth = $intMonth;
// Previous month // Previous month
$prevMonth = ($intMonth == 1) ? 12 : ($intMonth - 1); $prevMonth = ($intMonth == 1) ? 12 : ($intMonth - 1);
$prevYear = ($intMonth == 1) ? ($intYear - 1) : $intYear; $prevYear = ($intMonth == 1) ? ($intYear - 1) : $intYear;
$lblPrevious = $GLOBALS['TL_LANG']['MONTHS'][($prevMonth - 1)] . ' ' . $prevYear; $lblPrevious = $GLOBALS['TL_LANG']['MONTHS'][($prevMonth - 1)] . ' ' . $prevYear;
$intPrevYm = (int) ($prevYear . str_pad($prevMonth, 2, 0, STR_PAD _LEFT)); $intPrevYm = (int) ($prevYear . str_pad($prevMonth, 2, 0, STR_PAD _LEFT));
// Only generate a link if there are events (see #4160) // Only generate a link if there are events (see #4160)
if (($objMinMax->dateFrom !== null && $intPrevYm >= date('Ym', $o bjMinMax->dateFrom)) || $intPrevYm >= date('Ym')) if (($dateFrom !== null && $intPrevYm >= date('Ym', $dateFrom)) | | $intPrevYm >= date('Ym'))
{ {
$objTemplate->prevHref = $this->strUrl . '?month=' . $int PrevYm; $objTemplate->prevHref = $this->strUrl . '?month=' . $int PrevYm;
$objTemplate->prevTitle = StringUtil::specialchars($lblPr evious); $objTemplate->prevTitle = StringUtil::specialchars($lblPr evious);
$objTemplate->prevLink = $GLOBALS['TL_LANG']['MSC']['cal_ previous'] . ' ' . $lblPrevious; $objTemplate->prevLink = $GLOBALS['TL_LANG']['MSC']['cal_ previous'] . ' ' . $lblPrevious;
$objTemplate->prevLabel = $GLOBALS['TL_LANG']['MSC']['cal _previous']; $objTemplate->prevLabel = $GLOBALS['TL_LANG']['MSC']['cal _previous'];
} }
// Current month // Current month
$objTemplate->current = $GLOBALS['TL_LANG']['MONTHS'][(date('m', $this->Date->tstamp) - 1)] . ' ' . date('Y', $this->Date->tstamp); $objTemplate->current = $GLOBALS['TL_LANG']['MONTHS'][(date('m', $this->Date->tstamp) - 1)] . ' ' . date('Y', $this->Date->tstamp);
// Next month // Next month
$nextMonth = ($intMonth == 12) ? 1 : ($intMonth + 1); $nextMonth = ($intMonth == 12) ? 1 : ($intMonth + 1);
$nextYear = ($intMonth == 12) ? ($intYear + 1) : $intYear; $nextYear = ($intMonth == 12) ? ($intYear + 1) : $intYear;
$lblNext = $GLOBALS['TL_LANG']['MONTHS'][($nextMonth - 1)] . ' ' . $nextYear; $lblNext = $GLOBALS['TL_LANG']['MONTHS'][($nextMonth - 1)] . ' ' . $nextYear;
$intNextYm = $nextYear . str_pad($nextMonth, 2, 0, STR_PAD_LEFT); $intNextYm = $nextYear . str_pad($nextMonth, 2, 0, STR_PAD_LEFT);
// Only generate a link if there are events (see #4160) // Only generate a link if there are events (see #4160)
if ($intNextYm <= date('Ym') || ($objMinMax->dateTo !== null && $ intNextYm <= date('Ym', max($objMinMax->dateTo, $objMinMax->repeatUntil)))) if ($intNextYm <= date('Ym') || ($dateTo !== null && $intNextYm < = date('Ym', max($dateTo, $repeatUntil))))
{ {
$objTemplate->nextHref = $this->strUrl . '?month=' . $int NextYm; $objTemplate->nextHref = $this->strUrl . '?month=' . $int NextYm;
$objTemplate->nextTitle = StringUtil::specialchars($lblNe xt); $objTemplate->nextTitle = StringUtil::specialchars($lblNe xt);
$objTemplate->nextLink = $lblNext . ' ' . $GLOBALS['TL_LA NG']['MSC']['cal_next']; $objTemplate->nextLink = $lblNext . ' ' . $GLOBALS['TL_LA NG']['MSC']['cal_next'];
$objTemplate->nextLabel = $GLOBALS['TL_LANG']['MSC']['cal _next']; $objTemplate->nextLabel = $GLOBALS['TL_LANG']['MSC']['cal _next'];
} }
// Set the week start day // Set the week start day
if (!$this->cal_startDay) if (!$this->cal_startDay)
{ {
 End of changes. 3 change blocks. 
2 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)