// $Id: theme_sample.php,v 1.1.2.1 2007-02-28 08:46:55 eaton Exp $ // This function is an alternative to the standard Custom Pager theming function. It was used in // earlier versions of the module, but was removed to eliminate the node_load() calls for each // page in on high-traffic sites. Now, it provides an example of yet-another-way the pagers can // be themed. function my_theme_custom_pager($nav_array, $node, $pager) { drupal_add_css(drupal_get_path('module', 'custom_pagers') .'/custom_pagers.css'); if (is_numeric($nav_array['prev'])) { $prev = node_load($nav_array['prev']); } if (is_numeric($nav_array['next'])) { $next = node_load($nav_array['next']); } if ($prev || $next) { if ($prev) { $links[] = l(t('‹ ') . $prev->title, 'node/'. $prev->nid, array('class' => 'pager-previous', 'title' => $prev->title)); } // Word break (a is an inline element) $links[] = ''. ($nav_array['current_index'] + 1) .' of '. count($nav_array['full_list']) .''; if ($next) { $links[] = l($next->title . t(' ›'), 'node/'. $next->nid, array('class' => 'pager-next', 'title' => $next->title)); } $output .= '
' . implode(' ', $links) . '
'; } return $output; }