You are here

private function GroupActivity::detectGroup in Heartbeat 7

detectGroup

Detects the group for a given node ID.

1 call to GroupActivity::detectGroup()
GroupActivity::construct in modules/heartbeat_og/streams/groupactivity.inc
Fake constructor to hook this method instead of the constructor.

File

modules/heartbeat_og/streams/groupactivity.inc, line 27
Defines a stream for Group Activity.

Class

GroupActivity
Concrete class GroupActivity Defines a stream for activity within a group.

Code

private function detectGroup() {

  // First check the contextual arguments that could have been sent along
  // with ajax posts to get the context of the current node.
  if (!empty($_GET['contextualArguments']) && isset($_GET['contextualArguments']['og_etid'])) {
    $this
      ->setGroup($_GET['contextualArguments']['og_etid']);
  }
  elseif ($og_context = og_context()) {
    $this->og_context = $og_context;
    $this
      ->setGroup($og_context->etid);
  }
}