X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialWhatlinkshere.php;h=32c020bc0c3493bcf2444c966b4235f0c8ea4ca8;hb=45a2b06e77c7daf4f828bf73b385a53e191eed47;hp=7af8ac8182339b087306f2c948727bb5b0d2a98d;hpb=74a21f3bd1692dac958ddf3e09226a72b7bc65b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 7af8ac8182..32c020bc0c 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -1,13 +1,29 @@ selfTitle = SpecialPage::getTitleFor( 'Whatlinkshere', $this->target->getPrefixedDBkey() ); + $this->selfTitle = $this->getTitle( $this->target->getPrefixedDBkey() ); $wgOut->setPageTitle( wfMsg( 'whatlinkshere-title', $this->target->getPrefixedText() ) ); $wgOut->setSubtitle( wfMsg( 'whatlinkshere-backlink', $this->skin->link( $this->target, $this->target->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) ); @@ -176,8 +192,6 @@ class SpecialWhatLinksHere extends SpecialPage { $row->is_image = 0; $rows[$row->page_id] = $row; } - $dbr->freeResult( $plRes ); - } if( !$hidetrans ) { while ( $row = $dbr->fetchObject( $tlRes ) ) { @@ -185,7 +199,6 @@ class SpecialWhatLinksHere extends SpecialPage { $row->is_image = 0; $rows[$row->page_id] = $row; } - $dbr->freeResult( $tlRes ); } if( !$hideimages ) { while ( $row = $dbr->fetchObject( $ilRes ) ) { @@ -193,7 +206,6 @@ class SpecialWhatLinksHere extends SpecialPage { $row->is_image = 1; $rows[$row->page_id] = $row; } - $dbr->freeResult( $ilRes ); } // Sort by key and then change the keys to 0-based indices @@ -249,11 +261,13 @@ class SpecialWhatLinksHere extends SpecialPage { } protected function listItem( $row, $nt, $notClose = false ) { + global $wgLang; + # local message cache static $msgcache = null; if ( $msgcache === null ) { static $msgs = array( 'isredirect', 'istemplate', 'semicolon-separator', - 'whatlinkshere-links', 'isimage' ); + 'whatlinkshere-links', 'isimage', 'hist' ); $msgcache = array(); foreach ( $msgs as $msg ) { $msgcache[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) ); @@ -288,8 +302,10 @@ class SpecialWhatLinksHere extends SpecialPage { } # Space for utilities links, with a what-links-here link provided - $wlhLink = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] ); - $wlh = Xml::wrapClass( "($wlhLink)", 'mw-whatlinkshere-tools' ); + $tools = array(); + $tools[] = $this->wlhLink( $nt, $msgcache['whatlinkshere-links'] ); + $tools[] = $this->skin->linkKnown( $nt, $msgcache['hist'], array(), array( 'action' => 'history' ) ); + $wlh = Xml::wrapClass( '(' . $wgLang->pipeList( $tools ) . ')', 'mw-whatlinkshere-tools' ); return $notClose ? Xml::openElement( 'li' ) . "$link $propsText $wlh\n" : @@ -303,7 +319,7 @@ class SpecialWhatLinksHere extends SpecialPage { protected function wlhLink( Title $target, $text ) { static $title = null; if ( $title === null ) - $title = SpecialPage::getTitleFor( 'Whatlinkshere' ); + $title = $this->getTitle(); return $this->skin->linkKnown( $title, @@ -368,7 +384,7 @@ class SpecialWhatLinksHere extends SpecialPage { $f = Xml::openElement( 'form', array( 'action' => $wgScript ) ); # Values that should not be forgotten - $f .= Xml::hidden( 'title', SpecialPage::getTitleFor( 'Whatlinkshere' )->getPrefixedText() ); + $f .= Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ); foreach ( $this->opts->getUnconsumedValues() as $name => $value ) { $f .= Xml::hidden( $name, $value ); }