You are here

function paging_link in Paging 6

Same name and namespace in other branches
  1. 5 paging.module \paging_link()

Implementation of hook_link().

File

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

Code

function paging_link($type, $node = NULL, $teaser = FALSE) {
  $links = array();

  // Specify a new "Read more" which links to second page of the node if teaser is less than or
  // equal to the first page contents and if the setting is enabled.
  if ($type == 'node' && $teaser && $node->teaser && !empty($node->pagemore) && variable_get('paging_read_more_enabled_' . $node->type, 0)) {
    $links['paging_read_more'] = array(
      'title' => t('Read more'),
      'href' => drupal_get_path_alias("node/{$node->nid}"),
      'attributes' => array(
        'title' => t('Read the rest of this posting.'),
        'class' => 'read-more-paging',
      ),
      'query' => 'page=0,1',
    );
  }
  return $links;
}