You are here

function node_age_admin_settings in Spam 5.3

Module administrative configuration options.

1 string reference to 'node_age_admin_settings'
node_age_menu in filters/node_age/node_age.module
Drupal _menu() hook.

File

filters/node_age/node_age.module, line 102

Code

function node_age_admin_settings() {
  $form = array();
  $form['short'] = array(
    '#type' => 'fieldset',
    '#title' => 'Old content',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $limits = drupal_map_assoc(spam_range(604800, 14515200, 604800), 'format_interval');
  $weights = drupal_map_assoc(array(
    60,
    65,
    70,
    75,
    80,
    81,
    82,
    83,
    84,
    85,
    86,
    87,
    88,
    89,
    90,
    91,
    92,
    93,
    94,
    95,
    96,
    97,
    98,
    99,
  ));
  $form['short']['node_age_limit_short'] = array(
    '#type' => 'select',
    '#title' => t('Old content is content not published within the past'),
    '#options' => $limits,
    '#required' => TRUE,
    '#default_value' => variable_get('node_age_limit_short', 2419200),
  );
  $form['short']['node_age_weight_short'] = array(
    '#type' => 'select',
    '#title' => t('Probability that comments posted to old content is spam'),
    '#options' => $weights,
    '#required' => TRUE,
    '#description' => t('Probability that comments posted to old content are spam, as a percentage.'),
    '#default_value' => variable_get('node_age_weight_short', 85),
  );
  $form['long'] = array(
    '#type' => 'fieldset',
    '#title' => 'Really old content',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['long']['node_age_limit_long'] = array(
    '#type' => 'select',
    '#title' => t('Really old content is content not published within the past'),
    '#options' => $limits,
    '#required' => TRUE,
    '#default_value' => variable_get('node_age_limit_long', 4838400),
  );
  $form['long']['node_age_weight_long'] = array(
    '#type' => 'select',
    '#title' => t('Probability that comments posted to really old content is spam'),
    '#options' => $weights,
    '#required' => TRUE,
    '#description' => t('Probability that comments posted to really old content are spam, as a percentage.'),
    '#default_value' => variable_get('node_age_weight_long', 99),
  );
  return system_settings_form($form);
}