Swat/SwatGroupedFlydown.php
public function display()
    {
        if (!$this->visible) {
            return;
        }

        SwatWidget::display();

        // tree is copied for display so we can add a blank node if show_blank
        // is true
        $display_tree = $this->getDisplayTree();
        $count = count($display_tree) - 1;

        // only show a select if there is more than one option
        if ($count > 1) {
            $select_tag = new SwatHtmlTag('select');
            $select_tag->name = $this->id;
            $select_tag->id = $this->id;
            $select_tag->class = $this->getCSSClassString();

            if (!$this->isSensitive()) {
                $select_tag->disabled = 'disabled';
            }

            $select_tag->open();

            foreach ($display_tree->getChildren() as $child) {
                $this->displayNode($child, 1);
            }

            $select_tag->close();
        } elseif ($count === 1) {
            // get first and only element
            $children = $display_tree->getChildren();
            $option = reset($children)->getOption();
            $this->displaySingle($option);
        }
    }
public function display()
    {
        if (!$this->visible) {
            return;
        }

        SwatWidget::display();

        // tree is copied for display so we can add a blank node if show_blank
        // is true
        $display_tree = $this->getDisplayTree();
        $count = count($display_tree) - 1;

        // only show a select if there is more than one option
        if ($count > 1) {
            $select_tag = new SwatHtmlTag('select');
            $select_tag->name = $this->id;
            $select_tag->id = $this->id;
            $select_tag->class = $this->getCSSClassString();

            if (!$this->isSensitive()) {
                $select_tag->disabled = 'disabled';
            }

            $select_tag->open();

            foreach ($display_tree->getChildren() as $child) {
                $this->displayNode($child, 1);
            }

            $select_tag->close();
        } elseif ($count === 1) {
            // get first and only element
            $children = $display_tree->getChildren();
            $option = reset($children)->getOption();
            $this->displaySingle($option);
        }
    }
public function display ( ) { if ( ! $ this -> visible ) { return ; } SwatWidget :: display ( ) ; // tree is copied for display so we can add a blank node if show_blank // is true $ display_tree = $ this -> getDisplayTree ( ) ; $ count = count ( $ display_tree ) - 1 ; // only show a select if there is more than one option if ( $ count > 1 ) { $ select_tag = new SwatHtmlTag ( 'select' ) ; $ select_tag -> name = $ this -> id ; $ select_tag -> id = $ this -> id ; $ select_tag -> class = $ this -> getCSSClassString ( ) ; if ( ! $ this -> isSensitive ( ) ) { $ select_tag -> disabled = 'disabled' ; } $ select_tag -> open ( ) ; foreach ( $ display_tree -> getChildren ( ) as $ child ) { $ this -> displayNode ( $ child , 1 ) ; } $ select_tag -> close ( ) ; } elseif ( $ count === 1 ) { // get first and only element $ children = $ display_tree -> getChildren ( ) ; $ option = reset ( $ children ) -> getOption ( ) ; $ this -> displaySingle ( $ option ) ; } }
Displays this grouped flydown

Displays this flydown as a XHTML select. Level 1 tree nodes are
displayed as optgroups if their value is null, they have children and
they are not dividers.
Displays this grouped flydown