function _linkchecker_batch_import_nodes in Link checker 7
Same name and namespace in other branches
- 5.2 linkchecker.module \_linkchecker_batch_import_nodes()
- 6.2 includes/linkchecker.batch.inc \_linkchecker_batch_import_nodes()
Batch: Scan nodes for links.
3 calls to _linkchecker_batch_import_nodes()
- linkchecker_analyze_links_submit in ./
linkchecker.admin.inc - Submit callback.
- linkchecker_clear_analyze_links_submit in ./
linkchecker.admin.inc - Submit callback.
- linkchecker_node_type_form_submit in ./
linkchecker.module - Submit handler for linkchecker_form_node_type_form_alter().
File
- ./
linkchecker.batch.inc, line 11 - Batch API callbacks for the linkchecker module.
Code
function _linkchecker_batch_import_nodes($node_types = array()) {
// Get all active {node}.nid's.
$result = db_query('SELECT n.nid FROM {node} n WHERE n.status = :status AND n.type IN (:types) ORDER BY n.nid', array(
':status' => 1,
':types' => $node_types,
));
$operations = array();
foreach ($result as $row) {
$operations[] = array(
'_linkchecker_batch_node_import_op',
array(
$row->nid,
),
);
}
$batch = array(
'file' => drupal_get_path('module', 'linkchecker') . '/linkchecker.batch.inc',
'finished' => '_linkchecker_batch_node_import_finished',
'operations' => $operations,
'title' => t('Scanning for links'),
);
return $batch;
}