mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-17 17:08:41 +00:00
Fixes #89
This commit is contained in:
parent
4c343ef1a0
commit
ce99847ce6
|
|
@ -156,6 +156,9 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
$view->setTemplate('/Modules/News/Theme/Backend/news-archive');
|
$view->setTemplate('/Modules/News/Theme/Backend/news-archive');
|
||||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
|
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
|
||||||
|
|
||||||
|
$articles = NewsArticleMapper::getNewest(50);
|
||||||
|
$view->addData('articles', $articles);
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ $footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
|
||||||
$footerView->setPages(20);
|
$footerView->setPages(20);
|
||||||
$footerView->setPage(1);
|
$footerView->setPage(1);
|
||||||
|
|
||||||
|
$articles = $this->getData('articles');
|
||||||
|
|
||||||
echo $this->getData('nav')->render(); ?>
|
echo $this->getData('nav')->render(); ?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
@ -39,7 +41,17 @@ echo $this->getData('nav')->render(); ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4"><?= $footerView->render(); ?>
|
<td colspan="4"><?= $footerView->render(); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 0; foreach([] as $key => $value) : $count++; ?>
|
<?php $count = 0; foreach($articles as $key => $news) : $count++; $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/news/article?{?}&id=' . $news->getId());
|
||||||
|
$color = 'darkred';
|
||||||
|
if($news->getType() === \Modules\News\Models\NewsType::ARTICLE) { $color = 'green'; }
|
||||||
|
elseif($news->getType() === \Modules\News\Models\NewsType::HEADLINE) { $color = 'purple'; }
|
||||||
|
elseif($news->getType() === \Modules\News\Models\NewsType::LINK) { $color = 'yellow'; }
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><span class="tag <?= $color; ?>"><?= $this->getText('TYPE' . $news->getType()); ?></span></a>
|
||||||
|
<td><a href="<?= $url; ?>"><?= $news->getTitle(); ?></a>
|
||||||
|
<td><a href="<?= $url; ?>"><?= $news->getCreatedBy()->getName1(); ?></a>
|
||||||
|
<td><a href="<?= $url; ?>"><?= $news->getPublish()->format('Y-m-d'); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if($count === 0) : ?>
|
<?php if($count === 0) : ?>
|
||||||
<tr><td colspan="4" class="empty"><?= $this->getText('Empty', 0, 0); ?>
|
<tr><td colspan="4" class="empty"><?= $this->getText('Empty', 0, 0); ?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user