You are here

function linkchecker_link_edit_form in Link checker 6.2

Same name and namespace in other branches
  1. 5.2 linkchecker.module \linkchecker_link_edit_form()
  2. 7 linkchecker.pages.inc \linkchecker_link_edit_form()
1 string reference to 'linkchecker_link_edit_form'
linkchecker_menu in ./linkchecker.module
Implementation of hook_menu().

File

includes/linkchecker.pages.inc, line 181
User page callbacks for the linkchecker module.

Code

function linkchecker_link_edit_form(&$form_state, $link) {
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Settings'),
    '#collapsible' => FALSE,
    '#description' => t('The link <a href="@url">@url</a> was last checked on @last_checked and failed @fail_count times.', array(
      '@url' => $link['url'],
      '@fail_count' => $link['fail_count'],
      '@last_checked' => format_date($link['last_checked']),
    )),
  );
  $form['settings']['lid'] = array(
    '#type' => 'hidden',
    '#value' => $link['lid'],
  );
  $form['settings']['url'] = array(
    '#type' => 'hidden',
    '#value' => $link['url'],
  );
  $form['settings']['method'] = array(
    '#type' => 'select',
    '#title' => t('Select request method'),
    '#default_value' => $link['method'],
    '#options' => array(
      'HEAD' => t('HEAD'),
      'GET' => t('GET'),
    ),
    '#description' => t('Select the request method used for link checks of this link. If you encounter issues like status code 500 errors with the HEAD request method you should try the GET request method before ignoring a link.'),
  );
  $form['settings']['status'] = array(
    '#default_value' => $link['status'],
    '#type' => 'checkbox',
    '#title' => t('Check link status'),
    '#description' => t("Uncheck if you wish to ignore this link. Use this setting only as a last resort if there is no other way to solve a failed link check."),
  );
  $form['maintenance'] = array(
    '#type' => 'fieldset',
    '#title' => t('Maintenance'),
    '#collapsible' => FALSE,
  );
  $form['maintenance']['recheck'] = array(
    '#default_value' => 0,
    '#type' => 'checkbox',
    '#title' => t('Re-check link status on next cron run'),
    '#description' => t('Enable this checkbox if you want to re-check the link during the next cron job rather than wait for the next scheduled check on @date.', array(
      '@date' => format_date($link['last_checked'] + variable_get('linkchecker_check_links_interval', 2419200)),
    )),
  );
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  $form['buttons']['reset'] = array(
    '#type' => 'submit',
    '#value' => t('Reset to defaults'),
  );
  return $form;
}