You are here

function spaces_core_documents in Spaces 5

Same name and namespace in other branches
  1. 5.2 spaces_core/spaces_core.module \spaces_core_documents()
  2. 6 spaces_core/spaces_core.module \spaces_core_documents()
1 string reference to 'spaces_core_documents'
spaces_core_menu in spaces_core/spaces_core.module
Implementation of hook_menu()

File

spaces_core/spaces_core.module, line 218

Code

function spaces_core_documents() {

  // og version of the book root lookup
  $gid = spaces_gid();
  $nid = db_result(db_query('SELECT n.nid FROM {node} n JOIN {book} b ON n.nid = b.nid AND n.vid = b.vid JOIN {og_ancestry} og ON og.nid = n.nid WHERE og.group_nid = %d AND n.type = "%s" AND b.parent = %d LIMIT 1', $gid, 'book', 0));
  if ($nid) {
    drupal_goto('node/' . $nid);
  }
  context_ui_set('node', 'book');
  _spaces_core_book_link();
  $message = t('Please add your first book page to get started.');
  $button = theme('spaces_button');
  $o = "<p>{$message}</p>{$button}";
  return $o;
}