Skip to content

Commit

Permalink
#180 Added bans for the forum
Browse files Browse the repository at this point in the history
  • Loading branch information
simba77 committed Apr 3, 2022
1 parent c6d9a57 commit 0808025
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/johncms/forum/config/bans.global.php
Expand Up @@ -4,6 +4,8 @@

return [
'bans' => [
'ban_types' => [],
'ban_types' => [
\Johncms\Forum\Ban\BanTypes::class,
],
],
];
35 changes: 35 additions & 0 deletions modules/johncms/forum/src/Ban/BanTypes.php
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

namespace Johncms\Forum\Ban;

use Johncms\Users\Ban\BanTypesInterface;

class BanTypes implements BanTypesInterface
{
/**
* @inheritDoc
*/
public function getTypes(): array
{
return [
[
'name' => 'forum_read_only',
'displayName' => d__('forum', 'Can\'t write anything'),
],
[
'name' => 'forum_add_messages',
'displayName' => d__('forum', 'Add forum posts'),
],
[
'name' => 'forum_upload_photos',
'displayName' => d__('forum', 'Upload photos on the forum'),
],
[
'name' => 'forum_create_topics',
'displayName' => d__('forum', 'Create topics on the forum'),
],
];
}
}

0 comments on commit 0808025

Please sign in to comment.