Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -54,12 +54,18 @@ |
55 | 55 | $this->mNewSectionLink = false; |
56 | 56 | } |
57 | 57 | |
58 | | - function redirect( $url, $responsecode = '302' ) { |
| 58 | + public function redirect( $url, $responsecode = '302' ) { |
59 | 59 | # Strip newlines as a paranoia check for header injection in PHP<5.1.2 |
60 | 60 | $this->mRedirect = str_replace( "\n", '', $url ); |
61 | 61 | $this->mRedirectCode = $responsecode; |
62 | 62 | } |
63 | 63 | |
| 64 | + /** |
| 65 | + * Set the HTTP status code to send with the output. |
| 66 | + * |
| 67 | + * @param int $statusCode |
| 68 | + * @return nothing |
| 69 | + */ |
64 | 70 | function setStatusCode( $statusCode ) { $this->mStatusCode = $statusCode; } |
65 | 71 | |
66 | 72 | # To add an http-equiv meta tag, precede the name with "http:" |
— | — | @@ -88,8 +94,9 @@ |
89 | 95 | /** |
90 | 96 | * checkLastModified tells the client to use the client-cached page if |
91 | 97 | * possible. If sucessful, the OutputPage is disabled so that |
92 | | - * any future call to OutputPage->output() have no effect. The method |
93 | | - * returns true iff cache-ok headers was sent. |
| 98 | + * any future call to OutputPage->output() have no effect. |
| 99 | + * |
| 100 | + * @return bool True iff cache-ok headers was sent. |
94 | 101 | */ |
95 | 102 | function checkLastModified ( $timestamp ) { |
96 | 103 | global $wgCachePages, $wgCacheEpoch, $wgUser, $wgRequest; |
— | — | @@ -165,9 +172,9 @@ |
166 | 173 | } |
167 | 174 | } |
168 | 175 | |
169 | | - function setRobotpolicy( $str ) { $this->mRobotpolicy = $str; } |
170 | | - function setHTMLTitle( $name ) {$this->mHTMLtitle = $name; } |
171 | | - function setPageTitle( $name ) { |
| 176 | + public function setRobotpolicy( $str ) { $this->mRobotpolicy = $str; } |
| 177 | + public function setHTMLTitle( $name ) {$this->mHTMLtitle = $name; } |
| 178 | + public function setPageTitle( $name ) { |
172 | 179 | global $action, $wgContLang; |
173 | 180 | $name = $wgContLang->convert($name, true); |
174 | 181 | $this->mPagetitle = $name; |
— | — | @@ -180,50 +187,50 @@ |
181 | 188 | |
182 | 189 | $this->setHTMLTitle( wfMsg( 'pagetitle', $name ) ); |
183 | 190 | } |
184 | | - function getHTMLTitle() { return $this->mHTMLtitle; } |
185 | | - function getPageTitle() { return $this->mPagetitle; } |
186 | | - function setSubtitle( $str ) { $this->mSubtitle = /*$this->parse(*/$str/*)*/; } // @bug 2514 |
187 | | - function getSubtitle() { return $this->mSubtitle; } |
188 | | - function isArticle() { return $this->mIsarticle; } |
189 | | - function setPrintable() { $this->mPrintable = true; } |
190 | | - function isPrintable() { return $this->mPrintable; } |
191 | | - function setSyndicated( $show = true ) { $this->mShowFeedLinks = $show; } |
192 | | - function isSyndicated() { return $this->mShowFeedLinks; } |
193 | | - function setOnloadHandler( $js ) { $this->mOnloadHandler = $js; } |
194 | | - function getOnloadHandler() { return $this->mOnloadHandler; } |
195 | | - function disable() { $this->mDoNothing = true; } |
| 191 | + public function getHTMLTitle() { return $this->mHTMLtitle; } |
| 192 | + public function getPageTitle() { return $this->mPagetitle; } |
| 193 | + public function setSubtitle( $str ) { $this->mSubtitle = /*$this->parse(*/$str/*)*/; } // @bug 2514 |
| 194 | + public function getSubtitle() { return $this->mSubtitle; } |
| 195 | + public function isArticle() { return $this->mIsarticle; } |
| 196 | + public function setPrintable() { $this->mPrintable = true; } |
| 197 | + public function isPrintable() { return $this->mPrintable; } |
| 198 | + public function setSyndicated( $show = true ) { $this->mShowFeedLinks = $show; } |
| 199 | + public function isSyndicated() { return $this->mShowFeedLinks; } |
| 200 | + public function setOnloadHandler( $js ) { $this->mOnloadHandler = $js; } |
| 201 | + public function getOnloadHandler() { return $this->mOnloadHandler; } |
| 202 | + public function disable() { $this->mDoNothing = true; } |
196 | 203 | |
197 | | - function setArticleRelated( $v ) { |
| 204 | + public function setArticleRelated( $v ) { |
198 | 205 | $this->mIsArticleRelated = $v; |
199 | 206 | if ( !$v ) { |
200 | 207 | $this->mIsarticle = false; |
201 | 208 | } |
202 | 209 | } |
203 | | - function setArticleFlag( $v ) { |
| 210 | + public function setArticleFlag( $v ) { |
204 | 211 | $this->mIsarticle = $v; |
205 | 212 | if ( $v ) { |
206 | 213 | $this->mIsArticleRelated = $v; |
207 | 214 | } |
208 | 215 | } |
209 | 216 | |
210 | | - function isArticleRelated() { return $this->mIsArticleRelated; } |
| 217 | + public function isArticleRelated() { return $this->mIsArticleRelated; } |
211 | 218 | |
212 | | - function getLanguageLinks() { return $this->mLanguageLinks; } |
213 | | - function addLanguageLinks($newLinkArray) { |
| 219 | + public function getLanguageLinks() { return $this->mLanguageLinks; } |
| 220 | + public function addLanguageLinks($newLinkArray) { |
214 | 221 | $this->mLanguageLinks += $newLinkArray; |
215 | 222 | } |
216 | | - function setLanguageLinks($newLinkArray) { |
| 223 | + public function setLanguageLinks($newLinkArray) { |
217 | 224 | $this->mLanguageLinks = $newLinkArray; |
218 | 225 | } |
219 | 226 | |
220 | | - function getCategoryLinks() { |
| 227 | + public function getCategoryLinks() { |
221 | 228 | return $this->mCategoryLinks; |
222 | 229 | } |
223 | 230 | |
224 | 231 | /** |
225 | 232 | * Add an array of categories, with names in the keys |
226 | 233 | */ |
227 | | - function addCategoryLinks($categories) { |
| 234 | + public function addCategoryLinks($categories) { |
228 | 235 | global $wgUser, $wgContLang; |
229 | 236 | |
230 | 237 | if ( !is_array( $categories ) ) { |
— | — | @@ -243,25 +250,25 @@ |
244 | 251 | } |
245 | 252 | } |
246 | 253 | |
247 | | - function setCategoryLinks($categories) { |
| 254 | + public function setCategoryLinks($categories) { |
248 | 255 | $this->mCategoryLinks = array(); |
249 | 256 | $this->addCategoryLinks($categories); |
250 | 257 | } |
251 | 258 | |
252 | | - function suppressQuickbar() { $this->mSuppressQuickbar = true; } |
253 | | - function isQuickbarSuppressed() { return $this->mSuppressQuickbar; } |
| 259 | + public function suppressQuickbar() { $this->mSuppressQuickbar = true; } |
| 260 | + public function isQuickbarSuppressed() { return $this->mSuppressQuickbar; } |
254 | 261 | |
255 | | - function addHTML( $text ) { $this->mBodytext .= $text; } |
256 | | - function clearHTML() { $this->mBodytext = ''; } |
257 | | - function getHTML() { return $this->mBodytext; } |
258 | | - function debug( $text ) { $this->mDebugtext .= $text; } |
| 262 | + public function addHTML( $text ) { $this->mBodytext .= $text; } |
| 263 | + public function clearHTML() { $this->mBodytext = ''; } |
| 264 | + public function getHTML() { return $this->mBodytext; } |
| 265 | + public function debug( $text ) { $this->mDebugtext .= $text; } |
259 | 266 | |
260 | 267 | /* @deprecated */ |
261 | | - function setParserOptions( $options ) { |
| 268 | + public function setParserOptions( $options ) { |
262 | 269 | return $this->parserOptions( $options ); |
263 | 270 | } |
264 | 271 | |
265 | | - function parserOptions( $options = null ) { |
| 272 | + public function parserOptions( $options = null ) { |
266 | 273 | if ( !$this->mParserOptions ) { |
267 | 274 | $this->mParserOptions = new ParserOptions; |
268 | 275 | } |
— | — | @@ -274,7 +281,7 @@ |
275 | 282 | * @param mixed $revid an integer, or NULL |
276 | 283 | * @return mixed previous value |
277 | 284 | */ |
278 | | - function setRevisionId( $revid ) { |
| 285 | + public function setRevisionId( $revid ) { |
279 | 286 | $val = is_null( $revid ) ? null : intval( $revid ); |
280 | 287 | return wfSetVar( $this->mRevisionId, $val ); |
281 | 288 | } |
— | — | @@ -283,17 +290,20 @@ |
284 | 291 | * Convert wikitext to HTML and add it to the buffer |
285 | 292 | * Default assumes that the current page title will |
286 | 293 | * be used. |
| 294 | + * |
| 295 | + * @param string $text |
| 296 | + * @param bool $linestart |
287 | 297 | */ |
288 | | - function addWikiText( $text, $linestart = true ) { |
| 298 | + public function addWikiText( $text, $linestart = true ) { |
289 | 299 | global $wgTitle; |
290 | 300 | $this->addWikiTextTitle($text, $wgTitle, $linestart); |
291 | 301 | } |
292 | 302 | |
293 | | - function addWikiTextWithTitle($text, &$title, $linestart = true) { |
| 303 | + public function addWikiTextWithTitle($text, &$title, $linestart = true) { |
294 | 304 | $this->addWikiTextTitle($text, $title, $linestart); |
295 | 305 | } |
296 | 306 | |
297 | | - function addWikiTextTitle($text, &$title, $linestart) { |
| 307 | + private function addWikiTextTitle($text, &$title, $linestart) { |
298 | 308 | global $wgParser; |
299 | 309 | $fname = 'OutputPage:addWikiTextTitle'; |
300 | 310 | wfProfileIn($fname); |
— | — | @@ -304,7 +314,11 @@ |
305 | 315 | wfProfileOut($fname); |
306 | 316 | } |
307 | 317 | |
308 | | - function addParserOutputNoText( &$parserOutput ) { |
| 318 | + /** |
| 319 | + * @todo document |
| 320 | + * @param ParserOutput object &$parserOutput |
| 321 | + */ |
| 322 | + public function addParserOutputNoText( &$parserOutput ) { |
309 | 323 | $this->mLanguageLinks += $parserOutput->getLanguageLinks(); |
310 | 324 | $this->addCategoryLinks( $parserOutput->getCategories() ); |
311 | 325 | $this->mNewSectionLink = $parserOutput->getNewSection(); |
— | — | @@ -322,6 +336,10 @@ |
323 | 337 | wfRunHooks( 'OutputPageParserOutput', array( &$this, $parserOutput ) ); |
324 | 338 | } |
325 | 339 | |
| 340 | + /** |
| 341 | + * @todo document |
| 342 | + * @param ParserOutput &$parserOutput |
| 343 | + */ |
326 | 344 | function addParserOutput( &$parserOutput ) { |
327 | 345 | $this->addParserOutputNoText( $parserOutput ); |
328 | 346 | $text = $parserOutput->getText(); |
— | — | @@ -331,9 +349,13 @@ |
332 | 350 | |
333 | 351 | /** |
334 | 352 | * Add wikitext to the buffer, assuming that this is the primary text for a page view |
335 | | - * Saves the text into the parser cache if possible |
| 353 | + * Saves the text into the parser cache if possible. |
| 354 | + * |
| 355 | + * @param string $text |
| 356 | + * @param Article $article |
| 357 | + * @param bool $cache |
336 | 358 | */ |
337 | | - function addPrimaryWikiText( $text, $article, $cache = true ) { |
| 359 | + public function addPrimaryWikiText( $text, $article, $cache = true ) { |
338 | 360 | global $wgParser, $wgUser; |
339 | 361 | |
340 | 362 | $popts = $this->parserOptions(); |
— | — | @@ -351,8 +373,11 @@ |
352 | 374 | |
353 | 375 | /** |
354 | 376 | * For anything that isn't primary text or interface message |
| 377 | + * |
| 378 | + * @param string $text |
| 379 | + * @param bool $linestart Is this the start of a line? |
355 | 380 | */ |
356 | | - function addSecondaryWikiText( $text, $linestart = true ) { |
| 381 | + public function addSecondaryWikiText( $text, $linestart = true ) { |
357 | 382 | global $wgTitle; |
358 | 383 | $popts = $this->parserOptions(); |
359 | 384 | $popts->setTidy(true); |
— | — | @@ -363,9 +388,10 @@ |
364 | 389 | |
365 | 390 | /** |
366 | 391 | * Add the output of a QuickTemplate to the output buffer |
| 392 | + * |
367 | 393 | * @param QuickTemplate $template |
368 | 394 | */ |
369 | | - function addTemplate( &$template ) { |
| 395 | + public function addTemplate( &$template ) { |
370 | 396 | ob_start(); |
371 | 397 | $template->execute(); |
372 | 398 | $this->addHTML( ob_get_contents() ); |
— | — | @@ -374,8 +400,12 @@ |
375 | 401 | |
376 | 402 | /** |
377 | 403 | * Parse wikitext and return the HTML. |
| 404 | + * |
| 405 | + * @param string $text |
| 406 | + * @param bool $linestart Is this the start of a line? |
| 407 | + * @param bool $interface ?? |
378 | 408 | */ |
379 | | - function parse( $text, $linestart = true, $interface = false ) { |
| 409 | + public function parse( $text, $linestart = true, $interface = false ) { |
380 | 410 | global $wgParser, $wgTitle; |
381 | 411 | $popts = $this->parserOptions(); |
382 | 412 | if ( $interface) { $popts->setInterfaceMessage(true); } |
— | — | @@ -386,12 +416,12 @@ |
387 | 417 | } |
388 | 418 | |
389 | 419 | /** |
390 | | - * @param $article |
391 | | - * @param $user |
| 420 | + * @param Article $article |
| 421 | + * @param User $user |
392 | 422 | * |
393 | | - * @return bool |
| 423 | + * @return bool True if successful, else false. |
394 | 424 | */ |
395 | | - function tryParserCache( &$article, $user ) { |
| 425 | + public function tryParserCache( &$article, $user ) { |
396 | 426 | $parserCache =& ParserCache::singleton(); |
397 | 427 | $parserOutput = $parserCache->get( $article, $user ); |
398 | 428 | if ( $parserOutput !== false ) { |
— | — | @@ -403,18 +433,17 @@ |
404 | 434 | } |
405 | 435 | |
406 | 436 | /** |
407 | | - * Set the maximum cache time on the Squid in seconds |
408 | | - * @param $maxage |
| 437 | + * @param int $maxage Maximum cache time on the Squid, in seconds. |
409 | 438 | */ |
410 | | - function setSquidMaxage( $maxage ) { |
| 439 | + public function setSquidMaxage( $maxage ) { |
411 | 440 | $this->mSquidMaxage = $maxage; |
412 | 441 | } |
413 | 442 | |
414 | 443 | /** |
415 | 444 | * Use enableClientCache(false) to force it to send nocache headers |
416 | | - * @param $state |
| 445 | + * @param $state ?? |
417 | 446 | */ |
418 | | - function enableClientCache( $state ) { |
| 447 | + public function enableClientCache( $state ) { |
419 | 448 | return wfSetVar( $this->mEnableClientCache, $state ); |
420 | 449 | } |
421 | 450 | |
— | — | @@ -424,7 +453,7 @@ |
425 | 454 | && $wgRequest->getText('uselang', false) === false; |
426 | 455 | } |
427 | 456 | |
428 | | - function sendCacheControl() { |
| 457 | + public function sendCacheControl() { |
429 | 458 | global $wgUseSquid, $wgUseESI, $wgUseETag, $wgSquidMaxage, $wgRequest; |
430 | 459 | $fname = 'OutputPage::sendCacheControl'; |
431 | 460 | |
— | — | @@ -480,7 +509,7 @@ |
481 | 510 | * Finally, all the text has been munged and accumulated into |
482 | 511 | * the object, let's actually output it: |
483 | 512 | */ |
484 | | - function output() { |
| 513 | + public function output() { |
485 | 514 | global $wgUser, $wgOutputEncoding, $wgRequest; |
486 | 515 | global $wgContLanguageCode, $wgDebugRedirects, $wgMimeType; |
487 | 516 | global $wgJsMimeType, $wgStylePath, $wgUseAjax, $wgAjaxSearch, $wgScriptPath, $wgServer; |
— | — | @@ -605,7 +634,11 @@ |
606 | 635 | wfProfileOut( $fname ); |
607 | 636 | } |
608 | 637 | |
609 | | - function out( $ins ) { |
| 638 | + /** |
| 639 | + * @todo document |
| 640 | + * @param string $ins |
| 641 | + */ |
| 642 | + public function out( $ins ) { |
610 | 643 | global $wgInputEncoding, $wgOutputEncoding, $wgContLang; |
611 | 644 | if ( 0 == strcmp( $wgInputEncoding, $wgOutputEncoding ) ) { |
612 | 645 | $outs = $ins; |
— | — | @@ -616,7 +649,10 @@ |
617 | 650 | print $outs; |
618 | 651 | } |
619 | 652 | |
620 | | - function setEncodings() { |
| 653 | + /** |
| 654 | + * @todo document |
| 655 | + */ |
| 656 | + public function setEncodings() { |
621 | 657 | global $wgInputEncoding, $wgOutputEncoding; |
622 | 658 | global $wgUser, $wgContLang; |
623 | 659 | |
— | — | @@ -630,19 +666,20 @@ |
631 | 667 | } |
632 | 668 | |
633 | 669 | /** |
634 | | - * Returns a HTML comment with the elapsed time since request. |
635 | | - * This method has no side effects. |
636 | | - * Use wfReportTime() instead. |
| 670 | + * Deprecated, use wfReportTime() instead. |
637 | 671 | * @return string |
638 | 672 | * @deprecated |
639 | 673 | */ |
640 | | - function reportTime() { |
| 674 | + public function reportTime() { |
641 | 675 | $time = wfReportTime(); |
642 | 676 | return $time; |
643 | 677 | } |
644 | 678 | |
645 | 679 | /** |
646 | | - * Produce a "user is blocked" page |
| 680 | + * Produce a "user is blocked" page. |
| 681 | + * |
| 682 | + * @param bool $return Whether to have a "return to $wgTitle" message or not. |
| 683 | + * @return nothing |
647 | 684 | */ |
648 | 685 | function blockedPage( $return = true ) { |
649 | 686 | global $wgUser, $wgContLang, $wgTitle; |
— | — | @@ -672,9 +709,13 @@ |
673 | 710 | } |
674 | 711 | |
675 | 712 | /** |
676 | | - * Note: these arguments are keys into wfMsg(), not text! |
| 713 | + * Outputs a pretty page to explain why the request exploded. |
| 714 | + * |
| 715 | + * @param string $title Message key for page title. |
| 716 | + * @param string $msg Message key for page text. |
| 717 | + * @return nothing |
677 | 718 | */ |
678 | | - function showErrorPage( $title, $msg ) { |
| 719 | + public function showErrorPage( $title, $msg ) { |
679 | 720 | global $wgTitle; |
680 | 721 | |
681 | 722 | $this->mDebugtext .= 'Original title: ' . |
— | — | @@ -692,7 +733,7 @@ |
693 | 734 | } |
694 | 735 | |
695 | 736 | /** @obsolete */ |
696 | | - function errorpage( $title, $msg ) { |
| 737 | + public function errorpage( $title, $msg ) { |
697 | 738 | throw new ErrorPageError( $title, $msg ); |
698 | 739 | } |
699 | 740 | |
— | — | @@ -702,7 +743,7 @@ |
703 | 744 | * |
704 | 745 | * @param mixed $version The version of MediaWiki needed to use the page |
705 | 746 | */ |
706 | | - function versionRequired( $version ) { |
| 747 | + public function versionRequired( $version ) { |
707 | 748 | $this->setPageTitle( wfMsg( 'versionrequired', $version ) ); |
708 | 749 | $this->setHTMLTitle( wfMsg( 'versionrequired', $version ) ); |
709 | 750 | $this->setRobotpolicy( 'noindex,nofollow' ); |
— | — | @@ -715,9 +756,10 @@ |
716 | 757 | |
717 | 758 | /** |
718 | 759 | * Display an error page noting that a given permission bit is required. |
| 760 | + * |
719 | 761 | * @param string $permission key required |
720 | 762 | */ |
721 | | - function permissionRequired( $permission ) { |
| 763 | + public function permissionRequired( $permission ) { |
722 | 764 | global $wgGroupPermissions, $wgUser; |
723 | 765 | |
724 | 766 | $this->setPageTitle( wfMsg( 'badaccess' ) ); |
— | — | @@ -755,23 +797,25 @@ |
756 | 798 | } |
757 | 799 | |
758 | 800 | /** |
| 801 | + * Use permissionRequired. |
759 | 802 | * @deprecated |
760 | 803 | */ |
761 | | - function sysopRequired() { |
| 804 | + public function sysopRequired() { |
762 | 805 | throw new MWException( "Call to deprecated OutputPage::sysopRequired() method\n" ); |
763 | 806 | } |
764 | 807 | |
765 | 808 | /** |
| 809 | + * Use permissionRequired. |
766 | 810 | * @deprecated |
767 | 811 | */ |
768 | | - function developerRequired() { |
| 812 | + public function developerRequired() { |
769 | 813 | throw new MWException( "Call to deprecated OutputPage::developerRequired() method\n" ); |
770 | 814 | } |
771 | 815 | |
772 | 816 | /** |
773 | 817 | * Produce the stock "please login to use the wiki" page |
774 | 818 | */ |
775 | | - function loginToUse() { |
| 819 | + public function loginToUse() { |
776 | 820 | global $wgUser, $wgTitle, $wgContLang; |
777 | 821 | |
778 | 822 | if( $wgUser->isLoggedIn() ) { |
— | — | @@ -799,11 +843,16 @@ |
800 | 844 | } |
801 | 845 | |
802 | 846 | /** @obsolete */ |
803 | | - function databaseError( $fname, $sql, $error, $errno ) { |
| 847 | + public function databaseError( $fname, $sql, $error, $errno ) { |
804 | 848 | throw new MWException( "OutputPage::databaseError is obsolete\n" ); |
805 | 849 | } |
806 | 850 | |
807 | | - function readOnlyPage( $source = null, $protected = false ) { |
| 851 | + /** |
| 852 | + * @todo document |
| 853 | + * @param bool $protected Is the reason the page can't be reached because it's protected? |
| 854 | + * @param mixed $source |
| 855 | + */ |
| 856 | + public function readOnlyPage( $source = null, $protected = false ) { |
808 | 857 | global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle; |
809 | 858 | |
810 | 859 | $this->setRobotpolicy( 'noindex,nofollow' ); |
— | — | @@ -813,7 +862,7 @@ |
814 | 863 | $skin = $wgUser->getSkin(); |
815 | 864 | $this->setPageTitle( wfMsg( 'viewsource' ) ); |
816 | 865 | $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) ); |
817 | | - |
| 866 | + |
818 | 867 | # Determine if protection is due to the page being a system message |
819 | 868 | # and show an appropriate explanation |
820 | 869 | if( $wgTitle->getNamespace() == NS_MEDIAWIKI && !$wgUser->isAllowed( 'editinterface' ) ) { |
— | — | @@ -832,7 +881,7 @@ |
833 | 882 | } |
834 | 883 | |
835 | 884 | if( is_string( $source ) ) { |
836 | | - if( strcmp( $source, '' ) == 0 ) { |
| 885 | + if( $source === '' ) { |
837 | 886 | global $wgTitle; |
838 | 887 | if ( $wgTitle->getNamespace() == NS_MEDIAWIKI ) { |
839 | 888 | $source = wfMsgWeirdKey ( $wgTitle->getText() ); |
— | — | @@ -852,36 +901,36 @@ |
853 | 902 | } |
854 | 903 | |
855 | 904 | /** @obsolete */ |
856 | | - function fatalError( $message ) { |
| 905 | + public function fatalError( $message ) { |
857 | 906 | throw new FatalError( $message ); |
858 | 907 | } |
859 | 908 | |
860 | 909 | /** @obsolete */ |
861 | | - function unexpectedValueError( $name, $val ) { |
| 910 | + public function unexpectedValueError( $name, $val ) { |
862 | 911 | throw new FatalError( wfMsg( 'unexpected', $name, $val ) ); |
863 | 912 | } |
864 | 913 | |
865 | 914 | /** @obsolete */ |
866 | | - function fileCopyError( $old, $new ) { |
| 915 | + public function fileCopyError( $old, $new ) { |
867 | 916 | throw new FatalError( wfMsg( 'filecopyerror', $old, $new ) ); |
868 | 917 | } |
869 | 918 | |
870 | 919 | /** @obsolete */ |
871 | | - function fileRenameError( $old, $new ) { |
| 920 | + public function fileRenameError( $old, $new ) { |
872 | 921 | throw new FatalError( wfMsg( 'filerenameerror', $old, $new ) ); |
873 | 922 | } |
874 | 923 | |
875 | 924 | /** @obsolete */ |
876 | | - function fileDeleteError( $name ) { |
| 925 | + public function fileDeleteError( $name ) { |
877 | 926 | throw new FatalError( wfMsg( 'filedeleteerror', $name ) ); |
878 | 927 | } |
879 | 928 | |
880 | 929 | /** @obsolete */ |
881 | | - function fileNotFoundError( $name ) { |
| 930 | + public function fileNotFoundError( $name ) { |
882 | 931 | throw new FatalError( wfMsg( 'filenotfound', $name ) ); |
883 | 932 | } |
884 | 933 | |
885 | | - function showFatalError( $message ) { |
| 934 | + public function showFatalError( $message ) { |
886 | 935 | $this->setPageTitle( wfMsg( "internalerror" ) ); |
887 | 936 | $this->setRobotpolicy( "noindex,nofollow" ); |
888 | 937 | $this->setArticleRelated( false ); |
— | — | @@ -890,23 +939,23 @@ |
891 | 940 | $this->mBodytext = $message; |
892 | 941 | } |
893 | 942 | |
894 | | - function showUnexpectedValueError( $name, $val ) { |
| 943 | + public function showUnexpectedValueError( $name, $val ) { |
895 | 944 | $this->showFatalError( wfMsg( 'unexpected', $name, $val ) ); |
896 | 945 | } |
897 | 946 | |
898 | | - function showFileCopyError( $old, $new ) { |
| 947 | + public function showFileCopyError( $old, $new ) { |
899 | 948 | $this->showFatalError( wfMsg( 'filecopyerror', $old, $new ) ); |
900 | 949 | } |
901 | 950 | |
902 | | - function showFileRenameError( $old, $new ) { |
| 951 | + public function showFileRenameError( $old, $new ) { |
903 | 952 | $this->showFatalError( wfMsg( 'filerenameerror', $old, $new ) ); |
904 | 953 | } |
905 | 954 | |
906 | | - function showFileDeleteError( $name ) { |
| 955 | + public function showFileDeleteError( $name ) { |
907 | 956 | $this->showFatalError( wfMsg( 'filedeleteerror', $name ) ); |
908 | 957 | } |
909 | 958 | |
910 | | - function showFileNotFoundError( $name ) { |
| 959 | + public function showFileNotFoundError( $name ) { |
911 | 960 | $this->showFatalError( wfMsg( 'filenotfound', $name ) ); |
912 | 961 | } |
913 | 962 | |
— | — | @@ -915,7 +964,7 @@ |
916 | 965 | * @param $auto automatically redirect the user after 10 seconds |
917 | 966 | * @param $returnto page title to return to. Default is Main Page. |
918 | 967 | */ |
919 | | - function returnToMain( $auto = true, $returnto = NULL ) { |
| 968 | + public function returnToMain( $auto = true, $returnto = NULL ) { |
920 | 969 | global $wgUser, $wgOut, $wgRequest; |
921 | 970 | |
922 | 971 | if ( $returnto == NULL ) { |
— | — | @@ -948,8 +997,10 @@ |
949 | 998 | /** |
950 | 999 | * This function takes the title (first item of mGoodLinks), categories, existing and broken links for the page |
951 | 1000 | * and uses the first 10 of them for META keywords |
| 1001 | + * |
| 1002 | + * @param ParserOutput &$parserOutput |
952 | 1003 | */ |
953 | | - function addKeywords( &$parserOutput ) { |
| 1004 | + private function addKeywords( &$parserOutput ) { |
954 | 1005 | global $wgTitle; |
955 | 1006 | $this->addKeyword( $wgTitle->getPrefixedText() ); |
956 | 1007 | $count = 1; |
— | — | @@ -968,10 +1019,9 @@ |
969 | 1020 | } |
970 | 1021 | |
971 | 1022 | /** |
972 | | - * @access private |
973 | | - * @return string |
| 1023 | + * @return string The doctype, opening <html>, and head element. |
974 | 1024 | */ |
975 | | - function headElement() { |
| 1025 | + public function headElement() { |
976 | 1026 | global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType; |
977 | 1027 | global $wgUser, $wgContLang, $wgUseTrackbacks, $wgTitle, $wgStyleVersion; |
978 | 1028 | |
— | — | @@ -1014,7 +1064,10 @@ |
1015 | 1065 | return $ret; |
1016 | 1066 | } |
1017 | 1067 | |
1018 | | - function getHeadLinks() { |
| 1068 | + /** |
| 1069 | + * @return string HTML tag links to be put in the header. |
| 1070 | + */ |
| 1071 | + public function getHeadLinks() { |
1019 | 1072 | global $wgRequest; |
1020 | 1073 | $ret = ''; |
1021 | 1074 | foreach ( $this->mMetatags as $tag ) { |
— | — | @@ -1064,9 +1117,8 @@ |
1065 | 1118 | * Turn off regular page output and return an error reponse |
1066 | 1119 | * for when rate limiting has triggered. |
1067 | 1120 | * @todo i18n |
1068 | | - * @access public |
1069 | 1121 | */ |
1070 | | - function rateLimited() { |
| 1122 | + public function rateLimited() { |
1071 | 1123 | global $wgOut; |
1072 | 1124 | $wgOut->disable(); |
1073 | 1125 | wfHttpError( 500, 'Internal Server Error', |
— | — | @@ -1079,7 +1131,7 @@ |
1080 | 1132 | * |
1081 | 1133 | * @return bool True if the parser output instructs us to add one |
1082 | 1134 | */ |
1083 | | - function showNewSectionLink() { |
| 1135 | + public function showNewSectionLink() { |
1084 | 1136 | return $this->mNewSectionLink; |
1085 | 1137 | } |
1086 | 1138 | |