You are here

function drush_print_pdf_download in Printer, email and PDF versions 7.2

Same name and namespace in other branches
  1. 6 print_pdf/print_pdf.drush.inc \drush_print_pdf_download()
  2. 7 print_pdf/print_pdf.drush.inc \drush_print_pdf_download()

Download and extract PDF archive.

Parameters

string $library: Library to download.

File

print_pdf/print_pdf.drush.inc, line 54
Provide drush integration for print_pdf module PDF libraries download.

Code

function drush_print_pdf_download($library) {
  $pdf_libs = array();
  drush_command_invoke_all_ref('drush_pdf_libs_alter', $pdf_libs);
  if (isset($library) && isset($pdf_libs[drupal_strtolower($library)])) {
    $func = $pdf_libs[drupal_strtolower($library)]['callback'];
    $download_url = $func();
    if ($download_url) {
      _print_drush_download_lib($library, $download_url);
    }
  }
  else {
    drush_log(dt('Please specify a PDF library. Available choices: !libs.', array(
      '!libs' => implode(', ', array_keys($pdf_libs)),
    )), 'error');
  }
}