@@ -22,10 +22,10 @@ |
||
22 | 22 | * @ingroup ExtensionManager |
23 | 23 | */ |
24 | 24 | |
25 | -$specialPageAliases = []; |
|
25 | +$specialPageAliases = [ ]; |
|
26 | 26 | |
27 | 27 | /** English |
28 | 28 | */ |
29 | -$specialPageAliases['en'] = [ |
|
29 | +$specialPageAliases[ 'en' ] = [ |
|
30 | 30 | 'BatchUpload' => [ 'BatchUpload' ], |
31 | 31 | ]; |
@@ -22,10 +22,10 @@ |
||
22 | 22 | * @ingroup ExtensionManager |
23 | 23 | */ |
24 | 24 | |
25 | -$magicWords = []; |
|
25 | +$magicWords = [ ]; |
|
26 | 26 | |
27 | 27 | /** English |
28 | 28 | */ |
29 | -$magicWords['en'] = [ |
|
29 | +$magicWords[ 'en' ] = [ |
|
30 | 30 | 'batchupload' => [ 0, 'batchupload' ], |
31 | 31 | ]; |
32 | 32 | \ No newline at end of file |
@@ -95,17 +95,17 @@ |
||
95 | 95 | |
96 | 96 | return |
97 | 97 | |
98 | - '<span class="fileupload-container"> ' . |
|
99 | - '<span class="fileupload-dropzone fileinput-button"> ' . |
|
100 | - '<i class="glyphicon glyphicon-plus"></i> ' . |
|
101 | - '<span>' . \Message::newFromKey( 'simplebatchupload-buttonlabel' )->escaped() . '</span> ' . |
|
102 | - '<!-- The file input field used as target for the file upload widget -->' . |
|
103 | - '<input class="fileupload" type="file" name="file" multiple ' . |
|
104 | - ' data-url="' . wfScript( 'api' ) . '" ' . |
|
105 | - ' data-comment="' . $escapedUploadComment . '" ' . |
|
106 | - ' data-text="' . $escapedUploadPageText . '" ' . |
|
107 | - '> ' . |
|
108 | - '</span><ul class="fileupload-results"></ul> ' . |
|
98 | + '<span class="fileupload-container"> '. |
|
99 | + '<span class="fileupload-dropzone fileinput-button"> '. |
|
100 | + '<i class="glyphicon glyphicon-plus"></i> '. |
|
101 | + '<span>'.\Message::newFromKey( 'simplebatchupload-buttonlabel' )->escaped().'</span> '. |
|
102 | + '<!-- The file input field used as target for the file upload widget -->'. |
|
103 | + '<input class="fileupload" type="file" name="file" multiple '. |
|
104 | + ' data-url="'.wfScript( 'api' ).'" '. |
|
105 | + ' data-comment="'.$escapedUploadComment.'" '. |
|
106 | + ' data-text="'.$escapedUploadPageText.'" '. |
|
107 | + '> '. |
|
108 | + '</span><ul class="fileupload-results"></ul> '. |
|
109 | 109 | '</span>'; |
110 | 110 | } |
111 | 111 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return ''; |
59 | 59 | } |
60 | 60 | |
61 | - return '{{' . $this->getEscapedParameter( self::IDX_TEMPLATENAME ) . $this->getEscapedParameter( self::IDX_TEMPLATEPARAMETERS ) . '}}'; |
|
61 | + return '{{'.$this->getEscapedParameter( self::IDX_TEMPLATENAME ).$this->getEscapedParameter( self::IDX_TEMPLATEPARAMETERS ).'}}'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $this->populateParameters(); |
158 | 158 | } |
159 | 159 | |
160 | - $this->parameters[ self::IDX_TEMPLATEPARAMETERS ] .= '|' . $parameter; |
|
160 | + $this->parameters[ self::IDX_TEMPLATEPARAMETERS ] .= '|'.$parameter; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * @param $targetConfiguration |
49 | 49 | */ |
50 | - public function registerEarlyConfiguration( &$targetConfiguration ){ |
|
50 | + public function registerEarlyConfiguration( &$targetConfiguration ) { |
|
51 | 51 | $sourceConfiguration = $this->getEarlyConfiguration(); |
52 | 52 | $this->mergeConfiguration( $sourceConfiguration, $targetConfiguration ); |
53 | 53 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * @param $targetConfiguration |
57 | 57 | */ |
58 | - public function registerLateConfiguration( &$targetConfiguration ){ |
|
58 | + public function registerLateConfiguration( &$targetConfiguration ) { |
|
59 | 59 | $sourceConfiguration = $this->getLateConfiguration(); |
60 | 60 | $this->mergeConfiguration( $sourceConfiguration, $targetConfiguration ); |
61 | 61 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function mergeConfiguration( $sourceConfiguration, &$targetConfiguration ) { |
67 | 67 | foreach ( $sourceConfiguration as $varname => $value ) { |
68 | - $targetConfiguration[ $varname ] = array_key_exists( $varname, $targetConfiguration )?array_replace_recursive( $targetConfiguration[ $varname ], $value ):$value; |
|
68 | + $targetConfiguration[ $varname ] = array_key_exists( $varname, $targetConfiguration ) ?array_replace_recursive( $targetConfiguration[ $varname ], $value ) : $value; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | */ |
75 | 75 | protected function getEarlyConfiguration(): array { |
76 | 76 | |
77 | - $configuration = []; |
|
77 | + $configuration = [ ]; |
|
78 | 78 | |
79 | - $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadAlias' ] = __DIR__ . '/SimpleBatchUpload.alias.php'; |
|
80 | - $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadMagic' ] = __DIR__ . '/SimpleBatchUpload.magic.php'; |
|
79 | + $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadAlias' ] = __DIR__.'/SimpleBatchUpload.alias.php'; |
|
80 | + $configuration[ 'wgExtensionMessagesFiles' ][ 'SimpleBatchUploadMagic' ] = __DIR__.'/SimpleBatchUpload.magic.php'; |
|
81 | 81 | |
82 | 82 | $configuration[ 'wgSpecialPages' ][ 'BatchUpload' ] = '\SimpleBatchUpload\SpecialBatchUpload'; |
83 | 83 | |
84 | 84 | $configuration[ 'wgHooks' ][ 'ParserFirstCallInit' ][ 'ext.simplebatchupload' ] = [ $this, 'registerParserFunction' ]; |
85 | 85 | $configuration[ 'wgHooks' ][ 'MakeGlobalVariablesScript' ][ 'ext.simplebatchupload' ] = [ $this, 'onMakeGlobalVariablesScript' ]; |
86 | - $configuration[ 'wgHooks' ][ 'SetupAfterCache' ][ 'ext.simplebatchupload' ] = [ $this, 'onSetupAfterCache']; |
|
86 | + $configuration[ 'wgHooks' ][ 'SetupAfterCache' ][ 'ext.simplebatchupload' ] = [ $this, 'onSetupAfterCache' ]; |
|
87 | 87 | |
88 | 88 | return $configuration; |
89 | 89 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | protected function getLateConfiguration(): array { |
96 | 96 | |
97 | - $configuration = []; |
|
97 | + $configuration = [ ]; |
|
98 | 98 | $configuration[ 'wgResourceModules' ] = $this->getUploadSupportModuleDefinition() + $this->getUploadModuleDefinition(); |
99 | 99 | |
100 | 100 | return $configuration; |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | $dependencies = [ 'ext.SimpleBatchUpload.jquery-file-upload', 'mediawiki.Title', 'mediawiki.jqueryMsg' ]; |
140 | 140 | |
141 | 141 | if ( version_compare( $GLOBALS[ 'wgVersion' ], '1.32.0', '>' ) ) { |
142 | - $dependencies[] = 'mediawiki.api'; |
|
142 | + $dependencies[ ] = 'mediawiki.api'; |
|
143 | 143 | } else { |
144 | - $dependencies[] = 'mediawiki.api.edit'; |
|
144 | + $dependencies[ ] = 'mediawiki.api.edit'; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return [ 'ext.SimpleBatchUpload' => |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | protected function getBasePathsForNonComposerModules() { |
165 | 165 | return [ |
166 | 166 | 'localBasePath' => dirname( __DIR__ ), |
167 | - 'remoteBasePath' => $GLOBALS[ 'wgExtensionAssetsPath' ] . '/SimpleBatchUpload', |
|
167 | + 'remoteBasePath' => $GLOBALS[ 'wgExtensionAssetsPath' ].'/SimpleBatchUpload', |
|
168 | 168 | ]; |
169 | 169 | } |
170 | 170 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @param \OutputPage $out |
174 | 174 | */ |
175 | 175 | public function onMakeGlobalVariablesScript( &$vars, $out ) { |
176 | - $vars['simpleBatchUploadMaxFilesPerBatch'] = $this->getMaxFilesPerBatchConfig(); |
|
176 | + $vars[ 'simpleBatchUploadMaxFilesPerBatch' ] = $this->getMaxFilesPerBatchConfig(); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | public function onSetupAfterCache() { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * @param $targetConfiguration |
49 | 49 | */ |
50 | - public function registerEarlyConfiguration( &$targetConfiguration ){ |
|
50 | + public function registerEarlyConfiguration( &$targetConfiguration ) { |
|
51 | 51 | $sourceConfiguration = $this->getEarlyConfiguration(); |
52 | 52 | $this->mergeConfiguration( $sourceConfiguration, $targetConfiguration ); |
53 | 53 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | /** |
56 | 56 | * @param $targetConfiguration |
57 | 57 | */ |
58 | - public function registerLateConfiguration( &$targetConfiguration ){ |
|
58 | + public function registerLateConfiguration( &$targetConfiguration ) { |
|
59 | 59 | $sourceConfiguration = $this->getLateConfiguration(); |
60 | 60 | $this->mergeConfiguration( $sourceConfiguration, $targetConfiguration ); |
61 | 61 | } |