You are here

public static function PdfTemplate::getTemplatePath in Views PDF 7

Same name and namespace in other branches
  1. 6 views_pdf_template.php \PdfTemplate::getTemplatePath()
  2. 7.3 views_pdf_template.php \PdfTemplate::getTemplatePath()
  3. 7.2 views_pdf_template.php \PdfTemplate::getTemplatePath()

This method returns the path to a specific template.

File

./views_pdf_template.php, line 1068
PDF Class to generate PDFs with native PHP. This class based on FPDF and FPDI.

Class

PdfTemplate
The main class to generate the PDF.

Code

public static function getTemplatePath($template, $row = NULL, $view = NULL) {
  if (empty($template)) {
    return '';
  }
  if ($row != NULL && $view != NULL && !preg_match('/\\.pdf/', $template)) {
    return drupal_realpath($row->field_data_field_file_node_values[0]['uri']);
  }
  $template_dir = variable_get('views_pdf_template_stream', 'public://views_pdf_templates');
  return drupal_realpath($template_dir . '/' . $template);
}