pager_load_array

Versions
4.6 – 7
pager_load_array($value, $element, $old_array)

Helper function

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

▾ 5 functions call pager_load_array()

theme_pager_first in includes/pager.inc
Format a "first page" link.
theme_pager_last in includes/pager.inc
Format a "last page" link.
theme_pager_link in includes/pager.inc
Format a link to a specific query result page.
theme_pager_next in includes/pager.inc
Format a "next page" link.
theme_pager_previous in includes/pager.inc
Format a "previous page" link.

Code

includes/pager.inc, line 421

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.