1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-21 21:30:08 +00:00

Add possibility to define maxUsers in RoomAddForm

This commit is contained in:
Maximilian Mader 2015-01-10 00:43:51 +01:00
parent 16643a4ed3
commit 8c68694c00

View File

@ -38,6 +38,13 @@ class RoomAddForm extends \wcf\form\AbstractForm {
*/
public $topic = '';
/**
* Maximum number of users
*
* @var integer
*/
public $maxUsers = 0;
/**
* @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('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
$this->objectAction = new \chat\data\room\RoomAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
'title' => $this->title,
'topic' => $this->topic
'topic' => $this->topic,
'maxUsers' => $this->maxUsers
))));
$this->objectAction->executeAction();
$returnValues = $this->objectAction->getReturnValues();
@ -116,7 +125,7 @@ public function save() {
}
\wcf\system\acl\ACLHandler::getInstance()->save($roomID, $this->objectTypeID);
\wcf\system\acl\ACLHandler::getInstance()->disableAssignVariables();
\wcf\system\acl\ACLHandler::getInstance()->disableAssignVariables();
\chat\system\permission\PermissionHandler::clearCache();
$this->saved();
@ -144,6 +153,7 @@ public function assignVariables() {
'action' => 'add',
'title' => $this->title,
'topic' => $this->topic,
'maxUsers' => $this->maxUsers,
'objectTypeID' => $this->objectTypeID
));
}