You are here

class HtmlDocument in Forena Reports 7.5

Hierarchy

Expanded class hierarchy of HtmlDocument

File

src/DocumentFormats/HTMLDocument.php, line 9
HtmlDocument Straight html document with no wrapping theme. @author davidmetzler

Namespace

Drupal\forena\DocumentFormats
View source
class HtmlDocument extends DocumentTypeBase {
  public function render($r, $format, $options = array()) {
    $css = $this
      ->loadCSSFiles($format);
    $output = '<html><head>';
    $output .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>';
    $title = $r->title;

    // Add inline styles
    if ($css || isset($r->rpt_xml->head->style)) {
      $output .= '<style type="text/css">';
      $output .= $css;
      if (isset($r->rpt_xml->head->style)) {
        $sheet = (string) $r->rpt_xml->head->style;
        $output .= $sheet;
      }
      $output .= '</style>';
    }
    $output .= '<title>' . $r->title . '</title></head><body class="forena-report"><h1>' . $r->title . '</h1>' . $r->html . '</body></html>';
    return $output;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DocumentTypeBase::$allowDirectOutput public property
DocumentTypeBase::$charset public property
DocumentTypeBase::$content_type public property
DocumentTypeBase::$format public property
DocumentTypeBase::$print public property
DocumentTypeBase::check_markup public function Wrapper function for check output to default the right type.
DocumentTypeBase::convertCharset public function
DocumentTypeBase::header public function 5
DocumentTypeBase::loadCSSFiles public function
DocumentTypeBase::output public function 7
HtmlDocument::render public function Overrides DocumentTypeBase::render