You are here

public function SettingsForm::getTokenDescription in Instagram Feeds 8

Returns form element array with token suggestions.

Parameters

array $types: The list of allowed token types. If empty, all global types will be allowed.

Return value

array Array to join with element with tokens support.

2 calls to SettingsForm::getTokenDescription()
SettingsForm::buildForm in src/Form/SettingsForm.php
Form constructor.
SettingsForm::buildMappingForm in src/Form/SettingsForm.php
Form builder for mapping between media entity and Instagram post.

File

src/Form/SettingsForm.php, line 175

Class

SettingsForm
Defines an Instagram Feeds configuration form.

Namespace

Drupal\instagram_feeds\Form

Code

public function getTokenDescription(array $types = [
  'site',
  'random',
  'current-date',
  'current-user',
  'instagram-account',
  'instagram-post',
]) {
  sort($types);
  $key = md5(serialize($types));
  if (!isset($this->tokenDescription[$key])) {
    $this
      ->setTokenDescription($types);
  }
  return $this->tokenDescription[$key];
}