+ // Robado de HTML_Page.
+ $lnEnd = $this->_getLineEnd();
+ $tab = $this->_getTab();
+ $strHtml = '';
+ foreach ($array as $element) {
+ if (is_object($element)) {
+ if (is_subclass_of($element, 'html_common')) {
+ $element->setTabOffset(1);
+ $element->setTab($tab);
+ $element->setLineEnd($lnEnd);
+ }
+ if (is_object($element)) {
+ if (method_exists($element, 'toHtml')) {
+ $strHtml .= $element->toHtml() . $lnEnd;
+ } elseif (method_exists($element, 'toString')) {
+ $strHtml .= $element->toString() . $lnEnd;
+ }
+ } else {
+ $strHtml .= $tab . $element . $lnEnd;
+ }
+ } elseif (is_array($element)) {
+ $strHtml .= $this->_arrayToHtml($element);
+ } else {
+ $strHtml .= $tab . $element . $lnEnd;
+ }
+ }
+ return $strHtml;