Commit 6ae1ff05 authored by John Fiala's avatar John Fiala
Browse files

Issue #1784862 by aaronbauman: Added dialog switch to code displaying available tokens.

parent a464e9de
......@@ -118,26 +118,20 @@ function link_field_instance_settings_form($field, $instance) {
if (module_exists('token')) {
// Add token module replacements fields
$form['tokens'] = array(
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#title' => t('Placeholder tokens'),
'#description' => t("The following placeholder tokens can be used in both paths and titles. When used in a path or title, they will be replaced with the appropriate values."),
$form['enable_tokens'] = array(
'#type' => 'checkbox',
'#title' => t('Allow user-entered tokens'),
'#default_value' => isset($instance['settings']['enable_tokens']) ? $instance['settings']['enable_tokens'] : 1,
'#description' => t('Checking will allow users to enter tokens in URLs and Titles on the entity edit form. This does not affect the field settings on this page.'),
);
$entity_info = entity_get_info($instance['entity_type']);
$form['tokens']['help'] = array(
$form['tokens_help'] = array(
'#theme' => 'token_tree',
'#token_types' => array($entity_info['token type']),
'#global_types' => TRUE,
'#click_insert' => TRUE,
);
$form['enable_tokens'] = array(
'#type' => 'checkbox',
'#title' => t('Allow user-entered tokens'),
'#default_value' => isset($instance['settings']['enable_tokens']) ? $instance['settings']['enable_tokens'] : 1,
'#description' => t('Checking will allow users to enter tokens in URLs and Titles on the entity edit form. This does not affect the field settings on this page.'),
'#dialog' => TRUE,
);
}
......
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