You are here

function mediafront_token_info in MediaFront 7.2

Implementation of hook_token_info

Return value

type

File

./mediafront.module, line 764

Code

function mediafront_token_info() {
  $type = array(
    'name' => t('MediaFront'),
    'description' => t('Adds mediafront players using tokens.'),
  );

  // Get the mediafront presets.
  $presets = mediafront_preset_get_presets();

  // If there are presets, then define some tokens.
  if ($presets) {
    foreach ($presets as $preset) {
      $mediafront[$preset['name']] = array(
        'name' => 'MediaFront ' . $preset['name'] . ' preset',
        'description' => $preset['description'],
      );
    }

    // Return an array of tokens allowed by this module.
    return array(
      'types' => array(
        'mediafront' => $type,
      ),
      'tokens' => array(
        'mediafront' => $mediafront,
      ),
    );
  }

  // Return nothing.
  return array();
}