You are here

function _paging_populate_empty_names in Paging 7

Same name and namespace in other branches
  1. 6 paging.module \_paging_populate_empty_names()

Helper function to populate empty page names.

Parameters

$names: An array of page names found in the node body.

$title: The title of the node.

Return value

A complete array of page names, even if not provided.

2 calls to _paging_populate_empty_names()
paging_build_names in ./paging.module
Returns a rendered list of page links.
paging_node_view in ./paging.module
Implements hook_node_view().

File

./paging.module, line 594
Allows a node to be broken into multiple pages via a tag.

Code

function _paging_populate_empty_names($names, $title) {
  foreach ($names as $key => $name) {
    trim($names[$key]);
    if (empty($names[$key])) {
      $names[$key] = $title . ' - Page ' . ($key + 1);
    }
  }
  return $names;
}