Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mod_forum\output\forum_post Class Reference
Inheritance diagram for mod_forum\output\forum_post:
renderable templatable mod_forum\output\forum_post_email

Public Member Functions

 __construct ($course, $cm, $forum, $discussion, $post, $author, $recipient, $canreply)
 Builds a renderable forum post. More...
 
 __set ($key, $value)
 Magically sets a property against this object. More...
 
 export_for_template (\renderer_base $renderer, $plaintext=false)
 Export this data so it can be used as the context for a mustache template. More...
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template. More...
 
 get_author_fullname ()
 The fullname of the post author. More...
 
 get_author_picture (\renderer_base $renderer)
 The HTML for the author's user picture. More...
 
 get_authorlink ()
 Get the link to the author's profile page. More...
 
 get_coursefullname ()
 The full name of the course that the forum is in. More...
 
 get_courseidnumber ()
 ID number of the course that the forum is in. More...
 
 get_courselink ()
 Get the link to the course. More...
 
 get_coursename ()
 The name of the course that the forum is in. More...
 
 get_discussionlink ()
 Get the link to the current discussion. More...
 
 get_discussionname ()
 The name of the current discussion. More...
 
 get_forumindexlink ()
 Get the link to the forum index for this course. More...
 
 get_forumname ()
 The name of the forum. More...
 
 get_forumviewlink ()
 Get the link to the view page for this forum. More...
 
 get_group_picture (\renderer_base $renderer)
 The HTML for a group picture. More...
 
 get_is_firstpost ()
 Whether this is the first post. More...
 
 get_parentpostlink ()
 Get the link to the parent post. More...
 
 get_permalink ()
 Get the link to the current post, including post anchor. More...
 
 get_postanchor ()
 The plaintext anchor id for the current post. More...
 
 get_postdate ()
 The date of the post, formatted according to the postto user's preferences. More...
 
 get_replylink ()
 Get the link to reply to the current post. More...
 
 get_showdiscussionname ()
 Whether to show the discussion name. More...
 
 get_subject ()
 The formatted subject for the current post. More...
 
 get_unsubscribediscussionlink ()
 Get the link to unsubscribe from the discussion. More...
 
 get_unsubscribeforumlink ()
 Get the link to unsubscribe from the forum. More...
 

Protected Member Functions

 _get_discussionlink ()
 Get the link to the current discussion. More...
 
 export_for_template_html (\mod_forum_renderer $renderer)
 Export this data so it can be used as the context for a mustache template. More...
 
 export_for_template_shared (\mod_forum_renderer $renderer)
 Export this data so it can be used as the context for a mustache template. More...
 
 export_for_template_text (\mod_forum_renderer $renderer)
 Export this data so it can be used as the context for a mustache template. More...
 
 get_postto ()
 The recipient of the post. More...
 

Protected Attributes

object $author = null
 The user that wrote the post. More...
 
boolean $canreply = false
 Whether the user can reply to this post. More...
 
object $cm = null
 The course module for the forum. More...
 
object $course = null
 The course that the forum post is in. More...
 
object $discussion = null
 The discussion that the forum post is in. More...
 
object $forum = null
 The forum that the post is in. More...
 
object $post = null
 The forum post being displayed. More...
 
object $userto = null
 The user that is reading the post. More...
 
boolean $viewfullnames = false
 Whether to override forum display when displaying usernames. More...
 
array $writablekeys
 An associative array indicating which keys on this object should be writeable. More...
 

Constructor & Destructor Documentation

◆ __construct()

mod_forum\output\forum_post::__construct (   $course,
  $cm,
  $forum,
  $discussion,
  $post,
  $author,
  $recipient,
  $canreply 
)

Builds a renderable forum post.

Parameters
object$courseCourse of the forum
object$cmCourse Module of the forum
object$forumThe forum of the post
object$discussionDiscussion thread in which the post appears
object$postThe post
object$authorAuthor of the post
object$recipientRecipient of the email
bool$canreplyTrue if the user can reply to the post

Member Function Documentation

◆ __set()

mod_forum\output\forum_post::__set (   $key,
  $value 
)

Magically sets a property against this object.

Parameters
string$key
mixed$value

◆ _get_discussionlink()

mod_forum\output\forum_post::_get_discussionlink ( )
protected

Get the link to the current discussion.

Return values
string

◆ export_for_template() [1/2]

mod_forum\output\forum_post::export_for_template ( \renderer_base  $renderer,
  $plaintext = false 
)

Export this data so it can be used as the context for a mustache template.

Parameters
mod_forum_renderer$rendererThe render to be used for formatting the message and attachments
bool$plaintextWhethe the target is a plaintext target
Return values
arrayData ready for use in a mustache template

◆ export_for_template() [2/2]

templatable::export_for_template ( renderer_base  $output)
inherited

Function to export the renderer data in a format that is suitable for a mustache template.

