function weight_value

Same name and namespace in other branches
  1. 6.x drupal-6.x/includes/form.inc \weight_value()

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

Related topics

Archivo

drupal-7.x/includes/form.inc, line 3010
Functions for form and batch generation and processing.

Código

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