$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();
* @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 ) ) .
$this->getLevelMenu( $level ) . " \n" .
"<br /><span style='white-space: nowrap'> " .
$this->getExpiryCheck( $indefOnly ) . " \n" .
+ $this->getCascadeCheck( $cascadeOnly ) . " \n" .
$this->getSizeLimit( $sizetype, $size ) . " \n" .
"</span>" .
" " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
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
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';
$this->sizetype = $sizetype;
$this->size = intval($size);
$this->indefonly = (bool)$indefonly;
+ $this->cascadeonly = (bool)$cascadeonly;
parent::__construct();
}
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 );