Minor: add proper warning if test2pdf plugin cannot write icons to main/img/ - refs #2490

pull/2539/head
Yannick Warnier 8 years ago
parent d9ea0e02ff
commit 1297b3df9b
  1. 11
      plugin/test2pdf/src/test2pdf_plugin.class.php

@ -45,9 +45,14 @@ class Test2pdfPlugin extends Plugin
$dstfile1 = __DIR__.'/../../../main/img/icons/64/test2pdf.png'; $dstfile1 = __DIR__.'/../../../main/img/icons/64/test2pdf.png';
$dstfile2 = __DIR__.'/../../../main/img/icons/64/test2pdf_na.png'; $dstfile2 = __DIR__.'/../../../main/img/icons/64/test2pdf_na.png';
$dstfile3 = __DIR__.'/../../../main/img/test2pdf.png'; $dstfile3 = __DIR__.'/../../../main/img/test2pdf.png';
copy($srcfile1, $dstfile1); $res1 = @copy($srcfile1, $dstfile1);
copy($srcfile2, $dstfile2); $res2 = @copy($srcfile2, $dstfile2);
copy($srcfile3, $dstfile3); $res3 = @copy($srcfile3, $dstfile3);
if (!$res1 || !$res2 || !$res3) {
$warning = 'Test2PDF plugin icons could not be copied to main/img/ because of folder permissions. To fix, give web server user permissions to write to main/img/ before enabling this plugin.';
Display::addFlash($warning);
error_log($warning);
}
} }
/** /**

Loading…
Cancel
Save