private function drawThumbnailZone(&$thumbnail, $node, $clip, $background, $gridcolumn, $lastChild = false)
    {
        $x = $clip[0];
        $y = $clip[1];
        $width = $clip[2];
        $height = $clip[3];

        if (null !== $spansize = preg_replace('/[^0-9]+/', '', $node->getAttribute('class'))) {
            $width = floor($width * $spansize / $gridcolumn);
        }

        if (false !== strpos($node->getAttribute('class'), 'Child')) {
            $height = floor($height / 2);
        }

        if (!$node->hasChildNodes()) {
            $this->drawRect($thumbnail, array($x, $y, $width, $height), $background, ($width == $clip[2] || strpos($node->getAttribute('class'), 'hChild')), $lastChild);

            return $width + 2;
        }

        foreach ($node->childNodes as $child) {
            if (is_a($child, 'DOMText')) {
                continue;
            }

            if ('clear' == $child->getAttribute('class')) {
                $x = $clip[0];
                $y = $clip[1] + floor($height / 2) + 2;
                continue;
            }

            $x += $this->drawThumbnailZone($thumbnail, $child, array($x, $y, $clip[2], $height), $background, $gridcolumn, $node->isSameNode($node->parentNode->lastChild));
        }

        return $x + $width - 2;
    }
private function drawThumbnailZone(&$thumbnail, $node, $clip, $background, $gridcolumn, $lastChild = false)
    {
        $x = $clip[0];
        $y = $clip[1];
        $width = $clip[2];
        $height = $clip[3];

        if (null !== $spansize = preg_replace('/[^0-9]+/', '', $node->getAttribute('class'))) {
            $width = floor($width * $spansize / $gridcolumn);
        }

        if (false !== strpos($node->getAttribute('class'), 'Child')) {
            $height = floor($height / 2);
        }

        if (!$node->hasChildNodes()) {
            $this->drawRect($thumbnail, array($x, $y, $width, $height), $background, ($width == $clip[2] || strpos($node->getAttribute('class'), 'hChild')), $lastChild);

            return $width + 2;
        }

        foreach ($node->childNodes as $child) {
            if (is_a($child, 'DOMText')) {
                continue;
            }

            if ('clear' == $child->getAttribute('class')) {
                $x = $clip[0];
                $y = $clip[1] + floor($height / 2) + 2;
                continue;
            }

            $x += $this->drawThumbnailZone($thumbnail, $child, array($x, $y, $clip[2], $height), $background, $gridcolumn, $node->isSameNode($node->parentNode->lastChild));
        }

        return $x + $width - 2;
    }
private function drawThumbnailZone ( & $ thumbnail , $ node , $ clip , $ background , $ gridcolumn , $ lastChild = false ) { $ x = $ clip [ 0 ] ; $ y = $ clip [ 1 ] ; $ width = $ clip [ 2 ] ; $ height = $ clip [ 3 ] ; if ( null !== $ spansize = preg_replace ( '/[^0-9]+/' , '' , $ node -> getAttribute ( 'class' ) ) ) { $ width = floor ( $ width * $ spansize / $ gridcolumn ) ; } if ( false !== strpos ( $ node -> getAttribute ( 'class' ) , 'Child' ) ) { $ height = floor ( $ height / 2 ) ; } if ( ! $ node -> hasChildNodes ( ) ) { $ this -> drawRect ( $ thumbnail , array ( $ x , $ y , $ width , $ height ) , $ background , ( $ width == $ clip [ 2 ] || strpos ( $ node -> getAttribute ( 'class' ) , 'hChild' ) ) , $ lastChild ) ; return $ width + 2 ; } foreach ( $ node -> childNodes as $ child ) { if ( is_a ( $ child , 'DOMText' ) ) { continue ; } if ( 'clear' == $ child -> getAttribute ( 'class' ) ) { $ x = $ clip [ 0 ] ; $ y = $ clip [ 1 ] + floor ( $ height / 2 ) + 2 ; continue ; } $ x += $ this -> drawThumbnailZone ( $ thumbnail , $ child , array ( $ x , $ y , $ clip [ 2 ] , $ height ) , $ background , $ gridcolumn , $ node -> isSameNode ( $ node -> parentNode -> lastChild ) ) ; } return $ x + $ width - 2 ; }
Draw a final layout zone on its thumbnail.

@access private

@param ressource $thumbnail  The thumbnail ressource
@param DOMNode   $node       The current node zone
@param array     $clip       The clip rect to draw
@param int       $background The background color
@param int       $gridcolumn The number of columns in the grid
@param boolean   $lastChild  True if the current node is the last child of its parent node

@return int The new X axis position;
Draw a final layout zone on its thumbnail .