Documentación GVHIDRA 3.1.5
Referencia de la Clase HTML_TreeMenu_Listbox
Diagrama de herencias de HTML_TreeMenu_Listbox
HTML_TreeMenu_Presentation

Métodos públicos

 HTML_TreeMenu_Listbox ($structure, $options=array())
 toHTML ()
 _nodeToHTML ($node, $prefix= '')

Campos de datos

 $promoText
 $indentChar
 $indentNum
 $linkTarget

Descripción detallada

HTML_TreeMenu_Listbox class

This class presents the menu as a listbox

Definición en la línea 720 del archivo TreeMenu.php.


Documentación de las funciones miembro

_nodeToHTML ( node,
prefix = '' 
)

Returns HTML for a single node

private

Loop through subnodes

Definición en la línea 809 del archivo TreeMenu.php.

    {
        $html = sprintf('<option value="%s">%s%s</option>', $node->link, $prefix, $node->text);

        if (isset($node->items)) {
            for ($i=0; $i<count($node->items); $i++) {
                $html .= $this->_nodeToHTML($node->items[$i], $prefix . str_repeat($this->indentChar, $this->indentNum));
            }
        }

        return $html;
    }
HTML_TreeMenu_Listbox ( structure,
options = array() 
)

Constructor

Parámetros:
object$structureThe menu structure
array$optionsOptions whic affect the display of the listbox. These can consist of: o promoText The text that appears at the the top of the listbox Defaults to "Select..." o indentChar The character to use for indenting the nodes Defaults to "&nbsp;" o indentNum How many of the indentChars to use per indentation level Defaults to 2 o linkTarget Target for the links. Defaults to "_self" o submitText Text for the submit button. Defaults to "Go"

Definición en la línea 762 del archivo TreeMenu.php.

    {
        $this->HTML_TreeMenu_Presentation($structure);

        $this->promoText  = 'Select...';
        $this->indentChar = '&nbsp;';
        $this->indentNum  = 2;
        $this->linkTarget = '_self';
        $this->submitText = 'Go';

        foreach ($options as $option => $value) {
            $this->$option = $value;
        }
    }
toHTML ( )

Returns the HTML generated

Loop through subnodes

Definición en la línea 780 del archivo TreeMenu.php.

    {
        static $count = 0;
        $nodeHTML = '';

        if (isset($this->menu->items)) {
            for ($i=0; $i<count($this->menu->items); $i++) {
                $nodeHTML .= $this->_nodeToHTML($this->menu->items[$i]);
            }
        }

        return sprintf('<form target="%s" action="" onsubmit="var link = this.%s.options[this.%s.selectedIndex].value; if (link) {this.action = link; return true} else return false"><select name="%s"><option value="">%s</option>%s</select> <input type="submit" value="%s" /></form>',
                       $this->linkTarget,
                       'HTML_TreeMenu_Listbox_' . ++$count,
                       'HTML_TreeMenu_Listbox_' . $count,
                       'HTML_TreeMenu_Listbox_' . $count,
                       $this->promoText,
                       $nodeHTML,
                       $this->submitText);
    }

Documentación de los campos

$indentChar

Definición en la línea 732 del archivo TreeMenu.php.

$indentNum

Definición en la línea 739 del archivo TreeMenu.php.

$linkTarget

Definición en la línea 745 del archivo TreeMenu.php.

$promoText

Definición en la línea 726 del archivo TreeMenu.php.


La documentación para esta clase fue generada a partir del siguiente fichero: