r84891 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84890‎ | r84891 | r84892 >
Date:22:45, 27 March 2011
Author:happy-melon
Status:ok (Comments)
Tags:
Comment:
Follow-up r83907: abstract the flatlist mode into a descriptor option, and make it so the label does not linewrap away from the checkbox.
Modified paths:
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlockList.php (modified) (history)
  • /trunk/phase3/skins/common/shared.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/shared.css
@@ -129,6 +129,7 @@
130130 .mw-htmlform-multiselect-flatlist div.mw-htmlform-multiselect-item {
131131 display: inline;
132132 margin-right: 1em;
 133+ white-space: nowrap;
133134 }
134135
135136 input#wpSummary {
Index: trunk/phase3/includes/HTMLForm.php
@@ -1403,6 +1403,14 @@
14041404 * Multi-select field
14051405 */
14061406 class HTMLMultiSelectField extends HTMLFormField {
 1407+
 1408+ public function __construct( $params ){
 1409+ parent::__construct( $params );
 1410+ if( isset( $params['flatlist'] ) ){
 1411+ $this->mClass .= ' mw-htmlform-multiselect-flatlist';
 1412+ }
 1413+ }
 1414+
14071415 function validate( $value, $alldata ) {
14081416 $p = parent::validate( $value, $alldata );
14091417
@@ -1454,7 +1462,7 @@
14551463 $attribs + $thisAttribs );
14561464 $checkbox .= ' ' . Html::rawElement( 'label', array( 'for' => "{$this->mID}-$info" ), $label );
14571465
1458 - $html .= Html::rawElement( 'div', array( 'class' => 'mw-htmlform-multiselect-item' ), $checkbox );
 1466+ $html .= ' ' . Html::rawElement( 'div', array( 'class' => 'mw-htmlform-multiselect-item' ), $checkbox );
14591467 }
14601468 }
14611469
Index: trunk/phase3/includes/specials/SpecialBlockList.php
@@ -76,7 +76,7 @@
7777 wfMsg( 'blocklist-tempblocks' ) => 'tempblocks',
7878 wfMsg( 'blocklist-addressblocks' ) => 'addressblocks',
7979 ),
80 - 'cssclass' => 'mw-htmlform-multiselect-flatlist',
 80+ 'flatlist' => true,
8181 ),
8282 );
8383 $form = new HTMLForm( $fields );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83907Some tweaks to HTMLMultiSelect form to make it play nicely with GET forms, an...happy-melon15:50, 14 March 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   18:20, 18 June 2011

HTMLForm needs more docs.

#Comment by Happy-melon (talk | contribs)   19:08, 24 June 2011

Blame Andrew... :P

Status & tagging log