You are here

function mediafront_tokens in MediaFront 7.2

Implements hook_tokens

File

./mediafront.module, line 796

Code

function mediafront_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $players =& drupal_static(__FUNCTION__);
  $replacements = array();
  if ($type == 'mediafront') {
    foreach ($tokens as $name => $original) {
      if (!isset($players[$name])) {
        $players[$name] = mediafront_get_player($name);
      }
      $replacements[$original] = $players[$name];
    }
  }
  return $replacements;
}