You are here

function _pagerer_load_ak_array in Pagerer 7

Loads adaptive keys array.

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

2 calls to _pagerer_load_ak_array()
_pagerer_itemize_page_links in ./pagerer.module
Return rendered items representing the links to 'page' elements in the pager.
_pagerer_theme_handler in ./pagerer.module
Pagerer's theme handler.

File

./pagerer.module, line 2166
Pagerer

Code

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

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

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

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