function linkchecker_clear_analyze_links_submit in Link checker 6.2
Same name and namespace in other branches
- 7 linkchecker.admin.inc \linkchecker_clear_analyze_links_submit()
Submit callback; Clear link data and analyze all node types, boxes and cck fields.
1 string reference to 'linkchecker_clear_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 341 - Administrative page callbacks for the linkchecker module.
Code
function linkchecker_clear_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);
db_query("TRUNCATE TABLE {linkchecker_nodes}");
db_query("TRUNCATE TABLE {linkchecker_comments}");
db_query("TRUNCATE TABLE {linkchecker_boxes}");
db_query("TRUNCATE TABLE {linkchecker_links}");
// 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());
}
}