mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Add possibility to define maxUsers in RoomAddForm
This commit is contained in:
parent
16643a4ed3
commit
8c68694c00
@ -38,6 +38,13 @@ class RoomAddForm extends \wcf\form\AbstractForm {
|
|||||||
*/
|
*/
|
||||||
public $topic = '';
|
public $topic = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum number of users
|
||||||
|
*
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
public $maxUsers = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see \wcf\page\AbstractPage::__construct()
|
* @see \wcf\page\AbstractPage::__construct()
|
||||||
*/
|
*/
|
||||||
@ -67,6 +74,7 @@ public function readFormParameters() {
|
|||||||
|
|
||||||
if (I18nHandler::getInstance()->isPlainValue('title')) $this->title = I18nHandler::getInstance()->getValue('title');
|
if (I18nHandler::getInstance()->isPlainValue('title')) $this->title = I18nHandler::getInstance()->getValue('title');
|
||||||
if (I18nHandler::getInstance()->isPlainValue('topic')) $this->topic = I18nHandler::getInstance()->getValue('topic');
|
if (I18nHandler::getInstance()->isPlainValue('topic')) $this->topic = I18nHandler::getInstance()->getValue('topic');
|
||||||
|
if (isset($_POST['maxUsers']) $this->maxUsers = intval($_POST['maxUsers']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,7 +98,8 @@ public function save() {
|
|||||||
// save room
|
// save room
|
||||||
$this->objectAction = new \chat\data\room\RoomAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
|
$this->objectAction = new \chat\data\room\RoomAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
|
||||||
'title' => $this->title,
|
'title' => $this->title,
|
||||||
'topic' => $this->topic
|
'topic' => $this->topic,
|
||||||
|
'maxUsers' => $this->maxUsers
|
||||||
))));
|
))));
|
||||||
$this->objectAction->executeAction();
|
$this->objectAction->executeAction();
|
||||||
$returnValues = $this->objectAction->getReturnValues();
|
$returnValues = $this->objectAction->getReturnValues();
|
||||||
@ -144,6 +153,7 @@ public function assignVariables() {
|
|||||||
'action' => 'add',
|
'action' => 'add',
|
||||||
'title' => $this->title,
|
'title' => $this->title,
|
||||||
'topic' => $this->topic,
|
'topic' => $this->topic,
|
||||||
|
'maxUsers' => $this->maxUsers,
|
||||||
'objectTypeID' => $this->objectTypeID
|
'objectTypeID' => $this->objectTypeID
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user