r86246 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86245‎ | r86246 | r86247 >
Date:23:23, 16 April 2011
Author:happy-melon
Status:ok
Tags:
Comment:
Some more documentation and replacing static Skin calls
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -492,7 +492,7 @@
493493 * for the first message which is non-empty. If all messages are empty then an
494494 * instance of the first message key is returned.
495495 * Varargs: message keys
496 - * @return \type{Message}
 496+ * @return Message
497497 * @since 1.18
498498 */
499499 function wfMessageFallback( /*...*/ ) {
Index: trunk/phase3/includes/LogPage.php
@@ -318,6 +318,14 @@
319319 return $rv;
320320 }
321321
 322+ /**
 323+ * TODO document
 324+ * @param $type String
 325+ * @param $skin Skin
 326+ * @param $title Title
 327+ * @param $params Array
 328+ * @return String
 329+ */
322330 protected static function getTitleLink( $type, $skin, $title, &$params ) {
323331 global $wgLang, $wgContLang, $wgUserrightsInterwikiDelimiter;
324332 if( !$skin ) {
@@ -325,7 +333,7 @@
326334 }
327335 switch( $type ) {
328336 case 'move':
329 - $titleLink = $skin->link(
 337+ $titleLink = Linker::link(
330338 $title,
331339 htmlspecialchars( $title->getPrefixedText() ),
332340 array(),
@@ -336,7 +344,7 @@
337345 # Workaround for broken database
338346 $params[0] = htmlspecialchars( $params[0] );
339347 } else {
340 - $params[0] = $skin->link(
 348+ $params[0] = Linker::link(
341349 $targetTitle,
342350 htmlspecialchars( $params[0] )
343351 );
@@ -349,8 +357,8 @@
350358 // TODO: Store the user identifier in the parameters
351359 // to make this faster for future log entries
352360 $id = User::idFromName( $title->getText() );
353 - $titleLink = $skin->userLink( $id, $title->getText() )
354 - . $skin->userToolLinks( $id, $title->getText(), false, Linker::TOOL_LINKS_NOBLOCK );
 361+ $titleLink = Linker::userLink( $id, $title->getText() )
 362+ . Linker::userToolLinks( $id, $title->getText(), false, Linker::TOOL_LINKS_NOBLOCK );
355363 }
356364 break;
357365 case 'rights':
@@ -363,16 +371,16 @@
364372 break;
365373 }
366374 }
367 - $titleLink = $skin->link( Title::makeTitle( NS_USER, $text ) );
 375+ $titleLink = Linker::link( Title::makeTitle( NS_USER, $text ) );
368376 break;
369377 case 'merge':
370 - $titleLink = $skin->link(
 378+ $titleLink = Linker::link(
371379 $title,
372380 $title->getPrefixedText(),
373381 array(),
374382 array( 'redirect' => 'no' )
375383 );
376 - $params[0] = $skin->link(
 384+ $params[0] = Linker::link(
377385 Title::newFromText( $params[0] ),
378386 htmlspecialchars( $params[0] )
379387 );
@@ -380,15 +388,15 @@
381389 break;
382390 default:
383391 if( $title->getNamespace() == NS_SPECIAL ) {
384 - list( $name, $par ) = SpecialPage::resolveAliasWithSubpage( $title->getDBkey() );
 392+ list( $name, $par ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
385393 # Use the language name for log titles, rather than Log/X
386394 if( $name == 'Log' ) {
387 - $titleLink = '(' . $skin->link( $title, LogPage::logName( $par ) ) . ')';
 395+ $titleLink = '(' . Linker::link( $title, LogPage::logName( $par ) ) . ')';
388396 } else {
389 - $titleLink = $skin->link( $title );
 397+ $titleLink = Linker::link( $title );
390398 }
391399 } else {
392 - $titleLink = $skin->link( $title );
 400+ $titleLink = Linker::link( $title );
393401 }
394402 }
395403 return $titleLink;

Status & tagging log