You are here

function termstatus_settings in Taxonomy Term Status 7

Term status settings form.

1 string reference to 'termstatus_settings'
termstatus_menu in ./termstatus.module
Implements hook_menu().

File

./termstatus.admin.inc, line 10
Administrative interface for the taxonomy term status module.

Code

function termstatus_settings($form, &$form_state) {
  $count = _termstatus_count_nullstatus();
  $enabled = variable_get('termstatus_enable', FALSE);
  if ($count) {
    $form['message'] = array(
      '#markup' => t('There are %count taxonomy terms which do not have any status setting. You need to rebuild the taxonomy term status records.', array(
        '%count' => $count,
      )),
    );
  }
  $form['termstatus_enable'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable term status'),
    '#description' => t('If enabled, unpublished taxonomy terms are hidden'),
    '#default_value' => $enabled,
    '#disabled' => !$enabled && $count > 0,
  );
  $form['actions']['rebuild'] = array(
    '#type' => 'submit',
    '#value' => t('Rebuild missing status records'),
    '#disabled' => $count == 0,
    '#submit' => array(
      'termstatus_rebuild_submit',
    ),
  );
  return system_settings_form($form);
}