misuzu/public-legacy/manage/news/posts.php

25 lines
564 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->getAllPosts(
includeScheduled: true,
includeDeleted: true,
pagination: $pagination
);
Template::render('manage.news.posts', [
'news_posts' => $posts,
'posts_pagination' => $pagination,
]);