This means:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implemented in forumreport_summary\output\filters, core_user\output\unified_filter, core_user\output\status_field, core_tag\output\taglist, core_tag\output\tagindex, core_tag\output\tagfeed, core_tag\output\tagcloud, core_tag\output\tag, report_competency\output\user_course_navigation, report_competency\output\report, core_privacy\output\exported_navigation_page, core_privacy\output\exported_html_page, MoodleQuickForm_wikieditor, mod_lti\output\tool_configure_page, mod_lti\output\external_registration_return_page, mod_forum\output\quick_search_form, mod_forum\output\big_search_form, mod_feedback\output\summary, booktool_print\output\print_book_page, booktool_print\output\print_book_chapter_page, assign_attempt_history_chooser, mod_assign\output\grading_app, login_signup_form, progress_bar, action_menu, tabtree, tabobject, custom_menu_item, initials_bar, paging_bar, url_select, single_select, pix_icon, pix_icon_font, help_icon, component_action, MoodleQuickForm_warning, MoodleQuickForm_url, MoodleQuickForm_textarea, MoodleQuickForm_tags, MoodleQuickForm_submit, MoodleQuickForm_static, MoodleQuickForm_selectwithlink, MoodleQuickForm_selectgroups, MoodleQuickForm_select, MoodleQuickForm_recaptcha, MoodleQuickForm_passwordunmask, MoodleQuickForm_group, MoodleQuickForm_grading, MoodleQuickForm_filepicker, MoodleQuickForm_filemanager, MoodleQuickForm_editor, MoodleQuickForm_date_time_selector, MoodleQuickForm_date_selector, MoodleQuickForm_checkbox, MoodleQuickForm_autocomplete, MoodleQuickForm_advcheckbox, core\output\chooser_section, core\output\chooser_item, core\output\chooser, core\output\checkbox_toggleall, core_group\output\index_page, core_group\output\group_details, enrol_lti\output\registration, core_course\output\modchooser, block_timeline\output\main, block_starredcourses\output\main, block_search_forums\output\search_form, block_recentlyaccesseditems\output\main, block_recentlyaccessedcourses\output\main, block_myprofile\output\myprofile, block_myoverview\output\main, block_lp\output\summary, block_lp\output\plans_to_review_page, block_lp\output\competencies_to_review_page, core_auth\output\verify_age_location_page, core_auth\output\login, core_auth\output\digital_minor_page, tool_templatelibrary\output\list_templates_page, tool_policy\output\page_viewdoc, tool_policy\output\page_viewalldoc, tool_policy\output\page_nopermission, tool_policy\output\page_managedocs_list, tool_policy\output\page_agreedocs, tool_policy\output\guestconsent, tool_policy\output\acceptances, tool_lp\output\user_evidence_list_page, tool_lp\output\user_competency_summary_in_course, tool_lp\output\user_competency_summary, tool_lp\output\user_competency_course_navigation, tool_lp\output\template_competencies_page, tool_lp\output\related_competencies, tool_lp\output\plans_page, tool_lp\output\module_navigation, tool_lp\output\manage_templates_page, tool_lp\output\manage_competency_frameworks_page, tool_lp\output\manage_competencies_page, tool_lp\output\course_competencies_page, tool_lp\output\competency_summary, tool_lp\output\competency_plan_navigation, tool_langimport\output\langimport_page, tool_dataprivacy\output\summary_page, tool_dataprivacy\output\request_filter, tool_dataprivacy\output\purposes, tool_dataprivacy\output\my_data_requests_page, tool_dataprivacy\output\defaults_page, tool_dataprivacy\output\data_requests_page, tool_dataprivacy\output\data_registry_page, tool_dataprivacy\output\data_registry_compliance_page, tool_dataprivacy\output\data_deletion_page, tool_dataprivacy\output\categories, and tool_customlang\output\translator.

◆ export_for_template_html()

mod_forum\output\forum_post::export_for_template_html ( \mod_forum_renderer  $renderer)
protected

Export this data so it can be used as the context for a mustache template.

Parameters
mod_forum_renderer$rendererThe render to be used for formatting the message and attachments
Return values
arrayData ready for use in a mustache template

◆ export_for_template_shared()

mod_forum\output\forum_post::export_for_template_shared ( \mod_forum_renderer  $renderer)
protected

Export this data so it can be used as the context for a mustache template.

Parameters
mod_forum_renderer$rendererThe render to be used for formatting the message and attachments
Return values
stdClassData ready for use in a mustache template

◆ export_for_template_text()

mod_forum\output\forum_post::export_for_template_text ( \mod_forum_renderer  $renderer)
protected

Export this data so it can be used as the context for a mustache template.

Parameters
mod_forum_renderer$rendererThe render to be used for formatting the message and attachments
Return values
arrayData ready for use in a mustache template

