dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add GENDER to messages on Special:(Deleted)Contributions
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialContributions.php
diff --git
a/includes/specials/SpecialContributions.php
b/includes/specials/SpecialContributions.php
index
daf602b
..
6aeb2c3
100644
(file)
--- a/
includes/specials/SpecialContributions.php
+++ b/
includes/specials/SpecialContributions.php
@@
-37,8
+37,10
@@
class SpecialContributions extends IncludableSpecialPage {
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
- $out->addModuleStyles( 'mediawiki.special' );
- $out->addModuleStyles( 'mediawiki.special.changeslist' );
+ $out->addModuleStyles( [
+ 'mediawiki.special',
+ 'mediawiki.special.changeslist',
+ ] );
$this->addHelpLink( 'Help:User contributions' );
$this->opts = [];
$this->addHelpLink( 'Help:User contributions' );
$this->opts = [];
@@
-265,13
+267,13
@@
class SpecialContributions extends IncludableSpecialPage {
}
$user = htmlspecialchars( $userObj->getName() );
} else {
}
$user = htmlspecialchars( $userObj->getName() );
} else {
- $user =
Linker::link( $userObj->getUserPage(), htmlspecialchars( $userObj->getName()
) );
+ $user =
$this->getLinkRenderer()->makeLink( $userObj->getUserPage(), $userObj->getName(
) );
}
$nt = $userObj->getUserPage();
$talk = $userObj->getTalkPage();
$links = '';
if ( $talk ) {
}
$nt = $userObj->getUserPage();
$talk = $userObj->getTalkPage();
$links = '';
if ( $talk ) {
- $tools =
$this->getUserLinks( $nt, $talk
, $userObj );
+ $tools =
self::getUserLinks( $this
, $userObj );
$links = $this->getLanguage()->pipeList( $tools );
// Show a note if the user is blocked and display the last block log entry.
$links = $this->getLanguage()->pipeList( $tools );
// Show a note if the user is blocked and display the last block log entry.
@@
-311,86
+313,93
@@
class SpecialContributions extends IncludableSpecialPage {
/**
* Links to different places.
/**
* Links to different places.
- * @param Title $userpage Target user page
- * @param Title $talkpage Talk page
+ *
+ * @note This function is also called in DeletedContributionsPage
+ * @param SpecialPage $sp SpecialPage instance, for context
* @param User $target Target user object
* @return array
*/
* @param User $target Target user object
* @return array
*/
- public
function getUserLinks( Title $userpage, Title $talkpage
, User $target ) {
+ public
static function getUserLinks( SpecialPage $sp
, User $target ) {
$id = $target->getId();
$username = $target->getName();
$id = $target->getId();
$username = $target->getName();
+ $userpage = $target->getUserPage();
+ $talkpage = $target->getTalkPage();
- $tools[] = Linker::link( $talkpage, $this->msg( 'sp-contributions-talk' )->escaped() );
+ $linkRenderer = $sp->getLinkRenderer();
+ $tools['user-talk'] = $linkRenderer->makeLink(
+ $talkpage,
+ $sp->msg( 'sp-contributions-talk' )->text()
+ );
if ( ( $id !== null ) || ( $id === null && IP::isIPAddress( $username ) ) ) {
if ( ( $id !== null ) || ( $id === null && IP::isIPAddress( $username ) ) ) {
- if ( $
this
->getUser()->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
+ if ( $
sp
->getUser()->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
if ( $target->isBlocked() && $target->getBlock()->getType() != Block::TYPE_AUTO ) {
if ( $target->isBlocked() && $target->getBlock()->getType() != Block::TYPE_AUTO ) {
- $tools[
] = Linker::linkKnown
( # Change block link
+ $tools[
'block'] = $linkRenderer->makeKnownLink
( # Change block link
SpecialPage::getTitleFor( 'Block', $username ),
SpecialPage::getTitleFor( 'Block', $username ),
- $
this->msg( 'change-blocklink' )->escaped
()
+ $
sp->msg( 'change-blocklink' )->text
()
);
);
- $tools[
] = Linker::linkKnown
( # Unblock link
+ $tools[
'unblock'] = $linkRenderer->makeKnownLink
( # Unblock link
SpecialPage::getTitleFor( 'Unblock', $username ),
SpecialPage::getTitleFor( 'Unblock', $username ),
- $
this->msg( 'unblocklink' )->escaped
()
+ $
sp->msg( 'unblocklink' )->text
()
);
} else { # User is not blocked
);
} else { # User is not blocked
- $tools[
] = Linker::linkKnown
( # Block link
+ $tools[
'block'] = $linkRenderer->makeKnownLink
( # Block link
SpecialPage::getTitleFor( 'Block', $username ),
SpecialPage::getTitleFor( 'Block', $username ),
- $
this->msg( 'blocklink' )->escaped
()
+ $
sp->msg( 'blocklink' )->text
()
);
}
}
# Block log link
);
}
}
# Block log link
- $tools[
] = Linker::linkKnown
(
+ $tools[
'log-block'] = $linkRenderer->makeKnownLink
(
SpecialPage::getTitleFor( 'Log', 'block' ),
SpecialPage::getTitleFor( 'Log', 'block' ),
- $
this->msg( 'sp-contributions-blocklog' )->escaped
(),
+ $
sp->msg( 'sp-contributions-blocklog' )->text
(),
[],
[ 'page' => $userpage->getPrefixedText() ]
);
# Suppression log link (bug 59120)
[],
[ 'page' => $userpage->getPrefixedText() ]
);
# Suppression log link (bug 59120)
- if ( $
this
->getUser()->isAllowed( 'suppressionlog' ) ) {
- $tools[
] = Linker::linkKnown
(
+ if ( $
sp
->getUser()->isAllowed( 'suppressionlog' ) ) {
+ $tools[
'log-suppression'] = $linkRenderer->makeKnownLink
(
SpecialPage::getTitleFor( 'Log', 'suppress' ),
SpecialPage::getTitleFor( 'Log', 'suppress' ),
- $
this->msg( 'sp-contributions-suppresslog' )->escaped
(),
+ $
sp->msg( 'sp-contributions-suppresslog', $username )->text
(),
[],
[ 'offender' => $username ]
);
}
}
# Uploads
[],
[ 'offender' => $username ]
);
}
}
# Uploads
- $tools[
] = Linker::linkKnown
(
+ $tools[
'uploads'] = $linkRenderer->makeKnownLink
(
SpecialPage::getTitleFor( 'Listfiles', $username ),
SpecialPage::getTitleFor( 'Listfiles', $username ),
- $
this->msg( 'sp-contributions-uploads' )->escaped
()
+ $
sp->msg( 'sp-contributions-uploads' )->text
()
);
# Other logs link
);
# Other logs link
- $tools[
] = Linker::linkKnown
(
+ $tools[
'logs'] = $linkRenderer->makeKnownLink
(
SpecialPage::getTitleFor( 'Log', $username ),
SpecialPage::getTitleFor( 'Log', $username ),
- $
this->msg( 'sp-contributions-logs' )->escaped
()
+ $
sp->msg( 'sp-contributions-logs' )->text
()
);
# Add link to deleted user contributions for priviledged users
);
# Add link to deleted user contributions for priviledged users
- if ( $
this
->getUser()->isAllowed( 'deletedhistory' ) ) {
- $tools[
] = Linker::linkKnown
(
+ if ( $
sp
->getUser()->isAllowed( 'deletedhistory' ) ) {
+ $tools[
'deletedcontribs'] = $linkRenderer->makeKnownLink
(
SpecialPage::getTitleFor( 'DeletedContributions', $username ),
SpecialPage::getTitleFor( 'DeletedContributions', $username ),
- $
this->msg( 'sp-contributions-deleted' )->escaped
()
+ $
sp->msg( 'sp-contributions-deleted', $username )->text
()
);
}
# Add a link to change user rights for privileged users
$userrightsPage = new UserrightsPage();
);
}
# Add a link to change user rights for privileged users
$userrightsPage = new UserrightsPage();
- $userrightsPage->setContext( $
this
->getContext() );
+ $userrightsPage->setContext( $
sp
->getContext() );
if ( $userrightsPage->userCanChangeRights( $target ) ) {
if ( $userrightsPage->userCanChangeRights( $target ) ) {
- $tools[
] = Linker::linkKnown
(
+ $tools[
'userrights'] = $linkRenderer->makeKnownLink
(
SpecialPage::getTitleFor( 'Userrights', $username ),
SpecialPage::getTitleFor( 'Userrights', $username ),
- $
this->msg( 'sp-contributions-userrights' )->escaped
()
+ $
sp->msg( 'sp-contributions-userrights' )->text
()
);
}
);
}
- Hooks::run( 'ContributionsToolLinks', [ $id, $userpage, &$tools ] );
+ Hooks::run( 'ContributionsToolLinks', [ $id, $userpage, &$tools
, $sp
] );
return $tools;
}
return $tools;
}