You are here

public function BlockEditor::tokens in Forena Reports 8

Same name and namespace in other branches
  1. 7.5 src/Editor/BlockEditor.php \Drupal\forena\Editor\BlockEditor::tokens()

Return the tokens for the block.

File

src/Editor/BlockEditor.php, line 219

Class

BlockEditor

Namespace

Drupal\forena\Editor

Code

public function tokens() {

  // skip non-sql blocks
  if (!isset($this->block['file'])) {
    return array();
  }
  $block = $this
    ->dataManager()
    ->sqlBlock($this->provider, $this->block['file']);
  $tokens = @$block['tokens'];
  $c_idx = array_search('current_user', $tokens);
  if ($c_idx !== FALSE) {
    unset($tokens[$c_idx]);
  }
  return $tokens;
}