function print_pdf_form_alter in Printer, email and PDF versions 5.3
Same name and namespace in other branches
- 5.4 print_pdf/print_pdf.module \print_pdf_form_alter()
- 6 print_pdf/print_pdf.module \print_pdf_form_alter()
- 7.2 print_pdf/print_pdf.module \print_pdf_form_alter()
- 7 print_pdf/print_pdf.module \print_pdf_form_alter()
- 5.x print_pdf/print_pdf.module \print_pdf_form_alter()
Implementation of hook_form_alter().
File
- print_pdf/
print_pdf.module, line 174
Code
function print_pdf_form_alter($form_id, &$form) {
// Add the node-type settings option to activate the PDF version link
if ($form_id == 'node_type_form') {
$form['print']['print_pdf_display'] = array(
'#type' => 'checkbox',
'#title' => t('Show PDF version link'),
'#default_value' => variable_get('print_pdf_display_' . $form['#node_type']->type, PRINT_TYPE_SHOW_LINK_DEFAULT),
'#description' => t('Displays the link to a PDF version of the content. Further configuration is available on the !settings.', array(
'!settings' => l(t('settings page'), 'admin/settings/print'),
)),
);
$form['print']['print_pdf_display_comment'] = array(
'#type' => 'checkbox',
'#title' => t('Show PDF version link in individual comments'),
'#default_value' => variable_get('print_pdf_display_comment_' . $form['#node_type']->type, PRINT_TYPE_COMMENT_LINK_DEFAULT),
'#description' => t('Displays the link to a PDF version of the comment. Further configuration is available on the !settings.', array(
'!settings' => l(t('settings page'), 'admin/settings/print'),
)),
);
}
}