You are here

function linkchecker_link_edit_form_submit in Link checker 5.2

Same name and namespace in other branches
  1. 6.2 includes/linkchecker.pages.inc \linkchecker_link_edit_form_submit()
  2. 7 linkchecker.pages.inc \linkchecker_link_edit_form_submit()

File

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

Code

function linkchecker_link_edit_form_submit($form_id, $form_values) {

  // Force asap link re-check.
  if ($form_values['recheck']) {
    db_query("UPDATE {linkchecker_links} SET last_checked = %d WHERE lid = %d", 0, $form_values['lid']);
    drupal_set_message(t('The link %url will be checked again on the next cron run.', array(
      '%url' => $form_values['url'],
    )));
  }
  if ($form_values['method'] != $form_values['method_old']) {

    // Update settings and reset statistics for a quick re-check.
    db_query("UPDATE {linkchecker_links} SET method = '%s', fail_count = %d, last_checked = %d, status = %d WHERE lid = %d", $form_values['method'], 0, 0, $form_values['status'], $form_values['lid']);
    drupal_set_message(t('The link settings for %url have been saved and the fail counter has been reset.', array(
      '%url' => $form_values['url'],
    )));
  }
  else {

    // Update setting only.
    db_query("UPDATE {linkchecker_links} SET method = '%s', status = %d WHERE lid = %d", $form_values['method'], $form_values['status'], $form_values['lid']);
    drupal_set_message(t('The link settings for %url have been saved.', array(
      '%url' => $form_values['url'],
    )));
  }
}