MediaWiki master
MediaWiki\EditPage\PreloadedContentBuilder Class Reference

Provides the initial content of the edit box displayed in an edit form when creating a new page or a new section. More...

Public Member Functions

 __construct (private readonly IContentHandlerFactory $contentHandlerFactory, private readonly WikiPageFactory $wikiPageFactory, private readonly RedirectLookup $redirectLookup, private readonly SpecialPageFactory $specialPageFactory, private readonly ContentTransformer $contentTransformer, HookContainer $hookContainer)
 
 getDefaultContent (ProperPageIdentity $page)
 Get the content that is displayed when viewing a page that does not exist.
 
 getPreloadedContent (ProperPageIdentity $page, Authority $performer, ?string $preload, array $preloadParams, ?string $section)
 Get the initial content of the edit box displayed in an edit form when creating a new page or a new section.
 

Detailed Description

Provides the initial content of the edit box displayed in an edit form when creating a new page or a new section.

Used by EditPage, and may be used by extensions providing alternative editors.

Since
1.41

Definition at line 29 of file PreloadedContentBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\EditPage\PreloadedContentBuilder::__construct ( private readonly IContentHandlerFactory $contentHandlerFactory,
private readonly WikiPageFactory $wikiPageFactory,
private readonly RedirectLookup $redirectLookup,
private readonly SpecialPageFactory $specialPageFactory,
private readonly ContentTransformer $contentTransformer,
HookContainer $hookContainer )

Definition at line 35 of file PreloadedContentBuilder.php.

Member Function Documentation

◆ getDefaultContent()

MediaWiki\EditPage\PreloadedContentBuilder::getDefaultContent ( ProperPageIdentity $page)

Get the content that is displayed when viewing a page that does not exist.

Users should be discouraged from saving the page with identical content to this.

Some code may depend on the fact that this is only non-null for the 'MediaWiki:' namespace. Beware.

Parameters
ProperPageIdentity$page
Returns
Content|null

Definition at line 99 of file PreloadedContentBuilder.php.

Referenced by MediaWiki\EditPage\PreloadedContentBuilder\getPreloadedContent().

◆ getPreloadedContent()

MediaWiki\EditPage\PreloadedContentBuilder::getPreloadedContent ( ProperPageIdentity $page,
Authority $performer,
?string $preload,
array $preloadParams,
?string $section )

Get the initial content of the edit box displayed in an edit form when creating a new page or a new section.

Parameters
ProperPageIdentity$page
Authority$performer
string | null$preload
string[]$preloadParams
string | null$section
Returns
Content

Definition at line 57 of file PreloadedContentBuilder.php.

References MediaWiki\EditPage\PreloadedContentBuilder\getDefaultContent().


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