isLoggedIn() || !perms_check_user(MSZ_PERMS_NEWS, $msz->getActiveUser()->getId(), MSZ_PERM_NEWS_MANAGE_POSTS)) { echo render_error(403); return; } $news = $msz->getNews(); $pagination = new Pagination($news->countPosts( includeScheduled: true, includeDeleted: true ), 15); if(!$pagination->hasValidOffset()) { echo render_error(404); return; } $posts = $news->getAllPosts( includeScheduled: true, includeDeleted: true, pagination: $pagination ); Template::render('manage.news.posts', [ 'news_posts' => $posts, 'posts_pagination' => $pagination, ]);