You are here

public function CourseObjectBook::overrideNavigation in Course 6

Same name and namespace in other branches
  1. 7.2 modules/course_book/course_book.classes.inc \CourseObjectBook::overrideNavigation()
  2. 7 modules/course_book/course_book.classes.inc \CourseObjectBook::overrideNavigation()

Overrides navigation links.

Overrides CourseObject::overrideNavigation

File

modules/course_book/course_book.classes.inc, line 83

Class

CourseObjectBook

Code

public function overrideNavigation() {
  $links = parent::overrideNavigation();
  $node = node_load(arg(1));
  if (isset($node->book)) {
    $book_link = $node->book;
    if ($prev = book_prev($book_link)) {
      $links['prev'] = l('Previous', $prev['href']);
    }
    if ($next = book_next($book_link)) {
      $links['next'] = l('Next', $next['href']);
    }
  }
  return $links;
}