mirror of
https://github.com/Karaka-Management/oms-News.git
synced 2026-02-04 19:18:41 +00:00
Organization + calendar fixes/extensions
This commit is contained in:
parent
5b293282fa
commit
7a4ec7af7d
|
|
@ -102,7 +102,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
*/
|
||||
protected static $routes = [
|
||||
'^.*/backend/news/dashboard.*$' => [['dest' => '\Modules\News\Controller:viewNewsDashboard', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/news/single.*$' => [['dest' => '\Modules\News\Controller:viewNewsArticle', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/news/article.*$' => [['dest' => '\Modules\News\Controller:viewNewsArticle', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/news/archive.*$' => [['dest' => '\Modules\News\Controller:viewNewsArchive', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/news/create.*$' => [['dest' => '\Modules\News\Controller:viewNewsCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
];
|
||||
|
|
@ -123,10 +123,9 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
$view->setTemplate('/Modules/News/Theme/Backend/news-dashboard');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000701001, $request, $response));
|
||||
|
||||
$news = $this->getNewsListR(20, 0, 'news.news_publish', 'DESC', $this->app->accountManager->get($request->getAccount()));
|
||||
$headline = $this->getHeadlineListR(20, 0, 'news.news_publish', 'ASC', $this->app->accountManager->get($request->getAccount()));
|
||||
$view->addData('newsList', $news);
|
||||
$view->addData('headlineList', $headline);
|
||||
$mapper = new NewsArticleMapper($this->app->dbPool->get());
|
||||
$news = $mapper->getNewest(50);
|
||||
$view->addData('news', $news);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -149,7 +148,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
|
||||
$newsArticleMapper = new NewsArticleMapper($this->app->dbPool->get());
|
||||
$article = $newsArticleMapper->get((int) $request->getData('id'));
|
||||
$view->addData('newsList', $article);
|
||||
$view->addData('news', $article);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,14 @@ class NewsArticleMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $primaryField = 'news_id';
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $createdAt = 'news_created_at';
|
||||
|
||||
/**
|
||||
* Create article.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -34,4 +34,7 @@ $MODLANG['News'] = [
|
|||
'Title' => 'Title',
|
||||
'Type' => 'Type',
|
||||
'Visible' => 'Visible',
|
||||
'TYPE0' => 'Article',
|
||||
'TYPE1' => 'Link',
|
||||
'TYPE2' => 'Headline',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -17,38 +17,34 @@
|
|||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
|
||||
$newsList = $this->getData('newsList');
|
||||
$headlineList = $this->getData('headlineList');
|
||||
$newsList = $this->getData('news');
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-50 floatLeft">
|
||||
<section class="box w-100 floatLeft">
|
||||
<table class="table">
|
||||
<caption><?= $this->l11n->lang['News']['News'] ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td><?= $this->l11n->lang['News']['Type']; ?>
|
||||
<td class="wf-100"><?= $this->l11n->lang['News']['Title']; ?>
|
||||
<td><?= $this->l11n->lang['News']['Author']; ?>
|
||||
<td><?= $this->l11n->lang['News']['Date']; ?>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach([] as $key => $value) : $count++; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if($count === 0) : ?>
|
||||
<tr><td colspan="3" class="empty"><?= $this->l11n->lang[0]['Empty']; ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section class="box w-50 floatLeft">
|
||||
<table class="table">
|
||||
<caption><?= $this->l11n->lang['News']['Headlines'] ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="wf-100"><?= $this->l11n->lang['News']['Title']; ?>
|
||||
<td><?= $this->l11n->lang['News']['Author']; ?>
|
||||
<td><?= $this->l11n->lang['News']['Date']; ?>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach([] as $key => $value) : $count++; ?>
|
||||
<?php $count = 0; foreach($newsList as $key => $news) : $count++;
|
||||
$url = \phpOMS\Uri\UriFactory::build('/{/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><a href="<?= $url; ?>"><?= $news->isFeatured() ? '<i class="fa fa-star favorite"></i>' : ''; ?></a>
|
||||
<td><a href="<?= $url; ?>"><span class="tag <?= $color; ?>"><?= $this->l11n->lang['News']['TYPE' . $news->getType()]; ?></span></a>
|
||||
<td><a href="<?= $url; ?>"><?= $news->getTitle(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $news->getCreatedBy(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $news->getPublish()->format('Y-m-d'); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if($count === 0) : ?>
|
||||
<tr><td colspan="3" class="empty"><?= $this->l11n->lang[0]['Empty']; ?>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,31 @@
|
|||
<div class="b b-5 c7-1 c7" id="i7-1-1">
|
||||
<h1>
|
||||
<?= /** @var \Modules\News\Article $article */
|
||||
$article->getTitle(); ?>
|
||||
<i class="fa fa-minus min"></i>
|
||||
<i class="fa fa-plus max vh"></i>
|
||||
</h1>
|
||||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
|
||||
<div class="bc-1">
|
||||
<span><?= $article->getPublish()->format('Y-m-d H:i:s'); ?></span> <span><?= $article->getAuthor(); ?></span>
|
||||
<?= $article->getContent(); ?>
|
||||
$news = $this->getData('news');
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-100">
|
||||
<h1><?= $news->getTitle(); ?></h1>
|
||||
<div class="inner">
|
||||
<article>
|
||||
<?= $news->getContent(); ?>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user