You are here

FrxHtmlDoc.inc in Forena Reports 7.3

Same filename and directory in other branches
  1. 7.4 docformats/FrxHtmlDoc.inc

FrxHtmlDoc Straight html document with no wrapping theme. @author davidmetzler

File

docformats/FrxHtmlDoc.inc
View source
<?php

/**
 * @file FrxHtmlDoc
 * Straight html document with no wrapping theme.
 * @author davidmetzler
 *
 */
class FrxHtmlDoc extends FrxDocument {
  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>' . $this
      ->check_markup($r->html) . '</body></html>';
    return $output;
  }
  public function output($output) {
    print $output;
    return TRUE;
  }

}

Classes

Namesort descending Description
FrxHtmlDoc @file FrxHtmlDoc Straight html document with no wrapping theme. @author davidmetzler