nodeactivity.inc in Heartbeat 7
File
modules/heartbeat_defaults/streams/nodeactivity.inc
View source
<?php
class NodeActivity extends HeartbeatStream {
protected $nid = 0;
public function getNid() {
return $this->nid;
}
public function setNid($nid) {
$this->nid = $nid;
$this->contextual_arguments['nid'] = $this->nid;
}
public function construct() {
if (!empty($_GET['contextualArguments']) && isset($_GET['contextualArguments']['nid'])) {
$this
->setNid($_GET['contextualArguments']['nid']);
}
elseif (arg(0) == "node" && is_numeric(arg(1))) {
$this
->setNid(arg(1));
}
}
public function modifyActivityMessage(HeartbeatActivity $heartbeatActivity) {
$heartbeatActivity->nid = $this->nid;
}
protected function queryAlter() {
$this->query
->condition('ha.access', 0, '>')
->condition(db_or()
->condition('ha.nid', $this->nid)
->condition('ha.nid_target', $this->nid));
}
public function viewsQueryAlter(&$view) {
$views->query
->condition('ha.access', 0, '>')
->condition(db_or()
->condition('ha.nid', $this->nid)
->condition('ha.nid_target', $this->nid));
}
}
Classes
Name |
Description |
NodeActivity |
Class NodeActivity
Stream with all activity related to nodes. |