MediaWiki master
MediaWiki\EditPage\IntroMessageBuilder Class Reference

Provides the intro messages (edit notices and others) to be displayed before an edit form. More...

Public Member Functions

 __construct (private readonly Config $config, private readonly LinkRenderer $linkRenderer, private readonly PermissionManager $permManager, private readonly UserNameUtils $userNameUtils, private readonly TempUserCreator $tempUserCreator, private readonly UserFactory $userFactory, private readonly RestrictionStore $restrictionStore, private readonly DatabaseBlockStore $blockStore, private readonly ReadOnlyMode $readOnlyMode, private readonly SpecialPageFactory $specialPageFactory, private readonly RepoGroup $repoGroup, private readonly NamespaceInfo $namespaceInfo, private readonly SkinFactory $skinFactory, private readonly IConnectionProvider $dbProvider, private readonly UrlUtils $urlUtils)
 
 getIntroMessages (int $frames, array $skip, MessageLocalizer $localizer, ProperPageIdentity $page, ?RevisionRecord $revRecord, Authority $performer, ?string $editIntro, ?string $returnToQuery, bool $preview, ?string $section=null)
 Return intro messages to be shown before an edit form.
 

Public Attributes

const LESS_FRAMES = 2
 
const MORE_FRAMES = 1
 

Detailed Description

Provides the intro messages (edit notices and others) to be displayed before an edit form.

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

Since
1.41

Definition at line 42 of file IntroMessageBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\EditPage\IntroMessageBuilder::__construct ( private readonly Config $config,
private readonly LinkRenderer $linkRenderer,
private readonly PermissionManager $permManager,
private readonly UserNameUtils $userNameUtils,
private readonly TempUserCreator $tempUserCreator,
private readonly UserFactory $userFactory,
private readonly RestrictionStore $restrictionStore,
private readonly DatabaseBlockStore $blockStore,
private readonly ReadOnlyMode $readOnlyMode,
private readonly SpecialPageFactory $specialPageFactory,
private readonly RepoGroup $repoGroup,
private readonly NamespaceInfo $namespaceInfo,
private readonly SkinFactory $skinFactory,
private readonly IConnectionProvider $dbProvider,
private readonly UrlUtils $urlUtils )

Definition at line 50 of file IntroMessageBuilder.php.

Member Function Documentation

◆ getIntroMessages()

MediaWiki\EditPage\IntroMessageBuilder::getIntroMessages ( int $frames,
array $skip,
MessageLocalizer $localizer,
ProperPageIdentity $page,
?RevisionRecord $revRecord,
Authority $performer,
?string $editIntro,
?string $returnToQuery,
bool $preview,
?string $section = null )

Return intro messages to be shown before an edit form.

The message identifiers used as array keys are stable. Callers of this method may recognize specific messages and omit them when displaying, if they're not applicable to some interface or if they provide the same information in an alternative way.

Callers should load the 'mediawiki.interface.helpers.styles' ResourceLoader module, as some of the possible messages rely on those styles.

Parameters
int$framesSome intro messages come with optional wrapper frames. Pass IntroMessageBuilder::MORE_FRAMES to include the frames whenever possible, or IntroMessageBuilder::LESS_FRAMES to omit them whenever possible.
string[]$skipIdentifiers of messages not to generate
MessageLocalizer$localizer
ProperPageIdentity$pagePage being viewed
RevisionRecord | null$revRecordRevision being viewed, null if page doesn't exist
Authority$performer
string | null$editIntro
string | null$returnToQuery
bool$preview
string | null$section
Returns
array<string,string> Ordered map of identifiers to message HTML

Definition at line 111 of file IntroMessageBuilder.php.

Member Data Documentation

◆ LESS_FRAMES

const MediaWiki\EditPage\IntroMessageBuilder::LESS_FRAMES = 2

◆ MORE_FRAMES

const MediaWiki\EditPage\IntroMessageBuilder::MORE_FRAMES = 1

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