You are here

public function AjaxPageControllerBase::__construct in Forena Reports 8

AjaxPageControllerBase constructor.

File

src/Controller/AjaxPageControllerBase.php, line 158

Class

AjaxPageControllerBase

Namespace

Drupal\forena\Controller

Code

public function __construct() {
  static::$instance = $this;
  if (isset($_GET)) {
    $this->parms = $_GET;
    if (isset($_REQUEST[static::TOKEN_PARAMETER])) {
      $this->token = $_REQUEST[static::TOKEN_PARAMETER];
      unset($this->parms[static::TOKEN_PARAMETER]);
    }
    unset($this->parms['_wrapper_format']);
    unset($this->parms['ajax_form']);
  }
  $this->context = AppContext::create();
  $this->layout = static::LAYOUT;
  $this->libraries[] = 'forena/forena';

  // Set the context for the forena applcation.
  $this
    ->setReportContext('app', $this->context);

  // Load the state if it hasn't been loaded.
  $this
    ->loadState();
}