public static function PdfTemplate::getAvailableTemplates in Views PDF 6
Same name and namespace in other branches
- 7.3 views_pdf_template.php \PdfTemplate::getAvailableTemplates()
- 7 views_pdf_template.php \PdfTemplate::getAvailableTemplates()
- 7.2 views_pdf_template.php \PdfTemplate::getAvailableTemplates()
This method returns a list of current uploaded files.
1 call to PdfTemplate::getAvailableTemplates()
- views_pdf_get_pdf_templates in ./
views_pdf.module - This method can be used to get all available templates.
File
- ./
views_pdf_template.php, line 823 - 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 getAvailableTemplates() {
if (self::$templateList != NULL) {
return self::$templateList;
}
$files_path = file_directory_path();
$template_dir = variable_get('views_pdf_template_path', 'views_pdf_templates');
$dir = $files_path . '/' . $template_dir;
$templatesFiles = file_scan_directory($dir, '.pdf', array(
'.',
'..',
'CVS',
), 0, FALSE, 'filename', 0, 1);
$templates = array();
foreach ($templatesFiles as $file) {
$templates[$file->name] = $file->name;
}
self::$templateList = $templates;
return $templates;
}