class PrivateHeartbeat in Heartbeat 6.4
Same name and namespace in other branches
- 6.3 includes/privateheartbeat.inc \PrivateHeartbeat
Class PrivateHeartbeat Concrete class to prepare messages for the current user only
Hierarchy
- class \HeartbeatAccess
- class \PrivateHeartbeat
Expanded class hierarchy of PrivateHeartbeat
1 string reference to 'PrivateHeartbeat'
- heartbeat_heartbeat_register_access_types in ./
heartbeat.module - Implementation of hook_heartbeat_register_access_types().
File
- includes/
privateheartbeat.inc, line 16
View source
class PrivateHeartbeat extends HeartbeatAccess {
/**
* Skip active user.
* We never want to skip the active user. not for
* logged-in user and not for displayed user (profile).
* This is ofcourse because private stream is intended to
* show own activity.
*/
public function skipActiveUser() {
return FALSE;
}
public function dressUpMessages(HeartbeatParser $heartbeat) {
$sql = " AND ((ua.uid = %d AND hm.perms > %d ) OR (ua.uid_target = %d AND ua.access > %d) )";
$heartbeat->raw_messages = $this
->resultSql($sql, array(
$this->stream->uid,
HEARTBEAT_PRIVATE,
$this->stream->uid,
HEARTBEAT_PUBLIC_TO_ADDRESSEE,
));
return $heartbeat;
}
/**
* Function to add a part of a sql to a query built by views UI
*
* @param object $view The view handler object by reference to add our part to the query
*/
public function addViewQuery(&$view) {
// Make the sql limited to the access
$field = "{$view->table_alias}.{$view->real_field}";
$view->query
->set_where_group('OR', 'orgroup');
$sql = "{$field} = %d AND {$view->table_alias}.access > %d ";
$view->query
->add_where('orgroup', $sql, $this->_uid, HEARTBEAT_PRIVATE);
$sql = "({$view->table_alias}.uid_target = %d AND {$view->table_alias}.access > %d)";
$view->query
->add_where('orgroup', $sql, $this->_uid, HEARTBEAT_PUBLIC_TO_ADDRESSEE);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HeartbeatAccess:: |
public | property | ||
HeartbeatAccess:: |
protected | property | ||
HeartbeatAccess:: |
protected | property | ||
HeartbeatAccess:: |
protected | property | ||
HeartbeatAccess:: |
protected | property | ||
HeartbeatAccess:: |
protected | property | ||
HeartbeatAccess:: |
protected | property | ||
HeartbeatAccess:: |
protected | property | ||
HeartbeatAccess:: |
protected | property | ||
HeartbeatAccess:: |
protected | function | Check denied messages | |
HeartbeatAccess:: |
public | function | ConfigurationForm Basic configuration form for streams. | |
HeartbeatAccess:: |
public | function | Fake constructor to hook this method instead of the constructor. | 2 |
HeartbeatAccess:: |
protected | function | createHeartbeatParser | |
HeartbeatAccess:: |
public | function | ||
HeartbeatAccess:: |
protected | function | finishMessages | |
HeartbeatAccess:: |
final public | function | getAccess | |
HeartbeatAccess:: |
public | function | Function to retrieve the active user. | |
HeartbeatAccess:: |
public | function | ||
HeartbeatAccess:: |
final public | function | getOffsetSql | |
HeartbeatAccess:: |
public | function | Get HeartbeatStream object with all configurations | |
HeartbeatAccess:: |
protected | function | hasAccess | 4 |
HeartbeatAccess:: |
public | function | hasErrors | |
HeartbeatAccess:: |
public | function | Getter function for heartbeat page/blocks | |
HeartbeatAccess:: |
protected | function | prepareStream | 2 |
HeartbeatAccess:: |
protected | function | resultSql | 1 |
HeartbeatAccess:: |
protected | function | setError | |
HeartbeatAccess:: |
final public | function | setOffsetSql | |
HeartbeatAccess:: |
constant | |||
HeartbeatAccess:: |
constant | |||
HeartbeatAccess:: |
protected | function | proctected fuinction whoIsActor Calculate the user of whom we want to see activity for. Set the actor of the stream. | 1 |
HeartbeatAccess:: |
public | function | Constructor | |
PrivateHeartbeat:: |
public | function |
Function to add a part of a sql to a query built by views UI Overrides HeartbeatAccess:: |
|
PrivateHeartbeat:: |
public | function |
Overrides HeartbeatAccess:: |
|
PrivateHeartbeat:: |
public | function |
Skip active user.
We never want to skip the active user. not for
logged-in user and not for displayed user (profile).
This is ofcourse because private stream is intended to
show own activity. Overrides HeartbeatAccess:: |