You are here

function file_download_counter_token_info in File Download 8

Implements hook_token_info().

File

modules/file_download_counter/file_download_counter.tokens.inc, line 13
Builds placeholder replacement tokens for node visitor file_download_counter.

Code

function file_download_counter_token_info() {
  $file['total-count'] = [
    'name' => t("Number of downloads"),
    'description' => t("The number of visitors who have downloaded the file."),
  ];
  $file['day-count'] = [
    'name' => t("Downloads today"),
    'description' => t("The number of visitors who have downloaded the file today."),
  ];
  $file['last-view'] = [
    'name' => t("Last download"),
    'description' => t("The date on which a visitor last downloaded the file."),
    'type' => 'date',
  ];
  return [
    'tokens' => [
      'file' => $file,
    ],
  ];
}