Skip to content

Commit

Permalink
[FEATURE] show entries of ext:news in calendar (ext:calendarize_news)
Browse files Browse the repository at this point in the history
ref #18
  • Loading branch information
cdaecke committed Nov 9, 2022
1 parent 7a15636 commit e13527e
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Classes/Controller/CalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ public function listAction()

if ($type == 1573738558) {
$items = [];
$i = 0;
/** @var \HDNET\Calendarize\Domain\Model\Index $el */
foreach ($search as $el) {
if ($el->getUniqueRegisterKey() === 'Event') {
if ($el->getUniqueRegisterKey() === 'Event' || $el->getUniqueRegisterKey() === 'News') {
$uri = $this->uriBuilder
->reset()
->setTargetPageUid((int)$this->settings['pid']['defaultDetailPid'])
Expand Down Expand Up @@ -150,22 +151,29 @@ public function listAction()
$end = $el->getEndDateComplete()->format('c');
}

$items[] = [
$items[$i] = [
'id' => $el->getUid(),
'title' => $el->getOriginalObject()->getTitle(),
'abstract' => $el->getOriginalObject()->getAbstract(),
'description' => $el->getOriginalObject()->getDescription(),
'location' => $el->getOriginalObject()->getLocation(),
'locationLink' => $el->getOriginalObject()->getLocationLink(),
'organizer' => $el->getOriginalObject()->getOrganizer(),
'organizerLink' => $el->getOriginalObject()->getOrganizerLink(),
'start' => $start,
'end' => $end,
'allDay' => $el->isAllDay(),
'className' => 'cal-item' . $this->getCssClasses($el->getOriginalObject()->getCategories()),
'url' => $uri,
'uriAjax' => $uriAjax,
];

if ($el->getUniqueRegisterKey() === 'News') {
$items[$i]['abstract'] = $el->getOriginalObject()->getTeaser();
} else {
$items[$i]['abstract'] = $el->getOriginalObject()->getAbstract();
$items[$i]['location'] = $el->getOriginalObject()->getLocation();
$items[$i]['locationLink'] = $el->getOriginalObject()->getLocationLink();
$items[$i]['organizer'] = $el->getOriginalObject()->getOrganizer();
$items[$i]['organizerLink'] = $el->getOriginalObject()->getOrganizerLink();
}

$i++;
}
}

Expand Down

0 comments on commit e13527e

Please sign in to comment.