Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1227,6 +1227,7 @@ |
1228 | 1228 | 'protectedpages', |
1229 | 1229 | 'protectedpages-indef', |
1230 | 1230 | 'protectedpages-summary', |
| 1231 | + 'protectedpages-cascade', |
1231 | 1232 | 'protectedpagestext', |
1232 | 1233 | 'protectedpagesempty', |
1233 | 1234 | 'protectedtitles', |
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php |
— | — | @@ -32,10 +32,11 @@ |
33 | 33 | $size = $wgRequest->getIntOrNull( 'size' ); |
34 | 34 | $NS = $wgRequest->getIntOrNull( 'namespace' ); |
35 | 35 | $indefOnly = $wgRequest->getBool( 'indefonly' ) ? 1 : 0; |
| 36 | + $cascadeOnly = $wgRequest->getBool('cascadeonly') ? 1 : 0; |
36 | 37 | |
37 | | - $pager = new ProtectedPagesPager( $this, array(), $type, $level, $NS, $sizetype, $size, $indefOnly ); |
| 38 | + $pager = new ProtectedPagesPager( $this, array(), $type, $level, $NS, $sizetype, $size, $indefOnly, $cascadeOnly ); |
38 | 39 | |
39 | | - $wgOut->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly ) ); |
| 40 | + $wgOut->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly ) ); |
40 | 41 | |
41 | 42 | if ( $pager->getNumRows() ) { |
42 | 43 | $s = $pager->getNavigationBar(); |
— | — | @@ -111,10 +112,11 @@ |
112 | 113 | * @param $level string |
113 | 114 | * @param $minsize int |
114 | 115 | * @param $indefOnly bool |
| 116 | + * @param $cascadeOnly bool |
115 | 117 | * @return string Input form |
116 | 118 | * @private |
117 | 119 | */ |
118 | | - protected function showOptions( $namespace, $type='edit', $level, $sizetype, $size, $indefOnly ) { |
| 120 | + protected function showOptions( $namespace, $type='edit', $level, $sizetype, $size, $indefOnly, $cascadeOnly ) { |
119 | 121 | global $wgScript; |
120 | 122 | $title = SpecialPage::getTitleFor( 'ProtectedPages' ); |
121 | 123 | return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . |
— | — | @@ -126,6 +128,7 @@ |
127 | 129 | $this->getLevelMenu( $level ) . " \n" . |
128 | 130 | "<br /><span style='white-space: nowrap'> " . |
129 | 131 | $this->getExpiryCheck( $indefOnly ) . " \n" . |
| 132 | + $this->getCascadeCheck( $cascadeOnly ) . " \n" . |
130 | 133 | $this->getSizeLimit( $sizetype, $size ) . " \n" . |
131 | 134 | "</span>" . |
132 | 135 | " " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" . |
— | — | @@ -153,6 +156,14 @@ |
154 | 157 | return |
155 | 158 | Xml::checkLabel( wfMsg('protectedpages-indef'), 'indefonly', 'indefonly', $indefOnly ) . "\n"; |
156 | 159 | } |
| 160 | + |
| 161 | + /** |
| 162 | + * @return string Formatted HTML |
| 163 | + */ |
| 164 | + protected function getCascadeCheck( $cascadeOnly ) { |
| 165 | + return |
| 166 | + Xml::checkLabel( wfMsg('protectedpages-cascade'), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n"; |
| 167 | + } |
157 | 168 | |
158 | 169 | /** |
159 | 170 | * @return string Formatted HTML |
— | — | @@ -237,7 +248,8 @@ |
238 | 249 | public $mForm, $mConds; |
239 | 250 | private $type, $level, $namespace, $sizetype, $size, $indefonly; |
240 | 251 | |
241 | | - function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='', $size=0, $indefonly=false ) { |
| 252 | + function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='', |
| 253 | + $size=0, $indefonly = false, $cascadeonly = false ) { |
242 | 254 | $this->mForm = $form; |
243 | 255 | $this->mConds = $conds; |
244 | 256 | $this->type = ( $type ) ? $type : 'edit'; |
— | — | @@ -246,6 +258,7 @@ |
247 | 259 | $this->sizetype = $sizetype; |
248 | 260 | $this->size = intval($size); |
249 | 261 | $this->indefonly = (bool)$indefonly; |
| 262 | + $this->cascadeonly = (bool)$cascadeonly; |
250 | 263 | parent::__construct(); |
251 | 264 | } |
252 | 265 | |
— | — | @@ -281,6 +294,9 @@ |
282 | 295 | if( $this->indefonly ) { |
283 | 296 | $conds[] = "pr_expiry = 'infinity' OR pr_expiry IS NULL"; |
284 | 297 | } |
| 298 | + if ( $this->cascadeonly ) { |
| 299 | + $conds[] = "pr_cascade = '1'"; |
| 300 | + } |
285 | 301 | |
286 | 302 | if( $this->level ) |
287 | 303 | $conds[] = 'pr_level=' . $this->mDb->addQuotes( $this->level ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1945,6 +1945,7 @@ |
1946 | 1946 | 'protectedpages' => 'Protected pages', |
1947 | 1947 | 'protectedpages-indef' => 'Indefinite protections only', |
1948 | 1948 | 'protectedpages-summary' => '', # do not translate or duplicate this message to other languages |
| 1949 | +'protectedpages-cascade' => 'Cascading protections only', |
1949 | 1950 | 'protectedpagestext' => 'The following pages are protected from moving or editing', |
1950 | 1951 | 'protectedpagesempty' => 'No pages are currently protected with these parameters.', |
1951 | 1952 | 'protectedtitles' => 'Protected titles', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -76,6 +76,8 @@ |
77 | 77 | * (bug 15127) Work around minor display glitch in Opera. |
78 | 78 | * By default, reject file uploads that look like ZIP files, to avoid the |
79 | 79 | so-called GIFAR vulnerability. |
| 80 | +* (bug 15141) Give ability to only list protected pages with the cascading |
| 81 | + option enabled on Special:ProtectedPages |
80 | 82 | |
81 | 83 | === Bug fixes in 1.14 === |
82 | 84 | |