Reverted r109957 per slush (see CR comments)
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 28 Jan 2012 00:16:20 +0000 (00:16 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 28 Jan 2012 00:16:20 +0000 (00:16 +0000)
includes/HTMLForm.php

index ccdd44a..41a12c1 100644 (file)
@@ -72,8 +72,6 @@ class HTMLForm extends ContextSource {
                'submit' => 'HTMLSubmitField',
                'hidden' => 'HTMLHiddenField',
                'edittools' => 'HTMLEditTools',
-               'namespaces' => 'HTMLNamespacesField',
-               'restrictionlevels' => 'HTMLRestrictionLevelsField',
 
                // HTMLTextField will output the correct type="" attribute automagically.
                // There are about four zillion other HTML5 input types, like url, but
@@ -2002,99 +2000,3 @@ class HTMLEditTools extends HTMLFormField {
                        . "</div></td></tr>\n";
        }
 }
-
-/**
- * Dropdown for namespaces
- *
- * @since 1.20
- */
-class HTMLNamespacesField extends HTMLSelectField {
-
-       /**
-        * Constructor, adds the namespaces to the options
-        *
-        * @param $params
-        */
-       function __construct( $params ) {
-               global $wgContLang;
-               parent::__construct( $params );
-
-               $namespaces = $wgContLang->getFormattedNamespaces();
-
-               $options = array();
-               $options[ wfMessage( 'namespacesall' )->escaped() ] = ''; // TODO: Make an option
-
-               foreach ( $namespaces as $index => $name ) {
-                       // Don't include things like SpecialPages
-                       if ( $index < NS_MAIN ) {
-                               continue;
-                       }
-
-                       if ( $index === 0 ) {
-                               $name = wfMessage( 'blanknamespace' )->escaped();
-                       }
-
-                       $options[$name] = $index;
-               }
-
-               $this->mParams['options'] = $options;
-       }
-}
-
-/**
- * Dropdown for protection levels
- *
- * @since 1.20
- */
-class HTMLRestrictionLevelsField extends HTMLSelectField {
-
-       /**
-        * Should this field be displayed? If it hits a condition where it should
-        * be hidden, set this to false.
-        *
-        * @var bool
-        */
-       protected $enabled = true;
-
-       /**
-        * Constructor, adds the restrictions to the options
-        *
-        * @param $params
-        */
-       function __construct( $params ) {
-               global $wgRestrictionLevels;
-               parent::__construct( $params );
-
-               $options = array( wfMsg('restriction-level-all') => 0 ); // Temporary array
-
-               // First pass to load the level names
-               foreach( $wgRestrictionLevels as $type ) {
-                       if ( $type != '' && $type != '*' ) {
-                               $text = wfMsg("restriction-level-$type");
-                               $options[$text] = $type;
-                       }
-               }
-
-               // Is there only one level (aside from "all")?
-               if( count($options) <= 2 ) {
-                       $this->enabled = false;
-                       return;
-               }
-
-               $this->mParams['options'] = $options;
-       }
-
-       /**
-        * Returns nothing if there are no restrictions to show
-        *
-        * @param $value
-        * @return String
-        */
-       function getTableRow( $value ) {
-               if ( $this->enabled ) {
-                       return parent::getTableRow( $value );
-               }
-
-               return '';
-       }
-}
\ No newline at end of file