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

19 lines
601 B
PHP

<?php
namespace Misuzu;
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
die('Script must be called through the Misuzu route dispatcher.');
if(!$msz->authInfo->getPerms('global')->check(Perm::G_NEWS_CATEGORIES_MANAGE))
Template::throwError(403);
$pagination = Pagination::fromInput($msz->news->countCategories(), 15);
if(!$pagination->validOffset)
Template::throwError(404);
$categories = $msz->news->getCategories(pagination: $pagination);
Template::render('manage.news.categories', [
'news_categories' => $categories,
'categories_pagination' => $pagination,
]);