16
16
public function showList( $msg = '' ) {
17
17
global $wgOut, $wgRequest;
20
20
$wgOut->setSubtitle( $msg );
23
23
// Purge expired entries on one in every 10 queries
24
if ( !mt_rand( 0, 10 ) ) {
24
if( !mt_rand( 0, 10 ) ) {
25
25
Title::purgeExpiredRestrictions();
38
38
$wgOut->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly ) );
40
if ( $pager->getNumRows() ) {
40
if( $pager->getNumRows() ) {
41
41
$s = $pager->getNavigationBar();
43
43
$pager->getBody() .
74
74
$description_items[] = $protType;
76
if ( $row->pr_cascade ) {
76
if( $row->pr_cascade ) {
77
77
$description_items[] = wfMsg( 'protect-summary-cascade' );
80
80
$expiry_description = '';
83
if ( $row->pr_expiry != 'infinity' && strlen($row->pr_expiry) ) {
83
if( $row->pr_expiry != 'infinity' && strlen($row->pr_expiry) ) {
84
84
$expiry = Block::decodeExpiry( $row->pr_expiry );
86
$expiry_description = wfMsg( 'protect-expiring' , $wgLang->timeanddate( $expiry ) , $wgLang->date( $expiry ) , $wgLang->time( $expiry ) );
86
$expiry_description = wfMsg( 'protect-expiring' , $wgLang->timeanddate( $expiry ) ,
87
$wgLang->date( $expiry ) , $wgLang->time( $expiry ) );
88
89
$description_items[] = $expiry_description;
91
if (!is_null($size = $row->page_len)) {
92
if(!is_null($size = $row->page_len)) {
92
93
$stxt = $wgContLang->getDirMark() . ' ' . $skin->formatRevisionSize( $size );
95
96
# Show a link to the change protection form for allowed users otherwise a link to the protection log
96
97
if( $wgUser->isAllowed( 'protect' ) ) {
97
$changeProtection = ' (' . $skin->makeKnownLinkObj( $title, wfMsgHtml( 'protect_change' ), 'action=unprotect' ) . ')';
98
$changeProtection = ' (' . $skin->makeKnownLinkObj( $title, wfMsgHtml( 'protect_change' ),
99
'action=unprotect' ) . ')';
99
101
$ltitle = SpecialPage::getTitleFor( 'Log' );
100
$changeProtection = ' (' . $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'protectlogpage' ), 'type=protect&page=' . $title->getPrefixedUrl() ) . ')';
102
$changeProtection = ' (' . $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'protectlogpage' ),
103
'type=protect&page=' . $title->getPrefixedUrl() ) . ')';
103
106
wfProfileOut( __METHOD__ );
221
224
// First pass to load the log names
222
225
foreach( $wgRestrictionLevels as $type ) {
223
if ( $type !='' && $type !='*') {
226
if( $type !='' && $type !='*') {
224
227
$text = wfMsg("restriction-level-$type");
225
228
$m[$text] = $type;
248
251
public $mForm, $mConds;
249
252
private $type, $level, $namespace, $sizetype, $size, $indefonly;
251
function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='',
252
$size=0, $indefonly = false, $cascadeonly = false ) {
254
function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='', $size=0,
255
$indefonly = false, $cascadeonly = false )
253
257
$this->mForm = $form;
254
258
$this->mConds = $conds;
255
259
$this->type = ( $type ) ? $type : 'edit';
265
269
function getStartBody() {
266
wfProfileIn( __METHOD__ );
267
270
# Do a link batch query
268
271
$lb = new LinkBatch;
269
272
while( $row = $this->mResult->fetchObject() ) {
270
273
$lb->add( $row->page_namespace, $row->page_title );
274
wfProfileOut( __METHOD__ );
282
283
function getQueryInfo() {
283
284
$conds = $this->mConds;
284
$conds[] = 'pr_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() );
285
$conds[] = '(pr_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
286
'OR pr_expiry IS NULL)';
285
287
$conds[] = 'page_id=pr_page';
286
288
$conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
288
290
if( $this->sizetype=='min' ) {
289
291
$conds[] = 'page_len>=' . $this->size;
290
292
} else if( $this->sizetype=='max' ) {