You are here

function book_made_simple_og_manager in Book made simple 7.3

Add gids[] param in url for Organic Group managenement

2 calls to book_made_simple_og_manager()
book_made_simple_add_child_book_content_types_ddlist in ./book_made_simple.module
Display allowed child type as dropdown listbox.
book_made_simple_link in ./book_made_simple.module
Creates dropdown list of links.

File

./book_made_simple.module, line 589
Automaticly creats a book and simple creation of child pages. Author: M. Morin

Code

function book_made_simple_og_manager(&$query) {
  if (module_exists('og') && module_exists('og_context')) {
    $og_is_v1 = function_exists('og_get_group_ids');
    $group_node = og_context_determine_context($og_is_v1 ? null : 'node');
    if ($group_node) {
      $nid = false;
      if ($og_is_v1 && og_is_member($group_node)) {
        $nid = $group_node->nid;
      }

      // V2 OG Version
      if (!$og_is_v1 && og_is_member('node', $group_node)) {
        $nid = $group_node;
      }
      if ($nid !== FALSE) {
        if (is_array($query)) {
          $query['gids[]'] = $nid;
        }
        else {
          $query .= '&gids[]=' . $nid;
        }
      }
    }
  }
}