'defaultSmilies' => SmileyCache::getInstance()->getCategorySmilies(),
'message' => $this->message,
'permissionCanUseSmilies' => 'user.message.canUseSmilies',
- 'wysiwygSelector' => 'messageEditor'.$this->message->messageID
+ 'wysiwygSelector' => 'messageEditor'.$this->message->messageID,
]);
- if (MODULE_ATTACHMENT) {
- $tmpHash = StringUtil::getRandomID();
- $attachmentHandler = new AttachmentHandler('com.woltlab.wcf.conversation.message', $this->message->messageID, $tmpHash);
- $attachmentList = $attachmentHandler->getAttachmentList();
-
- WCF::getTPL()->assign([
- 'attachmentHandler' => $attachmentHandler,
- 'attachmentList' => $attachmentList->getObjects(),
- 'attachmentObjectID' => $this->message->messageID,
- 'attachmentObjectType' => 'com.woltlab.wcf.conversation.message',
- 'attachmentParentObjectID' => 0,
- 'tmpHash' => $tmpHash
- ]);
- }
+ $tmpHash = StringUtil::getRandomID();
+ $attachmentHandler = new AttachmentHandler('com.woltlab.wcf.conversation.message', $this->message->messageID, $tmpHash);
+ $attachmentList = $attachmentHandler->getAttachmentList();
+
+ WCF::getTPL()->assign([
+ 'attachmentHandler' => $attachmentHandler,
+ 'attachmentList' => $attachmentList->getObjects(),
+ 'attachmentObjectID' => $this->message->messageID,
+ 'attachmentObjectType' => 'com.woltlab.wcf.conversation.message',
+ 'attachmentParentObjectID' => 0,
+ 'tmpHash' => $tmpHash,
+ ]);
return [
'actionName' => 'beginEdit',
- 'template' => WCF::getTPL()->fetch('conversationMessageInlineEditor')
+ 'template' => WCF::getTPL()->fetch('conversationMessageInlineEditor'),
];
}
$this->message = new ConversationMessage($this->message->messageID);
$this->message->getAttachments();
- $attachmentList = null;
- if (MODULE_ATTACHMENT) {
- $attachmentList = $this->message->getAttachments(true);
- $count = 0;
- if ($attachmentList !== null) {
- // set permissions
- $attachmentList->setPermissions([
- 'canDownload' => true,
- 'canViewPreview' => true
- ]);
-
- $count = count($attachmentList);
- }
+ $attachmentList = $this->message->getAttachments(true);
+ $count = 0;
+ if ($attachmentList !== null) {
+ // set permissions
+ $attachmentList->setPermissions([
+ 'canDownload' => true,
+ 'canViewPreview' => true,
+ ]);
- // update count to reflect number of attachments after edit
- if ($count != $this->message->attachments) {
- $messageEditor = new ConversationMessageEditor($this->message);
- $messageEditor->update(['attachments' => $count]);
- }
+ $count = count($attachmentList);
+ }
+
+ // update count to reflect number of attachments after edit
+ if ($count != $this->message->attachments) {
+ $messageEditor = new ConversationMessageEditor($this->message);
+ $messageEditor->update(['attachments' => $count]);
}
// load embedded objects
'message' => $this->message->getFormattedMessage()
];
- if (MODULE_ATTACHMENT) {
- WCF::getTPL()->assign([
- 'attachmentList' => $attachmentList,
- 'objectID' => $this->message->messageID
- ]);
- $data['attachmentList'] = WCF::getTPL()->fetch('attachments');
- }
+ WCF::getTPL()->assign([
+ 'attachmentList' => $attachmentList,
+ 'objectID' => $this->message->messageID
+ ]);
+ $data['attachmentList'] = WCF::getTPL()->fetch('attachments');
return $data;
}
<categoryname>user.conversation</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>1</defaultvalue>
- <options>module_attachment</options>
<usersonly>1</usersonly>
</option>
<option name="user.conversation.maxAttachmentSize">
<categoryname>user.conversation</categoryname>
<optiontype>fileSize</optiontype>
<defaultvalue>1000000</defaultvalue>
- <options>module_attachment</options>
<minvalue>10000</minvalue>
<usersonly>1</usersonly>
</option>
zip
txt
pdf</defaultvalue>
- <options>module_attachment</options>
<usersonly>1</usersonly>
<wildcard>*</wildcard>
</option>
<categoryname>user.conversation</categoryname>
<optiontype>integer</optiontype>
<defaultvalue>5</defaultvalue>
- <options>module_attachment</options>
<minvalue>1</minvalue>
<maxvalue>100</maxvalue>
<usersonly>1</usersonly>