You are here

public function DataContext::__construct in Forena Reports 7.5

Constructor to initialize drupal site specific settings.

Overrides Context::__construct

File

src/Context/DataContext.php, line 30
DataContext.php The FrxData class holds all of the data contexts during the report rendering process. The general idea is that during the report render, data objects are pushed on the stack with the id's of the block or foreach objects that…

Class

DataContext

Namespace

Drupal\forena\Context

Code

public function __construct() {
  $site = array();
  global $language;
  global $user;
  global $theme_path;
  global $base_root;
  $site['base_path'] = base_path();
  $site['dir'] = rtrim(base_path(), '/');
  $site['theme_path'] = base_path() . $theme_path;
  $site['theme_dir'] =& $theme_path;
  $site['base_url'] =& $base_root;
  $site['user_name'] = $user->uid ? $user->name : '';
  $site['uid'] = $user ? $user->uid : 0;
  $site['language'] =& $language;
  $site['args'] = arg();
  $site['page'] = base_path() . $_GET['q'];
  $dest = drupal_get_destination();
  $site['destination'] = $dest['destination'];
  $this
    ->setContext('site', $site);
}