Commit 878b0a64 authored by jcnventura's avatar jcnventura

Update function for new pdf_tool variable format (module|path).

parent 55be92e7
......@@ -159,3 +159,28 @@ function print_pdf_update_7200(&$sandbox) {
variable_del('print_pdf_node_link_pages');
variable_del('print_pdf_node_link_visibility');
}
/**
* Update pdf_tool variable to new module|path format
*/
function print_pdf_update_7201(&$sandbox) {
$tool = explode('|', variable_get('print_pdf_pdf_tool', PRINT_PDF_PDF_TOOL_DEFAULT));
if (count($tool == 1)) {
// Not an array yet, update variable to new format
if (preg_match('!dompdf_config.inc.php$!', $tool[0])) {
$tool[0] = 'print_pdf_dompdf|' . $tool[0];
}
elseif (preg_match('!tcpdf.php$!', $tool[0])) {
$tool[0] = 'print_pdf_tcpdf|' . $tool[0];
}
elseif (preg_match('!wkhtmltopdf!', $tool[0])) {
$tool[0] = 'print_pdf_wkhtmltopdf|' . $tool[0];
}
else {
$tool[0] = PRINT_PDF_PDF_TOOL_DEFAULT;
}
variable_set('print_pdf_pdf_tool', $tool[0]);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment