MediaWiki REL1_30
CiteDataModule.php
Go to the documentation of this file.
1<?php
14
15 /* Protected Members */
16
18 protected $targets = [ 'desktop', 'mobile' ];
19
20 /* Methods */
21
23 $citationDefinition = json_decode(
24 $context->msg( 'cite-tool-definition.json' )
25 ->inContentLanguage()
26 ->plain()
27 );
28
29 if ( $citationDefinition === null ) {
30 $citationDefinition = json_decode(
31 $context->msg( 'visualeditor-cite-tool-definition.json' )
32 ->inContentLanguage()
33 ->plain()
34 );
35 }
36
37 $citationTools = [];
38 if ( is_array( $citationDefinition ) ) {
39 foreach ( $citationDefinition as $tool ) {
40 if ( !isset( $tool->title ) ) {
41 $tool->title = $context->msg( 'visualeditor-cite-tool-name-' . $tool->name )
42 ->text();
43 }
44 $citationTools[] = $tool;
45 }
46 }
47
48 return
49 've.init.platform.addMessages(' . FormatJson::encode(
50 [
51 'cite-tool-definition.json' => json_encode( $citationTools )
52 ],
54 ) . ');';
55 }
56
58 return [
59 'ext.visualEditor.base',
60 'ext.visualEditor.mediawiki',
61 ];
62 }
63
65 $summary = parent::getDefinitionSummary( $context );
66 $summary[] = [
67 'script' => $this->getScript( $context ),
68 ];
69 return $summary;
70 }
71}
getDefinitionSummary(ResourceLoaderContext $context)
Get a list of resources that web browsers may preload.
getDependencies(ResourceLoaderContext $context=null)
Get a list of modules this module depends on.
getScript(ResourceLoaderContext $context)
Get all JS for this module for a given language and skin.
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:2780