You are here

function linkchecker_form_node_type_form_alter in Link checker 7

Implements hook_form_BASE_FORM_ID_alter().

File

./linkchecker.module, line 1030
This module periodically check links in given node types, blocks etc.

Code

function linkchecker_form_node_type_form_alter(&$form, $form_state) {
  if (isset($form['type'])) {
    $form['#submit'][] = 'linkchecker_node_type_form_submit';
    $form['linkchecker'] = array(
      '#title' => t('Link checker'),
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#group' => 'additional_settings',
      '#attached' => array(
        'js' => array(
          drupal_get_path('module', 'linkchecker') . '/linkchecker-node-form.js',
        ),
      ),
    );
    $form['linkchecker']['linkchecker_scan_node'] = array(
      '#type' => 'checkbox',
      '#title' => t('Scan content'),
      '#description' => t('Enables link checking for this content type.'),
      '#default_value' => variable_get('linkchecker_scan_node_' . $form['#node_type']->type, FALSE),
    );
    if (module_exists('comment')) {
      $form['linkchecker']['linkchecker_scan_comment'] = array(
        '#type' => 'checkbox',
        '#title' => t('Scan comments'),
        '#description' => t('Enables link checking for comments.'),
        '#default_value' => variable_get('linkchecker_scan_comment_' . $form['#node_type']->type, FALSE),
      );
    }
  }
}