Page MenuHomePhabricator

SpecialProtectedpages.php

Authored By
bzimport
Nov 21 2014, 9:16 PM
Size
1 KB
Referenced Files
None
Subscribers
None

SpecialProtectedpages.php

<?php
/**
*
* @package MediaWiki
* @subpackage SpecialPage
*/
/**
*
*/
require_once("QueryPage.php");
/**
* SpecialProtectedpages extends QueryPage. It is used to return all protected
* pages in the database, excludimg MediaWiki namespace.
* @package MediaWiki
* @subpackage SpecialPage
*/
class ProtectedPagesPage extends QueryPage {
function getName() {
return "Protectedpages";
}
/**
* This query is indexed as of 1.5
*/
function isExpensive() {
return false;
}
function isSyndicated() {
return false;
}
function getSQL() {
$dbr =& wfGetDB( DB_SLAVE );
$page = $dbr->tableName( 'page' );
$name = $dbr->addQuotes( $this->getName() );
return
"SELECT $name as type,
page_namespace as namespace,
page_title as title,
page_restrictions AS value
FROM $page
WHERE OCTET_LENGTH(page_restrictions) <> 0 AND page_namespace <> ".NS_MEDIAWIKI;
}
function getOrder() {
return ' ORDER BY title DESC';
}
function sortDescending() {
return false;
}
function formatResult( $skin, $result ) {
global $wgLang, $wgContLang;
$nb = htmlspecialchars( $result->value );
$title = Title::makeTitle( $result->namespace, $result->title );
$link = $skin->makeKnownLinkObj( $title, $wgContLang->convert( $title->getPrefixedText() ) );
return "{$link} ({$nb})";
}
}
/**
* constructor
*/
function wfSpecialProtectedpages() {
list( $limit, $offset ) = wfCheckLimits();
$spp = new ProtectedPagesPage();
return $spp->doQuery( $offset, $limit );
}
?>

File Metadata

Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2453
Default Alt Text
SpecialProtectedpages.php (1 KB)

Event Timeline