|
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. | |
| 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 ) |
Definition at line 58 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 144 of file ContentModelChange.php.
| 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 245 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 127 of file ContentModelChange.php.
| MediaWiki\Content\ContentModelChange::setMessagePrefix | ( | $msgPrefix | ) |
| string | $msgPrefix |
Definition at line 95 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 159 of file ContentModelChange.php.