From 4415a2e8c4bcc78744701fb086061e76b8988b5e Mon Sep 17 00:00:00 2001 From: Benjamin Date: Mon, 8 Jun 2026 16:25:52 +0200 Subject: [PATCH] A lot of things. --- Api/Controller/ThreadController.php | 33 ++++ ApprovalQueue/{ClubRequest.php => Club.php} | 35 ++-- Entity/Club.php | 120 +++++++++++++ Entity/ClubRequest.php | 75 -------- Pub/Controller/Club.php | 164 +++++++++++++++++- Service/Club/ApproverService.php | 64 +++++++ Service/Club/CreatorService.php | 99 +++++++++++ Service/Club/DeleterService.php | 40 +++++ Service/Club/EditorService.php | 73 ++++++++ Service/Club/ModeratorService.php | 106 +++++++++++ Setup.php | 17 +- XF/Entity/Forum.php | 22 +++ ...m_RomhackPlaza-Master-XF-Entity-Forum.json | 6 + _output/class_extensions/_metadata.json | 3 + _output/content_type_fields/_metadata.json | 8 +- .../club-approval_queue_handler_class.json | 5 + _output/content_type_fields/club-entity.json | 5 + ..._request-approval_queue_handler_class.json | 5 - .../club_request-entity.json | 5 - _output/extension_hint.php | 1 + _output/navigation/_metadata.json | 40 +++-- _output/navigation/about.json | 2 +- _output/navigation/clubs.json | 13 ++ _output/navigation/community.json | 2 +- _output/navigation/contact_us.json | 2 +- _output/navigation/database.json | 2 +- _output/navigation/discord.json | 2 +- _output/navigation/drafts.json | 13 ++ _output/navigation/forum.json | 2 +- _output/navigation/home.json | 2 +- _output/navigation/learn_romhacking.json | 2 +- _output/navigation/legal_pages.json | 2 +- _output/navigation/members.json | 2 +- _output/navigation/pages.json | 2 +- _output/navigation/rom_checker.json | 2 +- _output/navigation/rom_hasher.json | 2 +- _output/navigation/rom_patcher.json | 2 +- _output/navigation/submissions_queue.json | 2 +- _output/navigation/tools.json | 2 +- _output/navigation/website.json | 2 +- _output/phrases/_metadata.json | 12 ++ _output/phrases/nav.clubs.txt | 1 + _output/phrases/nav.drafts.txt | 1 + _output/routes/_metadata.json | 5 +- _output/routes/api_threads_undelete.json | 11 ++ _output/routes/public_clubs_.json | 2 +- _output/template_modifications/_metadata.json | 11 ++ .../public/rhpz_above_thread_list_clubs.json | 9 + .../rhpz_above_thread_list_clubs_buttons.json | 9 + ...hpz_category_view_clubs_submit_button.json | 9 + _output/templates/_metadata.json | 14 +- .../public/approval_item_club_request.html | 2 +- .../templates/public/club_delete_confirm.html | 13 ++ _output/templates/public/club_edit_form.html | 72 ++++++++ .../templates/public/club_request_form.html | 1 + 55 files changed, 995 insertions(+), 163 deletions(-) create mode 100644 Api/Controller/ThreadController.php rename ApprovalQueue/{ClubRequest.php => Club.php} (65%) create mode 100644 Entity/Club.php delete mode 100644 Entity/ClubRequest.php create mode 100644 Service/Club/ApproverService.php create mode 100644 Service/Club/CreatorService.php create mode 100644 Service/Club/DeleterService.php create mode 100644 Service/Club/EditorService.php create mode 100644 Service/Club/ModeratorService.php create mode 100644 XF/Entity/Forum.php create mode 100644 _output/class_extensions/XF-Entity-Forum_RomhackPlaza-Master-XF-Entity-Forum.json create mode 100644 _output/content_type_fields/club-approval_queue_handler_class.json create mode 100644 _output/content_type_fields/club-entity.json delete mode 100644 _output/content_type_fields/club_request-approval_queue_handler_class.json delete mode 100644 _output/content_type_fields/club_request-entity.json create mode 100644 _output/navigation/clubs.json create mode 100644 _output/navigation/drafts.json create mode 100644 _output/phrases/nav.clubs.txt create mode 100644 _output/phrases/nav.drafts.txt create mode 100644 _output/routes/api_threads_undelete.json create mode 100644 _output/template_modifications/_metadata.json create mode 100644 _output/template_modifications/public/rhpz_above_thread_list_clubs.json create mode 100644 _output/template_modifications/public/rhpz_above_thread_list_clubs_buttons.json create mode 100644 _output/template_modifications/public/rhpz_category_view_clubs_submit_button.json create mode 100644 _output/templates/public/club_delete_confirm.html create mode 100644 _output/templates/public/club_edit_form.html diff --git a/Api/Controller/ThreadController.php b/Api/Controller/ThreadController.php new file mode 100644 index 0000000..ecde159 --- /dev/null +++ b/Api/Controller/ThreadController.php @@ -0,0 +1,33 @@ +assertApiScope('thread:write'); + + /** @var Thread $thread */ + $thread = $this->assertRecordExists('XF:Thread', $params->thread_id, ['FirstPost'] ); + if( $thread->discussion_state !== 'deleted' ) + return $this->error("This thread is not deleted.", 'not_deleted' ); + + if(!$thread->canUndelete($error)){ + return $this->noPermission($error); + } + + $thread->discussion_state = 'visible'; + $thread->save(); + + return $this->apiSuccess([ + 'thread' => $thread->toApiResult() + ]); + + } +} \ No newline at end of file diff --git a/ApprovalQueue/ClubRequest.php b/ApprovalQueue/Club.php similarity index 65% rename from ApprovalQueue/ClubRequest.php rename to ApprovalQueue/Club.php index 97c7d2b..ba859bb 100644 --- a/ApprovalQueue/ClubRequest.php +++ b/ApprovalQueue/Club.php @@ -5,7 +5,7 @@ namespace RomhackPlaza\Master\ApprovalQueue; use XF\ApprovalQueue\AbstractHandler; use XF\Mvc\Entity\Entity; -class ClubRequest extends AbstractHandler +class Club extends AbstractHandler { protected function canViewContent(Entity $content, &$error = null) @@ -23,15 +23,15 @@ class ClubRequest extends AbstractHandler return ['User']; } - public function actionApprove(\RomhackPlaza\Master\Entity\ClubRequest $clubRequest) + public function actionApprove(\RomhackPlaza\Master\Entity\Club $club) { - $clubRequest->request_state = 'visible'; - $clubRequest->save(); + $club->club_state = 'visible'; + $club->save(); $node = \XF::em()->create('XF:Node'); $node->node_type_id = 'Forum'; - $node->title = $clubRequest->title; - $node->description = $clubRequest->description; + $node->title = $club->title; + $node->description = $club->description; $node->parent_node_id = \XF::options()->rhpz_club_node_id ?? 0; $node->display_order = 1; $node->save(); @@ -41,7 +41,10 @@ class ClubRequest extends AbstractHandler $forum->allow_posting = true; $forum->save(); - $user = $clubRequest->User; + $club->node_id = $node->node_id; + $club->save(); + + $user = $club->User; if ($user) { $modContent = \XF::em()->create('XF:ModeratorContent'); @@ -54,26 +57,16 @@ class ClubRequest extends AbstractHandler $permissionUpdater->setContent('node', $node->node_id); $permissionUpdater->setUser($user); - $permissionUpdater->updatePermissions([ - 'forum' => [ - 'editAnyPost' => 'content_allow', - 'deleteAnyPost' => 'content_allow', - 'deleteAnyThread' => 'content_allow', - 'inlineMod' => 'content_allow', - 'lockUnlockThread' => 'content_allow', - 'stickUnstickThread' => 'content_allow' - ] - ]); + $permissionUpdater->updatePermissions(\RomhackPlaza\Master\Entity\Club::MOD_PERMISSIONS); - // D. Reconstruction des permissions \XF::app()->jobManager()->enqueueUnique('permissionRebuild', 'XF:PermissionRebuild'); } } - public function actionReject(\RomhackPlaza\Master\Entity\ClubRequest $clubRequest) + public function actionReject(\RomhackPlaza\Master\Entity\Club $club) { - $clubRequest->request_state = 'rejected'; - $clubRequest->save(); + $club->club_state = 'rejected'; + $club->save(); } public function getTemplateName() diff --git a/Entity/Club.php b/Entity/Club.php new file mode 100644 index 0000000..d6a090a --- /dev/null +++ b/Entity/Club.php @@ -0,0 +1,120 @@ + [ + 'editAnyPost' => 'content_allow', + 'deleteAnyPost' => 'content_allow', + 'deleteAnyThread' => 'content_allow', + 'inlineMod' => 'content_allow', + 'lockUnlockThread' => 'content_allow', + 'stickUnstickThread' => 'content_allow' + ] + ]; + + public static function getStructure(Structure $structure): Structure + { + $structure->table = 'xf_club'; + $structure->shortName = 'RomhackPlaza\Master:Club'; + $structure->primaryKey = 'club_id'; + $structure->columns = [ + 'club_id' => ['type' => self::UINT, 'autoIncrement' => true], + 'node_id' => ['type' => self::UINT, 'default' => 0], + 'user_id' => ['type' => self::UINT, 'required' => true], + 'title' => ['type' => self::STR, 'maxLength' => 100, 'required' => true], + 'description' => ['type' => self::STR, 'required' => true], + 'club_state' => ['type' => self::STR, 'default' => 'moderated', + 'allowedValues' => ['visible', 'moderated', 'rejected'] + ], + 'club_creation_date' => ['type' => self::UINT, 'default' => \XF::$time], + 'banner_date' => ['type' => self::UINT, 'default' => 0], + ]; + $structure->relations = [ + 'User' => [ + 'entity' => 'XF:User', + 'type' => self::TO_ONE, + 'conditions' => 'user_id', + 'primary' => true + ], + 'Forum' => [ + 'entity' => 'XF:Forum', + 'type' => self::TO_ONE, + 'conditions' => 'node_id', + 'primary' => true + ] + ]; + + return $structure; + } + + public function getBannerUrl(): ?string + { + if( !$this->banner_date ) + return null; + + return \XF::app()->applyExternalDataUrl("club_banners/{$this->club_id}.jpg?{$this->banner_date}"); + } + + protected function _postSave() + { + if( $this->isInsert() && $this->club_state == 'moderated' ){ + $this->inQueue(); + } else if( $this->isUpdate() && $this->isChanged('club_state') ){ + if( $this->club_state === 'moderated' ){ + $this->inQueue(); + } else { + $this->removeQueue(); + } + } + } + + protected function _postDelete() + { + if( $this->club_state === 'moderated' ){ + $this->removeQueue(); + } + } + + protected function inQueue() + { + $queue = $this->em()->find('XF:ApprovalQueue', ['club', $this->club_id ] ); + if( !$queue ) + { + /** @var ApprovalQueue $newQueue */ + $newQueue = $this->em()->create('XF:ApprovalQueue'); + $newQueue->content_type = 'club'; + $newQueue->content_id = $this->club_id; + $newQueue->save(); + } + } + + protected function removeQueue() + { + $queue = $this->em()->find('XF:ApprovalQueue', ['club', $this->club_id ] ); + if( $queue ) + $queue->delete(); + } +} \ No newline at end of file diff --git a/Entity/ClubRequest.php b/Entity/ClubRequest.php deleted file mode 100644 index c0754b0..0000000 --- a/Entity/ClubRequest.php +++ /dev/null @@ -1,75 +0,0 @@ -table = 'xf_club_request'; - $structure->shortName = 'RomhackPlaza\Master:ClubRequest'; - $structure->primaryKey = 'request_id'; - $structure->columns = [ - 'request_id' => ['type' => self::UINT, 'autoIncrement' => true], - 'user_id' => ['type' => self::UINT, 'required' => true], - 'title' => ['type' => self::STR, 'maxLength' => 100, 'required' => true], - 'description' => ['type' => self::STR, 'required' => true], - 'request_state' => ['type' => self::STR, 'default' => 'moderated', - 'allowedValues' => ['visible', 'moderated', 'rejected'] - ], - 'request_date' => ['type' => self::UINT, 'default' => \XF::$time] - ]; - $structure->relations = [ - 'User' => [ - 'entity' => 'XF:User', - 'type' => self::TO_ONE, - 'conditions' => 'user_id', - 'primary' => true - ] - ]; - - return $structure; - } - - protected function _postSave() - { - if( $this->isInsert() && $this->request_state == 'moderated' ){ - $this->inQueue(); - } else if( $this->isUpdate() && $this->isChanged('request_state') ){ - if( $this->request_state === 'moderated' ){ - $this->inQueue(); - } else { - $this->removeQueue(); - } - } - } - - protected function _postDelete() - { - if( $this->request_state === 'moderated' ){ - $this->removeQueue(); - } - } - - protected function inQueue() - { - $queue = $this->em()->find('XF:ApprovalQueue', ['club_request', $this->request_id ] ); - if( !$queue ) - { - $newQueue = $this->em()->create('XF:ApprovalQueue'); - $newQueue->content_type = 'club_request'; - $newQueue->content_id = $this->request_id; - $newQueue->save(); - } - } - - protected function removeQueue() - { - $queue = $this->em()->find('XF:ApprovalQueue', ['club_request', $this->request_id ] ); - if( $queue ) - $queue->delete(); - } -} \ No newline at end of file diff --git a/Pub/Controller/Club.php b/Pub/Controller/Club.php index 747c2c3..44e6569 100644 --- a/Pub/Controller/Club.php +++ b/Pub/Controller/Club.php @@ -2,12 +2,23 @@ namespace RomhackPlaza\Master\Pub\Controller; +use PhpParser\Node\Param; +use RomhackPlaza\Master\Service\Club\CreatorService; +use RomhackPlaza\Master\Service\Club\DeleterService; +use RomhackPlaza\Master\Service\Club\EditorService; +use RomhackPlaza\Master\Service\Club\ModeratorService; use XF\Mvc\ParameterBag; use XF\Pub\Controller\AbstractController; +use XF\Util\File; class Club extends AbstractController { + public function actionIndex(){ + $clubsForum = \XF::options()->rhpz_club_node_id; + return $this->redirect('categories/.' . $clubsForum ); + } + public function actionSubmit(ParameterBag $params) { $this->assertRegistrationRequired(); @@ -15,18 +26,157 @@ class Club extends AbstractController return $this->view('RomhackPlaza\Master:Club\Request', 'club_request_form'); } + public function actionEdit(ParameterBag $params) + { + $this->assertRegistrationRequired(); + + if( !$params->club_id ) + $this->notFound("Club not found"); + + /** @var \RomhackPlaza\Master\Entity\Club $club */ + $club = $this->assertRecordExists( 'RomhackPlaza\Master:Club', $params->club_id ); + if( $club->user_id !== \XF::visitor()->user_id && !\XF::visitor()->hasAdminPermission('node') ){ + $this->noPermission(); + } + + $mods = []; + $modsCount = 0; + + if( $club->node_id ){ + $mods = $this->finder('XF:ModeratorContent') + ->where('content_type', 'node') + ->where('content_id', $club->node_id) + ->with('User') + ->fetch(); + foreach( $mods as $m ){ + if( $m->user_id !== $club->user_id ){ + $modsCount++; + } + } + } + + return $this->view('RomhackPlaza\Master:Club\Edit', 'club_edit_form', [ 'club' => $club, 'moderators' => $mods, 'subModCount' => $modsCount ] ); + } + public function actionSave(ParameterBag $params) { $this->assertRegistrationRequired(); $this->assertPostOnly(); - $entity = $this->em()->create('RomhackPlaza\Master:ClubRequest'); - $entity->user_id = \XF::visitor()->user_id; - $entity->title = $this->filter('title','str'); - $entity->description = $this->filter('description','str'); - $entity->request_state = 'moderated'; - $entity->save(); + $isEdit = (bool) $params->club_id; + if( $isEdit ){ + $club = $this->assertRecordExists('RomhackPlaza\Master:Club', $params->club_id ); + if( $club->user_id !== \XF::visitor()->user_id && !\XF::visitor()->hasAdminPermission('node') ){ + $this->noPermission(); + } - return $this->redirect($this->buildLink('clubs'), "Your club creation request has been submitted and is awaiting approval by a staff member."); + /** @var EditorService $editor */ + $editor = $this->service('RomhackPlaza\Master:Club\Editor', $club); + $editor->setContent($this->filter('title','str'), $this->filter('description','str')); + $editor->setBannerUpload($this->request->getFile('upload_banner', false, false) ); + + if( !$editor->validate($errors) ){ + return $this->error($errors); + } + + $editor->save(); + + return $this->redirect( $this->buildLink('clubs'), "Changes saved successfully" ); + + } else { + + /** @var CreatorService $creator */ + $creator = $this->service('RomhackPlaza\Master:Club\Creator', \XF::visitor()); + $creator->setContent($this->filter('title','str'), $this->filter('description','str')); + $creator->setBannerUpload($this->request->getFile('upload_banner', false, false)); + + if( !$creator->validate($errors) ){ + return $this->error($errors); + } + $creator->save(); + return $this->redirect( $this->buildLink('clubs'), "Your club creation request has been submitted and is awaiting approval by a staff member." ); + } } + + public function actionDelete(ParameterBag $params) + { + $this->assertRegistrationRequired(); + + /** @var \RomhackPlaza\Master\Entity\Club $club */ + $club = $this->assertRecordExists('RomhackPlaza\Master:Club', $params->club_id); + if( $club->user_id !== \XF::visitor()->user_id && !\XF::visitor()->hasAdminPermission('node') ){ + $this->noPermission(); + } + + if( $this->isPost() ){ + /** @var DeleterService $deleter */ + $deleter = $this->service('RomhackPlaza\Master:Club\Deleter', $club); + $deleter->delete(); + + return $this->redirect( $this->buildLink('clubs'), "Club deleted successfully." ); + } + + return $this->view('RomhackPlaza\Master:Club\Delete', 'club_delete_confirm', [ 'club' => $club ] ); + } + + public function actionAddModerator(ParameterBag $params) + { + $this->assertRegistrationRequired(); + $this->assertPostOnly(); + + /** @var \RomhackPlaza\Master\Entity\Club $club */ + $club = $this->assertRecordExists('RomhackPlaza\Master:Club', $params->club_id); + if( $club->user_id !== \XF::visitor()->user_id && !\XF::visitor()->hasAdminPermission('node') ){ + return $this->noPermission(); + } + + $username = $this->filter('username','str'); + $user = $this->em()->findOne('XF:User', ['username' => $username]); + + if( !$user ){ + return $this->error("This user doesn't exist"); + } + + /** @var ModeratorService $modManage */ + $modManage = \XF::app()->service('RomhackPlaza\Master:Club\Moderator', $club, $user ); + $error = ""; + $modManage->addModerator( $error ); + + if( $error && $error !== "" ){ + return $this->error($error); + } + + return $this->redirect( $this->buildLink('clubs/edit', $club), "Moderator added successfully." ); + } + + public function actionRemoveModerator(ParameterBag $params) + { + $this->assertRegistrationRequired(); + $this->assertPostOnly(); + + /** @var \RomhackPlaza\Master\Entity\Club $club */ + $club = $this->assertRecordExists('RomhackPlaza\Master:Club', $params->club_id); + if( $club->user_id !== \XF::visitor()->user_id && !\XF::visitor()->hasAdminPermission('node') ){ + $this->noPermission(); + } + + $userId = $this->filter('user_id','uint'); + $user = $this->em()->findOne('XF:User', ['user_id' => $userId]); + + if( !$user ){ + $this->error("This user doesn't exist"); + } + + /** @var ModeratorService $modManage */ + $modManage = \XF::app()->service('RomhackPlaza\Master:Club\Moderator', $club, $user ); + $error = ""; + $modManage->deleteModerator( $error ); + + if( $error && $error !== "" ){ + return $this->error($error); + } + + return $this->redirect( $this->buildLink('clubs/edit', $club), "Moderator deleted successfully." ); + } + } \ No newline at end of file diff --git a/Service/Club/ApproverService.php b/Service/Club/ApproverService.php new file mode 100644 index 0000000..c44f5f1 --- /dev/null +++ b/Service/Club/ApproverService.php @@ -0,0 +1,64 @@ +club = $club; + } + + public function approve(): bool + { + if( $this->club->club_state !== 'moderated' ) { + return false; + } + + $this->club->club_state = 'visible'; + $this->club->save(); + + /** @var Node $node */ + $node = $this->em()->create('XF:Node'); + + $node->node_type_id = 'Forum'; + $node->title = $this->club->title; + $node->description = $this->club->description; + $node->parent_node_id = \XF::options()->rhpz_club_node_id ?? 0; + $node->display_order = 1; + $node->save(); + + /** @var Forum $forum */ + $forum = $this->em()->create('XF:Forum'); + $forum->node_id = $node->node_id; + $forum->allow_posting = true; + $forum->save(); + + $this->club->node_id = $node->node_id; + $this->club->save(); + + $user = $this->club->User; + if( $user ){ + /** @var ModeratorService $modManage */ + $modManage = \XF::app()->service('RomhackPlaza\Master:Club\Moderator', $this->club, $user ); + $modManage->addModerator( $error ); + } + + return true; + } +} \ No newline at end of file diff --git a/Service/Club/CreatorService.php b/Service/Club/CreatorService.php new file mode 100644 index 0000000..2c3e772 --- /dev/null +++ b/Service/Club/CreatorService.php @@ -0,0 +1,99 @@ +club = $this->em()->create('RomhackPlaza\Master:Club'); + $this->setUser($creator); + $this->setupDefaults(); + } + + protected function setupDefaults() + { + $this->club->club_state = 'moderated'; + } + + public function getClub() + { + return $this->club; + } + + public function getUser() + { + return $this->user; + } + + public function setUser(User $user) + { + $this->user = $user; + $this->club->user_id = $this->user->user_id; + } + + public function setContent(string $title, string $description ) + { + $this->club->title = $title; + $this->club->description = $description; + } + + public function setBannerUpload(?Upload $upload = null) + { + if ($upload) { + $upload->requireImage(); + if($upload->isValid()){ + $this->bannerUpload = $upload; + } + } + } + + protected function _validate() + { + $this->club->preSave(); + return $this->club->getErrors(); + } + + protected function _save() + { + $this->club->save(); + + if( $this->bannerUpload ){ + $path = 'data://club_banners/' . $this->club->club_id . '.jpg'; + if( File::copyFileToAbstractedPath($this->bannerUpload->getFileWrapper()->getFilePath(), $path) ){ + $this->club->banner_date = \XF::$time; + $this->club->save(); + } + } + + return $this->club; + } +} \ No newline at end of file diff --git a/Service/Club/DeleterService.php b/Service/Club/DeleterService.php new file mode 100644 index 0000000..045c668 --- /dev/null +++ b/Service/Club/DeleterService.php @@ -0,0 +1,40 @@ +club = $club; + } + + public function delete() + { + if( $this->club->Forum && $this->club->Forum->Node ){ + $this->club->Forum->Node->delete(); + } + + $path = 'data://club_banners/' . $this->club->club_id . '.jpg'; + File::deleteFromAbstractedPath($path); + + $this->club->delete(); + } +} \ No newline at end of file diff --git a/Service/Club/EditorService.php b/Service/Club/EditorService.php new file mode 100644 index 0000000..bccc35f --- /dev/null +++ b/Service/Club/EditorService.php @@ -0,0 +1,73 @@ +club = $club; + } + + public function setContent(string $title, string $description) + { + $this->club->title = $title; + $this->club->description = $description; + } + + public function setBannerUpload(?Upload $upload = null) + { + if( $upload ){ + $upload->requireImage(); + if( $upload->isValid() ){ + $path = 'data://club_banners/' . $this->club->club_id . '.jpg'; + if(File::copyFileToAbstractedPath($upload->getFileWrapper()->getFilePath(), $path)){ + $this->club->banner_date = \XF::$time; + } + } + } + } + + protected function syncForumNode() + { + if( $this->club->Forum && $this->club->Forum->Node ) + { + $node = $this->club->Forum->Node; + $node->title = $this->club->title; + $node->description = $this->club->description; + $node->save(); + } + } + + protected function _validate() + { + $this->club->preSave(); + return $this->club->getErrors(); + } + + protected function _save() + { + $this->club->save(); + $this->syncForumNode(); + + return $this->club; + } +} \ No newline at end of file diff --git a/Service/Club/ModeratorService.php b/Service/Club/ModeratorService.php new file mode 100644 index 0000000..e8be63e --- /dev/null +++ b/Service/Club/ModeratorService.php @@ -0,0 +1,106 @@ +club = $club; + $this->user = $moderator; + } + + protected function countMods( int $nodeId, int $excludeUserId = 0 ) + { + return $this->finder('XF:ModeratorContent') + ->where('content_type', 'node') + ->where('content_id', $nodeId) + ->where('user_id', '!=', $excludeUserId) + ->total(); + } + + public function addModerator( string &$error ): bool + { + if( !$this->club->Forum || !$this->club->Forum->Node ) { + $error = "No node linked to this club."; + return false; + } + + if( $this->countMods( $this->club->node_id, $this->club->user_id ) > self::MAX_MODS ) { + $error = "The limit of 5 moderators has been reached."; + return false; + } + + $existingMod = $this->em()->findOne('XF:ModeratorContent', [ + 'content_type' => 'node', + 'content_id' => $this->club->node_id, + 'user_id' => $this->user->user_id + ]); + if( $existingMod ){ + $error = "This user is already a moderator."; + return false; + } + + $modContent = $this->em()->create('XF:ModeratorContent'); + $modContent->content_type = 'node'; + $modContent->content_id = $this->club->node_id; + $modContent->user_id = $this->user->user_id; + $modContent->save(); + + $permissionUpdater = \XF::app()->service('XF:UpdatePermissions'); + $permissionUpdater->setContent('node', $this->club->node_id); + $permissionUpdater->setUser($this->user); + $permissionUpdater->updatePermissions(Club::MOD_PERMISSIONS); + + \XF::app()->jobManager()->enqueueUnique('permissionRebuild', 'XF:PermissionRebuild'); + return true; + } + + public function deleteModerator( string &$error ): bool + { + if( !$this->club->Forum || !$this->club->Forum->Node ) { + $error = "No node linked to this club."; + return false; + } + + if( $this->user->user_id === $this->club->user_id ){ + $error = "You cannot delete yourself."; + return false; + } + + $mod = $this->em()->findOne('XF:ModeratorContent', [ + 'content_type' => 'node', + 'content_id' => $this->club->node_id, + 'user_id' => $this->user->user_id + ]); + + if( $mod ){ + $mod->delete(); + + \XF::db()->delete('xf_permission_entry_content', 'content_type = ? AND content_id = ? AND user_id = ?', ['node', $this->club->node_id, $this->user->user_id]); + + \XF::app()->jobManager()->enqueueUnique('permissionRebuild', 'XF:PermissionRebuild'); + } + + return true; + } +} \ No newline at end of file diff --git a/Setup.php b/Setup.php index 83d1c76..3e075ac 100644 --- a/Setup.php +++ b/Setup.php @@ -25,19 +25,22 @@ class Setup extends AbstractSetup } /** - * Create club request table. + * Create club table. * @return void */ public function installStep2(): void { - $this->schemaManager()->createTable('xf_club_request', function(Create $table){ - $table->addColumn('request_id', 'int')->autoIncrement(); + $this->schemaManager()->createTable('xf_club', function(Create $table){ + $table->addColumn('club_id', 'int')->autoIncrement(); + $table->addColumn( 'node_id', 'int' ); $table->addColumn('user_id', 'int'); $table->addColumn('title', 'varchar', 100); $table->addColumn('description', 'text'); - $table->addColumn('request_state', 'enum')->values(['visible','moderated','rejected'])->setDefault('moderated'); - $table->addColumn('request_date','int'); - $table->addKey('request_state'); + $table->addColumn('club_state', 'enum')->values(['visible','moderated','rejected'])->setDefault('moderated'); + $table->addColumn('club_creation_date','int'); + $table->addColumn('banner_date', 'int')->setDefault(0); + $table->addPrimaryKey('club_id'); + $table->addKey('club_state'); }); } @@ -50,6 +53,6 @@ class Setup extends AbstractSetup public function uninstallStep2(): void { - $this->schemaManager()->dropTable('xf_club_request'); + $this->schemaManager()->dropTable('xf_club'); } } \ No newline at end of file diff --git a/XF/Entity/Forum.php b/XF/Entity/Forum.php new file mode 100644 index 0000000..7654a5d --- /dev/null +++ b/XF/Entity/Forum.php @@ -0,0 +1,22 @@ +relations['Club'] = [ + 'entity' => 'RomhackPlaza\Master:Club', + 'type' => self::TO_ONE, + 'conditions' => 'node_id', + 'primary' => false + ]; + + return $structure; + } +} \ No newline at end of file diff --git a/_output/class_extensions/XF-Entity-Forum_RomhackPlaza-Master-XF-Entity-Forum.json b/_output/class_extensions/XF-Entity-Forum_RomhackPlaza-Master-XF-Entity-Forum.json new file mode 100644 index 0000000..def4609 --- /dev/null +++ b/_output/class_extensions/XF-Entity-Forum_RomhackPlaza-Master-XF-Entity-Forum.json @@ -0,0 +1,6 @@ +{ + "from_class": "XF\\Entity\\Forum", + "to_class": "RomhackPlaza\\Master\\XF\\Entity\\Forum", + "execute_order": 10, + "active": true +} \ No newline at end of file diff --git a/_output/class_extensions/_metadata.json b/_output/class_extensions/_metadata.json index 96c4b77..12689a8 100644 --- a/_output/class_extensions/_metadata.json +++ b/_output/class_extensions/_metadata.json @@ -1,4 +1,7 @@ { + "XF-Entity-Forum_RomhackPlaza-Master-XF-Entity-Forum.json": { + "hash": "c7747b6ea6bd924d2d02e82917ff0df3" + }, "XF-Entity-User_RomhackPlaza-Master-XF-Entity-User.json": { "hash": "811593d6f012a53b9fa2ced871de96a9" } diff --git a/_output/content_type_fields/_metadata.json b/_output/content_type_fields/_metadata.json index 102b3e5..8381f54 100644 --- a/_output/content_type_fields/_metadata.json +++ b/_output/content_type_fields/_metadata.json @@ -1,9 +1,9 @@ { - "club_request-approval_queue_handler_class.json": { - "hash": "e46546c5b569b04e7ad740a672d217cd" + "club-approval_queue_handler_class.json": { + "hash": "468464999ab50b9de400a6eae27625ac" }, - "club_request-entity.json": { - "hash": "547d2af8708a4c569b3b09fdd9308880" + "club-entity.json": { + "hash": "ed572323131987e295051165e4ec3c5e" }, "romhackplaza_entry-entity.json": { "hash": "8686ffd261eb8c1698a3ec6e31118f02" diff --git a/_output/content_type_fields/club-approval_queue_handler_class.json b/_output/content_type_fields/club-approval_queue_handler_class.json new file mode 100644 index 0000000..fc196f3 --- /dev/null +++ b/_output/content_type_fields/club-approval_queue_handler_class.json @@ -0,0 +1,5 @@ +{ + "content_type": "club", + "field_name": "approval_queue_handler_class", + "field_value": "RomhackPlaza\\Master\\ApprovalQueue\\Club" +} \ No newline at end of file diff --git a/_output/content_type_fields/club-entity.json b/_output/content_type_fields/club-entity.json new file mode 100644 index 0000000..0fb334d --- /dev/null +++ b/_output/content_type_fields/club-entity.json @@ -0,0 +1,5 @@ +{ + "content_type": "club", + "field_name": "entity", + "field_value": "RomhackPlaza\\Master\\Entity\\Club" +} \ No newline at end of file diff --git a/_output/content_type_fields/club_request-approval_queue_handler_class.json b/_output/content_type_fields/club_request-approval_queue_handler_class.json deleted file mode 100644 index 3aaaaf2..0000000 --- a/_output/content_type_fields/club_request-approval_queue_handler_class.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "content_type": "club_request", - "field_name": "approval_queue_handler_class", - "field_value": "RomhackPlaza\\Master\\ApprovalQueue\\ClubRequest" -} \ No newline at end of file diff --git a/_output/content_type_fields/club_request-entity.json b/_output/content_type_fields/club_request-entity.json deleted file mode 100644 index 17f5bcf..0000000 --- a/_output/content_type_fields/club_request-entity.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "content_type": "club_request", - "field_name": "entity", - "field_value": "RomhackPlaza\\Master\\Entity\\ClubRequest" -} \ No newline at end of file diff --git a/_output/extension_hint.php b/_output/extension_hint.php index ae897a0..f542957 100644 --- a/_output/extension_hint.php +++ b/_output/extension_hint.php @@ -10,5 +10,6 @@ namespace RomhackPlaza\Master\XF\Entity { + class XFCP_Forum extends \XF\Entity\Forum {} class XFCP_User extends \XF\Entity\User {} } diff --git a/_output/navigation/_metadata.json b/_output/navigation/_metadata.json index b8b2f6d..087d264 100644 --- a/_output/navigation/_metadata.json +++ b/_output/navigation/_metadata.json @@ -1,53 +1,59 @@ { "about.json": { - "hash": "96e3aa134dd14f5d43ca9ca1d5c55113" + "hash": "362cdca71eb4d21d7b9290ffc8f0df57" + }, + "clubs.json": { + "hash": "e7ddced6269072f7db774f09424d671c" }, "community.json": { - "hash": "bddec05ee1acb9cb82ed72155bdd7817" + "hash": "b3b5bb7146a8eb66e2830c48c4714456" }, "contact_us.json": { - "hash": "05d205aee6ac1db9d9ad0f68bdd4f7c2" + "hash": "59453e1b06c296c777987d0fae0eb3a5" }, "database.json": { - "hash": "7b42b608fad8ab23417a8cc3fcd331c2" + "hash": "604cabbdf4fb4fd941dc6123eb119165" }, "discord.json": { - "hash": "d20860e95b3f4a96622733ef9ef4cfa0" + "hash": "37b3a139a26e30bd558de47b9e364d41" + }, + "drafts.json": { + "hash": "bea14e944290aeb07659374fa487d61c" }, "forum.json": { - "hash": "4a2e65ba6b553ed68dd5b6f7fd6d71d8" + "hash": "ca20fad278aeab93ccbc3c3a20a743d2" }, "home.json": { - "hash": "6bf83f1a17528a3c075addfbc8fca830" + "hash": "4f55ee2e4a49e82c18e9beab428ab0ee" }, "learn_romhacking.json": { - "hash": "dc98809d9e310f450123400bf106d2e5" + "hash": "3da66fadac2c1aa805e639d727e36223" }, "legal_pages.json": { - "hash": "d379ad33a85a4387888d90fd75380b8a" + "hash": "34ae35915e620f1f0b5d88dcd25a5b59" }, "members.json": { - "hash": "d625548b0c17df789d595691931732a3" + "hash": "cad1568d161bea1a7dd1f286b8788e2d" }, "pages.json": { - "hash": "fe3fa7929ab20e981dd2f03d6d81f5d2" + "hash": "8d75bf99b2fb6528f84433f4519d4da3" }, "rom_checker.json": { - "hash": "d23131981318ff9afa142b6512225cc3" + "hash": "c9349db6120520e82d02b793a30e67ce" }, "rom_hasher.json": { - "hash": "5f7ab5a76ff0060ac7854ca2c53ea245" + "hash": "e14613a1bd0f1e1fadc084a009801570" }, "rom_patcher.json": { - "hash": "73fab3932646c350da9a40102f650d9d" + "hash": "2a2af404aa6395b02c711867a7287a6f" }, "submissions_queue.json": { - "hash": "84060a775af4419d44c8dc2c083ef447" + "hash": "071c745afd8f28cf9505702496f72a18" }, "tools.json": { - "hash": "0221bb27d36511c5dd1feaf697626778" + "hash": "3d56ca10d6cf3ff772e9ce92d200f2f8" }, "website.json": { - "hash": "e2f7d3d0102894eb09ecb359712d0fed" + "hash": "9ca169f049cffa2cf82f395617e2b897" } } \ No newline at end of file diff --git a/_output/navigation/about.json b/_output/navigation/about.json index 80027db..836d989 100644 --- a/_output/navigation/about.json +++ b/_output/navigation/about.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "pages", - "display_order": 2, + "display_order": 200, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}/pages/about", diff --git a/_output/navigation/clubs.json b/_output/navigation/clubs.json new file mode 100644 index 0000000..379bda0 --- /dev/null +++ b/_output/navigation/clubs.json @@ -0,0 +1,13 @@ +{ + "parent_navigation_id": "community", + "display_order": 200, + "navigation_type_id": "basic", + "type_config": { + "link": "{{ link('clubs') }}", + "display_condition": "", + "extra_attributes": { + "icon": "balloon" + } + }, + "enabled": true +} \ No newline at end of file diff --git a/_output/navigation/community.json b/_output/navigation/community.json index 4f4a42b..b968752 100644 --- a/_output/navigation/community.json +++ b/_output/navigation/community.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "", - "display_order": 50, + "display_order": 300, "navigation_type_id": "basic", "type_config": { "link": "", diff --git a/_output/navigation/contact_us.json b/_output/navigation/contact_us.json index 1fcb8d4..035b412 100644 --- a/_output/navigation/contact_us.json +++ b/_output/navigation/contact_us.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "pages", - "display_order": 3, + "display_order": 300, "navigation_type_id": "basic", "type_config": { "link": "{{ link('misc/contact') }}", diff --git a/_output/navigation/database.json b/_output/navigation/database.json index e9bff33..5b1c83a 100644 --- a/_output/navigation/database.json +++ b/_output/navigation/database.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "website", - "display_order": 2, + "display_order": 200, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}/database", diff --git a/_output/navigation/discord.json b/_output/navigation/discord.json index b04c7a6..4a141f0 100644 --- a/_output/navigation/discord.json +++ b/_output/navigation/discord.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "community", - "display_order": 2, + "display_order": 300, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}/discord", diff --git a/_output/navigation/drafts.json b/_output/navigation/drafts.json new file mode 100644 index 0000000..b039b4c --- /dev/null +++ b/_output/navigation/drafts.json @@ -0,0 +1,13 @@ +{ + "parent_navigation_id": "website", + "display_order": 400, + "navigation_type_id": "basic", + "type_config": { + "link": "{$xf.options.homePageUrl}/my-drafts", + "display_condition": "{$xf.visitor.user_id}", + "extra_attributes": { + "icon": "scissors" + } + }, + "enabled": true +} \ No newline at end of file diff --git a/_output/navigation/forum.json b/_output/navigation/forum.json index 8ae83fb..0552b5f 100644 --- a/_output/navigation/forum.json +++ b/_output/navigation/forum.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "community", - "display_order": 1, + "display_order": 100, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.boardUrl}", diff --git a/_output/navigation/home.json b/_output/navigation/home.json index da3bf4d..3527312 100644 --- a/_output/navigation/home.json +++ b/_output/navigation/home.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "website", - "display_order": 1, + "display_order": 100, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}", diff --git a/_output/navigation/learn_romhacking.json b/_output/navigation/learn_romhacking.json index b940efe..b91b196 100644 --- a/_output/navigation/learn_romhacking.json +++ b/_output/navigation/learn_romhacking.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "pages", - "display_order": 1, + "display_order": 100, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}/pages/learn", diff --git a/_output/navigation/legal_pages.json b/_output/navigation/legal_pages.json index 10b8bbf..9ce4d49 100644 --- a/_output/navigation/legal_pages.json +++ b/_output/navigation/legal_pages.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "pages", - "display_order": 4, + "display_order": 400, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}/pages/legal-pages", diff --git a/_output/navigation/members.json b/_output/navigation/members.json index 7963fb6..7bc2626 100644 --- a/_output/navigation/members.json +++ b/_output/navigation/members.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "community", - "display_order": 3, + "display_order": 400, "navigation_type_id": "basic", "type_config": { "link": "{{ link('members') }}", diff --git a/_output/navigation/pages.json b/_output/navigation/pages.json index bb72a97..cdd5606 100644 --- a/_output/navigation/pages.json +++ b/_output/navigation/pages.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "", - "display_order": 150, + "display_order": 500, "navigation_type_id": "basic", "type_config": { "link": "", diff --git a/_output/navigation/rom_checker.json b/_output/navigation/rom_checker.json index d186479..da65b88 100644 --- a/_output/navigation/rom_checker.json +++ b/_output/navigation/rom_checker.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "tools", - "display_order": 3, + "display_order": 300, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}/tools/rom-checker", diff --git a/_output/navigation/rom_hasher.json b/_output/navigation/rom_hasher.json index 7f1a7c9..cb7554f 100644 --- a/_output/navigation/rom_hasher.json +++ b/_output/navigation/rom_hasher.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "tools", - "display_order": 2, + "display_order": 200, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}/tools/rom-hasher", diff --git a/_output/navigation/rom_patcher.json b/_output/navigation/rom_patcher.json index e35e6e1..680ba5d 100644 --- a/_output/navigation/rom_patcher.json +++ b/_output/navigation/rom_patcher.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "tools", - "display_order": 1, + "display_order": 100, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}/tools/rom-patcher", diff --git a/_output/navigation/submissions_queue.json b/_output/navigation/submissions_queue.json index 9439978..f5f7fb4 100644 --- a/_output/navigation/submissions_queue.json +++ b/_output/navigation/submissions_queue.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "website", - "display_order": 3, + "display_order": 300, "navigation_type_id": "basic", "type_config": { "link": "{$xf.options.homePageUrl}/queue", diff --git a/_output/navigation/tools.json b/_output/navigation/tools.json index 123cd59..388d844 100644 --- a/_output/navigation/tools.json +++ b/_output/navigation/tools.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "", - "display_order": 100, + "display_order": 400, "navigation_type_id": "basic", "type_config": { "link": "", diff --git a/_output/navigation/website.json b/_output/navigation/website.json index 00ea74b..fcf7af0 100644 --- a/_output/navigation/website.json +++ b/_output/navigation/website.json @@ -1,6 +1,6 @@ { "parent_navigation_id": "", - "display_order": 1, + "display_order": 200, "navigation_type_id": "basic", "type_config": { "link": "", diff --git a/_output/phrases/_metadata.json b/_output/phrases/_metadata.json index 7135574..74be088 100644 --- a/_output/phrases/_metadata.json +++ b/_output/phrases/_metadata.json @@ -5,6 +5,12 @@ "version_string": "1.0.0", "hash": "8f7f4c1ce7a4f933663d10543562b096" }, + "nav.clubs.txt": { + "global_cache": false, + "version_id": 1000000, + "version_string": "1.0.0", + "hash": "bc56e1ae1e30e7123ffc5030f108f2a0" + }, "nav.community.txt": { "global_cache": false, "version_id": 1000000, @@ -29,6 +35,12 @@ "version_string": "1.0.0", "hash": "8f5cc6430613f1c12f36965050bb7197" }, + "nav.drafts.txt": { + "global_cache": false, + "version_id": 1000000, + "version_string": "1.0.0", + "hash": "bc67af65fab4a8b1848ccedf29c3b733" + }, "nav.forum.txt": { "global_cache": false, "version_id": 1000000, diff --git a/_output/phrases/nav.clubs.txt b/_output/phrases/nav.clubs.txt new file mode 100644 index 0000000..18aaf16 --- /dev/null +++ b/_output/phrases/nav.clubs.txt @@ -0,0 +1 @@ +Clubs \ No newline at end of file diff --git a/_output/phrases/nav.drafts.txt b/_output/phrases/nav.drafts.txt new file mode 100644 index 0000000..c27ba2c --- /dev/null +++ b/_output/phrases/nav.drafts.txt @@ -0,0 +1 @@ +My drafts \ No newline at end of file diff --git a/_output/routes/_metadata.json b/_output/routes/_metadata.json index c3ee973..0c6bcac 100644 --- a/_output/routes/_metadata.json +++ b/_output/routes/_metadata.json @@ -2,8 +2,11 @@ "api_romhackplaza_entry_.json": { "hash": "5f1609f559980b44af09fd85c3b34a30" }, + "api_threads_undelete.json": { + "hash": "3376251e185807693e0fb7dc6dcc9ee0" + }, "public_clubs_.json": { - "hash": "a10d34d7ce33cb577dc85906353d1bb2" + "hash": "4fbb4a364e108ff5b30dfd57692205aa" }, "public_romhackplaza_entry_.json": { "hash": "2c40d7266fcc22a5727830a69af2360c" diff --git a/_output/routes/api_threads_undelete.json b/_output/routes/api_threads_undelete.json new file mode 100644 index 0000000..207ccb2 --- /dev/null +++ b/_output/routes/api_threads_undelete.json @@ -0,0 +1,11 @@ +{ + "route_type": "api", + "route_prefix": "threads", + "sub_name": "undelete", + "format": ":int/undelete", + "build_class": "", + "build_method": "", + "controller": "RomhackPlaza\\Master:Thread", + "context": "", + "action_prefix": "" +} \ No newline at end of file diff --git a/_output/routes/public_clubs_.json b/_output/routes/public_clubs_.json index 1cd0ec9..7efbdae 100644 --- a/_output/routes/public_clubs_.json +++ b/_output/routes/public_clubs_.json @@ -2,7 +2,7 @@ "route_type": "public", "route_prefix": "clubs", "sub_name": "", - "format": "", + "format": ":int/", "build_class": "", "build_method": "", "controller": "RomhackPlaza\\Master:Club", diff --git a/_output/template_modifications/_metadata.json b/_output/template_modifications/_metadata.json new file mode 100644 index 0000000..1a3032e --- /dev/null +++ b/_output/template_modifications/_metadata.json @@ -0,0 +1,11 @@ +{ + "public/rhpz_above_thread_list_clubs.json": { + "hash": "c261ea6e33cf5eb7ab0a7f6fe934de7c" + }, + "public/rhpz_above_thread_list_clubs_buttons.json": { + "hash": "c783001e00f7a63389c9ae988012f5fe" + }, + "public/rhpz_category_view_clubs_submit_button.json": { + "hash": "a24a5a4b130b6198de7ef37610aa1a7d" + } +} \ No newline at end of file diff --git a/_output/template_modifications/public/rhpz_above_thread_list_clubs.json b/_output/template_modifications/public/rhpz_above_thread_list_clubs.json new file mode 100644 index 0000000..05e3bd4 --- /dev/null +++ b/_output/template_modifications/public/rhpz_above_thread_list_clubs.json @@ -0,0 +1,9 @@ +{ + "template": "forum_view", + "description": "Add the club banner above the threads list.", + "execution_order": 10, + "enabled": true, + "action": "str_replace", + "find": "", + "replace": "$0\n\n
\n \n \"Banner\n \n
\n
" +} \ No newline at end of file diff --git a/_output/template_modifications/public/rhpz_above_thread_list_clubs_buttons.json b/_output/template_modifications/public/rhpz_above_thread_list_clubs_buttons.json new file mode 100644 index 0000000..b5d3caf --- /dev/null +++ b/_output/template_modifications/public/rhpz_above_thread_list_clubs_buttons.json @@ -0,0 +1,9 @@ +{ + "template": "forum_view", + "description": "Add Owner edit/delete buttons.", + "execution_order": 5, + "enabled": true, + "action": "str_replace", + "find": "", + "replace": "$0\n\n
\n
\n Edit\n Delete\n
\n
\n
" +} \ No newline at end of file diff --git a/_output/template_modifications/public/rhpz_category_view_clubs_submit_button.json b/_output/template_modifications/public/rhpz_category_view_clubs_submit_button.json new file mode 100644 index 0000000..2cf57ba --- /dev/null +++ b/_output/template_modifications/public/rhpz_category_view_clubs_submit_button.json @@ -0,0 +1,9 @@ +{ + "template": "category_view", + "description": "Add Club Submit button", + "execution_order": 10, + "enabled": true, + "action": "str_replace", + "find": "\t\t\t\t\t\t\t", + "replace": "\n\t\n\t\tRequest a club\n\t\n\n$0" +} \ No newline at end of file diff --git a/_output/templates/_metadata.json b/_output/templates/_metadata.json index d25982e..68e17fb 100644 --- a/_output/templates/_metadata.json +++ b/_output/templates/_metadata.json @@ -7,12 +7,22 @@ "public/approval_item_club_request.html": { "version_id": 1000000, "version_string": "1.0.0", - "hash": "39492e4fb48e7aa1622a6bb4371a36f4" + "hash": "da1f9c78c4e33597062258c0bba3cb4d" + }, + "public/club_delete_confirm.html": { + "version_id": 1000000, + "version_string": "1.0.0", + "hash": "c84c3878a0aee370e2080427405fe920" + }, + "public/club_edit_form.html": { + "version_id": 1000000, + "version_string": "1.0.0", + "hash": "d83cbfd477fc14de26b72aed00c866c3" }, "public/club_request_form.html": { "version_id": 1000000, "version_string": "1.0.0", - "hash": "5e1c397d93134aaa7164301d5a3553ce" + "hash": "443b696b5c7ae6bc4b1ef36d170ac7e7" }, "public/report_content_romhackplaza_entry.html": { "version_id": 1000000, diff --git a/_output/templates/public/approval_item_club_request.html b/_output/templates/public/approval_item_club_request.html index ba30adb..b2a55e9 100644 --- a/_output/templates/public/approval_item_club_request.html +++ b/_output/templates/public/approval_item_club_request.html @@ -2,7 +2,7 @@ arg-content="{$content}" arg-user="{$content.User}" arg-messageHtml="{$content.description}" - arg-contentDate="{$content.request_date}" + arg-contentDate="{$content.club_creation_date}" arg-typePhraseHtml="Club Request" arg-headerPhrase="{$content.title}" arg-spamDetails="{$spamDetails}" diff --git a/_output/templates/public/club_delete_confirm.html b/_output/templates/public/club_delete_confirm.html new file mode 100644 index 0000000..ebe8edc --- /dev/null +++ b/_output/templates/public/club_delete_confirm.html @@ -0,0 +1,13 @@ +Delete club : {$club.title} + + +
+
+ + Are you sure you want to delete this club ? {$club.title} ?
+ Deleting this will also delete all threads and posts. +
+
+ +
+
\ No newline at end of file diff --git a/_output/templates/public/club_edit_form.html b/_output/templates/public/club_edit_form.html new file mode 100644 index 0000000..29f6538 --- /dev/null +++ b/_output/templates/public/club_edit_form.html @@ -0,0 +1,72 @@ +
+ +
+ + + + + + + + + + +
+ +
+
+ + + +
+
+

Club Moderators ({$subModCount}/5)

+
+ +
+ +
+
+ {$mod.User.username} + + Owner + +
+
+ + + + Remove + + + - + +
+
+
+
+ +
No moderators for this club.
+
+
+
+
+ +
+ + +

Add a moderator

+
+ +
+ +
+ +
+
+ Limit reached: You have reached the maximum number of 5 moderators for your club. You must remove one before you can add a new one. +
+
+
+
+
\ No newline at end of file diff --git a/_output/templates/public/club_request_form.html b/_output/templates/public/club_request_form.html index 8ecd903..e175484 100644 --- a/_output/templates/public/club_request_form.html +++ b/_output/templates/public/club_request_form.html @@ -5,6 +5,7 @@
+