You are here

private function MembersActivity::setGroup in Heartbeat 6.4

Same name and namespace in other branches
  1. 7 modules/heartbeat_og/streams/membersactivity.inc \MembersActivity::setGroup()

setGroup

Sets the group for a given node ID.

Parameters

Integer $nid: The group node ID.

1 call to MembersActivity::setGroup()
MembersActivity::construct in modules/og_activity/membersactivity.inc
Fake constructor to hook this method instead of the constructor.

File

modules/og_activity/membersactivity.inc, line 77

Class

MembersActivity
Class MembersActivity Concrete class to prepare messages for the current user and all of his/her relations.

Code

private function setGroup($nid = 0) {
  if ($nid != 0) {
    $this->_gid = $nid;
    $this->group = node_load($nid);
  }
  elseif (!empty($_REQUEST['group_nid'])) {
    $this->_gid = $_REQUEST['group_nid'];
    $this->group = node_load($this->_gid);
  }
  elseif (arg(0) == 'node' && is_numeric(arg(1))) {
    $node = node_load(arg(1));
    if (og_is_group_type($node->type)) {
      $this->_gid = arg(1);
      $this->group = $node;
    }
    elseif (og_is_group_post_type($node->type)) {
      $this->_gid = current($node->og_groups);
      $this->group = node_load($this->_gid);
    }
  }
}