You are here

function theme_print_pdf_format_link in Printer, email and PDF versions 6

Same name and namespace in other branches
  1. 5.4 print_pdf/print_pdf.module \theme_print_pdf_format_link()
  2. 5.3 print_pdf/print_pdf.module \theme_print_pdf_format_link()
  3. 7 print_pdf/print_pdf.module \theme_print_pdf_format_link()
  4. 5.x print_pdf/print_pdf.module \theme_print_pdf_format_link()

Format the PDF version link

Return value

array of formatted attributes

2 theme calls to theme_print_pdf_format_link()
print_pdf_insert_link in print_pdf/print_pdf.module
Auxiliary function to display a formatted PDF version link
print_pdf_link in print_pdf/print_pdf.module
Implementation of hook_link().

File

print_pdf/print_pdf.module, line 474
Displays Printer-friendly versions of Drupal pages.

Code

function theme_print_pdf_format_link() {
  $print_pdf_link_class = variable_get('print_pdf_link_class', PRINT_PDF_LINK_CLASS_DEFAULT);
  $print_pdf_content_disposition = variable_get('print_pdf_content_disposition', PRINT_PDF_CONTENT_DISPOSITION_DEFAULT);
  $print_pdf_show_link = variable_get('print_pdf_show_link', PRINT_PDF_SHOW_LINK_DEFAULT);
  $print_pdf_link_text = filter_xss(variable_get('print_pdf_link_text', t('PDF version')));
  $img = drupal_get_path('module', 'print') . '/icons/pdf_icon.gif';
  $title = t('Display a PDF version of this page.');
  $class = strip_tags($print_pdf_link_class);
  $new_window = $print_pdf_content_disposition == 1;
  $format = _print_format_link_aux($print_pdf_show_link, $print_pdf_link_text, $img);
  return array(
    'text' => $format['text'],
    'html' => $format['html'],
    'attributes' => print_fill_attributes($title, $class, $new_window),
  );
}