fetchHead($this->_doc); $contents = ob_get_contents(); ob_end_clean(); return $contents; } /** * Generates the head html and return the results as a string * * @access public * @return string */ function fetchHead(&$document) { // get line endings $lnEnd = $document->_getLineEnd(); $tab = $document->_getTab(); $tagEnd = ' />'; $strHtml = ''; // Generate base tag (need to happen first) $base = $document->getBase(); if(!empty($base)) { $strHtml .= $tab.''.$lnEnd; } // Generate META tags (needs to happen as early as possible in the head) foreach ($document->_metaTags as $type => $tag) { foreach ($tag as $name => $content) { if ($type == 'http-equiv') { $strHtml .= $tab.''.$lnEnd; $strHtml .= $tab.''.$lnEnd; $strHtml .= $tab.''.htmlspecialchars($document->getTitle()).''.$lnEnd; // Generate link declarations foreach ($document->_links as $link) { $strHtml .= $tab.$link.$tagEnd.$lnEnd; } // Generate stylesheet links foreach ($document->_styleSheets as $strSrc => $strAttr ) { $strHtml .= $tab . '_style as $type => $content) { $strHtml .= $tab.''.$lnEnd; } // Generate script file links foreach ($document->_scripts as $strSrc => $strType) { $strHtml .= $tab.''.$lnEnd; } // Generate script declarations foreach ($document->_script as $type => $content) { $strHtml .= $tab.''.$lnEnd; } foreach($document->_custom as $custom) { $strHtml .= $tab.$custom.$lnEnd; } return $strHtml; } }