https://bugzilla.wikimedia.org/show_bug.cgi?id=41788

       Web browser: ---
             Bug #: 41788
           Summary: Add support for optgroups
           Product: MediaWiki extensions
           Version: master
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: MultiBoilerplate
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---


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;

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to