You are here

function weight_settings_form in Weight 5

Same name and namespace in other branches
  1. 6 weight.admin.inc \weight_settings_form()
  2. 7 weight.admin.inc \weight_settings_form()
1 string reference to 'weight_settings_form'
weight_settings_page in ./weight.module

File

./weight.module, line 289

Code

function weight_settings_form() {
  $form = array();
  $types = node_get_types('names');
  $form['weight_range'] = array(
    '#type' => 'select',
    '#title' => t('Node Weight Range'),
    '#default_value' => variable_get('weight_range', 20),
    '#options' => array(
      5 => 5,
      10 => 10,
      20 => 20,
      30 => 30,
      40 => 40,
      50 => 50,
      60 => 60,
      70 => 70,
      80 => 80,
      90 => 90,
    ),
    '#description' => t('<p>This will be the +/- range for node weight.</p>'),
  );
  $form['weight_use_menu'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use Menu Weight'),
    '#default_value' => variable_get('weight_use_menu', FALSE),
    '#description' => t('<p>If the node has not been weighted, should we use the menu item weight?</p>'),
  );
  $form['weight_node_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Display On'),
    '#default_value' => variable_get('weight_node_types', $types),
    '#options' => $types,
    '#description' => t('<p>Add node weighting to these content types.</p>
      <p><i>Note:</i> Unselecting a node type after having changed weights
      for nodes of that type will leave these nodes with the current weight.
      You may want to check the <a href="@posts_page">Post page</a>. Before
      unsetting any node types.', array(
      '@posts_page' => url('admin/content/node'),
    )),
  );
  $form[] = array(
    '#type' => 'submit',
    '#value' => t('Update'),
  );
  return $form;
}