From b9b85843572bf283f48285001e276ba7e61b63f6 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 22 Feb 2009 13:37:51 +0100 Subject: updated to MediaWiki 1.14.0 --- includes/specials/SpecialProtectedpages.php | 32 +++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'includes/specials/SpecialProtectedpages.php') diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index 3025c055..4e56ca42 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -16,7 +16,6 @@ class ProtectedPagesForm { public function showList( $msg = '' ) { global $wgOut, $wgRequest; - $wgOut->setPagetitle( wfMsg( "protectedpages" ) ); if ( "" != $msg ) { $wgOut->setSubtitle( $msg ); } @@ -32,10 +31,11 @@ class ProtectedPagesForm { $size = $wgRequest->getIntOrNull( 'size' ); $NS = $wgRequest->getIntOrNull( 'namespace' ); $indefOnly = $wgRequest->getBool( 'indefonly' ) ? 1 : 0; + $cascadeOnly = $wgRequest->getBool('cascadeonly') ? 1 : 0; - $pager = new ProtectedPagesPager( $this, array(), $type, $level, $NS, $sizetype, $size, $indefOnly ); + $pager = new ProtectedPagesPager( $this, array(), $type, $level, $NS, $sizetype, $size, $indefOnly, $cascadeOnly ); - $wgOut->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly ) ); + $wgOut->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly ) ); if ( $pager->getNumRows() ) { $s = $pager->getNavigationBar(); @@ -83,7 +83,7 @@ class ProtectedPagesForm { if ( $row->pr_expiry != 'infinity' && strlen($row->pr_expiry) ) { $expiry = Block::decodeExpiry( $row->pr_expiry ); - $expiry_description = wfMsgForContent( 'protect-expiring', $wgLang->timeanddate( $expiry ) ); + $expiry_description = wfMsg( 'protect-expiring' , $wgLang->timeanddate( $expiry ) , $wgLang->date( $expiry ) , $wgLang->time( $expiry ) ); $description_items[] = $expiry_description; } @@ -111,21 +111,24 @@ class ProtectedPagesForm { * @param $level string * @param $minsize int * @param $indefOnly bool + * @param $cascadeOnly bool * @return string Input form * @private */ - protected function showOptions( $namespace, $type='edit', $level, $sizetype, $size, $indefOnly ) { + protected function showOptions( $namespace, $type='edit', $level, $sizetype, $size, $indefOnly, $cascadeOnly ) { global $wgScript; $title = SpecialPage::getTitleFor( 'ProtectedPages' ); return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . Xml::openElement( 'fieldset' ) . Xml::element( 'legend', array(), wfMsg( 'protectedpages' ) ) . - Xml::hidden( 'title', $title->getPrefixedDBkey() ) . " \n" . + Xml::hidden( 'title', $title->getPrefixedDBkey() ) . "\n" . $this->getNamespaceMenu( $namespace ) . " \n" . $this->getTypeMenu( $type ) . " \n" . $this->getLevelMenu( $level ) . " \n" . - "
  " . + "
" . $this->getExpiryCheck( $indefOnly ) . " \n" . + $this->getCascadeCheck( $cascadeOnly ) . " \n" . + "
" . $this->getSizeLimit( $sizetype, $size ) . " \n" . "" . " " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . @@ -153,6 +156,14 @@ class ProtectedPagesForm { return Xml::checkLabel( wfMsg('protectedpages-indef'), 'indefonly', 'indefonly', $indefOnly ) . "\n"; } + + /** + * @return string Formatted HTML + */ + protected function getCascadeCheck( $cascadeOnly ) { + return + Xml::checkLabel( wfMsg('protectedpages-cascade'), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n"; + } /** * @return string Formatted HTML @@ -237,7 +248,8 @@ class ProtectedPagesPager extends AlphabeticPager { public $mForm, $mConds; private $type, $level, $namespace, $sizetype, $size, $indefonly; - function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='', $size=0, $indefonly=false ) { + function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='', + $size=0, $indefonly = false, $cascadeonly = false ) { $this->mForm = $form; $this->mConds = $conds; $this->type = ( $type ) ? $type : 'edit'; @@ -246,6 +258,7 @@ class ProtectedPagesPager extends AlphabeticPager { $this->sizetype = $sizetype; $this->size = intval($size); $this->indefonly = (bool)$indefonly; + $this->cascadeonly = (bool)$cascadeonly; parent::__construct(); } @@ -281,6 +294,9 @@ class ProtectedPagesPager extends AlphabeticPager { if( $this->indefonly ) { $conds[] = "pr_expiry = 'infinity' OR pr_expiry IS NULL"; } + if ( $this->cascadeonly ) { + $conds[] = "pr_cascade = '1'"; + } if( $this->level ) $conds[] = 'pr_level=' . $this->mDb->addQuotes( $this->level ); -- cgit v1.2.2