Add blog extension

This commit is contained in:
2026-12-02 10:20:36 +00:00
parent 47214e0bbc
commit f35645132e
19 changed files with 1005 additions and 2 deletions
@@ -0,0 +1,24 @@
<?php
phpb_requires_authenticated();
if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') {
http_response_code(405);
exit();
}
if (!phpb_validate_csrf()) {
http_response_code(403);
exit();
}
$deleted = false;
try {
if (isset($_POST['id']) && is_string($_POST['id']) && ctype_digit($_POST['id']) && (int) $_POST['id'] > 0) {
$deleted = (new \Plugi\Extensions\Blog\CategoriesRepository())->destroy((int) $_POST['id']);
}
} catch (\Throwable) {
$deleted = false;
}
phpb_redirect(phpb_url('website_manager', ['tab' => 'ext--blog', 'action' => 'categories']), [
'message-type' => $deleted ? 'success' : 'error',
'message' => $deleted ? 'Category deleted; associated posts are uncategorized.' : 'The category could not be deleted.',
]);