Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | List of all members
mod_forum\local\factories\renderer Class Reference

Renderer factory. More...

Public Member Functions

 __construct (legacy_data_mapper_factory $legacydatamapperfactory, exporter_factory $exporterfactory, vault_factory $vaultfactory, manager_factory $managerfactory, entity_factory $entityfactory, builder_factory $builderfactory, url_factory $urlfactory, moodle_page $page)
 Constructor. More...
 
 get_blog_discussion_list_renderer (forum_entity $forum)
 Create a blog type discussion list renderer. More...
 
 get_discussion_list_renderer (forum_entity $forum)
 Create a standard type discussion list renderer. More...
 
 get_discussion_renderer (forum_entity $forum, discussion_entity $discussion, int $displaymode)
 Create a discussion renderer for the given forum and discussion. More...
 
 get_frontpage_news_discussion_list_renderer (forum_entity $forum)
 Create a discussion list renderer for the social course format. More...
 
 get_posts_renderer ()
 Create a posts renderer to render posts without defined parent/reply relationships. More...
 
 get_posts_search_results_renderer (array $searchterms)
 Create a posts renderer to render posts in the forum search results. More...
 
 get_single_discussion_list_renderer (forum_entity $forum, discussion_entity $discussion, bool $hasmultiplediscussions, int $displaymode)
 Create a single type discussion list renderer. More...
 
 get_single_discussion_posts_renderer (int $displaymode=null, bool $readonly=false)
 Create a posts renderer to render a list of posts in a single discussion. More...
 
 get_social_discussion_list_renderer (forum_entity $forum)
 Create a discussion list renderer for the social course format. More...
 
 get_user_forum_posts_report_renderer (bool $addlinkstocontext)
 Create a posts renderer to render posts in mod/forum/user.php. More...
 

Detailed Description

Renderer factory.

See: https://designpatternsphp.readthedocs.io/en/latest/Creational/SimpleFactory/README.html

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

mod_forum\local\factories\renderer::__construct ( legacy_data_mapper_factory  $legacydatamapperfactory,
exporter_factory  $exporterfactory,
vault_factory  $vaultfactory,
manager_factory  $managerfactory,
entity_factory  $entityfactory,
builder_factory  $builderfactory,
url_factory  $urlfactory,
moodle_page  $page 
)

Constructor.

Parameters
legacy_data_mapper_factory$legacydatamapperfactoryLegacy data mapper factory
exporter_factory$exporterfactoryExporter factory
vault_factory$vaultfactoryVault factory
manager_factory$managerfactoryManager factory
entity_factory$entityfactoryEntity factory
builder_factory$builderfactoryBuilder factory
url_factory$urlfactoryURL factory
moodle_page$pageMoodle page

Member Function Documentation

◆ get_blog_discussion_list_renderer()

mod_forum\local\factories\renderer::get_blog_discussion_list_renderer ( forum_entity  $forum)

Create a blog type discussion list renderer.

Parameters
forum_entity$forumThe forum that the discussions belong to
Return values
discussion_list_renderer

◆ get_discussion_list_renderer()

mod_forum\local\factories\renderer::get_discussion_list_renderer ( forum_entity  $forum)

Create a standard type discussion list renderer.

Parameters
forum_entity$forumThe forum that the discussions belong to
Return values
discussion_list_renderer

◆ get_discussion_renderer()

mod_forum\local\factories\renderer::get_discussion_renderer ( forum_entity  $forum,
discussion_entity  $discussion,
int  $displaymode 
)

Create a discussion renderer for the given forum and discussion.

Parameters
forum_entity$forumForum the discussion belongs to
discussion_entity$discussionDiscussion to render
int$displaymodeHow should the posts be formatted?
Return values
discussion_renderer

◆ get_frontpage_news_discussion_list_renderer()

mod_forum\local\factories\renderer::get_frontpage_news_discussion_list_renderer ( forum_entity  $forum)

Create a discussion list renderer for the social course format.

Parameters
forum_entity$forumThe forum that the discussions belong to
Return values
discussion_list_renderer

◆ get_posts_renderer()

mod_forum\local\factories\renderer::get_posts_renderer ( )

Create a posts renderer to render posts without defined parent/reply relationships.

Return values
posts_renderer

◆ get_posts_search_results_renderer()

mod_forum\local\factories\renderer::get_posts_search_results_renderer ( array  $searchterms)

Create a posts renderer to render posts in the forum search results.

Parameters
string[]$searchtermsThe search terms to be highlighted in the posts
Return values
posts_renderer

◆ get_single_discussion_list_renderer()

mod_forum\local\factories\renderer::get_single_discussion_list_renderer ( forum_entity  $forum,
discussion_entity  $discussion,
bool  $hasmultiplediscussions,
int  $displaymode 
)

Create a single type discussion list renderer.

Parameters
forum_entity$forumForum the discussion belongs to
discussion_entity$discussionThe discussion entity
bool$hasmultiplediscussionsWhether the forum has multiple discussions (more than one)
int$displaymodeHow should the posts be formatted?
Return values
discussion_renderer

◆ get_single_discussion_posts_renderer()

mod_forum\local\factories\renderer::get_single_discussion_posts_renderer ( int  $displaymode = null,
bool  $readonly = false 
)

Create a posts renderer to render a list of posts in a single discussion.

Parameters
int | null$displaymodeHow should the posts be formatted?
bool$readonlyShould the posts include the actions to reply, delete, etc?
Return values
posts_renderer

◆ get_social_discussion_list_renderer()

mod_forum\local\factories\renderer::get_social_discussion_list_renderer ( forum_entity  $forum)

Create a discussion list renderer for the social course format.

Parameters
forum_entity$forumThe forum that the discussions belong to
Return values
discussion_list_renderer

◆ get_user_forum_posts_report_renderer()

mod_forum\local\factories\renderer::get_user_forum_posts_report_renderer ( bool  $addlinkstocontext)

Create a posts renderer to render posts in mod/forum/user.php.

Parameters
bool$addlinkstocontextShould links to the course, forum, and discussion be included?
Return values
posts_renderer

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