Last modified: 2014-02-12 23:38:16 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 T43788, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41788 - Add support for optgroups
Add support for optgroups
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
MultiBoilerplate (Other open bugs)
master
All All
: Normal enhancement (vote)
: ---
Assigned To: Robert Leverington
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-05 16:19 UTC by bugzilla.mediawiki
Modified: 2014-02-12 23:38 UTC (History)
0 users

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


Attachments

Description bugzilla.mediawiki 2012-11-05 16:19:38 UTC
When having lots of templates in the boilerplate list, it becomes hard to keep an overview. Proposal is to use the HTML optgroup tag to add "titles" in the dropdown list. In the multibolierplate page, those "titles" are entered as header2 elements (== title ==)

+		$headingFound=0;
		foreach( $things as $row ) {
			if ( substr( ltrim( $row ), 0, 1)==="*" ) {

...

				$options .= Xml::option( $row1[ 0 ], $row1[ 1 ], $selected );
			}
+			if(ereg('== (.*) ==',$row,$optGroupText)) {
+			  if($headingFound==1) {
+			    $options.='</optgroup>';
+			  }
+			  $headingFound=1;
+			  $options.='<optgroup label="'.htmlspecialchars($optGroupText[1]).'">';
+			}
		}
+		if($headingFound==1) {
+		  $options.='</optgroup>';
+		}		
	}

	// No options found in either configuration file, abort.
	if( $options == '' ) return true;

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


Navigation
Links