You are here

function print_mail_form_alter in Printer, email and PDF versions 5.3

Same name and namespace in other branches
  1. 5.4 print_mail/print_mail.module \print_mail_form_alter()
  2. 6 print_mail/print_mail.module \print_mail_form_alter()
  3. 7 print_mail/print_mail.module \print_mail_form_alter()
  4. 5.x print_mail/print_mail.module \print_mail_form_alter()

Implementation of hook_form_alter().

File

print_mail/print_mail.module, line 150

Code

function print_mail_form_alter($form_id, &$form) {

  // Add the node-type settings option to activate the mail version link
  if ($form_id == 'node_type_form') {
    $form['print']['print_mail_display'] = array(
      '#type' => 'checkbox',
      '#title' => t('Show send by e-mail link'),
      '#default_value' => variable_get('print_mail_display_' . $form['#node_type']->type, PRINT_TYPE_SHOW_LINK_DEFAULT),
      '#description' => t('Displays a link to send the content by e-mail. Further configuration is available on the !settings.', array(
        '!settings' => l(t('settings page'), 'admin/settings/print'),
      )),
    );
    $form['print']['print_mail_display_comment'] = array(
      '#type' => 'checkbox',
      '#title' => t('Show send by e-mail link in individual comments'),
      '#default_value' => variable_get('print_mail_display_comment_' . $form['#node_type']->type, PRINT_TYPE_COMMENT_LINK_DEFAULT),
      '#description' => t('Displays a link to send the comment by e-mail. Further configuration is available on the !settings.', array(
        '!settings' => l(t('settings page'), 'admin/settings/print'),
      )),
    );
  }
}