MediaWiki REL1_37
|
Helper class to change the content model of pages. More...
Public Member Functions | |
__construct (IContentHandlerFactory $contentHandlerFactory, HookContainer $hookContainer, RevisionLookup $revLookup, UserFactory $userFactory, Authority $performer, WikiPage $page, string $newModel) | |
authorizeChange () | |
Authorize the move by $performer. | |
checkPermissions () | |
Check user can edit and editcontentmodel before and after. | |
doContentModelChange (IContextSource $context, $comment, $bot) | |
Handle change and logging after validation. | |
probablyCanChange () | |
Check whether $performer can execute the move. | |
setMessagePrefix ( $msgPrefix) | |
setTags ( $tags) | |
Specify the tags the user wants to add, and check permissions. | |
Private Member Functions | |
authorizeInternal (callable $authorizer) | |
createNewContent () | |
Private Attributes | |
IContentHandlerFactory | $contentHandlerFactory |
HookRunner | $hookRunner |
int false | $latestRevId |
latest revision id, or false if creating | |
string | $logAction |
'new' or 'change' | |
string | $msgPrefix |
'apierror-' or empty string, for status messages | |
Content | $newContent |
string | $newModel |
WikiPage | $page |
Authority | $performer |
making the change | |
RevisionLookup | $revLookup |
string[] | $tags |
tags to add | |
UserFactory | $userFactory |
Helper class to change the content model of pages.
For creating new pages via the action API, use the edit api and specify the desired content model and format.
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 69 of file ContentModelChange.php.
ContentModelChange::authorizeChange | ( | ) |
Authorize the move by $performer.
self::probablyCanChange
instead.Definition at line 149 of file ContentModelChange.php.
|
private |
callable | $authorizer | ( string $action, PageIdentity $target, PermissionStatus $status ) |
Definition at line 110 of file ContentModelChange.php.
ContentModelChange::checkPermissions | ( | ) |
Check user can edit and editcontentmodel before and after.
Definition at line 163 of file ContentModelChange.php.
References MediaWiki\Permissions\PermissionStatus\toLegacyErrorArray(), and wfDeprecated().
|
private |
Definition at line 191 of file ContentModelChange.php.
References $title, and Message\plaintextParam().
ContentModelChange::doContentModelChange | ( | IContextSource | $context, |
$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 262 of file ContentModelChange.php.
References $title, EDIT_FORCE_BOT, EDIT_INTERNAL, EDIT_NEW, EDIT_UPDATE, LogFormatter\newFromEntry(), and wfMessage().
ContentModelChange::probablyCanChange | ( | ) |
Check whether $performer can execute the move.
self::authorizeChange
instead.Definition at line 132 of file ContentModelChange.php.
ContentModelChange::setMessagePrefix | ( | $msgPrefix | ) |
string | $msgPrefix |
Definition at line 102 of file ContentModelChange.php.
ContentModelChange::setTags | ( | $tags | ) |
Specify the tags the user wants to add, and check permissions.
string[] | $tags |
Definition at line 178 of file ContentModelChange.php.
References ChangeTags\canAddTagsAccompanyingChange().
|
private |
Definition at line 25 of file ContentModelChange.php.
|
private |
Definition at line 28 of file ContentModelChange.php.
|
private |
latest revision id, or false if creating
Definition at line 52 of file ContentModelChange.php.
|
private |
'new' or 'change'
Definition at line 55 of file ContentModelChange.php.
|
private |
'apierror-' or empty string, for status messages
Definition at line 58 of file ContentModelChange.php.
|
private |
Definition at line 49 of file ContentModelChange.php.
|
private |
Definition at line 43 of file ContentModelChange.php.
|
private |
Definition at line 40 of file ContentModelChange.php.
|
private |
making the change
Definition at line 37 of file ContentModelChange.php.
|
private |
Definition at line 31 of file ContentModelChange.php.
|
private |
tags to add
Definition at line 46 of file ContentModelChange.php.
|
private |
Definition at line 34 of file ContentModelChange.php.