<?php
/**
+ * Implements Special:Protectedpages
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
* @file
* @ingroup SpecialPage
*/
/**
- * @todo document
+ * A special page that lists protected pages
+ *
* @ingroup SpecialPage
*/
-class ProtectedPagesForm {
+class SpecialProtectedpages extends SpecialPage {
protected $IdLevel = 'level';
protected $IdType = 'type';
- public function showList( $msg = '' ) {
+ public function __construct() {
+ parent::__construct( 'Protectedpages' );
+ }
+
+ public function execute( $par ) {
global $wgOut, $wgRequest;
- if( $msg != "" ) {
- $wgOut->setSubtitle( $msg );
- }
+ $this->setHeaders();
+ $this->outputHeader();
// Purge expired entries on one in every 10 queries
if( !mt_rand( 0, 10 ) ) {
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', array(), wfMsg( 'protectedpages' ) ) .
Xml::hidden( 'title', $title->getPrefixedDBkey() ) . "\n" .
- $this->getNamespaceMenu( $namespace ) . " \n" .
- $this->getTypeMenu( $type ) . " \n" .
- $this->getLevelMenu( $level ) . " \n" .
+ $this->getNamespaceMenu( $namespace ) . " \n" .
+ $this->getTypeMenu( $type ) . " \n" .
+ $this->getLevelMenu( $level ) . " \n" .
"<br /><span style='white-space: nowrap'>" .
- $this->getExpiryCheck( $indefOnly ) . " \n" .
- $this->getCascadeCheck( $cascadeOnly ) . " \n" .
+ $this->getExpiryCheck( $indefOnly ) . " \n" .
+ $this->getCascadeCheck( $cascadeOnly ) . " \n" .
"</span><br /><span style='white-space: nowrap'>" .
- $this->getSizeLimit( $sizetype, $size ) . " \n" .
+ $this->getSizeLimit( $sizetype, $size ) . " \n" .
"</span>" .
- " " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
+ " " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' );
}
*/
protected function getNamespaceMenu( $namespace = null ) {
return "<span style='white-space: nowrap'>" .
- Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' '
+ Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' '
. Xml::namespaceSelector( $namespace, '' ) . "</span>";
}
return
Xml::radioLabel( wfMsg('minimum-size'), 'sizetype', 'min', 'wpmin', !$max ) .
- ' ' .
+ ' ' .
Xml::radioLabel( wfMsg('maximum-size'), 'sizetype', 'max', 'wpmax', $max ) .
- ' ' .
+ ' ' .
Xml::input( 'size', 9, $size, array( 'id' => 'wpsize' ) ) .
- ' ' .
+ ' ' .
Xml::label( wfMsg('pagesize'), 'wpsize' );
}
}
return "<span style='white-space: nowrap'>" .
- Xml::label( wfMsg('restriction-type') , $this->IdType ) . ' ' .
+ Xml::label( wfMsg('restriction-type') , $this->IdType ) . ' ' .
Xml::tags( 'select',
array( 'id' => $this->IdType, 'name' => $this->IdType ),
implode( "\n", $options ) ) . "</span>";
return 'pr_id';
}
}
-
-/**
- * Constructor
- */
-function wfSpecialProtectedpages() {
- $ppForm = new ProtectedPagesForm();
- $ppForm->showList();
-}