You are here

function spaces_core_documents in Spaces 5.2

Same name and namespace in other branches
  1. 5 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 216

Code

function spaces_core_documents() {

  // og version of the book root lookup
  if ($space = spaces_get_space()) {
    $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', $space->sid, 'book', 0));
    if ($nid) {
      drupal_goto('node/' . $nid);
    }
    context_ui_set('node', 'book');
    $message = t('Please add your first book page to get started.');
    $button = spaces_node_links();
    $o = "<p>{$message}</p>{$button}";
    return $o;
  }
}