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 (Config $config, LinkRenderer $linkRenderer, PermissionManager $permManager, UserNameUtils $userNameUtils, TempUserCreator $tempUserCreator, UserFactory $userFactory, RestrictionStore $restrictionStore, DatabaseBlockStore $blockStore, ReadOnlyMode $readOnlyMode, SpecialPageFactory $specialPageFactory, RepoGroup $repoGroup, NamespaceInfo $namespaceInfo, SkinFactory $skinFactory, IConnectionProvider $dbProvider)
 
 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 40 of file IntroMessageBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 63 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 137 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: