MediaWiki REL1_40
|
Backend logic for changing the content model of a page. More...
Public Member Functions | |
__construct (IContentHandlerFactory $contentHandlerFactory, HookContainer $hookContainer, RevisionLookup $revLookup, UserFactory $userFactory, Authority $performer, WikiPage $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 22 of file ContentModelChange.php.
ContentModelChange::__construct | ( | IContentHandlerFactory | $contentHandlerFactory, |
HookContainer | $hookContainer, | ||
RevisionLookup | $revLookup, | ||
UserFactory | $userFactory, | ||
Authority | $performer, | ||
WikiPage | $page, | ||
string | $newModel ) |
IContentHandlerFactory | $contentHandlerFactory | |
HookContainer | $hookContainer | |
RevisionLookup | $revLookup | |
UserFactory | $userFactory | |
Authority | $performer | |
WikiPage | $page | |
string | $newModel |
Definition at line 58 of file ContentModelChange.php.
ContentModelChange::authorizeChange | ( | ) |
Authorize the content model change by $performer.
self::probablyCanChange
instead.Definition at line 138 of file ContentModelChange.php.
ContentModelChange::checkPermissions | ( | ) |
Check user can edit and editcontentmodel before and after.
Definition at line 152 of file ContentModelChange.php.
References MediaWiki\Permissions\PermissionStatus\toLegacyErrorArray(), and wfDeprecated().
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 |
ThrottledError |
Definition at line 251 of file ContentModelChange.php.
References $title, EDIT_FORCE_BOT, EDIT_INTERNAL, EDIT_NEW, EDIT_UPDATE, and wfMessage().
ContentModelChange::probablyCanChange | ( | ) |
Check whether $performer can execute the content model change.
self::authorizeChange
instead.Definition at line 121 of file ContentModelChange.php.
ContentModelChange::setMessagePrefix | ( | $msgPrefix | ) |
string | $msgPrefix |
Definition at line 91 of file ContentModelChange.php.
ContentModelChange::setTags | ( | $tags | ) |
Specify the tags the user wants to add, and check permissions.
string[] | $tags |
Definition at line 167 of file ContentModelChange.php.
References ChangeTags\canAddTagsAccompanyingChange().