You are here

function Pagination::getHeaders in Pagination (Node) 6

Same name and namespace in other branches
  1. 7 includes/Pagination.inc \Pagination::getHeaders()

@desc Get page headers

Parameters

int nid: @return array page headers @public

1 call to Pagination::getHeaders()
Pagination::getToc in ./pagination.module
@desc Get a themed Table of Contents

File

./pagination.module, line 571
pagination.module @desc Allow for arbitrary nodes to be paginated. administrators can set which nodes they wish to paginate, and the length of content required to split a node into pages. Alternatively, content creators can set manual break points…

Class

Pagination
@desc Handles all the pagination logic

Code

function getHeaders($nid = 0) {
  if (!$nid) {
    return array();
  }
  static $query;
  if (!$query and $this->value > PAGINATION_AUTO) {
    $query = 'SELECT headers FROM {node_pagination} WHERE nid = %d';
    $result = db_query($query, $nid);
    $get = db_fetch_object($result);
    $headers = isset($get->headers) ? unserialize($get->headers) : array();
    foreach ($headers as $key => $header) {

      // Page 1 is always the node title
      $this->headers[$key + 1] = $header;
    }
  }
  return $this->headers;
}