r96830 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96829‎ | r96830 | r96831 >
Date:09:25, 12 September 2011
Author:ialex
Status:ok
Tags:
Comment:
Added visibility markers to some Linker methods
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -109,7 +109,7 @@
110110 * @param $threshold Integer: user defined threshold
111111 * @return String: CSS class
112112 */
113 - static function getLinkColour( $t, $threshold ) {
 113+ public static function getLinkColour( $t, $threshold ) {
114114 $colour = '';
115115 if ( $t->isRedirect() ) {
116116 # Page is a redirect
@@ -376,7 +376,7 @@
377377 *
378378 * @return string
379379 */
380 - static function makeSelfLinkObj( $nt, $html = '', $query = '', $trail = '', $prefix = '' ) {
 380+ public static function makeSelfLinkObj( $nt, $html = '', $query = '', $trail = '', $prefix = '' ) {
381381 if ( $html == '' ) {
382382 $html = htmlspecialchars( $nt->getPrefixedText() );
383383 }
@@ -410,7 +410,7 @@
411411 *
412412 * @return string
413413 */
414 - static function fnamePart( $url ) {
 414+ private static function fnamePart( $url ) {
415415 $basename = strrchr( $url, '/' );
416416 if ( false === $basename ) {
417417 $basename = $url;
@@ -429,7 +429,7 @@
430430 *
431431 * @return string
432432 */
433 - static function makeExternalImage( $url, $alt = '' ) {
 433+ public static function makeExternalImage( $url, $alt = '' ) {
434434 if ( $alt == '' ) {
435435 $alt = self::fnamePart( $url );
436436 }
@@ -478,7 +478,7 @@
479479 * @param $widthOption: Used by the parser to remember the user preference thumbnailsize
480480 * @return String: HTML for an image, with links, wrappers, etc.
481481 */
482 - static function makeImageLink2( Title $title, $file, $frameParams = array(),
 482+ public static function makeImageLink2( Title $title, $file, $frameParams = array(),
483483 $handlerParams = array(), $time = false, $query = "", $widthOption = null )
484484 {
485485 $res = null;
@@ -605,7 +605,7 @@
606606 * @param $frameParams The frame parameters
607607 * @param $query An optional query string to add to description page links
608608 */
609 - static function getImageLinkMTOParams( $frameParams, $query = '' ) {
 609+ private static function getImageLinkMTOParams( $frameParams, $query = '' ) {
610610 $mtoParams = array();
611611 if ( isset( $frameParams['link-url'] ) && $frameParams['link-url'] !== '' ) {
612612 $mtoParams['custom-url-link'] = $frameParams['link-url'];
@@ -634,7 +634,7 @@
635635 * @param $framed Boolean
636636 * @param $manualthumb String
637637 */
638 - static function makeThumbLinkObj( Title $title, $file, $label = '', $alt,
 638+ public static function makeThumbLinkObj( Title $title, $file, $label = '', $alt,
639639 $align = 'right', $params = array(), $framed = false , $manualthumb = "" )
640640 {
641641 $frameParams = array(
@@ -660,7 +660,7 @@
661661 * @param string $query
662662 * @return mixed
663663 */
664 - static function makeThumbLink2( Title $title, $file, $frameParams = array(),
 664+ public static function makeThumbLink2( Title $title, $file, $frameParams = array(),
665665 $handlerParams = array(), $time = false, $query = "" )
666666 {
667667 global $wgStylePath, $wgContLang;
@@ -870,7 +870,7 @@
871871 *
872872 * @return string
873873 */
874 - static function specialLink( $name, $key = '' ) {
 874+ public static function specialLink( $name, $key = '' ) {
875875 if ( $key == '' ) {
876876 $key = strtolower( $name );
877877 }
@@ -886,7 +886,7 @@
887887 * @param $linktype String: type of external link. Gets added to the classes
888888 * @param $attribs Array of extra attributes to <a>
889889 */
890 - static function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array() ) {
 890+ public static function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array() ) {
891891 $class = "external";
892892 if ( isset($linktype) && $linktype ) {
893893 $class .= " $linktype";
@@ -1026,7 +1026,7 @@
10271027 * @param $isPublic Boolean: show only if all users can see it
10281028 * @return String: HTML fragment
10291029 */
1030 - static function revUserLink( $rev, $isPublic = false ) {
 1030+ public static function revUserLink( $rev, $isPublic = false ) {
10311031 if ( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
10321032 $link = wfMsgHtml( 'rev-deleted-user' );
10331033 } elseif ( $rev->userCan( Revision::DELETED_USER ) ) {
@@ -1047,7 +1047,7 @@
10481048 * @param $isPublic Boolean: show only if all users can see it
10491049 * @return string HTML
10501050 */
1051 - static function revUserTools( $rev, $isPublic = false ) {
 1051+ public static function revUserTools( $rev, $isPublic = false ) {
10521052 if ( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
10531053 $link = wfMsgHtml( 'rev-deleted-user' );
10541054 } elseif ( $rev->userCan( Revision::DELETED_USER ) ) {
@@ -1080,7 +1080,7 @@
10811081 * @param $title Mixed: Title object (to generate link to the section in autocomment) or null
10821082 * @param $local Boolean: whether section links should refer to local page
10831083 */
1084 - static function formatComment( $comment, $title = null, $local = false ) {
 1084+ public static function formatComment( $comment, $title = null, $local = false ) {
10851085 wfProfileIn( __METHOD__ );
10861086
10871087 # Sanitize text a bit:
@@ -1280,7 +1280,7 @@
12811281 * @param $text
12821282 * @return string
12831283 */
1284 - static function normalizeSubpageLink( $contextTitle, $target, &$text ) {
 1284+ public static function normalizeSubpageLink( $contextTitle, $target, &$text ) {
12851285 # Valid link forms:
12861286 # Foobar -- normal
12871287 # :Foobar -- override special treatment of prefix (images, language links)
@@ -1362,7 +1362,7 @@
13631363 *
13641364 * @return string
13651365 */
1366 - static function commentBlock( $comment, $title = null, $local = false ) {
 1366+ public static function commentBlock( $comment, $title = null, $local = false ) {
13671367 // '*' used to be the comment inserted by the software way back
13681368 // in antiquity in case none was provided, here for backwards
13691369 // compatability, acc. to brion -ævar
@@ -1383,7 +1383,7 @@
13841384 * @param $isPublic Boolean: show only if all users can see it
13851385 * @return String: HTML fragment
13861386 */
1387 - static function revComment( Revision $rev, $local = false, $isPublic = false ) {
 1387+ public static function revComment( Revision $rev, $local = false, $isPublic = false ) {
13881388 if ( $rev->getRawComment() == "" ) {
13891389 return "";
13901390 }
@@ -1422,7 +1422,7 @@
14231423 *
14241424 * @return string
14251425 */
1426 - static function tocIndent() {
 1426+ public static function tocIndent() {
14271427 return "\n<ul>";
14281428 }
14291429
@@ -1431,7 +1431,7 @@
14321432 *
14331433 * @return string
14341434 */
1435 - static function tocUnindent( $level ) {
 1435+ public static function tocUnindent( $level ) {
14361436 return "</li>\n" . str_repeat( "</ul>\n</li>\n", $level > 0 ? $level : 0 );
14371437 }
14381438
@@ -1440,7 +1440,7 @@
14411441 *
14421442 * @return string
14431443 */
1444 - static function tocLine( $anchor, $tocline, $tocnumber, $level, $sectionIndex = false ) {
 1444+ public static function tocLine( $anchor, $tocline, $tocnumber, $level, $sectionIndex = false ) {
14451445 $classes = "toclevel-$level";
14461446 if ( $sectionIndex !== false ) {
14471447 $classes .= " tocsection-$sectionIndex";
@@ -1456,7 +1456,7 @@
14571457 * tocUnindent() will be used instead if we're ending a line below
14581458 * the new level.
14591459 */
1460 - static function tocLineEnd() {
 1460+ public static function tocLineEnd() {
14611461 return "</li>\n";
14621462 }
14631463
@@ -1467,7 +1467,7 @@
14681468 * @param $lang mixed: Language code for the toc title
14691469 * @return String: full html of the TOC
14701470 */
1471 - static function tocList( $toc, $lang = false ) {
 1471+ public static function tocList( $toc, $lang = false ) {
14721472 $title = wfMsgExt( 'toc', array( 'language' => $lang, 'escape' ) );
14731473 return
14741474 '<table id="toc" class="toc"><tr><td>'
@@ -1561,7 +1561,7 @@
15621562 *
15631563 * @param $rev Revision object
15641564 */
1565 - static function generateRollback( $rev ) {
 1565+ public static function generateRollback( $rev ) {
15661566 return '<span class="mw-rollback-link">['
15671567 . self::buildRollbackLink( $rev )
15681568 . ']</span>';

Status & tagging log