Commit c954bf91 authored by frjo's avatar frjo
Browse files

Issue #1555856 by Alan D: Patch to add File Token support.

parent 47126e08
......@@ -524,7 +524,7 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $
'#type' => 'fieldset',
'#title' => t('Replacement patterns'),
'#theme' => 'token_tree',
'#token_types' => array($instance['entity_type']),
'#token_types' => array($instance['entity_type'], 'file'),
'#states' => array(
'visible' => array(
':input[name$="[settings_edit_form][settings][colorbox_caption]"]' => array('value' => 'custom'),
......
......@@ -64,7 +64,10 @@ function theme_colorbox_image_formatter($variables) {
$caption = $entity_title;
break;
case 'custom':
$caption = token_replace($settings['colorbox_caption_custom'], array($entity_type => $entity));
$caption = token_replace($settings['colorbox_caption_custom'], array(
$entity_type => $entity,
'file' => (object) $item,
));
break;
default:
$caption = '';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment