From ad71a0226167c10685cb5c491a3b0b0c6d88fa66 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 28 Jan 2012 00:16:20 +0000 Subject: [PATCH] Reverted r109957 per slush (see CR comments) --- includes/HTMLForm.php | 98 ------------------------------------------- 1 file changed, 98 deletions(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index ccdd44afea..41a12c1d22 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -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 { . "\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 -- 2.20.1