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

24 lines
541 B
PHP

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