◆ get_author_fullname()

mod_forum\output\forum_post::get_author_fullname ( )

The fullname of the post author.

Return values
string

◆ get_author_picture()

mod_forum\output\forum_post::get_author_picture ( \renderer_base  $renderer)

The HTML for the author's user picture.

Parameters
renderer_base$renderer
Return values
string

◆ get_authorlink()

mod_forum\output\forum_post::get_authorlink ( )

Get the link to the author's profile page.

Return values
string

◆ get_coursefullname()

mod_forum\output\forum_post::get_coursefullname ( )

The full name of the course that the forum is in.

Return values
string

◆ get_courseidnumber()

mod_forum\output\forum_post::get_courseidnumber ( )

ID number of the course that the forum is in.

Return values
string

◆ get_courselink()

mod_forum\output\forum_post::get_courselink ( )

Get the link to the course.

Return values
string

◆ get_coursename()

mod_forum\output\forum_post::get_coursename ( )

The name of the course that the forum is in.

Return values
string

◆ get_discussionlink()

mod_forum\output\forum_post::get_discussionlink ( )

Get the link to the current discussion.

Return values
string

◆ get_discussionname()

mod_forum\output\forum_post::get_discussionname ( )

The name of the current discussion.

Return values
string

◆ get_forumindexlink()

mod_forum\output\forum_post::get_forumindexlink ( )

Get the link to the forum index for this course.

Return values
string

◆ get_forumname()

mod_forum\output\forum_post::get_forumname ( )

The name of the forum.

Return values
string

◆ get_forumviewlink()

mod_forum\output\forum_post::get_forumviewlink ( )

Get the link to the view page for this forum.

Return values
string

◆ get_group_picture()

mod_forum\output\forum_post::get_group_picture ( \renderer_base  $renderer)

The HTML for a group picture.

Parameters
renderer_base$renderer
Return values
string

◆ get_is_firstpost()

mod_forum\output\forum_post::get_is_firstpost ( )

Whether this is the first post.

Return values
boolean

◆ get_parentpostlink()

mod_forum\output\forum_post::get_parentpostlink ( )

Get the link to the parent post.

Return values
string

◆ get_permalink()

mod_forum\output\forum_post::get_permalink ( )

Get the link to the current post, including post anchor.

Return values
string

◆ get_postanchor()

mod_forum\output\forum_post::get_postanchor ( )

The plaintext anchor id for the current post.

Return values
string

◆ get_postdate()

mod_forum\output\forum_post::get_postdate ( )

The date of the post, formatted according to the postto user's preferences.

Return values
string.

◆ get_postto()

mod_forum\output\forum_post::get_postto ( )
protected

The recipient of the post.

Return values
string

◆ get_replylink()

mod_forum\output\forum_post::get_replylink ( )

Get the link to reply to the current post.

Return values
string

◆ get_showdiscussionname()

mod_forum\output\forum_post::get_showdiscussionname ( )

Whether to show the discussion name.

If the forum name matches the discussion name, the discussion name is not typically displayed.

Return values
boolean

◆ get_subject()

mod_forum\output\forum_post::get_subject ( )

The formatted subject for the current post.

Return values
string

◆ get_unsubscribediscussionlink()

mod_forum\output\forum_post::get_unsubscribediscussionlink ( )

Get the link to unsubscribe from the discussion.

Return values
string

◆ get_unsubscribeforumlink()

mod_forum\output\forum_post::get_unsubscribeforumlink ( )

Get the link to unsubscribe from the forum.

Return values
string

Member Data Documentation

◆ $author

object mod_forum\output\forum_post::$author = null
protected

The user that wrote the post.

$author

◆ $canreply

boolean mod_forum\output\forum_post::$canreply = false
protected

Whether the user can reply to this post.

$canreply

◆ $cm

object mod_forum\output\forum_post::$cm = null
protected

The course module for the forum.

$cm

◆ $course

object mod_forum\output\forum_post::$course = null
protected

The course that the forum post is in.

$course

◆ $discussion

object mod_forum\output\forum_post::$discussion = null
protected

The discussion that the forum post is in.

$discussion

◆ $forum

object mod_forum\output\forum_post::$forum = null
protected

The forum that the post is in.

$forum

◆ $post

object mod_forum\output\forum_post::$post = null
protected

The forum post being displayed.

$post

◆ $userto

object mod_forum\output\forum_post::$userto = null
protected

The user that is reading the post.

$userto

◆ $viewfullnames

boolean mod_forum\output\forum_post::$viewfullnames = false
protected

Whether to override forum display when displaying usernames.

$viewfullnames

◆ $writablekeys

array mod_forum\output\forum_post::$writablekeys
protected
Initial value:
= array(
'viewfullnames' => true,
)

An associative array indicating which keys on this object should be writeable.

$writablekeys


The documentation for this class was generated from the following file: