You are here

function activemenu_js_book in Javascript Tools 5

Menu callback. Handle the activemenu for book menus.

This callback is registered in activemenu_menu().

1 string reference to 'activemenu_js_book'
book_activemenu_menu in activemenu/modules/book.inc
Implementation of hook_activemenu().

File

activemenu/modules/book.inc, line 37

Code

function activemenu_js_book() {
  if ($path = activemenu_get_request_path()) {

    // The book menu will use the nid as the key, so we take the second part of the path which will be the nid.
    $arg = explode('/', $path);
    $nid = $arg[1];
    print drupal_to_js(array(
      'status' => TRUE,
      'content' => book_tree($nid, 5, array(
        $nid,
      )),
    ));
  }
  exit;
}