Last modified: 2012-12-30 21:04:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37970, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35970 - Prefs: multiselect inputs should be separated as list instead of br-tags
Prefs: multiselect inputs should be separated as list instead of br-tags
Status: NEW
Product: MediaWiki
Classification: Unclassified
User preferences (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-14 12:26 UTC by Subfader
Modified: 2012-12-30 21:04 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Subfader 2012-04-14 12:26:49 UTC
Special:Preferences: multiselect can take a long list of inputs (I use one with 55 inputs, very long single column list...)

Instead of seperating them with br-tags a non-style list should be used. 

Besides being semantically correct(!) one would be able to create CSS coluuns of the long list.
Comment 1 Subfader 2012-04-14 12:31:30 UTC
HTMLform.php > class HTMLMultiSelectField extends HTMLFormField {...}
Comment 2 Subfader 2012-04-14 12:37:01 UTC
	function formatOptions( $options, $value ) {
		$html = '';

		$attribs = array();
		if ( !empty( $this->mParams['disabled'] ) ) {
			$attribs['disabled'] = 'disabled';
		}
		
		$html .= '<ul class="'.$this->mParams['name'].'">';

		foreach( $options as $label => $info ) {
			if( is_array( $info ) ) {
				$html .= Html::rawElement( 'h1', array(), $label ) . "\n";
				$html .= $this->formatOptions( $info, $value );
			} else {
				$thisAttribs = array( 'id' => $this->mID . "-$info", 'value' => $info );
				
				$checkbox = Xml::check( $this->mName . '[]', in_array( $info, $value ),
								$attribs + $thisAttribs );
				$checkbox .= '&nbsp;' . Html::rawElement( 'label', array( 'for' => $this->mID . "-$info" ), $label );

				$html .= '<li>' .$checkbox. '</li>';
			}
		}
		
		$html .= '</ul>';

		return $html;
	}

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links