function process_weight in Drupal 5
Same name and namespace in other branches
- 6 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;
}