You are here

function linkchecker_analyze_links_submit in Link checker 6.2

Same name and namespace in other branches
  1. 7 linkchecker.admin.inc \linkchecker_analyze_links_submit()

Submit callback; Analyze all node types, boxes and cck fields.

1 string reference to 'linkchecker_analyze_links_submit'
linkchecker_admin_settings_form in includes/linkchecker.admin.inc
@file Administrative page callbacks for the linkchecker module.

File

includes/linkchecker.admin.inc, line 315
Administrative page callbacks for the linkchecker module.

Code

function linkchecker_analyze_links_submit($form, &$form_state) {

  // Exclude unnecessary elements.
  unset($form_state['values']['linkchecker_analyze'], $form_state['values']['linkchecker_clear_analyze']);

  // Save form settings.
  system_settings_form_submit($form, $form_state);

  // Start batch and analyze all nodes.
  $node_types = array_keys(array_filter(variable_get('linkchecker_scan_nodetypes', array())));
  if (!empty($node_types)) {
    module_load_include('inc', 'linkchecker', '/includes/linkchecker.batch');
    batch_set(_linkchecker_batch_import_nodes($node_types));
    if (variable_get('linkchecker_scan_comments', 0)) {
      batch_set(_linkchecker_batch_import_comments($node_types));
    }
  }
  if (variable_get('linkchecker_scan_blocks', 0)) {
    module_load_include('inc', 'linkchecker', '/includes/linkchecker.batch');
    batch_set(_linkchecker_batch_import_boxes());
  }
}