misuzu/public-legacy/manage/news/posts.php
2023-09-08 20:40:48 +00:00

26 lines
561 B
PHP

<?php
namespace Misuzu;
if(!$msz->getAuthInfo()->getPerms('global')->check(Perm::G_NEWS_POSTS_MANAGE))
Template::throwError(403);
$news = $msz->getNews();
$pagination = new Pagination($news->countPosts(
includeScheduled: true,
includeDeleted: true
), 15);
if(!$pagination->hasValidOffset())
Template::throwError(404);
$posts = $news->getPosts(
includeScheduled: true,
includeDeleted: true,
pagination: $pagination
);
Template::render('manage.news.posts', [
'news_posts' => $posts,
'posts_pagination' => $pagination,
]);