Abstract handler for content type-specific attachment behaviors.
| package | XenForo_Attachment |
|---|
__construct()
canUploadAndManageAttachments(array $contentData, array $viewingUser) : boolean
The content data may contain different type-specific values in different situations. Eg, when posting a thread, only the node_id is known; when posting a reply, the thread_id is know; when editing a post, the post_id is known.
arrayType-specific params based on context
arraynullViewing user array; null for visitor
booleancanViewAttachment(array $attachment, array $viewingUser) : boolean
arrayAttachment to view
arraynullViewing user array; null for visitor
booleangetAttachmentConstraints() : array
arraygetAttachmentCountLimit() : integer | true
integertrueIf true, there is no limitgetContentDataFromContentId(integer $contentId) : array
By default, this only contains only the primary content ID.
integer
arraygetContentIdFromContentData(array $contentData) : integer
arrayType-specific content data
integergetContentLink(array $attachment, array $extraParams, boolean $skipPrepend) : string
arraydata - ideally containing everything necessary to build the content link
array
boolean
stringgetContentTypePhraseKey() : string
stringstandardizeViewingUserReference(array $viewingUser)
arraynullViewing user array. Will be normalized.
_canUploadAndManageAttachments(array $contentData, array $viewingUser) : boolean
The content data may contain different type-specific values in different situations. Eg, when posting a thread, only the node_id is known; when posting a reply, the thread_id is know; when editing a post, the post_id is known.
arrayType-specific params based on context
arrayViewing user array
boolean_canViewAttachment(array $attachment, array $viewingUser) : boolean
arrayAttachment to view
arrayViewing user array
boolean$_contentIdKey : string
Must be overriden by children.
$_contentRoute : string
Example: posts use 'posts' Must be overriden by children.
$_contentTypePhraseKey : string
Examples: 'post'; 'conversation_message' Must be overriden by children.