<?php
$articles
=
$this
->get(
'articles'
);
$entrantsMapper
=
$this
->get(
'entrantsMapper'
);
$categoryMapper
=
$this
->get(
'categoryMapper'
);
$commentMapper
=
$this
->get(
'commentMapper'
);
$userMapper
=
$this
->get(
'userMapper'
);
$events
=
$this
->get(
'eventListUpcoming'
);
?>
<link href=
"<?=$this->getModuleUrl('static/css/start.css') ?>"
rel=
"stylesheet"
>
<div
class
=
"col-lg-6 startseite"
>
<h4>Heute on Air</h4>
<table
class
=
"table"
>
<tbody>
<?php
if
(
$this
->get(
'sendeplanList'
)) {
foreach
(
$this
->get(
'sendeplanList'
)
as
$sendeplanList
) {
if
(!is_in_array(
$this
->get(
'readAccess'
),
explode
(
','
,
$sendeplanList
->getReadAccess())) &&
$adminAccess
== false) {
continue
;
}
$e
= [];
$e
[
'title'
] =
$this
->escape(
$sendeplanList
->getTitle()).
" mit "
.
$this
->escape(
$sendeplanList
->getPlace());
$e
[
'start'
] =
new
\Ilch\
Date
(
$sendeplanList
->getStart());
$e
[
'end'
] =
new
\Ilch\
Date
(
$sendeplanList
->getEnd());
$e
[
'color'
] =
$sendeplanList
->getColor();
$e
[
'url'
] =
$this
->getUrl(
'sendeplan/events/show/id/'
.
$sendeplanList
->getId());
if
(
$userMapper
->getUserByName(
$this
->escape(
$sendeplanList
->getPlace()))){
$user_pic
=
$userMapper
->getUserByName(
$this
->escape(
$sendeplanList
->getPlace()))->getAvatar();
}
else
{
$user_pic
=
'static/img/noavatar.jpg'
;
}
echo
'<tr>'
;
echo
"<td>"
.
$e
[
'start'
]->format(
'H:i'
).
" - "
.
$e
[
'end'
]->format(
'H:i'
).
"</td>"
;
echo
"<td><img src="
.
$this
->getBaseUrl().
$user_pic
.
"></td>"
;
echo
"<td with><a href='"
.
$e
['url
']."'
>".
$e
[
'title'
].
"</a></td>"
;
echo
"</tr>"
;
}
}
else
{
echo
'Heute keine Sendung'
;
}
?>
</tbody>
</table>
<div
class
=
"text-center"
>
<a
class
=
"btn btn-primary"
href=
"<?=$this->getUrl(['module' => 'sendeplan','action' => 'index']) ?>"
>zum Sendeplan</a>
<a
class
=
"btn btn-primary"
href=
"<?=$this->getUrl(['module' => 'wg','action' => 'index']) ?>"
>zur Wunschbox</a></div>
</div>
<div
class
=
"col-lg-6 startseite"
>
<div
class
=
"text-center"
>
<a
class
=
"btn btn-primary"
href=
"<?=$this->getBaseUrl().'player/mpr-stream.m3u' ?>"
> <i
class
=
"fa fa-play-circle"
></i> Media Player (.m3u)</a>
<a
class
=
"btn btn-primary"
href=
"<?=$this->getBaseUrl().'player/mpr-stream.pls' ?>"
> <i
class
=
"fa fa-bolt"
></i> Winamp / VLC (.pls)</a>
</div>
<div
class
=
"text-center"
>
$_buffer
=
explode
(
','
,
$_url
);
echo
'Aktuell: '
.
$_buffer
[
'6'
];
?>
</div>
</div>
<div
class
=
"col-lg-12 startseite"
></div>
<div
class
=
"col-lg-12 startseite news"
>
<h2>Unsere Redaktion <a
class
=
'btn'
href=
'<?=$this->getUrl(['
module
' => '
article
']) ?>'
> Mehr Artikel lesen</a></h2>
<?php
if
(
$this
->get(
'articles'
) !=
''
){?>
<div
class
=
"col-lg-12 news"
>
<?php
foreach
(
$articles
as
$article
)
{
$date
=
new
\Ilch\
Date
(
$article
->getDateCreated());
$commentsCount
=
$commentMapper
->getCountComments(sprintf(Modules\Article\Config\Config::COMMENT_KEY_TPL,
$article
->getId()));
if
(
empty
(
$article
->getImage())){
$image
=
'application/layouts/mpr2021/img/news.png'
;
}
else
{
$image
=
$article
->getImage();
}
?>
<div
class
=
"news-item"
>
<img src=
"<?=$this->getBaseUrl($image)?>"
alt=
""
>
<h3><?=
$this
->escape(
$article
->getTitle()) ?></h3>
<p> <?php
$content
=
$article
->getContent(); ?>
<?php
if
(
strpos
(
$content
,
'[PREVIEWSTOP]'
) !== false): ?>
<?php
$contentParts
=
explode
(
'[PREVIEWSTOP]'
,
$content
); ?>
<?=
$this
->purify(reset(
$contentParts
)) ?>
<br />
<a
class
=
"btn"
href=
"<?=$this->getUrl(['module' => 'article','action' => 'show', 'id' => $article->getId()]) ?>"
>Weiter lesen</a>
<?php
else
: ?>
<?=
$this
->purify(
$content
) ?>
<?php
endif
; ?></p>
<div
class
=
'small'
> <i
class
=
"fa fa-calendar"
title=
"<?=$this->getTrans('date') ?>"
></i> <a href=
"<?=$this->getUrl(['module' => 'article','controller' => 'archive', 'action' => 'show', 'year' => $date->format('Y', true), 'month' => $date->format('m', true)]) ?>"
><?=
$date
->format(
'd.'
, true) ?> <?=
$this
->getTrans(
$date
->format(
'F'
, true)) ?> <?=
$date
->format(
'Y'
, true) ?></a> | <i
class
=
"fa fa-comment-o"
title=
"<?=$this->getTrans('comments') ?>"
></i> <a href=
"<?=$this->getUrl(['module' => 'article','action' => 'show', 'id' => $article->getId().'#comment']) ?>"
><?=
$commentsCount
?></a>
| <i
class
=
"fa fa-eye"
title=
"<?=$this->getTrans('hits') ?>"
></i> <?=
$article
->getVisits() ?></div>
</div>
<?php
}
}
else
{?>
<div
class
=
"col-lg-12"
>
<h3>Keine News vorhanden</h3>
<?php
}
?></div>
</div>