You are here

function linkchecker_analyze_links_submit in Link checker 7

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

Submit callback.

Analyze fields in all node types, comments, custom blocks.

1 call to linkchecker_analyze_links_submit()
drush_linkchecker_analyze in ./linkchecker.drush.inc
Callback for command linkchecker-analyze.
1 string reference to 'linkchecker_analyze_links_submit'
linkchecker_admin_settings_form in ./linkchecker.admin.inc
Implements hook_admin_settings_form().

File

./linkchecker.admin.inc, line 307
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 = linkchecker_scan_node_types();
  if (!empty($node_types)) {
    module_load_include('inc', 'linkchecker', 'linkchecker.batch');
    batch_set(_linkchecker_batch_import_nodes($node_types));
  }
  $comment_types = linkchecker_scan_comment_types();
  if (!empty($comment_types)) {
    module_load_include('inc', 'linkchecker', 'linkchecker.batch');
    batch_set(_linkchecker_batch_import_comments($comment_types));
  }
  if (variable_get('linkchecker_scan_blocks', 0)) {
    module_load_include('inc', 'linkchecker', 'linkchecker.batch');
    batch_set(_linkchecker_batch_import_block_custom());
  }
}