You are here

public function WorkbenchAccessTokens::getTokenInfo in Workbench Access 8

Implements hook_token_info().

File

src/WorkbenchAccessTokens.php, line 77

Class

WorkbenchAccessTokens
Token handler for Workbench Access.

Namespace

Drupal\workbench_access

Code

public function getTokenInfo() {
  $info['tokens'] = [
    'user' => [
      'workbench-access-sections' => [
        'name' => t('Workbench access sections'),
        'description' => $this
          ->t('Section assignments for the user account.'),
        // Optionally use token module's array type which gives users greater
        // control on output.
        'type' => $this->moduleHandler
          ->moduleExists('token') ? 'array' : '',
      ],
    ],
    'node' => [
      'workbench-access-sections' => [
        'name' => t('Workbench access sections'),
        'description' => $this
          ->t('Section assignments for content.'),
        // Optionally use token module's array type which gives users greater
        // control on output.
        'type' => $this->moduleHandler
          ->moduleExists('token') ? 'array' : '',
      ],
    ],
  ];
  return $info;
}