32 lines
976 B
PHP
32 lines
976 B
PHP
<?php
|
|
|
|
namespace RomhackPlaza\Master\Pub\Controller;
|
|
|
|
use XF\Mvc\ParameterBag;
|
|
use XF\Pub\Controller\AbstractController;
|
|
|
|
class Club extends AbstractController
|
|
{
|
|
|
|
public function actionSubmit(ParameterBag $params)
|
|
{
|
|
$this->assertRegistrationRequired();
|
|
|
|
return $this->view('RomhackPlaza\Master:Club\Request', 'club_request_form');
|
|
}
|
|
|
|
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();
|
|
|
|
return $this->redirect($this->buildLink('clubs'), "Your club creation request has been submitted and is awaiting approval by a staff member.");
|
|
}
|
|
} |