You are here

function weight_value in Drupal 7

Same name and namespace in other branches
  1. 4 includes/form.inc \weight_value()
  2. 5 includes/form.inc \weight_value()
  3. 6 includes/form.inc \weight_value()

Sets the value for a weight element, with zero as a default.

Related topics

File

includes/form.inc, line 3177
Functions for form and batch generation and processing.

Code

function weight_value(&$form) {
  if (isset($form['#default_value'])) {
    $form['#value'] = $form['#default_value'];
  }
  else {
    $form['#value'] = 0;
  }
}