Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | var $mInterwikiMagic; # Interlanguage links are removed and returned in an array |
19 | 19 | var $mAllowExternalImages; # Allow external images inline |
20 | 20 | var $mAllowExternalImagesFrom; # If not, any exception? |
21 | | - var $mEnableImageWhitelist; # If not or it doesn't match, should we check an on-wiki whitelist? |
| 21 | + var $mEnableImageWhitelist; # If not or it doesn't match, should we check an on-wiki whitelist? |
22 | 22 | var $mDateFormat = null; # Date format index |
23 | 23 | var $mEditSection = true; # Create "edit section" links |
24 | 24 | var $mAllowSpecialInclusion; # Allow inclusion of special pages |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | function getAllowExternalImagesFrom() { return $this->mAllowExternalImagesFrom; } |
63 | 63 | function getEnableImageWhitelist() { return $this->mEnableImageWhitelist; } |
64 | 64 | function getEditSection() { return $this->mEditSection; } |
65 | | - function getNumberHeadings() { $this->optionUsed('numberheadings'); |
| 65 | + function getNumberHeadings() { $this->optionUsed( 'numberheadings' ); |
66 | 66 | return $this->mNumberHeadings; } |
67 | 67 | function getAllowSpecialInclusion() { return $this->mAllowSpecialInclusion; } |
68 | 68 | function getTidy() { return $this->mTidy; } |
— | — | @@ -76,32 +76,32 @@ |
77 | 77 | function getEnableLimitReport() { return $this->mEnableLimitReport; } |
78 | 78 | function getCleanSignatures() { return $this->mCleanSignatures; } |
79 | 79 | function getExternalLinkTarget() { return $this->mExternalLinkTarget; } |
80 | | - function getMath() { $this->optionUsed('math'); |
| 80 | + function getMath() { $this->optionUsed( 'math' ); |
81 | 81 | return $this->mMath; } |
82 | | - function getThumbSize() { $this->optionUsed('thumbsize'); |
| 82 | + function getThumbSize() { $this->optionUsed( 'thumbsize' ); |
83 | 83 | return $this->mThumbSize; } |
84 | | - function getStubThreshold() { $this->optionUsed('stubthreshold'); |
| 84 | + function getStubThreshold() { $this->optionUsed( 'stubthreshold' ); |
85 | 85 | return $this->mStubThreshold; } |
86 | 86 | |
87 | 87 | function getIsPreview() { return $this->mIsPreview; } |
88 | 88 | function getIsSectionPreview() { return $this->mIsSectionPreview; } |
89 | | - function getIsPrintable() { $this->optionUsed('printable'); |
| 89 | + function getIsPrintable() { $this->optionUsed( 'printable' ); |
90 | 90 | return $this->mIsPrintable; } |
91 | 91 | function getUser() { return $this->mUser; } |
92 | 92 | function getPreSaveTransform() { return $this->mPreSaveTransform; } |
93 | 93 | |
94 | | - /** |
95 | | - * @param $title Title |
96 | | - * @return Skin |
| 94 | + /** |
| 95 | + * @param $title Title |
| 96 | + * @return Skin |
97 | 97 | * @deprecated since 1.18 Use Linker::* instead |
98 | | - */ |
99 | | - function getSkin( $title = null ) { |
| 98 | + */ |
| 99 | + function getSkin( $title = null ) { |
100 | 100 | wfDeprecated( __METHOD__ ); |
101 | 101 | return new DummyLinker; |
102 | 102 | } |
103 | 103 | |
104 | 104 | function getDateFormat() { |
105 | | - $this->optionUsed('dateformat'); |
| 105 | + $this->optionUsed( 'dateformat' ); |
106 | 106 | if ( !isset( $this->mDateFormat ) ) { |
107 | 107 | $this->mDateFormat = $this->mUser->getDatePreference(); |
108 | 108 | } |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | * @since 1.17 |
125 | 125 | */ |
126 | 126 | function getUserLang() { |
127 | | - $this->optionUsed('userlang'); |
| 127 | + $this->optionUsed( 'userlang' ); |
128 | 128 | return $this->mUserLang; |
129 | 129 | } |
130 | 130 | |
— | — | @@ -136,9 +136,9 @@ |
137 | 137 | function setEditSection( $x ) { return wfSetVar( $this->mEditSection, $x ); } |
138 | 138 | function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); } |
139 | 139 | function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); } |
140 | | - function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); } |
| 140 | + function setTidy( $x ) { return wfSetVar( $this->mTidy, $x ); } |
141 | 141 | function setSkin( $x ) { $this->mSkin = $x; } |
142 | | - function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x); } |
| 142 | + function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x ); } |
143 | 143 | function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x, true ); } |
144 | 144 | function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); } |
145 | 145 | function setMaxPPNodeCount( $x ) { return wfSetVar( $this->mMaxPPNodeCount, $x ); } |
— | — | @@ -281,37 +281,43 @@ |
282 | 282 | |
283 | 283 | $confstr = ''; |
284 | 284 | |
285 | | - if ( in_array( 'math', $forOptions ) ) |
| 285 | + if ( in_array( 'math', $forOptions ) ) { |
286 | 286 | $confstr .= $this->mMath; |
287 | | - else |
| 287 | + } else { |
288 | 288 | $confstr .= '*'; |
| 289 | + } |
289 | 290 | |
290 | 291 | |
291 | 292 | // Space assigned for the stubthreshold but unused |
292 | 293 | // since it disables the parser cache, its value will always |
293 | 294 | // be 0 when this function is called by parsercache. |
294 | | - if ( in_array( 'stubthreshold', $forOptions ) ) |
| 295 | + if ( in_array( 'stubthreshold', $forOptions ) ) { |
295 | 296 | $confstr .= '!' . $this->mStubThreshold; |
296 | | - else |
| 297 | + } else { |
297 | 298 | $confstr .= '!*' ; |
| 299 | + } |
298 | 300 | |
299 | | - if ( in_array( 'dateformat', $forOptions ) ) |
| 301 | + if ( in_array( 'dateformat', $forOptions ) ) { |
300 | 302 | $confstr .= '!' . $this->getDateFormat(); |
| 303 | + } |
301 | 304 | |
302 | | - if ( in_array( 'numberheadings', $forOptions ) ) |
| 305 | + if ( in_array( 'numberheadings', $forOptions ) ) { |
303 | 306 | $confstr .= '!' . ( $this->mNumberHeadings ? '1' : '' ); |
304 | | - else |
| 307 | + } else { |
305 | 308 | $confstr .= '!*'; |
| 309 | + } |
306 | 310 | |
307 | | - if ( in_array( 'userlang', $forOptions ) ) |
| 311 | + if ( in_array( 'userlang', $forOptions ) ) { |
308 | 312 | $confstr .= '!' . $this->mUserLang; |
309 | | - else |
| 313 | + } else { |
310 | 314 | $confstr .= '!*'; |
| 315 | + } |
311 | 316 | |
312 | | - if ( in_array( 'thumbsize', $forOptions ) ) |
| 317 | + if ( in_array( 'thumbsize', $forOptions ) ) { |
313 | 318 | $confstr .= '!' . $this->mThumbSize; |
314 | | - else |
| 319 | + } else { |
315 | 320 | $confstr .= '!*'; |
| 321 | + } |
316 | 322 | |
317 | 323 | // add in language specific options, if any |
318 | 324 | // @todo FIXME: This is just a way of retrieving the url/user preferred variant |
— | — | @@ -324,9 +330,10 @@ |
325 | 331 | } elseif ( !$this->mEditSection ) { |
326 | 332 | $confstr .= '!edit=0'; |
327 | 333 | } |
328 | | - |
329 | | - if ( $this->mIsPrintable && in_array( 'printable', $forOptions ) ) |
| 334 | + |
| 335 | + if ( $this->mIsPrintable && in_array( 'printable', $forOptions ) ) { |
330 | 336 | $confstr .= '!printable=1'; |
| 337 | + } |
331 | 338 | |
332 | 339 | if ( $this->mExtraKey != '' ) |
333 | 340 | $confstr .= $this->mExtraKey; |