4 * @addtogroup SpecialPage
9 * @addtogroup SpecialPage
11 class ProtectedPagesPage
extends PageQueryPage
{
14 return "Protectedpages";
17 function getPageHeader() {
18 return '<p>' . wfMsg('protectedpagestext') . '</p>';
22 * LEFT JOIN is expensive
26 function isExpensive( ) {
30 function isSyndicated() { return false; }
35 function sortDescending() {
40 * @return string an sqlquery
43 $dbr =& wfGetDB( DB_SLAVE
);
44 list( $page, $page_restrictions ) = $dbr->tableNamesN( 'page', 'page_restrictions' );
45 return "SELECT DISTINCT page_id, 'Protectedpages' as type, page_namespace AS namespace, page_title as title, " .
46 "page_title AS value, pr_level, pr_expiry " .
47 "FROM $page, $page_restrictions WHERE page_id = pr_page AND pr_user IS NULL ";
51 * Make link to the page, and add the protection levels.
53 * @param $skin Skin to be used
54 * @param $result Result row
57 function formatResult( $skin, $result ) {
59 $title = Title
::makeTitleSafe( $result->namespace, $result->title
);
60 $link = $skin->makeLinkObj( $title );
62 $description_items = array ();
64 $protType = wfMsg( 'restriction-level-' . $result->pr_level
);
66 $description_items[] = $protType;
68 $expiry_description = '';
70 if ( $result->pr_expiry
!= 'infinity' && strlen($result->pr_expiry
) ) {
71 $expiry = Block
::decodeExpiry( $result->pr_expiry
);
73 $expiry_description = wfMsgForContent( 'protect-expiring', $wgLang->timeanddate( $expiry ) );
75 $description_items[] = $expiry_description;
78 return wfSpecialList( $link, implode( $description_items, ', ' ) );
85 function wfSpecialProtectedpages() {
87 list( $limit, $offset ) = wfCheckLimits();
89 $depp = new ProtectedPagesPage();
91 Title
::purgeExpiredRestrictions();
93 return $depp->doQuery( $offset, $limit );