123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?php
- abstract class HeartbeatStream
- {
-
- protected $query = NULL;
-
- public $config = NULL;
-
- public $messages = array();
-
- public $prefix = '';
-
- public $suffix = '';
-
- public $templates = array();
-
- public $contextual_arguments = array();
-
- protected $templates_denied = array();
-
- protected $language = LANGUAGE_NONE;
-
- protected $exclude_og = FALSE;
-
- protected $_uid = 0;
-
- protected $_errors = array();
-
- protected $_has_errors = FALSE;
-
- protected $needsModal = TRUE;
-
- protected $_offset_time = 0;
-
- protected $oldest_date = 604800;
-
- protected $messages_max = 0;
-
- protected $latest_activity_id = 0;
-
- protected $_page = FALSE;
-
- protected $ajax = 0;
-
- protected $canPage = FALSE;
-
- protected $_whoisuser_type = self::VIEWER;
-
- protected $viewer = null;
-
- protected $viewed = null;
-
- protected $view_mode = 'default';
- protected $_whoisuser_types = array(
- self::VIEWER => 'Viewing user',
- self::VIEWED => 'Viewed user'
- );
-
- const VIEWER = 0;
- const VIEWED = 1;
- final public function __construct(HeartbeatStreamConfig $streamConfig, $page = FALSE, $account = NULL) {
- $this->_page = $page;
- $this->setConfig($streamConfig);
- $this->setAjax();
- if (empty($this->_offset_time)) {
- $this->setOffsetTime();
- }
- $this->setViewer(\Drupal::currentUser());
- $this->setViewed($account);
- $this->setAvailableTemplates();
- $this->construct();
- $this->setContextualArguments();
- }
-
- public function construct() {
- }
-
- protected function setContextualArguments() {
- $contextualArguments = \Drupal::request()->query->get('contextualArguments');
- if (!empty($contextualArguments) && isset($contextualArguments['uid_target'])) {
- $this->contextual_arguments = $contextualArguments['uid_target'];
- } elseif ($this->viewed->uid != $this->viewer->uid) {
- $this->contextual_arguments['uid_target'] = $this->viewed->uid;
- }
-
-
-
- }
- }
|