function pager_load_array

7.x theme.inc pager_load_array($value, $element, $old_array)
6.x theme.inc pager_load_array($value, $element, $old_array)

Adapted from https://api.drupal.org/api/drupal/includes%21pager.inc/function/pager_lo...

Copies $old_array to $new_array and sets $new_array[$element] = $value Fills in $new_array[0 .. $element - 1] = 0

File

includes/theme.inc, line 467

Code

function pager_load_array($value, $element, $old_array) {
  $new_array = $old_array;

  // Look for empty elements.
  for ($i = 0; $i < $element; $i++) {
    if (!$new_array [$i]) {

      // Load found empty element with 0.
      $new_array [$i] = 0;
    }
  }

  // Update the changed element.
  $new_array [$element] = (int) $value;
  return $new_array;
}