Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -1,14 +1,14 @@ |
2 | | -<?php |
| 2 | +<?php |
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Contains list of related resources and hooks which anticipate the use of Resource Loader, whenever that is released |
6 | 6 | */ |
7 | 7 | class UploadWizardHooks { |
8 | | - |
| 8 | + |
9 | 9 | /* We define scripts here for Resource Loader, but in the meantime we are going to load these the old-fashioned way |
10 | 10 | (see SpecialUploadWizard.php). |
11 | 11 | |
12 | | - So this list of scripts has to be topologically-sorted by hand. That is, the depended-upon stuff comes first. |
| 12 | + So this list of scripts has to be topologically-sorted by hand. That is, the depended-upon stuff comes first. |
13 | 13 | There can be no circular dependencies. */ |
14 | 14 | |
15 | 15 | public static $modules = array( |
— | — | @@ -60,15 +60,15 @@ |
61 | 61 | 'resources/mw.UploadWizardUtil.js', |
62 | 62 | |
63 | 63 | // interface libraries |
64 | | - 'resources/mw.GroupProgressBar.js', |
| 64 | + 'resources/mw.GroupProgressBar.js', |
65 | 65 | |
66 | 66 | // UploadWizard specific abstractions |
67 | 67 | 'resources/mw.UploadWizardDeed.js', |
68 | 68 | 'resources/mw.UploadWizardLicenseInput.js', |
69 | 69 | |
70 | | - // main library |
| 70 | + // main library |
71 | 71 | 'resources/mw.UploadWizard.js', |
72 | | - |
| 72 | + |
73 | 73 | // launcher |
74 | 74 | 'UploadWizardPage.js' |
75 | 75 | ), |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | 'resources/jquery.ui/themes/vector/jquery.ui.datepicker.css', |
135 | 135 | 'resources/jquery.ui/themes/vector/jquery.ui.progressbar.css', |
136 | 136 | ), |
137 | | - 'messages' => array( |
| 137 | + 'messages' => array( |
138 | 138 | 'linktest', |
139 | 139 | 'pluraltest', |
140 | 140 | 'magictest', |
— | — | @@ -276,10 +276,10 @@ |
277 | 277 | ), |
278 | 278 | ), |
279 | 279 | ); |
280 | | - |
| 280 | + |
281 | 281 | /* |
282 | 282 | * ResourceLoaderRegisterModules hook |
283 | | - * |
| 283 | + * |
284 | 284 | * Adds modules to ResourceLoader |
285 | 285 | */ |
286 | 286 | public static function resourceLoaderRegisterModules( &$resourceLoader ) { |
— | — | @@ -287,7 +287,7 @@ |
288 | 288 | if ( $wgUploadWizardDisableResourceLoader ) { |
289 | 289 | return true; |
290 | 290 | } |
291 | | - |
| 291 | + |
292 | 292 | $localpath = dirname( __FILE__ ); |
293 | 293 | $remotepath = "$wgExtensionAssetsPath/UploadWizard"; |
294 | 294 | foreach ( self::$modules as $name => $resources ) { |
Index: trunk/extensions/UploadWizard/UploadWizardTutorial.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * Class to encapsulate all the html generation associated with the UploadWizard tutorial. |
| 5 | + * Class to encapsulate all the html generation associated with the UploadWizard tutorial. |
6 | 6 | * Might be a start for a subclass of UploadWizard, if we ever free it of its WMF-oriented features |
7 | 7 | * So that non-WMF'ers can use it |
8 | 8 | */ |
— | — | @@ -23,8 +23,8 @@ |
24 | 24 | const IMAGEMAP_ID = 'tutorialMap'; |
25 | 25 | |
26 | 26 | /** |
27 | | - * Fetches appropriate HTML for the tutorial portion of the wizard. |
28 | | - * Looks up an image on the current wiki. This will work as is on Commons, and will also work |
| 27 | + * Fetches appropriate HTML for the tutorial portion of the wizard. |
| 28 | + * Looks up an image on the current wiki. This will work as is on Commons, and will also work |
29 | 29 | * on test wikis that enable instantCommons. |
30 | 30 | * @param {String} $langCode language code as used by MediaWiki, similar but not identical to ISO 639-1. |
31 | 31 | * @return {String} html that will display the tutorial. |
— | — | @@ -37,10 +37,10 @@ |
38 | 38 | $tutorialHtml = ''; |
39 | 39 | |
40 | 40 | $langCode = $wgLang->getCode(); |
41 | | - |
| 41 | + |
42 | 42 | $tutorialFile = false; |
43 | | - // getFile returns false if it can't find the right file |
44 | | - if ( ! $tutorialFile = self::getFile( $langCode ) ) { |
| 43 | + // getFile returns false if it can't find the right file |
| 44 | + if ( ! $tutorialFile = self::getFile( $langCode ) ) { |
45 | 45 | $error = 'localized-file-missing'; |
46 | 46 | if ( $langCode !== 'en' ) { |
47 | 47 | $tutorialFile = self::getFile( 'en' ); |
— | — | @@ -54,8 +54,8 @@ |
55 | 55 | |
56 | 56 | if ( $tutorialFile ) { |
57 | 57 | // XXX TODO if the client can handle SVG, we could also just send it the unscaled thumb, client-scaled into a DIV or something. |
58 | | - // if ( client can handle SVG ) { |
59 | | - // $tutorialThumbnailImage->getUnscaledThumb(); |
| 58 | + // if ( client can handle SVG ) { |
| 59 | + // $tutorialThumbnailImage->getUnscaledThumb(); |
60 | 60 | // } |
61 | 61 | // put it into a div of appropriate dimensions. |
62 | 62 | |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | $error = 'cannot-transform'; |
68 | 68 | } |
69 | 69 | } else { |
70 | | - $error = 'file-missing'; |
| 70 | + $error = 'file-missing'; |
71 | 71 | } |
72 | 72 | |
73 | 73 | if ( $error !== null ) { |
— | — | @@ -74,17 +74,17 @@ |
75 | 75 | } |
76 | 76 | |
77 | 77 | return $errorHtml . $tutorialHtml; |
78 | | - |
79 | | - } |
80 | 78 | |
| 79 | + } |
| 80 | + |
81 | 81 | /** |
82 | 82 | * Get tutorial file for a particular language, or false if not available. |
83 | 83 | * @param {String} $langCode: language Code |
84 | | - * @return {File|false} |
| 84 | + * @return {File|false} |
85 | 85 | */ |
86 | 86 | public static function getFile( $langCode ) { |
87 | 87 | $tutorialName = str_replace( '$1', $langCode, self::NAME_TEMPLATE ); |
88 | | - $tutorialTitle = Title::newFromText( $tutorialName, NS_FILE ); |
| 88 | + $tutorialTitle = Title::newFromText( $tutorialName, NS_FILE ); |
89 | 89 | return wfFindFile( $tutorialTitle ); |
90 | 90 | } |
91 | 91 | |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | */ |
97 | 97 | public static function getImageHtml( $thumb ) { |
98 | 98 | // here we use the not-yet-forgotten HTML imagemap to add a clickable area to the tutorial image. |
99 | | - // we could do more special effects with hovers and images and such, not to mention SVG scripting, |
| 99 | + // we could do more special effects with hovers and images and such, not to mention SVG scripting, |
100 | 100 | // but we aren't sure what we want yet... |
101 | 101 | $img = Html::element( 'img', array( |
102 | 102 | 'src' => $thumb->getUrl(), |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | 'usemap' => '#' . self::IMAGEMAP_ID |
106 | 106 | ) ); |
107 | 107 | $areaAltText = wfMsg( 'mwe-upwiz-help-desk' ); |
108 | | - $area = Html::element( 'area', array( |
| 108 | + $area = Html::element( 'area', array( |
109 | 109 | 'shape' => 'rect', |
110 | 110 | 'coords' => self::HELPDESK_BUTTON_COORDS, |
111 | 111 | 'href' => self::HELPDESK_URL, |
Index: trunk/extensions/UploadWizard/generateMinifiedResources.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | parent::__construct(); |
15 | 15 | $this->mDescription = 'Generate combined and minified JS and CSS for UploadWizard'; |
16 | 16 | } |
17 | | - |
| 17 | + |
18 | 18 | public function execute() { |
19 | 19 | $dependencyLoader = new UploadWizardDependencyLoader(); |
20 | 20 | $dependencyLoader->writeOptimizedFiles(); |
Index: trunk/extensions/UploadWizard/UploadWizardDependencyLoader.php |
— | — | @@ -4,14 +4,14 @@ |
5 | 5 | * What's that you say? ANOTHER way to load dependencies? Everyone's doing it. |
6 | 6 | * |
7 | 7 | * Doing resource loading the old-fashioned way for now until Resource Loader or something becomes the standard. |
8 | | - * We anticipate that Resource Loader will be available sometime in late 2010 or early 2011, |
| 8 | + * We anticipate that Resource Loader will be available sometime in late 2010 or early 2011, |
9 | 9 | * so we define scripts in the hooks that Resource Loader will expect, over in UploadWizardHooks.php. |
10 | 10 | * |
11 | 11 | * Since the resources are defined in PHP, it was convenient to write the minifier routines here too. |
12 | | - * We do not expect to minify on the fly in MediaWiki; those rotutines will be called by |
| 12 | + * We do not expect to minify on the fly in MediaWiki; those rotutines will be called by |
13 | 13 | * developer scripts to write minified files before committing to the source code repository. |
14 | 14 | * |
15 | | - * (Previously the usability projects had used Makefiles, but then had to keep dependencies in sync in |
| 15 | + * (Previously the usability projects had used Makefiles, but then had to keep dependencies in sync in |
16 | 16 | * PHP and the Makefile). I started to write a PHP file that then would write a Makefile and realized |
17 | 17 | * this was getting a bit insane. |
18 | 18 | * |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | const SCRIPTS_COMBINED = 'combined.js'; |
26 | 26 | const STYLES_MINIFIED = 'combined.min.css'; |
27 | 27 | const SCRIPTS_MINIFIED = 'combined.min.js'; |
28 | | - |
| 28 | + |
29 | 29 | protected $scripts; |
30 | 30 | protected $inlineScripts; |
31 | 31 | protected $styles; |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | $dirStyleCombinedUrls = array(); |
114 | 114 | $dirStyleMinifiedUrls = array(); |
115 | 115 | $dirStylesMap = array(); |
116 | | - foreach( $this->styles as $style ) { |
| 116 | + foreach ( $this->styles as $style ) { |
117 | 117 | $dir = dirname( $style ); |
118 | 118 | if ( !isset( $dirStylesMap[$dir] ) ) { |
119 | 119 | $dirStylesMap[$dir] = array(); |
— | — | @@ -132,14 +132,14 @@ |
133 | 133 | $this->writeStyleImporter( $dirStyleMinifiedUrls, $resourceDir . '/' . self::STYLES_MINIFIED ); |
134 | 134 | |
135 | 135 | // scripts are easy, they don't (or shouldn't) refer to other resources with relative paths |
136 | | - $scriptsCombinedFile = $resourceDir . '/'. self::SCRIPTS_COMBINED; |
| 136 | + $scriptsCombinedFile = $resourceDir . '/' . self::SCRIPTS_COMBINED; |
137 | 137 | $this->concatenateFiles( $this->scripts, $scriptsCombinedFile ); |
138 | 138 | $this->writeMinifiedJs( $scriptsCombinedFile, $resourceDir . '/' . self::SCRIPTS_MINIFIED ); |
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
142 | | - * Since I couldn't figure out how to solve the CSS minification issue and how |
143 | | - * it broke relative paths for images, we'll minify one file per directory. |
| 142 | + * Since I couldn't figure out how to solve the CSS minification issue and how |
| 143 | + * it broke relative paths for images, we'll minify one file per directory. |
144 | 144 | * This means we'll need a "master" file to import them all. We can use CSS @import, |
145 | 145 | * It's supported by browsers later than NS 4.0 or IE 4.0. |
146 | 146 | * @param {Array} $urls : list of urls |
— | — | @@ -148,27 +148,27 @@ |
149 | 149 | function writeStyleImporter( $urls, $outputFile ) { |
150 | 150 | $fp = fopen( $outputFile, 'w' ); |
151 | 151 | if ( ! $fp ) { |
152 | | - print "couldn't open $outputFile for writing\n"; |
| 152 | + print "couldn't open $outputFile for writing\n"; |
153 | 153 | exit; |
154 | 154 | } |
155 | | - foreach ( $urls as $url ) { |
| 155 | + foreach ( $urls as $url ) { |
156 | 156 | fwrite( $fp, "@import \"$url\";\n" ); |
157 | 157 | } |
158 | 158 | fclose( $fp ); |
159 | 159 | } |
160 | | - |
| 160 | + |
161 | 161 | /** |
162 | 162 | * Concatenates several files on the filesystem into one. |
163 | | - * @param {Array} filenames |
164 | | - * @param {String} filename to concatenate all files into. Will replace existing contents |
| 163 | + * @param {Array} filenames |
| 164 | + * @param {String} filename to concatenate all files into. Will replace existing contents |
165 | 165 | */ |
166 | | - private function concatenateFiles( $files, $outputFile ) { |
| 166 | + private function concatenateFiles( $files, $outputFile ) { |
167 | 167 | $fp = fopen( $outputFile, 'w' ); |
168 | 168 | if ( ! $fp ) { |
169 | | - print "couldn't open $outputFile for writing"; |
| 169 | + print "couldn't open $outputFile for writing"; |
170 | 170 | exit; |
171 | 171 | } |
172 | | - foreach ( $files as $file ) { |
| 172 | + foreach ( $files as $file ) { |
173 | 173 | fwrite( $fp, file_get_contents( $file ) ); |
174 | 174 | } |
175 | 175 | fclose( $fp ); |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | private function writeMinifiedJs( $inputFile, $outputFile ) { |
184 | 184 | $fp = fopen( $outputFile, 'w' ); |
185 | 185 | if ( ! $fp ) { |
186 | | - print "couldn't open $outputFile for writing"; |
| 186 | + print "couldn't open $outputFile for writing"; |
187 | 187 | exit; |
188 | 188 | } |
189 | 189 | fwrite( $fp, JSMin::minify( file_get_contents( $inputFile ) ) ); |
— | — | @@ -207,15 +207,15 @@ |
208 | 208 | |
209 | 209 | // remove whitespace immediately before an open-curly |
210 | 210 | $contents = preg_replace( '/\s*\{/', '{', $contents ); |
211 | | - |
| 211 | + |
212 | 212 | // remove /* ... */ comments, potentially on multiple lines |
213 | | - // CAUTION: gets edge cases wrong, like nested or quoted comments. |
| 213 | + // CAUTION: gets edge cases wrong, like nested or quoted comments. |
214 | 214 | // Not for use with nuclear reactors. |
215 | 215 | $contents = preg_replace( '/\/\*.*?\*\//s', '', $contents ); |
216 | 216 | |
217 | 217 | $fp = fopen( $outputFile, 'w' ); |
218 | 218 | if ( ! $fp ) { |
219 | | - print "couldn't open $outputFile for writing"; |
| 219 | + print "couldn't open $outputFile for writing"; |
220 | 220 | exit; |
221 | 221 | } |
222 | 222 | fwrite( $fp, $contents ); |
Index: trunk/extensions/UploadWizard/UploadWizardMessages.php |
— | — | @@ -1,9 +1,9 @@ |
2 | 2 | <?php |
3 | | -/** |
| 3 | +/** |
4 | 4 | * UploadWizardMessages |
5 | 5 | * |
6 | 6 | * Simple class to take messages from a modules' i18n.php and dump them into Javascript. |
7 | | - * |
| 7 | + * |
8 | 8 | * @file |
9 | 9 | * @ingroup Upload |
10 | 10 | */ |
— | — | @@ -28,14 +28,14 @@ |
29 | 29 | // Empty out messages in the current scope |
30 | 30 | $messages = array(); |
31 | 31 | require( $wgExtensionMessagesFiles[ $moduleName ] ); |
32 | | - |
| 32 | + |
33 | 33 | // iterate over the default messages, and get this wiki's current messages |
34 | | - // presumably this will include local overrides in MediaWiki: space |
| 34 | + // presumably this will include local overrides in MediaWiki: space |
35 | 35 | $messagesForJs = array(); |
36 | | - |
| 36 | + |
37 | 37 | // 'en' is the default language, so it will be the most complete |
38 | 38 | foreach ( array_keys( $messages['en'] ) as $key ) { |
39 | | - $messagesForJs[ $key ] = wfMsgGetKey( $key, /*DB*/true, $language, /*Transform*/false ); |
| 39 | + $messagesForJs[ $key ] = wfMsgGetKey( $key, /*DB*/true, $language, /*Transform*/false ); |
40 | 40 | } |
41 | 41 | |
42 | 42 | $messagesJson = FormatJson::encode( $messagesForJs ); |
— | — | @@ -46,14 +46,14 @@ |
47 | 47 | static function getNormalizedLangCode( $langCode ) { |
48 | 48 | global $wgLang; |
49 | 49 | // Check the langCode |
50 | | - if( !$langCode) { |
| 50 | + if ( !$langCode ) { |
51 | 51 | if ( $wgLang ) { |
52 | 52 | $langCode = $wgLang->getCode(); |
53 | 53 | } else { |
54 | 54 | $langCode = 'en'; // desperation |
55 | 55 | } |
56 | | - } |
57 | | - |
| 56 | + } |
| 57 | + |
58 | 58 | } |
59 | 59 | |
60 | 60 | } |
Index: trunk/extensions/UploadWizard/UploadWizard.php |
— | — | @@ -30,21 +30,21 @@ |
31 | 31 | |
32 | 32 | |
33 | 33 | |
34 | | -$dir = dirname(__FILE__); |
| 34 | +$dir = dirname( __FILE__ ); |
35 | 35 | |
36 | 36 | $wgExtensionMessagesFiles['UploadWizard'] = $dir . '/UploadWizard.i18n.php'; |
37 | 37 | $wgExtensionAliasesFiles['UploadWizard'] = $dir . '/UploadWizard.alias.php'; |
38 | 38 | |
39 | 39 | # Require modules, includeing the special page |
40 | | -foreach ( array( 'SpecialUploadWizard', |
41 | | - 'UploadWizardMessages', |
| 40 | +foreach ( array( 'SpecialUploadWizard', |
| 41 | + 'UploadWizardMessages', |
42 | 42 | 'UploadWizardHooks', |
43 | 43 | 'UploadWizardTutorial', |
44 | 44 | 'UploadWizardDependencyLoader' ) as $module ) { |
45 | 45 | $wgAutoloadLocalClasses[$module] = $dir . "/" . $module . ".php"; |
46 | 46 | } |
47 | | - |
48 | 47 | |
| 48 | + |
49 | 49 | # Let the special page be a special center of unique specialness |
50 | 50 | $wgSpecialPages['UploadWizard'] = 'SpecialUploadWizard'; |
51 | 51 | $wgSpecialPageGroups['UploadWizard'] = 'media'; |
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | |
17 | 17 | // $request is the request (usually wgRequest) |
18 | 18 | // $par is everything in the URL after Special:UploadWizard. Not sure what we can use it for |
19 | | - public function __construct( $request=null, $par=null ) { |
| 19 | + public function __construct( $request = null, $par = null ) { |
20 | 20 | global $wgRequest; |
21 | 21 | // here we would configure ourselves based on stuff in $request and $wgRequest, but so far, we |
22 | 22 | // don't have such things |
— | — | @@ -26,21 +26,21 @@ |
27 | 27 | // at some point, if we completely subsume its functionality, change that to point here again, |
28 | 28 | // but then we'll need to process non-JS uploads in the same way Special:Upload does. |
29 | 29 | $this->simpleForm = new UploadWizardSimpleForm(); |
30 | | - $this->simpleForm->setTitle( |
| 30 | + $this->simpleForm->setTitle( |
31 | 31 | SpecialPage::getTitleFor( 'Upload' ) |
32 | 32 | ); |
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Replaces default execute method |
37 | | - * Checks whether uploading enabled, user permissions okay, |
38 | | - * @param $subPage, e.g. the "foo" in Special:UploadWizard/foo. |
| 37 | + * Checks whether uploading enabled, user permissions okay, |
| 38 | + * @param $subPage, e.g. the "foo" in Special:UploadWizard/foo. |
39 | 39 | */ |
40 | 40 | public function execute( $subPage ) { |
41 | 41 | global $wgLang, $wgUser, $wgOut, $wgExtensionAssetsPath, |
42 | 42 | $wgUploadWizardDebug, $wgUploadWizardDisableResourceLoader; |
43 | 43 | |
44 | | - // side effects: if we can't upload, will print error page to wgOut |
| 44 | + // side effects: if we can't upload, will print error page to wgOut |
45 | 45 | // and return false |
46 | 46 | if ( !( $this->isUploadAllowed() && $this->isUserUploadAllowed( $wgUser ) ) ) { |
47 | 47 | return; |
— | — | @@ -56,10 +56,10 @@ |
57 | 57 | $wgOut->addHTML( '</noscript>' ); |
58 | 58 | |
59 | 59 | |
60 | | - // global javascript variables |
| 60 | + // global javascript variables |
61 | 61 | $this->addJsVars( $subPage ); |
62 | | - |
63 | | - // dependencies (css, js) |
| 62 | + |
| 63 | + // dependencies (css, js) |
64 | 64 | if ( !$wgUploadWizardDisableResourceLoader && class_exists( 'ResourceLoader' ) ) { |
65 | 65 | $wgOut->addModules( 'ext.uploadWizard' ); |
66 | 66 | } else { |
— | — | @@ -73,11 +73,11 @@ |
74 | 74 | $dependencyLoader->outputHtml( $wgOut, $basepath ); |
75 | 75 | } |
76 | 76 | } |
77 | | - |
| 77 | + |
78 | 78 | // where the uploadwizard will go |
79 | 79 | // TODO import more from UploadWizard's createInterface call. |
80 | 80 | $wgOut->addHTML( self::getWizardHtml() ); |
81 | | - |
| 81 | + |
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | global $wgOut, $wgEnableAPI; |
121 | 121 | |
122 | 122 | // Check uploading enabled |
123 | | - if( !UploadBase::isEnabled() ) { |
| 123 | + if ( !UploadBase::isEnabled() ) { |
124 | 124 | $wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext' ); |
125 | 125 | return false; |
126 | 126 | } |
— | — | @@ -127,17 +127,17 @@ |
128 | 128 | // XXX does wgEnableAPI affect all uploads too? |
129 | 129 | |
130 | 130 | // Check whether we actually want to allow changing stuff |
131 | | - if( wfReadOnly() ) { |
| 131 | + if ( wfReadOnly() ) { |
132 | 132 | $wgOut->readOnlyPage(); |
133 | 133 | return false; |
134 | | - } |
| 134 | + } |
135 | 135 | |
136 | 136 | // we got all the way here, so it must be okay to upload |
137 | 137 | return true; |
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
141 | | - * Check if the user can upload |
| 141 | + * Check if the user can upload |
142 | 142 | * Side effect: will print error page to wgOut if cannot upload. |
143 | 143 | * @param User |
144 | 144 | * @return boolean -- true if can upload |
— | — | @@ -145,8 +145,8 @@ |
146 | 146 | private function isUserUploadAllowed( $user ) { |
147 | 147 | global $wgOut, $wgGroupPermissions; |
148 | 148 | |
149 | | - if( !$user->isAllowed( 'upload' ) ) { |
150 | | - if( !$user->isLoggedIn() && ( $wgGroupPermissions['user']['upload'] |
| 149 | + if ( !$user->isAllowed( 'upload' ) ) { |
| 150 | + if ( !$user->isLoggedIn() && ( $wgGroupPermissions['user']['upload'] |
151 | 151 | || $wgGroupPermissions['autoconfirmed']['upload'] ) ) { |
152 | 152 | // Custom message if logged-in users without any special rights can upload |
153 | 153 | $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' ); |
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | } |
159 | 159 | |
160 | 160 | // Check blocks |
161 | | - if( $user->isBlocked() ) { |
| 161 | + if ( $user->isBlocked() ) { |
162 | 162 | $wgOut->blockedPage(); |
163 | 163 | return false; |
164 | 164 | } |
— | — | @@ -167,7 +167,7 @@ |
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
171 | | - * Return the basic HTML structure for the entire page |
| 171 | + * Return the basic HTML structure for the entire page |
172 | 172 | * Will be enhanced by the javascript to actually do stuff |
173 | 173 | * @return {String} html |
174 | 174 | */ |
— | — | @@ -178,23 +178,23 @@ |
179 | 179 | |
180 | 180 | // the arrow steps |
181 | 181 | . '<ul id="mwe-upwiz-steps">' |
182 | | - . '<li id="mwe-upwiz-step-tutorial"><div>' . wfMsg('mwe-upwiz-step-tutorial') . '</div></li>' |
183 | | - . '<li id="mwe-upwiz-step-file"><div>' . wfMsg('mwe-upwiz-step-file') . '</div></li>' |
184 | | - . '<li id="mwe-upwiz-step-deeds"><div>' . wfMsg('mwe-upwiz-step-deeds') . '</div></li>' |
185 | | - . '<li id="mwe-upwiz-step-details"><div>' . wfMsg('mwe-upwiz-step-details') . '</div></li>' |
186 | | - . '<li id="mwe-upwiz-step-thanks"><div>' . wfMsg('mwe-upwiz-step-thanks') . '</div></li>' |
| 182 | + . '<li id="mwe-upwiz-step-tutorial"><div>' . wfMsg( 'mwe-upwiz-step-tutorial' ) . '</div></li>' |
| 183 | + . '<li id="mwe-upwiz-step-file"><div>' . wfMsg( 'mwe-upwiz-step-file' ) . '</div></li>' |
| 184 | + . '<li id="mwe-upwiz-step-deeds"><div>' . wfMsg( 'mwe-upwiz-step-deeds' ) . '</div></li>' |
| 185 | + . '<li id="mwe-upwiz-step-details"><div>' . wfMsg( 'mwe-upwiz-step-details' ) . '</div></li>' |
| 186 | + . '<li id="mwe-upwiz-step-thanks"><div>' . wfMsg( 'mwe-upwiz-step-thanks' ) . '</div></li>' |
187 | 187 | . '</ul>' |
188 | 188 | |
189 | 189 | // the individual steps, all at once |
190 | 190 | . '<div id="mwe-upwiz-content">' |
191 | 191 | |
192 | 192 | . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-tutorial">' |
193 | | - . '<div id="mwe-upwiz-tutorial">' |
| 193 | + . '<div id="mwe-upwiz-tutorial">' |
194 | 194 | . UploadWizardTutorial::getHtml() |
195 | 195 | . '</div>' |
196 | 196 | . '<div class="mwe-upwiz-buttons">' |
197 | 197 | . '<button class="mwe-upwiz-button-next">' . wfMsg( "mwe-upwiz-next" ) . '</button>' |
198 | | - . '</div>' |
| 198 | + . '</div>' |
199 | 199 | . '</div>' |
200 | 200 | |
201 | 201 | . '<div class="mwe-upwiz-stepdiv ui-helper-clearfix" id="mwe-upwiz-stepdiv-file">' |
— | — | @@ -202,7 +202,7 @@ |
203 | 203 | . '<div id="mwe-upwiz-filelist" class="ui-corner-all"></div>' |
204 | 204 | . '<div id="mwe-upwiz-upload-ctrls" class="mwe-upwiz-file ui-helper-clearfix">' |
205 | 205 | . '<div id="mwe-upwiz-add-file-container" class="mwe-upwiz-add-files-0">' |
206 | | - . '<button id="mwe-upwiz-add-file">' . wfMsg("mwe-upwiz-add-file-0") . '</button>' |
| 206 | + . '<button id="mwe-upwiz-add-file">' . wfMsg( "mwe-upwiz-add-file-0" ) . '</button>' |
207 | 207 | . '</div>' |
208 | 208 | . '<div id="mwe-upwiz-upload-ctrl-container">' |
209 | 209 | . '<button id="mwe-upwiz-upload-ctrl">' . wfMsg( "mwe-upwiz-upload" ) . '</button>' |
— | — | @@ -212,17 +212,17 @@ |
213 | 213 | . '<div id="mwe-upwiz-continue" class="ui-helper-clearfix"></div>' |
214 | 214 | . '</div>' |
215 | 215 | . '<div class="mwe-upwiz-buttons">' |
216 | | - . '<div class="mwe-upwiz-file-next-all-ok mwe-upwiz-file-endchoice">' |
217 | | - . wfMsg( "mwe-upwiz-file-all-ok" ) |
| 216 | + . '<div class="mwe-upwiz-file-next-all-ok mwe-upwiz-file-endchoice">' |
| 217 | + . wfMsg( "mwe-upwiz-file-all-ok" ) |
218 | 218 | . '<button class="mwe-upwiz-button-next">' . wfMsg( "mwe-upwiz-next-file" ) . '</button>' |
219 | 219 | . '</div>' |
220 | | - . '<div class="mwe-upwiz-file-next-some-failed mwe-upwiz-file-endchoice">' |
221 | | - . wfMsg( "mwe-upwiz-file-some-failed" ) |
| 220 | + . '<div class="mwe-upwiz-file-next-some-failed mwe-upwiz-file-endchoice">' |
| 221 | + . wfMsg( "mwe-upwiz-file-some-failed" ) |
222 | 222 | . '<button class="mwe-upwiz-button-retry">' . wfMsg( "mwe-upwiz-file-retry" ) . '</button>' |
223 | 223 | . '<button class="mwe-upwiz-button-next">' . wfMsg( "mwe-upwiz-next-file-despite-failures" ) . '</button>' |
224 | 224 | . '</div>' |
225 | | - . '<div class="mwe-upwiz-file-next-all-failed mwe-upwiz-file-endchoice">' |
226 | | - . wfMsg( "mwe-upwiz-file-all-failed" ) |
| 225 | + . '<div class="mwe-upwiz-file-next-all-failed mwe-upwiz-file-endchoice">' |
| 226 | + . wfMsg( "mwe-upwiz-file-all-failed" ) |
227 | 227 | . '<button class="mwe-upwiz-button-retry"> ' . wfMsg( "mwe-upwiz-file-retry" ) . '</button>' |
228 | 228 | . '</div>' |
229 | 229 | . '</div>' |
— | — | @@ -241,8 +241,8 @@ |
242 | 242 | . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-details">' |
243 | 243 | . '<div id="mwe-upwiz-macro">' |
244 | 244 | . '<div id="mwe-upwiz-macro-progress" class="ui-helper-clearfix"></div>' |
245 | | - . '<div id="mwe-upwiz-macro-choice">' |
246 | | - . '<div>' . wfMsg( 'mwe-upwiz-details-intro' ) . '</div>' |
| 245 | + . '<div id="mwe-upwiz-macro-choice">' |
| 246 | + . '<div>' . wfMsg( 'mwe-upwiz-details-intro' ) . '</div>' |
247 | 247 | . '</div>' |
248 | 248 | . '<div id="mwe-upwiz-macro-files"></div>' |
249 | 249 | . '</div>' |
— | — | @@ -265,7 +265,7 @@ |
266 | 266 | |
267 | 267 | . '</div>'; |
268 | 268 | } |
269 | | - |
| 269 | + |
270 | 270 | } |
271 | 271 | |
272 | 272 | |