2019-06-09 22:10:59 +00:00
|
|
|
<?php
|
2019-09-28 22:43:51 +00:00
|
|
|
namespace Misuzu;
|
|
|
|
|
2019-06-09 22:10:59 +00:00
|
|
|
require_once '../../../misuzu.php';
|
|
|
|
|
|
|
|
if(!perms_check_user(MSZ_PERMS_NEWS, user_session_current('user_id'), MSZ_PERM_NEWS_MANAGE_POSTS)) {
|
|
|
|
echo render_error(403);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-12-06 01:04:10 +00:00
|
|
|
$postsPagination = new Pagination(news_posts_count(null, false, true, false), 15);
|
2019-06-09 22:10:59 +00:00
|
|
|
|
2019-12-06 01:04:10 +00:00
|
|
|
if(!$postsPagination->hasValidOffset()) {
|
2019-06-09 22:10:59 +00:00
|
|
|
echo render_error(404);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-12-06 01:04:10 +00:00
|
|
|
$posts = news_posts_get(
|
|
|
|
$postsPagination->getOffset(),
|
|
|
|
$postsPagination->getRange(),
|
|
|
|
null, false, true, false
|
|
|
|
);
|
2019-06-09 22:10:59 +00:00
|
|
|
|
2019-12-04 18:16:22 +00:00
|
|
|
Template::render('manage.news.posts', [
|
2019-06-09 22:10:59 +00:00
|
|
|
'news_posts' => $posts,
|
|
|
|
'posts_pagination' => $postsPagination,
|
|
|
|
]);
|