You are here

function linkchecker_admin_settings in Link checker 5

1 string reference to 'linkchecker_admin_settings'
linkchecker_menu in ./linkchecker.module
Implementation of hook_menu().

File

./linkchecker.module, line 55
This module periodically check html links referenced by drupal nodes Developed and maintained by Marek Tichy, marek@ecn.cz

Code

function linkchecker_admin_settings() {
  $instruction_text = '<div>Configure Link checker core parameters.</div>';
  $form['instructions'] = array(
    '#type' => 'markup',
    '#value' => $instruction_text,
  );
  $form['linkchecker_rebuild'] = array(
    '#default_value' => variable_get('linkchecker_rebuild', 1),
    '#type' => 'select',
    '#title' => t('Delete all existing reports and scheduled tasks and start linkchecker from scratch'),
    '#description' => t("Choose how often should linkchecker inspect all existing nodes again. Menwhile, the linkchecker operates in an incremental mode, when only newly added and updated nodes are being checked."),
    '#options' => array(
      "0" => t("Never"),
      "1" => t("Next cron run"),
      "604800" => t("Weekly"),
      "2419200" => t("Monthly"),
    ),
  );
  $form['linkchecker_fqdn_only'] = array(
    '#default_value' => variable_get('linkchecker_fqdn_only', 1),
    '#type' => 'checkbox',
    '#title' => t('Consider only fully qualified URLs ( not local links )'),
    '#description' => "",
  );
  $form['linkchecker_ignore_responses'] = array(
    '#default_value' => variable_get('linkchecker_ignore_responses', "401\n403"),
    '#type' => 'textarea',
    '#title' => t("Don't treat those response codes as errors"),
    '#description' => "One per line, HTTP code only (e.g. 403) or full response string (e.g. 402 Payment Required)",
  );
  $form['linkchecker_maxtime'] = array(
    '#default_value' => variable_get('linkchecker_maxtime', 30),
    '#type' => 'textfield',
    '#title' => t('Maximum runtime'),
    '#size' => 50,
    '#maxlength' => 100,
    '#description' => t('Maximum allowed time (in seconds) that can be spent on link checking every cron job run. The default value is 30 seconds. '),
  );
  $form['linkchecker_socket_timeout'] = array(
    '#default_value' => variable_get('linkchecker_socket_timeout', 3),
    '#type' => 'textfield',
    '#title' => t('Socket timeout (seconds)'),
    '#size' => 50,
    '#maxlength' => 100,
    '#description' => t('If the linkchecker does not get at least some response from a remote site within the socket timeout, the link is considered broken.'),
  );
  $form['linkchecker_max_links_per_node'] = array(
    '#default_value' => variable_get('linkchecker_max_links_per_node', 0),
    '#type' => 'textfield',
    '#title' => t('Max links per node'),
    '#size' => 50,
    '#maxlength' => 100,
    '#description' => t('Set this limit if you have nodes with many links for which the link checking often takes longer than maximum runtime (you will see messages in the log files). 0 means no limit (default).'),
  );
  $form['linkchecker_remove_after'] = array(
    '#default_value' => variable_get('linkchecker_remove_after', 30),
    '#type' => 'textfield',
    '#title' => t('Days to keep reports'),
    '#size' => 50,
    '#maxlength' => 100,
    '#description' => t('If the node is not fixed within this number of days, we remove it.'),
  );
  $form['linkchecker_give_up'] = array(
    '#default_value' => variable_get('linkchecker_give_up', 5),
    '#type' => 'textfield',
    '#title' => t('Max attempts'),
    '#size' => 50,
    '#maxlength' => 100,
    '#description' => t('If the linkchecker keeps timing out on a node, give up on it after this number of attempts.'),
  );
  return system_settings_form($form);
}