You are here

function _paging_content_wrap in Paging 6

Wrap the pager(s) and node body in a div for compatibility with AJAX replacement method.

1 call to _paging_content_wrap()
_paging_nodeapi in ./paging.module
Helper function for paging_nodeapi().

File

./paging.module, line 644
Allows users to use a tag to break up a node into multiple pages.

Code

function _paging_content_wrap(&$node) {
  foreach (array(
    'paging_above',
    'body',
    'paging',
  ) as $value) {
    if (array_key_exists($value, $node->content)) {
      $x[$value] = $node->content[$value];
    }
  }

  // Sort by #weight.
  uasort($x, 'element_sort');

  // Opening tag in first item.
  $start = reset(array_keys($x));
  $node->content[$start]['#value'] = '<div id="paging-pager-' . $node->nid . '" class="paging-pager-contents">' . $node->content[$start]['#value'];

  // Closing tag in last item.
  $end = end(array_keys($x));
  $node->content[$end]['#value'] .= '</div>';
}