You are here

function FrxHostApplication::report_css in Forena Reports 6.2

Same name and namespace in other branches
  1. 7.2 FrxHostApplication.inc \FrxHostApplication::report_css()

* Determines which css files need to be loaded. * *

Parameters

array $desc Report descriptor from forena_rport_desc: * @param string $form The report "form" to be used. From the report * @param string $format Document format that will be used for the report. * @return array A list of css files that should be applied to the report.

File

./FrxHostApplication.inc, line 103

Class

FrxHostApplication

Code

function report_css($desc, $form, $format = '') {
  $css_files = array();

  // First check for the form file
  $path = forena_report_path();
  if (file_exists($path . '/' . $form . '.css')) {
    $css_files[] = $path . '/' . $form . '.css';
  }
  if ($format && file_exists($path . '/' . $form . '-' . $format . '.css')) {
    $css_files[] = $path . '/' . $form . '-' . $format . '.css';
  }

  // Now check for a report specific file
  $base_file = $path . '/' . $desc['name'];
  if ($format && file_exists($base_file . '-' . $format . '.css')) {
    $css_files[] = $base_file . '-' . $format . '.css';
  }
  elseif (file_exists($base_file . '.css')) {
    $css_files[] = $base_file . '.css';
  }

  //drupal_set_message("desc: <pre>". print_r($desc, 1) ."</pre>");

  //drupal_set_message("css files: <pre>". print_r($css_files, 1) ."</pre>");
  return $css_files;
}