From a9038b2c26f956aa07810902119d68cf6615212c Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Sat, 16 Apr 2011 23:23:28 +0000 Subject: [PATCH] Some more documentation and replacing static Skin calls --- includes/GlobalFunctions.php | 2 +- includes/LogPage.php | 30 +++++++++++++++++++----------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 0437bd5735..73afefaffa 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -492,7 +492,7 @@ function wfMessage( $key /*...*/) { * for the first message which is non-empty. If all messages are empty then an * instance of the first message key is returned. * Varargs: message keys - * @return \type{Message} + * @return Message * @since 1.18 */ function wfMessageFallback( /*...*/ ) { diff --git a/includes/LogPage.php b/includes/LogPage.php index dbf9014ff6..2d9304b43e 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -318,6 +318,14 @@ class LogPage { return $rv; } + /** + * TODO document + * @param $type String + * @param $skin Skin + * @param $title Title + * @param $params Array + * @return String + */ protected static function getTitleLink( $type, $skin, $title, &$params ) { global $wgLang, $wgContLang, $wgUserrightsInterwikiDelimiter; if( !$skin ) { @@ -325,7 +333,7 @@ class LogPage { } switch( $type ) { case 'move': - $titleLink = $skin->link( + $titleLink = Linker::link( $title, htmlspecialchars( $title->getPrefixedText() ), array(), @@ -336,7 +344,7 @@ class LogPage { # Workaround for broken database $params[0] = htmlspecialchars( $params[0] ); } else { - $params[0] = $skin->link( + $params[0] = Linker::link( $targetTitle, htmlspecialchars( $params[0] ) ); @@ -349,8 +357,8 @@ class LogPage { // TODO: Store the user identifier in the parameters // to make this faster for future log entries $id = User::idFromName( $title->getText() ); - $titleLink = $skin->userLink( $id, $title->getText() ) - . $skin->userToolLinks( $id, $title->getText(), false, Linker::TOOL_LINKS_NOBLOCK ); + $titleLink = Linker::userLink( $id, $title->getText() ) + . Linker::userToolLinks( $id, $title->getText(), false, Linker::TOOL_LINKS_NOBLOCK ); } break; case 'rights': @@ -363,16 +371,16 @@ class LogPage { break; } } - $titleLink = $skin->link( Title::makeTitle( NS_USER, $text ) ); + $titleLink = Linker::link( Title::makeTitle( NS_USER, $text ) ); break; case 'merge': - $titleLink = $skin->link( + $titleLink = Linker::link( $title, $title->getPrefixedText(), array(), array( 'redirect' => 'no' ) ); - $params[0] = $skin->link( + $params[0] = Linker::link( Title::newFromText( $params[0] ), htmlspecialchars( $params[0] ) ); @@ -380,15 +388,15 @@ class LogPage { break; default: if( $title->getNamespace() == NS_SPECIAL ) { - list( $name, $par ) = SpecialPage::resolveAliasWithSubpage( $title->getDBkey() ); + list( $name, $par ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); # Use the language name for log titles, rather than Log/X if( $name == 'Log' ) { - $titleLink = '(' . $skin->link( $title, LogPage::logName( $par ) ) . ')'; + $titleLink = '(' . Linker::link( $title, LogPage::logName( $par ) ) . ')'; } else { - $titleLink = $skin->link( $title ); + $titleLink = Linker::link( $title ); } } else { - $titleLink = $skin->link( $title ); + $titleLink = Linker::link( $title ); } } return $titleLink; -- 2.20.1