*/
class SpecialListGroupRights extends SpecialPage {
- var $skin;
-
/**
* Constructor
*/
function __construct() {
- global $wgUser;
parent::__construct( 'Listgrouprights' );
- $this->skin = $wgUser->getSkin();
}
/**
* Show the special page
*/
public function execute( $par ) {
- global $wgOut, $wgImplicitGroups;
+ global $wgImplicitGroups;
global $wgGroupPermissions, $wgRevokePermissions, $wgAddGroups, $wgRemoveGroups;
global $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
+ $out = $this->getOutput();
$this->setHeaders();
$this->outputHeader();
- $wgOut->addModuleStyles( 'mediawiki.special' );
+ $out->addModuleStyles( 'mediawiki.special' );
- $wgOut->addHTML(
+ $out->addHTML(
Xml::openElement( 'table', array( 'class' => 'wikitable mw-listgrouprights-table' ) ) .
'<tr>' .
Xml::element( 'th', null, wfMsg( 'listgrouprights-group' ) ) .
// Do not make a link for the generic * group
$grouppage = htmlspecialchars( $groupnameLocalized );
} else {
- $grouppage = $this->skin->link(
+ $grouppage = Linker::link(
Title::newFromText( $grouppageLocalized ),
htmlspecialchars( $groupnameLocalized )
);
if ( $group === 'user' ) {
// Link to Special:listusers for implicit group 'user'
- $grouplink = '<br />' . $this->skin->link(
+ $grouplink = '<br />' . Linker::link(
SpecialPage::getTitleFor( 'Listusers' ),
wfMsgHtml( 'listgrouprights-members' ),
array(),
array( 'known', 'noclasses' )
);
} elseif ( !in_array( $group, $wgImplicitGroups ) ) {
- $grouplink = '<br />' . $this->skin->link(
+ $grouplink = '<br />' . Linker::link(
SpecialPage::getTitleFor( 'Listusers' ),
wfMsgHtml( 'listgrouprights-members' ),
array(),
$removegroupsSelf = isset( $wgGroupsRemoveFromSelf[$group] ) ? $wgGroupsRemoveFromSelf[$group] : array();
$id = $group == '*' ? false : Sanitizer::escapeId( $group );
- $wgOut->addHTML( Html::rawElement( 'tr', array( 'id' => $id ),
+ $out->addHTML( Html::rawElement( 'tr', array( 'id' => $id ),
"
<td>$grouppage$grouplink</td>
<td>" .
'
) );
}
- $wgOut->addHTML(
+ $out->addHTML(
Xml::closeElement( 'table' ) . "\n<br /><hr />\n"
);
- $wgOut->wrapWikiMsg( "<div class=\"mw-listgrouprights-key\">\n$1\n</div>", 'listgrouprights-key' );
+ $out->wrapWikiMsg( "<div class=\"mw-listgrouprights-key\">\n$1\n</div>", 'listgrouprights-key' );
}
/**
}
function execute( $par ) {
- global $wgOut;
+ $out = $this->getOutput();
$this->setHeaders();
$this->outputHeader();
- $wgOut->allowClickjacking();
- $wgOut->addModuleStyles( 'mediawiki.special' );
+ $out->allowClickjacking();
+ $out->addModuleStyles( 'mediawiki.special' );
$groups = $this->getPageGroups();
}
private function outputPageList( $groups ) {
- global $wgUser, $wgOut, $wgMiserMode;
+ global $wgMiserMode;
+ $out = $this->getOutput();
- $sk = $wgUser->getSkin();
$includesRestrictedPages = false;
$includesCachedPages = false;
$total = count( $sortedPages );
$count = 0;
- $wgOut->wrapWikiMsg( "<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n", "specialpages-group-$group" );
- $wgOut->addHTML(
+ $out->wrapWikiMsg( "<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n", "specialpages-group-$group" );
+ $out->addHTML(
Html::openElement( 'table', array( 'style' => 'width:100%;', 'class' => 'mw-specialpages-table' ) ) ."\n" .
Html::openElement( 'tr' ) . "\n" .
Html::openElement( 'td', array( 'style' => 'width:30%;vertical-align:top' ) ) . "\n" .
$pageClasses[] = 'mw-specialpagerestricted';
}
- $link = $sk->linkKnown( $title , htmlspecialchars( $desc ) );
- $wgOut->addHTML( Html::rawElement( 'li', array( 'class' => implode( ' ', $pageClasses ) ), $link ) . "\n" );
+ $link = Linker::linkKnown( $title , htmlspecialchars( $desc ) );
+ $out->addHTML( Html::rawElement( 'li', array( 'class' => implode( ' ', $pageClasses ) ), $link ) . "\n" );
# Split up the larger groups
$count++;
if( $total > 3 && $count == $middle ) {
- $wgOut->addHTML(
+ $out->addHTML(
Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) .
Html::element( 'td', array( 'style' => 'width:10%' ), '' ) .
Html::openElement( 'td', array( 'style' => 'width:30%' ) ) . Html::openElement( 'ul' ) . "\n"
);
}
}
- $wgOut->addHTML(
+ $out->addHTML(
Html::closeElement( 'ul' ) . Html::closeElement( 'td' ) .
Html::element( 'td', array( 'style' => 'width:30%' ), '' ) .
Html::closeElement( 'tr' ) . Html::closeElement( 'table' ) . "\n"
}
if ( $includesRestrictedPages || $includesCachedPages ) {
- $wgOut->wrapWikiMsg( "<div class=\"mw-specialpages-notes\">\n$1\n</div>", 'specialpages-note' );
+ $out->wrapWikiMsg( "<div class=\"mw-specialpages-notes\">\n$1\n</div>", 'specialpages-note' );
}
}
}
// Stored objects
protected $opts, $target, $selfTitle;
- // Stored globals
- protected $skin;
-
protected $limits = array( 20, 50, 100, 250, 500 );
public function __construct() {
parent::__construct( 'Whatlinkshere' );
- global $wgUser;
- $this->skin = $wgUser->getSkin();
}
function execute( $par ) {
- global $wgOut, $wgRequest;
-
+ $out = $this->getOutput();
+
$this->setHeaders();
$opts = new FormOptions();
$opts->add( 'hidelinks', false );
$opts->add( 'hideimages', false );
- $opts->fetchValuesFromRequest( $wgRequest );
+ $opts->fetchValuesFromRequest( $this->getRequest() );
$opts->validateIntBounds( 'limit', 0, 5000 );
// Give precedence to subpage syntax
$this->target = Title::newFromURL( $opts->getValue( 'target' ) );
if( !$this->target ) {
- $wgOut->addHTML( $this->whatlinkshereForm() );
+ $out->addHTML( $this->whatlinkshereForm() );
return;
}
- $this->skin->setRelevantTitle( $this->target );
+ $this->getSkin()->setRelevantTitle( $this->target );
$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' ) ) ) );
+ $out->setPageTitle( wfMsg( 'whatlinkshere-title', $this->target->getPrefixedText() ) );
+ $out->setSubtitle( wfMsg( 'whatlinkshere-backlink', Linker::link( $this->target, $this->target->getPrefixedText(), array(), array( 'redirect' => 'no' ) ) ) );
$this->showIndirectLinks( 0, $this->target, $opts->getValue( 'limit' ),
$opts->getValue( 'from' ), $opts->getValue( 'back' ) );
* @private
*/
function showIndirectLinks( $level, $target, $limit, $from = 0, $back = 0 ) {
- global $wgOut, $wgMaxRedirectLinksRetrieved;
+ global $wgMaxRedirectLinksRetrieved;
+ $out = $this->getOutput();
$dbr = wfGetDB( DB_SLAVE );
$options = array();
if( ( !$fetchlinks || !$dbr->numRows($plRes) ) && ( $hidetrans || !$dbr->numRows($tlRes) ) && ( $hideimages || !$dbr->numRows($ilRes) ) ) {
if ( 0 == $level ) {
- $wgOut->addHTML( $this->whatlinkshereForm() );
+ $out->addHTML( $this->whatlinkshereForm() );
// Show filters only if there are links
if( $hidelinks || $hidetrans || $hideredirs || $hideimages )
- $wgOut->addHTML( $this->getFilterPanel() );
+ $out->addHTML( $this->getFilterPanel() );
$errMsg = is_int($namespace) ? 'nolinkshere-ns' : 'nolinkshere';
- $wgOut->addWikiMsg( $errMsg, $this->target->getPrefixedText() );
+ $out->addWikiMsg( $errMsg, $this->target->getPrefixedText() );
}
return;
}
$prevId = $from;
if ( $level == 0 ) {
- $wgOut->addHTML( $this->whatlinkshereForm() );
- $wgOut->addHTML( $this->getFilterPanel() );
- $wgOut->addWikiMsg( 'linkshere', $this->target->getPrefixedText() );
+ $out->addHTML( $this->whatlinkshereForm() );
+ $out->addHTML( $this->getFilterPanel() );
+ $out->addWikiMsg( 'linkshere', $this->target->getPrefixedText() );
$prevnext = $this->getPrevNext( $prevId, $nextId );
- $wgOut->addHTML( $prevnext );
+ $out->addHTML( $prevnext );
}
- $wgOut->addHTML( $this->listStart( $level ) );
+ $out->addHTML( $this->listStart( $level ) );
foreach ( $rows as $row ) {
$nt = Title::makeTitle( $row->page_namespace, $row->page_title );
if ( $row->page_is_redirect && $level < 2 ) {
- $wgOut->addHTML( $this->listItem( $row, $nt, true ) );
+ $out->addHTML( $this->listItem( $row, $nt, true ) );
$this->showIndirectLinks( $level + 1, $nt, $wgMaxRedirectLinksRetrieved );
- $wgOut->addHTML( Xml::closeElement( 'li' ) );
+ $out->addHTML( Xml::closeElement( 'li' ) );
} else {
- $wgOut->addHTML( $this->listItem( $row, $nt ) );
+ $out->addHTML( $this->listItem( $row, $nt ) );
}
}
- $wgOut->addHTML( $this->listEnd() );
+ $out->addHTML( $this->listEnd() );
if( $level == 0 ) {
- $wgOut->addHTML( $prevnext );
+ $out->addHTML( $prevnext );
}
}
$query = array();
}
- $link = $this->skin->linkKnown(
+ $link = Linker::linkKnown(
$nt,
null,
array(),
if ( $title === null )
$title = $this->getTitle();
- return $this->skin->linkKnown(
+ return Linker::linkKnown(
$title,
$text,
array(),
}
function makeSelfLink( $text, $query ) {
- return $this->skin->linkKnown(
+ return Linker::linkKnown(
$this->selfTitle,
$text,
array(),