Swat/SwatUI.php
private function parseUI($node, SwatUIObject $parent)
    {
        array_push($this->stack, $parent);

        foreach ($node->childNodes as $child_node) {
            // only parse element nodes. ignore text nodes
            if ($child_node->nodeType == XML_ELEMENT_NODE) {
                if ($child_node->nodeName === 'property') {
                    $this->parseProperty($child_node, $parent);
                } else {
                    $parsed_object = $this->parseObject($child_node);

                    $this->checkParsedObject(
                        $parsed_object,
                        $child_node->nodeName
                    );

                    /*
                     * No exceptions were thrown and the widget has an id
                     * so add to widget list to make it look-up-able.
                     */
                    if (
                        $child_node->nodeName === 'widget' &&
                        $parsed_object->id !== null
                    ) {
                        $this->widgets[$parsed_object->id] = $parsed_object;
                    }

                    $this->attachToParent($parsed_object, $parent);
                    $this->parseUI($child_node, $parsed_object);
                }
            }
        }

        array_pop($this->stack);
    }
private function parseUI($node, SwatUIObject $parent)
    {
        array_push($this->stack, $parent);

        foreach ($node->childNodes as $child_node) {
            // only parse element nodes. ignore text nodes
            if ($child_node->nodeType == XML_ELEMENT_NODE) {
                if ($child_node->nodeName === 'property') {
                    $this->parseProperty($child_node, $parent);
                } else {
                    $parsed_object = $this->parseObject($child_node);

                    $this->checkParsedObject(
                        $parsed_object,
                        $child_node->nodeName
                    );

                    /*
                     * No exceptions were thrown and the widget has an id
                     * so add to widget list to make it look-up-able.
                     */
                    if (
                        $child_node->nodeName === 'widget' &&
                        $parsed_object->id !== null
                    ) {
                        $this->widgets[$parsed_object->id] = $parsed_object;
                    }

                    $this->attachToParent($parsed_object, $parent);
                    $this->parseUI($child_node, $parsed_object);
                }
            }
        }

        array_pop($this->stack);
    }
private function parseUI ( $ node , SwatUIObject $ parent ) { array_push ( $ this -> stack , $ parent ) ; foreach ( $ node -> childNodes as $ child_node ) { // only parse element nodes. ignore text nodes if ( $ child_node -> nodeType == XML_ELEMENT_NODE ) { if ( $ child_node -> nodeName === 'property' ) { $ this -> parseProperty ( $ child_node , $ parent ) ; } else { $ parsed_object = $ this -> parseObject ( $ child_node ) ; $ this -> checkParsedObject ( $ parsed_object , $ child_node -> nodeName ) ; /*
                     * No exceptions were thrown and the widget has an id
                     * so add to widget list to make it look-up-able.
                     */ if ( $ child_node -> nodeName === 'widget' && $ parsed_object -> id !== null ) { $ this -> widgets [ $ parsed_object -> id ] = $ parsed_object ; } $ this -> attachToParent ( $ parsed_object , $ parent ) ; $ this -> parseUI ( $ child_node , $ parsed_object ) ; } } } array_pop ( $ this -> stack ) ; }
Recursivly parses an XML node into a widget tree

Calls self on all node children.

@param Object $node the XML node to begin with.
@param SwatUIObject $parent the parent object (usually a SwatContainer)
to add parsed objects to.

@throws SwatDuplicateIdException, SwatInvalidClassException,
SwatInvalidPropertyException, SwatInvalidPropertyTypeException,
SwatDoesNotImplementException, SwatClassNotFoundException,
SwatInvalidConstantExpressionException,
SwatUndefinedConstantException
Recursivly parses an XML node into a widget tree