You are here

function imagefield_extended_token_list in ImageField Extended 6.3

Same name and namespace in other branches
  1. 6.4 imagefield_extended.module \imagefield_extended_token_list()

Implements hook_token_list().

File

./imagefield_extended.module, line 449
Insert additional fields into an ImageField data array.

Code

function imagefield_extended_token_list($type = 'all') {
  if ($type == 'field' || $type == 'all') {
    $tokens = array();
    $fields = _imagefield_extended_fields();
    foreach ($fields['textfields'] as $id => $name) {
      $name = check_plain($name);
      $tokens['file']['imagefield-extended-' . $id . '-raw'] = t('ImageField Extended - !field raw', array(
        '!field' => $name,
      ));
      $tokens['file']['imagefield-extended-' . $id . '-plain'] = t('ImageField Extended - !field plain', array(
        '!field' => $name,
      ));
      $tokens['file']['imagefield-extended-' . $id] = t('ImageField Extended - !field', array(
        '!field' => $name,
      ));
    }
    foreach ($fields['checkboxes'] as $id => $name) {
      $name = check_plain($name);

      //$key = 'workflow_' . $id;
      $tokens['file']['imagefield-extended-workflow-' . $id . '-yn'] = t('ImageField Extended - !field (Yes / No)', array(
        '!field' => $name,
      ));
      $tokens['file']['imagefield-extended-workflow-' . $id . '-on'] = t('ImageField Extended - !field (On / Off)', array(
        '!field' => $name,
      ));
      $tokens['file']['imagefield-extended-workflow-' . $id] = t('ImageField Extended - !field (1 / O)', array(
        '!field' => $name,
      ));
    }
    return $tokens;
  }
}