You are here

function process_position in Nodequeue 7.2

Same name and namespace in other branches
  1. 6.2 nodequeue.module \process_position()
  2. 7.3 nodequeue.module \process_position()

Expand position elements into selects. Works like the weight element, except only positive values are allowed.

1 string reference to 'process_position'
nodequeue_element_info in ./nodequeue.module
Implements hook_element_info().

File

./nodequeue.module, line 415
Maintains queues of nodes in arbitrary order.

Code

function process_position($element) {
  for ($n = 1; $n <= $element['#delta']; $n++) {
    $positions[$n] = $n;
  }
  $element['#options'] = $positions;
  $element['#options']['r'] = t('Remove');
  $element['#type'] = 'select';

  // add default properties for the select element
  $element += element_info('select');
  return $element;
}