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

Expand weight elements into selects.

Related topics

File

includes/form.inc, line 1506

Code

function process_weight($element) {
  for ($n = -1 * $element['#delta']; $n <= $element['#delta']; $n++) {
    $weights[$n] = $n;
  }
  $element['#options'] = $weights;
  $element['#type'] = 'select';
  $element['#is_weight'] = TRUE;
  return $element;
}