mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-15 02:55:04 +00:00
Load WikiEditor ref toolbar button on other content types
Allow other extensions to provide lists of page content models for which they want to load the Cite toolbar button. This will, for example, make it possible for ProofreadPage to have the button on Page pages. Bug: T348403 Change-Id: Id28cb0b6cb8a2b86a66b17232575afe513969c54
This commit is contained in:
parent
7ef1d0d009
commit
b03dd1bba8
|
@ -91,11 +91,16 @@ class CiteHooks implements
|
|||
* @param OutputPage $outputPage object.
|
||||
*/
|
||||
public function onEditPage__showEditForm_initial( $editPage, $outputPage ) {
|
||||
if ( $editPage->contentModel !== CONTENT_MODEL_WIKITEXT ) {
|
||||
$extensionRegistry = ExtensionRegistry::getInstance();
|
||||
$allowedContentModels = array_merge(
|
||||
[ CONTENT_MODEL_WIKITEXT ],
|
||||
$extensionRegistry->getAttribute( 'CiteAllowedContentModels' )
|
||||
);
|
||||
if ( !in_array( $editPage->contentModel, $allowedContentModels ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$wikiEditorEnabled = ExtensionRegistry::getInstance()->isLoaded( 'WikiEditor' );
|
||||
$wikiEditorEnabled = $extensionRegistry->isLoaded( 'WikiEditor' );
|
||||
|
||||
$user = $editPage->getContext()->getUser();
|
||||
|
||||
|
|
Loading…
Reference in a new issue