views_data_export_pdf.install in Views Data Export PDF 7
Same filename and directory in other branches
Install and update hooks for the Views Data Export PDF module.
File
views_data_export_pdf.installView source
<?php
/**
* @file
* Install and update hooks for the Views Data Export PDF module.
*/
/**
* Implements hook_requirements().
*/
function views_data_export_pdf_requirements($phase) {
$requirements = [];
// Ensure translations don't break during installation.
$t = get_t();
if ($phase === 'runtime') {
$installed_renderers = views_data_export_pdf_get_renderer_types();
if (empty($installed_renderers)) {
$requirements['views_data_export_pdf_renderers'] = array(
'title' => $t('VDE PDF Renderers'),
'value' => $t('None installed'),
'description' => $t('The "Views Data Export PDF" module requires at least one renderer sub-module to be installed in order to function. Please consult the <code>README.md</code> file that ships with the module for instructions.'),
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}
/**
* Installs the new wkhtmltopdf sub-module to avoid breaking existing sites.
*/
function views_data_export_pdf_update_7001() {
module_enable([
'vde_pdf_wkhtmltopdf',
]);
}
Functions
Name![]() |
Description |
---|---|
views_data_export_pdf_requirements | Implements hook_requirements(). |
views_data_export_pdf_update_7001 | Installs the new wkhtmltopdf sub-module to avoid breaking existing sites. |