You are here

function _spaces_core_book_link in Spaces 5

2 calls to _spaces_core_book_link()
spaces_core_documents in spaces_core/spaces_core.module
spaces_core_nodeapi in spaces_core/spaces_core.module
hook_nodeapi

File

spaces_core/spaces_core.module, line 283

Code

function _spaces_core_book_link() {

  // Generate the appropriate node button if viewing a book page
  if (spaces_gid() && spaces_is_member() && spaces_feature('book')) {
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $pid = arg(1);
      $types = node_get_types();
      $links['book']['title'] = $types['book']->name;
      $links['book']['href'] = 'node/add/book/parent/' . $pid;
    }
    if ($links) {
      context_set('spaces', 'links', $links);
    }
  }
}