MediaWiki REL1_31
CiteDataModule.php
Go to the documentation of this file.
1<?php
2
12
14 protected $targets = [ 'desktop', 'mobile' ];
15
18 $citationDefinition = json_decode(
19 $context->msg( 'cite-tool-definition.json' )
20 ->inContentLanguage()
21 ->plain()
22 );
23
24 if ( $citationDefinition === null ) {
25 $citationDefinition = json_decode(
26 $context->msg( 'visualeditor-cite-tool-definition.json' )
27 ->inContentLanguage()
28 ->plain()
29 );
30 }
31
32 $citationTools = [];
33 if ( is_array( $citationDefinition ) ) {
34 foreach ( $citationDefinition as $tool ) {
35 if ( !isset( $tool->title ) ) {
36 $tool->title = $context->msg( 'visualeditor-cite-tool-name-' . $tool->name )
37 ->text();
38 }
39 $citationTools[] = $tool;
40 }
41 }
42
43 return 've.init.platform.addMessages(' . FormatJson::encode(
44 [
45 'cite-tool-definition.json' => json_encode( $citationTools )
46 ],
48 ) . ');';
49 }
50
53 return [
54 'ext.visualEditor.base',
55 'ext.visualEditor.mediawiki',
56 ];
57 }
58
61 $summary = parent::getDefinitionSummary( $context );
62 $summary[] = [
63 'script' => $this->getScript( $context ),
64 ];
65 return $summary;
66 }
67
68}
Resource loader module providing extra data from the server to Cite.
getDefinitionSummary(ResourceLoaderContext $context)
@inheritDoc
getDependencies(ResourceLoaderContext $context=null)
@inheritDoc
getScript(ResourceLoaderContext $context)
@inheritDoc
Object passed around to modules which contains information about the state of a specific loader reque...
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
static inDebugMode()
Determine whether debug mode was requested Order of priority is 1) request param, 2) cookie,...
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
Definition hooks.txt:2811