You are here

protected function HeartbeatStream::setContextualArguments in Heartbeat 7

setContextualArguments().

1 call to HeartbeatStream::setContextualArguments()
HeartbeatStream::__construct in includes/heartbeatstream.inc
Constructor

File

includes/heartbeatstream.inc, line 142
HeartbeatStream object is the object that takes stream configuration to create a stream of activity objects. It is the controlling organ at the pre-query, query and post-query phases.

Class

HeartbeatStream
Abstract class HeartbeatStream This base class has final template methods which are used by the derived concretes. The HeartbeatStream is a state object that is given to the HeartbeatStreamBuilder to set the access to the current request.

Code

protected function setContextualArguments() {

  // Add a contextual argument if we are viewing a user.
  if (!empty($_GET['contextualArguments']) && isset($_GET['contextualArguments']['uid_target'])) {
    $this->contextual_arguments['uid_target'] = $_GET['contextualArguments']['uid_target'];
  }
  elseif ($this->viewed->uid != $this->viewer->uid) {
    $this->contextual_arguments['uid_target'] = $this->viewed->uid;
  }
  drupal_add_js(array(
    'heartbeatContextArguments' => $this->contextual_arguments,
  ), "setting");
}