Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2883
SpecialProtectedpages.php
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 9:16 PM
2014-11-21 21:16:15 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
SpecialProtectedpages.php
View Options
<?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
Details
Attached
Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2453
Default Alt Text
SpecialProtectedpages.php (1 KB)
Attached To
Mode
T8211: List of all protected pages
Attached
Detach File
Event Timeline
Log In to Comment