29 lines
590 B
PHP
29 lines
590 B
PHP
<?php
|
|
namespace Misuzu;
|
|
|
|
if(!$msz->getAuthInfo()->getPerms('global')->check(Perm::G_NEWS_POSTS_MANAGE)) {
|
|
echo render_error(403);
|
|
return;
|
|
}
|
|
|
|
$news = $msz->getNews();
|
|
$pagination = new Pagination($news->countPosts(
|
|
includeScheduled: true,
|
|
includeDeleted: true
|
|
), 15);
|
|
|
|
if(!$pagination->hasValidOffset()) {
|
|
echo render_error(404);
|
|
return;
|
|
}
|
|
|
|
$posts = $news->getAllPosts(
|
|
includeScheduled: true,
|
|
includeDeleted: true,
|
|
pagination: $pagination
|
|
);
|
|
|
|
Template::render('manage.news.posts', [
|
|
'news_posts' => $posts,
|
|
'posts_pagination' => $pagination,
|
|
]);
|