Projet

Général

Profil

Révision a2baadd1

Ajouté par Assos Assos il y a environ 10 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/print/print_pdf/print_pdf.module
170 170
 * Implements hook_block_view().
171 171
 */
172 172
function print_pdf_block_view($delta = 0) {
173
  $block = array();
174

  
173 175
      switch ($delta) {
174 176
      case 'print_pdf-top':
175 177
        $block['subject'] = t('Most PDFd');
......
408 410
 */
409 411
function print_pdf_node_update($node) {
410 412
  if (user_access('administer print') || user_access('node-specific print configuration')) {
411
    if (!isset($node->print_pdf_display)) $node->print_pdf_display = variable_get('print_pdf_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
412
    if (!isset($node->print_pdf_display_comment)) $node->print_pdf_display_comment = variable_get('print_pdf_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
413
    if (!isset($node->print_pdf_display_urllist)) $node->print_pdf_display_urllist = variable_get('print_pdf_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
413
    if (!isset($node->print_pdf_display) || $node->print_pdf_display === NULL) {
414
      $node->print_pdf_display = variable_get('print_pdf_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
415
    }
416
    if (!isset($node->print_pdf_display_comment) || $node->print_pdf_display_comment === NULL) {
417
      $node->print_pdf_display_comment = variable_get('print_pdf_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
418
    }
419
    if (!isset($node->print_pdf_display_urllist) || $node->print_pdf_display_urllist === NULL) {
420
      $node->print_pdf_display_urllist = variable_get('print_pdf_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
421
    }
414 422

  
415 423
    _print_pdf_node_conf_modify($node->nid, $node->print_pdf_display, $node->print_pdf_display_comment, $node->print_pdf_display_urllist);
416 424
  }
......
675 683
  require_once(DRUPAL_ROOT . '/' . $print_pdf_pdf_tool);
676 684

  
677 685
  // Hide warnings, as some TCPDF constants may still be undefined
678
  @$pdf = new TCPDF();
686
  if (class_exists('TCPDF')) {
687
    @$pdf = new TCPDF();
679 688

  
680
  if (method_exists($pdf, 'getTCPDFVersion')) {
681
    return $pdf->getTCPDFVersion();
682
  }
683
  elseif (defined('PDF_PRODUCER')) {
684
    sscanf(PDF_PRODUCER, "TCPDF %s", $version);
689
    if (class_exists('TCPDF_STATIC')) {
690
      return TCPDF_STATIC::getTCPDFVersion();
691
    }
692
    elseif (method_exists($pdf, 'getTCPDFVersion')) {
693
      return $pdf->getTCPDFVersion();
694
    }
695
    elseif (defined('PDF_PRODUCER')) {
696
      sscanf(PDF_PRODUCER, "TCPDF %s", $version);
685 697

  
686
    return $version;
687
  }
688
  else {
689
    return 'unknown';
698
      return $version;
699
    }
690 700
  }
701
  return 'unknown';
691 702
}
692 703

  
693 704
/**

Formats disponibles : Unified diff