Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

A Handler to process replies to forum posts.

Copyright: 2014 Andrew Nicols
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 327 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

reply_handler:: (5 methods):
  get_description()
  get_name()
  process_message()
  process_attachment()
  get_success_message()


Class: reply_handler  - X-Ref

A Handler to process replies to forum posts.

get_description()   X-Ref
Return a description for the current handler.

return: string

get_name()   X-Ref
Return a short name for the current handler.
This appears in the admin pages as a human-readable name.

return: string

process_message(\stdClass $record, \stdClass $messagedata)   X-Ref
Process a message received and validated by the Inbound Message processor.

param: \stdClass $messagedata The Inbound Message record
param: \stdClass $messagedata The message data packet
return: bool Whether the message was successfully processed.

process_attachment($acceptedtypes, \context_user $context, $itemid, \stdClass $attachment)   X-Ref
Process attachments included in a message.

param: string[] $acceptedtypes String The mimetypes of the acceptable attachment types.
param: \context_user $context context_user The context of the user creating this attachment.
param: int $itemid int The itemid to store this attachment under.
param: \stdClass $attachment stdClass The Attachment data to store.
return: \stored_file

get_success_message(\stdClass $messagedata, $handlerresult)   X-Ref
Return the content of any success notification to be sent.
Both an HTML and Plain Text variant must be provided.

param: \stdClass $messagedata The message data.
param: \stdClass $handlerresult The record for the newly created post.
return: \stdClass with keys `html` and `plain`.