From d7f91715e4ba276106fa75d80d44e6f852ca6d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 4 Jun 2012 21:10:03 +0200 Subject: [PATCH] More docs. --- file/lib/data/chat/room/ChatRoom.class.php | 7 +++- .../data/chat/room/ChatRoomEditor.class.php | 2 +- file/lib/form/ChatForm.class.php | 38 +++++++++++++++++++ file/lib/page/ChatPage.class.php | 1 + 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/file/lib/data/chat/room/ChatRoom.class.php b/file/lib/data/chat/room/ChatRoom.class.php index 4b67297..9882226 100644 --- a/file/lib/data/chat/room/ChatRoom.class.php +++ b/file/lib/data/chat/room/ChatRoom.class.php @@ -38,7 +38,6 @@ public function __toString() { return $this->getTitle(); } - /** * Returns whether the user is allowed to enter the room. * @@ -49,11 +48,14 @@ public function canEnter() { $suspensions = ChatSuspension::getSuspensionsForUser(); $canEnter = $ph->getPermission($this, 'user.canEnter'); + // room suspension if ($canEnter && isset($suspensions[$this->roomID][ChatSuspension::TYPE_BAN])) { if ($suspensions[$this->roomID][ChatSuspension::TYPE_BAN]['time'] > TIME_NOW) { $canEnter = false; } } + + // global suspension if ($canEnter && isset($suspensions[null][ChatSuspension::TYPE_BAN])) { if ($suspensions[null][ChatSuspension::TYPE_BAN]['time'] > TIME_NOW) { $canEnter = false; @@ -73,11 +75,14 @@ public function canWrite() { $suspensions = ChatSuspension::getSuspensionsForUser(); $canWrite = $ph->getPermission($this, 'user.canWrite'); + // room suspension if ($canWrite && isset($suspensions[$this->roomID][ChatSuspension::TYPE_MUTE])) { if ($suspensions[$this->roomID][ChatSuspension::TYPE_MUTE]['time'] > TIME_NOW) { $canWrite = false; } } + + // global suspension if ($canWrite && isset($suspensions[null][ChatSuspension::TYPE_MUTE])) { if ($suspensions[null][ChatSuspension::TYPE_MUTE]['time'] > TIME_NOW) { $canWrite = false; diff --git a/file/lib/data/chat/room/ChatRoomEditor.class.php b/file/lib/data/chat/room/ChatRoomEditor.class.php index b75affd..6c856b4 100644 --- a/file/lib/data/chat/room/ChatRoomEditor.class.php +++ b/file/lib/data/chat/room/ChatRoomEditor.class.php @@ -17,7 +17,7 @@ class ChatRoomEditor extends \wcf\data\DatabaseObjectEditor implements \wcf\data */ protected static $baseClass = '\wcf\data\chat\room\ChatRoom'; - + /** * @see \wcf\data\DatabaseObjectEditor::deleteAll() */ diff --git a/file/lib/form/ChatForm.class.php b/file/lib/form/ChatForm.class.php index 3165528..e41c430 100644 --- a/file/lib/form/ChatForm.class.php +++ b/file/lib/form/ChatForm.class.php @@ -15,11 +15,49 @@ * @subpackage form */ class ChatForm extends AbstractForm { + /** + * Should HTML be enabled for this message. + * + * @var integer + */ public $enableHTML = 0; + + /** + * Should smilies be enabled for this message. + * + * @var integer + */ public $enableSmilies = 1; + + /** + * @see \wcf\page\AbstractPage::$neededModules + */ + public $neededModules = array('CHAT_ACTIVE'); + + /** + * @see \wcf\page\AbstractPage::$neededPermissions + */ public $neededPermissions = array('user.chat.canEnter'); + + /** + * The given message-string. + * + * @var string + */ public $message = ''; + + /** + * The current room. + * + * @var \wcf\data\chat\room\ChatRoom + */ public $room = null; + + /** + * Values read from the UserStorage of the current user. + * + * @var array + */ public $userData = array(); /** diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index cc80e2c..c3da844 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -20,6 +20,7 @@ class ChatPage extends AbstractPage { * @var string */ public $chatVersion = ''; + /** * @see \wcf\page\AbstractPage::$neededModules */