[dev] Framework :: Browser optgroup feature

jvandal at infoteck.qc.ca jvandal at infoteck.qc.ca
Fri Apr 16 19:14:02 PDT 2004


Hi,

I've add a new feature to the Browser class. It the OPTGROUP (HTML 4.0) element. Here is a short description of this form tag :


The OPTGROUP element allows authors to group selection list choices into a hierarchy. This is particularly helpful to non-visual user agents when large numbers of options are available to choose from. Possible rendering of this element could be a collapsible hierarchy list of OPTION element content or some presentation conveying the hierarchy relationship of the OPTION contents. Browsers not supporting this element will "see" only a traditional flat list of OPTION elements. The LABEL attribute for this element is used to provide shorter labels for the nodes of the hierarchical menus. 
I want tu use this feature in some <select> list so if the browser support the optgroup feature, it will show the list like :

My Calendar
Shared Calendars
    Michael Smith
    Susan Smith
    Howard Smith
Remote Calendars
    Robert Smith

If no support is available, use the current way:

+ My Calendar
Shared Calendars:
 + Michael Smith
 + Susan Smith
 + Howard Smith
Remote Calendars:
 + Robert Smith

    
Example of future use (patch will follow):

<select NAME="calendars">
<option LABEL="My Calendar" VALUE="calendar">My Calendar
<optgroup LABEL="Shared Calendars">
    <option VALUE="michael">Michael Smith
    <option VALUE="susan">Susan Smith
    <option VALUE="howard">Howard Smith
</optgroup>
<optgroup LABEL="Remote Calendars">
    <option VALUE="robert">Robert Smith
</optgroup>
</select> 

For a description of optgroup 
http://www.blooberry.com/indexdot/html/tagpages/o/optgroup.htm

Mozilla 1.0 (Netscape 7.x)
http://www.websiteoptimization.com/speed/4/4-8.html

IE6 (Win)
http://www.legalanarchy.com/ie6.gif

IE5 Mac
http://www.websiteoptimization.com/speed/4/4-7.html

Opera 7
(sorry no screenshoot)

--
Joel Vandal
Infoteck Internet
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 1030 bytes
Desc: Clef publique PGP
Url : http://lists.horde.org/archives/dev/attachments/20040416/1bfc6144/attachment.bin
-------------- next part --------------
Index: Browser.php
===================================================================
RCS file: /repository/framework/Browser/Browser.php,v
retrieving revision 1.127
diff -u -r1.127 Browser.php
--- Browser.php 7 Apr 2004 14:43:06 -0000       1.127
+++ Browser.php 17 Apr 2004 01:50:27 -0000
@@ -103,7 +103,8 @@
         'utf'        => false,
         'rte'        => false,
         'homepage'   => false,
-        'accesskey'  => false
+        'accesskey'  => false,
+        'optgroup'   => false
     );

     /**
@@ -229,6 +230,7 @@
                     $this->setFeature('dom');
                     $this->setFeature('iframes');
                     $this->setFeature('accesskey');
+                    $this->setFeature('optgroup');
                     $this->setQuirk('double_linebreak_textarea');
                     break;
                 }
@@ -263,6 +265,7 @@
                     $this->setFeature('rte');
                     $this->setFeature('homepage');
                     $this->setFeature('accesskey');
+                    $this->setFeature('optgroup');
                     $this->setQuirk('scrollbar_in_way');
                     $this->setQuirk('broken_multipart_form');
                     break;
@@ -270,6 +273,7 @@
                 case 5:
                     if ($this->getPlatform() == 'mac') {
                         $this->setFeature('javascript', 1.2);
+                        $this->setFeature('optgroup');
                     } else {
                         // MSIE 5 for Windows.
                         $this->setFeature('javascript', 1.4);


More information about the dev mailing list