Commit 732c2b6e authored by frjo's avatar frjo
Browse files

Issue #1560086 by Alan D.: Patch to allows users to disable or reduce the...

Issue #1560086 by Alan D.: Patch to allows users to disable or reduce the recursion limit of the token help tree.
parent c0164da9
......@@ -509,12 +509,15 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $
),
),
);
if (module_exists('token')) {
// Allow users to hide or set a custom recursion limit.
// The module token_tweaks sets a global recursion limit that can not be bypassed.
if (module_exists('token') && $recursion_limit = min(variable_get('token_tree_recursion_limit', 3), variable_get('colorbox_token_recursion_limit', 3))) {
$element['colorbox_token'] = array(
'#type' => 'fieldset',
'#title' => t('Replacement patterns'),
'#theme' => 'token_tree',
'#token_types' => array($instance['entity_type'], 'file'),
'#recursion_limit' => $recursion_limit,
'#states' => array(
'visible' => array(
':input[name$="[settings_edit_form][settings][colorbox_caption]"]' => array('value' => 'custom'),
......
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