You are here

function filefield_paths_token_list in File (Field) Paths 6

Same name and namespace in other branches
  1. 5 filefield_paths.module \filefield_paths_token_list()
  2. 6.2 modules/token.inc \filefield_paths_token_list()

Implements hook_token_list().

1 call to filefield_paths_token_list()
theme_filefield_paths_token_help in ./filefield_paths.module

File

./filefield_paths.module, line 586
Contains core functions for the FileField Paths module.

Code

function filefield_paths_token_list($type = 'all') {
  if ($type == 'field' || $type == 'all') {
    $tokens = array();
    if (!module_exists('filefield')) {
      $tokens['file']['filefield-onlyname'] = t("File name without extension");
      $tokens['file']['filefield-extension'] = t("File extension");
    }
    $tokens['file']['filefield-onlyname-original'] = t("File name without extension - original");
    $tokens['file']['filefield-extension-original'] = t("File extension - original");

    // Tokens for Image module integration.
    if (module_exists('image')) {
      $tokens['image']['image-derivative'] = t("Image derivative (thumbnail, preview, etc)");
    }
    return $tokens;
  }
}