Last modified: 2014-02-12 23:38:16 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;