class NodeActivity in Heartbeat 7
Class NodeActivity Stream with all activity related to nodes.
Hierarchy
- class \HeartbeatStream
- class \NodeActivity
Expanded class hierarchy of NodeActivity
File
- modules/
heartbeat_defaults/ streams/ nodeactivity.inc, line 11
View source
class NodeActivity extends HeartbeatStream {
// Contains the Node ID for which should be filtered.
protected $nid = 0;
/**
* getNid().
*
* Function to retrieve the node id
*/
public function getNid() {
return $this->nid;
}
/**
* setNid().
*/
public function setNid($nid) {
$this->nid = $nid;
// Add the node ID to the contextual arguments.
$this->contextual_arguments['nid'] = $this->nid;
}
/**
* Implements construct().
*/
public function construct() {
// 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']['nid'])) {
$this
->setNid($_GET['contextualArguments']['nid']);
}
elseif (arg(0) == "node" && is_numeric(arg(1))) {
$this
->setNid(arg(1));
}
}
/**
* modifyActivityMessage().
* This will make sure the nid is saved when a message is logged.
* E.g. ActivityStatus plugin with a shout in node context.
*/
public function modifyActivityMessage(HeartbeatActivity $heartbeatActivity) {
// Add the content node context.
$heartbeatActivity->nid = $this->nid;
}
/**
* Implements queryAlter().
*/
protected function queryAlter() {
$this->query
->condition('ha.access', 0, '>')
->condition(db_or()
->condition('ha.nid', $this->nid)
->condition('ha.nid_target', $this->nid));
}
/**
* Function to add a part of a sql to a query built by views UI
*
* @param object $view
* The view handler by reference to add our part to the query.
*/
public function viewsQueryAlter(&$view) {
$views->query
->condition('ha.access', 0, '>')
->condition(db_or()
->condition('ha.nid', $this->nid)
->condition('ha.nid_target', $this->nid));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
public | property | ||
HeartbeatStream:: |
public | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
public | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
public | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
public | property | ||
HeartbeatStream:: |
public | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
protected | property | ||
HeartbeatStream:: |
public | function | addError | |
HeartbeatStream:: |
public | function | canPostActivityStatuses(). TODO Remove this here. The stream plugins should be stored in the stream object. This kind of access will become much easier to implement. | |
HeartbeatStream:: |
protected | function | Function to check access on messages This behaviour is set by a heartbeat message configuration to overrule the chosen display access type | |
HeartbeatStream:: |
protected | function | createQuery(). | 1 |
HeartbeatStream:: |
public | function | excludeOg(). | |
HeartbeatStream:: |
public | function | Function that reorganizes a query result of messages into a stream of heartbeat activity objects. | |
HeartbeatStream:: |
protected | function | executeQuery | |
HeartbeatStream:: |
public | function | executeViews(). | |
HeartbeatStream:: |
public | function | getAjax(). | |
HeartbeatStream:: |
public | function | getConfig(). | |
HeartbeatStream:: |
public | function | getCurrentLanguages(). | |
HeartbeatStream:: |
public | function | ||
HeartbeatStream:: |
public | function | getLatestActivityId() | |
HeartbeatStream:: |
public | function | Get the messages. | |
HeartbeatStream:: |
final public | function | getOffsetTime | |
HeartbeatStream:: |
final public | function | getTemplate(). | |
HeartbeatStream:: |
public | function | getViewed(). | |
HeartbeatStream:: |
public | function | getViewedId(). | |
HeartbeatStream:: |
public | function | getViewer(). | |
HeartbeatStream:: |
public | function | hasAccess | 4 |
HeartbeatStream:: |
public | function | hasErrors | |
HeartbeatStream:: |
public | function | Function to check if more/older messages can be loaded | |
HeartbeatStream:: |
public | function | isAjax(). | |
HeartbeatStream:: |
public | function | isPage(). | |
HeartbeatStream:: |
public | function | needsModal(). Returns a boolean to indicate whether modal window is needed on the page. | |
HeartbeatStream:: |
public | function | numberOfMessages(). | |
HeartbeatStream:: |
public | function | Create the well-formed activity messages from a result. HeartbeatParser will do most of the work here. | |
HeartbeatStream:: |
public | function | Render(). | |
HeartbeatStream:: |
public | function | result Prepares a query, makes it available to alter it and finally executes it. | |
HeartbeatStream:: |
public | function | setAjax(). | |
HeartbeatStream:: |
protected | function | setAvailableTemplates() | |
HeartbeatStream:: |
public | function | setConfig(). | |
HeartbeatStream:: |
protected | function | setContextualArguments(). | |
HeartbeatStream:: |
protected | function | setError Alias for addError. | |
HeartbeatStream:: |
public | function | setIsPage(). | |
HeartbeatStream:: |
public | function | Set the maximum number of items to fetch. | |
HeartbeatStream:: |
public | function | setLanguage(). | |
HeartbeatStream:: |
public | function | setLatestActivityId(). | |
HeartbeatStream:: |
final public | function | setOffsetTime | |
HeartbeatStream:: |
public | function | setViewed(). | |
HeartbeatStream:: |
public | function | setViewer(). | |
HeartbeatStream:: |
public | function | setViewMode(). | |
HeartbeatStream:: |
public | function | skipActiveUser(). | |
HeartbeatStream:: |
constant | |||
HeartbeatStream:: |
constant | |||
HeartbeatStream:: |
final public | function | Constructor | |
NodeActivity:: |
protected | property | ||
NodeActivity:: |
public | function |
Implements construct(). Overrides HeartbeatStream:: |
|
NodeActivity:: |
public | function | getNid(). | |
NodeActivity:: |
public | function |
modifyActivityMessage().
This will make sure the nid is saved when a message is logged.
E.g. ActivityStatus plugin with a shout in node context. Overrides HeartbeatStream:: |
|
NodeActivity:: |
protected | function |
Implements queryAlter(). Overrides HeartbeatStream:: |
|
NodeActivity:: |
public | function | setNid(). | |
NodeActivity:: |
public | function |
Function to add a part of a sql to a query built by views UI Overrides HeartbeatStream:: |