30 lines
875 B
PHP
30 lines
875 B
PHP
<?php
|
|
namespace Misuzu;
|
|
|
|
use RuntimeException;
|
|
|
|
if(!$msz->authInfo->getPerms('global')->check(Perm::G_CL_CHANGES_MANAGE))
|
|
Template::throwError(403);
|
|
|
|
$pagination = new Pagination($msz->changelog->countChanges(), 30);
|
|
if(!$pagination->hasValidOffset())
|
|
Template::throwError(404);
|
|
|
|
$changeInfos = $msz->changelog->getChanges(pagination: $pagination);
|
|
$changes = [];
|
|
|
|
foreach($changeInfos as $changeInfo) {
|
|
$userInfo = $changeInfo->userId !== null ? $msz->usersCtx->getUserInfo($changeInfo->userId) : null;
|
|
|
|
$changes[] = [
|
|
'change' => $changeInfo,
|
|
'tags' => $msz->changelog->getTags(changeInfo: $changeInfo),
|
|
'user' => $userInfo,
|
|
'user_colour' => $msz->usersCtx->getUserColour($userInfo),
|
|
];
|
|
}
|
|
|
|
Template::render('manage.changelog.changes', [
|
|
'changelog_changes' => $changes,
|
|
'changelog_pagination' => $pagination,
|
|
]);
|