views_pdf.install in Views PDF 8
Same filename and directory in other branches
Install the views module
File
views_pdf.installView source
<?php
/**
* @file
* Install the views module
*/
use setasign\Fpdi\Fpdi;
/**
* Implements hook_requirements().
*/
function views_pdf_requirements($phase) {
$requirements = [];
if ($phase !== 'runtime') {
return $requirements;
}
if (class_exists(\TCPDF::class)) {
$requirements['views_pdf_fpdi_tcpdf'] = [
'title' => t('Views pdf: TCPDF library'),
'severity' => REQUIREMENT_OK,
'value' => t('TCPDF correctly installed.'),
];
}
else {
$requirements['views_pdf_fpdi_tcpdf'] = [
'title' => t('Views pdf: TCPDF library'),
'severity' => REQUIREMENT_ERROR,
'value' => t('TCPDF is missing.'),
];
}
if (class_exists(Fpdi::class)) {
$requirements['views_pdf_fpdi'] = [
'title' => t('Views pdf: FPDI library'),
'severity' => REQUIREMENT_OK,
'value' => t('FPDI correctly installed. Current version :version', [
':version',
Fpdi::VERSION,
]),
];
}
else {
$requirements['views_pdf_fpdi'] = [
'title' => t('Views pdf: FPDI library'),
'severity' => REQUIREMENT_OK,
'value' => t('FPDI is missing'),
];
}
return $requirements;
}
Functions
Name | Description |
---|---|
views_pdf_requirements | Implements hook_requirements(). |