MediaWiki master
|
Backend logic for changing the content model of a page. More...
Public Member Functions | |
__construct (IContentHandlerFactory $contentHandlerFactory, HookContainer $hookContainer, RevisionLookup $revLookup, UserFactory $userFactory, WikiPageFactory $wikiPageFactory, LogFormatterFactory $logFormatterFactory, Authority $performer, PageIdentity $page, string $newModel) | |
authorizeChange () | |
Authorize the content model change by $performer. | |
checkPermissions () | |
Check user can edit and editcontentmodel before and after. | |
doContentModelChange (IContextSource $context, string $comment, $bot) | |
Handle change and logging after validation. | |
probablyCanChange () | |
Check whether $performer can execute the content model change. | |
setMessagePrefix ( $msgPrefix) | |
setTags ( $tags) | |
Specify the tags the user wants to add, and check permissions. | |
Backend logic for changing the content model of a page.
Note that you can create a new page directly with a desired content model and format, e.g. via EditPage or externally from ApiEditPage.
Definition at line 34 of file ContentModelChange.php.
MediaWiki\Content\ContentModelChange::__construct | ( | IContentHandlerFactory | $contentHandlerFactory, |
HookContainer | $hookContainer, | ||
RevisionLookup | $revLookup, | ||
UserFactory | $userFactory, | ||
WikiPageFactory | $wikiPageFactory, | ||
LogFormatterFactory | $logFormatterFactory, | ||
Authority | $performer, | ||
PageIdentity | $page, | ||
string | $newModel ) |
IContentHandlerFactory | $contentHandlerFactory | |
HookContainer | $hookContainer | |
RevisionLookup | $revLookup | |
UserFactory | $userFactory | |
WikiPageFactory | $wikiPageFactory | |
LogFormatterFactory | $logFormatterFactory | |
Authority | $performer | |
PageIdentity | $page | |
string | $newModel |
Definition at line 76 of file ContentModelChange.php.
References MediaWiki\Page\WikiPageFactory\newFromTitle().
MediaWiki\Content\ContentModelChange::authorizeChange | ( | ) |
Authorize the content model change by $performer.
self::probablyCanChange
instead.Definition at line 162 of file ContentModelChange.php.
MediaWiki\Content\ContentModelChange::checkPermissions | ( | ) |
Check user can edit and editcontentmodel before and after.
Definition at line 176 of file ContentModelChange.php.
References MediaWiki\Permissions\PermissionStatus\toLegacyErrorArray(), and wfDeprecated().
MediaWiki\Content\ContentModelChange::doContentModelChange | ( | IContextSource | $context, |
string | $comment, | ||
$bot ) |
Handle change and logging after validation.
Can still be intercepted by hooks
IContextSource | $context | |
string | $comment | |
bool | $bot | Mark as a bot edit if the user can |
Definition at line 278 of file ContentModelChange.php.
References EDIT_FORCE_BOT, EDIT_INTERNAL, EDIT_NEW, EDIT_UPDATE, and wfMessage().
MediaWiki\Content\ContentModelChange::probablyCanChange | ( | ) |
Check whether $performer can execute the content model change.
self::authorizeChange
instead.Definition at line 145 of file ContentModelChange.php.
MediaWiki\Content\ContentModelChange::setMessagePrefix | ( | $msgPrefix | ) |
string | $msgPrefix |
Definition at line 113 of file ContentModelChange.php.
MediaWiki\Content\ContentModelChange::setTags | ( | $tags | ) |
Specify the tags the user wants to add, and check permissions.
string[] | $tags |
Definition at line 192 of file ContentModelChange.php.
References ChangeTags\canAddTagsAccompanyingChange().