Commit 6df3d912 authored by metzlerd's avatar metzlerd
Browse files

Added <style> support in Frx file.

parent b5d80ae4
......@@ -11,9 +11,14 @@ class FrxHtmlDoc extends FrxDocument {
$output = '<html><head>';
$output .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>';
$title = $r->title;
if ($css) {
// 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>';
......
......@@ -36,9 +36,13 @@ class FrxMPDF extends FrxDocument {
$output = '';
$output = '<html><head>';
$output .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>';
if (@$options['css']) {
if (@$options['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 $link_class'><h1>" . $r->title . '</h1>' . $html;
......
......@@ -30,9 +30,13 @@ class FrxPrincePDF extends FrxDocument {
$link_class = $disable_links ? 'prince-disable-links': '';
$output = '<html><head>';
$output .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>';
if (@$options['css']) {
if (@$options['css'] || isset($r->rpt_xml->head->style)) {
$output .= '<style type="text/css">';
$output .= $css;
if (isset($r->rpt_xml->head->style) || isset($r->rpt_xml->head->style)) {
$sheet = (string)$r->rpt_xml->head->style;
$output .= $sheet;
}
$output .= '</style>';
}
......
......@@ -28,6 +28,12 @@ class FrxWebDoc extends FrxDocument {
}
}
// Add inline styles
if (isset($r->rpt_xml->head->style)) {
$sheet = (string)$r->rpt_xml->head->style;
drupal_add_css($sheet, array('type' => 'inline'));
}
// Add javascript files
foreach (Frx::Skin()->scripts as $script) {
drupal_add_js($script);
......
......@@ -14,9 +14,13 @@ class FrxWordDoc extends FrxDocument {
$css = $this->loadCSSFiles($format);
$output = '<html><head>';
$output .= '<meta http-equiv="Content-Type" content="text/html"/>';
if ($options['css']) {
if ($options['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">' . $this->check_markup($r->html) . '</body></html>';
......
......@@ -266,7 +266,7 @@ can define parameters in the head section of the .frx file as follows:
the select value</td>
</tr>
<tr>
<th>label_field</th><td>The anme of the columne from the block that is used for
<th>label_field</th><td>The name of the columne from the block that is used for
the select description.</td>
</tr>
</table>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment