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

18 lines
487 B
PHP

<?php
namespace Misuzu;
if(!$msz->getAuthInfo()->getPerms('global')->check(Perm::G_NEWS_CATEGORIES_MANAGE))
Template::throwError(403);
$news = $msz->getNews();
$pagination = new Pagination($news->countCategories(), 15);
if(!$pagination->hasValidOffset())
Template::throwError(404);
$categories = $news->getCategories(pagination: $pagination);
Template::render('manage.news.categories', [
'news_categories' => $categories,
'categories_pagination' => $pagination,
]);