- # Talk page link
- $tools[] = Linker::link( $talk, $this->msg( 'sp-contributions-talk' )->escaped() );
- if ( ( $id !== null ) || ( $id === null && IP::isIPAddress( $nt->getText() ) ) ) {
- # Block / Change block / Unblock links
- if ( $this->getUser()->isAllowed( 'block' ) ) {
- if ( $userObj->isBlocked() && $userObj->getBlock()->getType() !== Block::TYPE_AUTO ) {
- $tools[] = Linker::linkKnown( # Change block link
- SpecialPage::getTitleFor( 'Block', $nt->getDBkey() ),
- $this->msg( 'change-blocklink' )->escaped()
- );
- $tools[] = Linker::linkKnown( # Unblock link
- SpecialPage::getTitleFor( 'BlockList' ),
- $this->msg( 'unblocklink' )->escaped(),
- [],
- [
- 'action' => 'unblock',
- 'ip' => $nt->getDBkey()
- ]
- );
- } else {
- # User is not blocked
- $tools[] = Linker::linkKnown( # Block link
- SpecialPage::getTitleFor( 'Block', $nt->getDBkey() ),
- $this->msg( 'blocklink' )->escaped()
- );
- }
- }
- # Block log link
- $tools[] = Linker::linkKnown(
- SpecialPage::getTitleFor( 'Log' ),
- $this->msg( 'sp-contributions-blocklog' )->escaped(),
- [],
- [
- 'type' => 'block',
- 'page' => $nt->getPrefixedText()
- ]
- );
- # Suppression log link (bug 59120)
- if ( $this->getUser()->isAllowed( 'suppressionlog' ) ) {
- $tools[] = Linker::linkKnown(
- SpecialPage::getTitleFor( 'Log', 'suppress' ),
- $this->msg( 'sp-contributions-suppresslog' )->escaped(),
- [],
- [ 'offender' => $userObj->getName() ]
- );
- }
- }