Revision 4cfd8be6
Added by Assos Assos over 9 years ago
drupal7/sites/all/modules/token/token.module | ||
---|---|---|
180 | 180 |
'text' => NULL, |
181 | 181 |
'options' => array(), |
182 | 182 |
'dialog' => TRUE, |
183 |
), |
|
183 |
) + $info['token_tree']['variables'],
|
|
184 | 184 |
'file' => 'token.pages.inc', |
185 | 185 |
); |
186 | 186 |
|
... | ... | |
273 | 273 |
* Implements hook_widget_form_alter(). |
274 | 274 |
*/ |
275 | 275 |
function token_field_widget_form_alter(&$element, &$form_state, $context) { |
276 |
if (!empty($element['#description']) && is_string($element['#description'])) {
|
|
277 |
$element['#description'] = filter_xss_admin(token_replace($element['#description']));
|
|
276 |
if (!empty($element['#description']) && !empty($context['instance']['description'])) {
|
|
277 |
$element['#description'] = filter_xss_admin(token_replace($context['instance']['description']));
|
|
278 | 278 |
} |
279 | 279 |
} |
280 | 280 |
|
... | ... | |
412 | 412 |
*/ |
413 | 413 |
function token_entity_info_alter(&$info) { |
414 | 414 |
foreach (array_keys($info) as $entity_type) { |
415 |
// Add a token view mode if it does not already exist. |
|
416 |
if (!empty($info[$entity_type]['view modes']) && !isset($info[$entity_type]['view modes']['token'])) { |
|
417 |
$info[$entity_type]['view modes']['token'] = array( |
|
418 |
'label' => t('Tokens'), |
|
419 |
'custom settings' => FALSE, |
|
420 |
); |
|
415 |
// Add a token view mode if it does not already exist. Only work with |
|
416 |
// fieldable entities. |
|
417 |
if (!empty($info[$entity_type]['fieldable'])) { |
|
418 |
if (!isset($info[$entity_type])) { |
|
419 |
$info[$entity_type]['view modes'] = array(); |
|
420 |
} |
|
421 |
if (!isset($info[$entity_type]['view modes']['token'])) { |
|
422 |
$info[$entity_type]['view modes']['token'] = array( |
|
423 |
'label' => t('Tokens'), |
|
424 |
'custom settings' => FALSE, |
|
425 |
); |
|
426 |
} |
|
421 | 427 |
} |
422 | 428 |
|
423 | 429 |
if (!empty($info[$entity_type]['token type'])) { |
... | ... | |
647 | 653 |
$invalid_tokens = array(); |
648 | 654 |
|
649 | 655 |
foreach ($tokens as $token => $full_token) { |
656 |
if (isset($token_info['tokens'][$type][$token])) { |
|
657 |
continue; |
|
658 |
} |
|
659 |
|
|
650 | 660 |
// Split token up if it has chains. |
651 | 661 |
$parts = explode(':', $token, 2); |
652 | 662 |
|
Also available in: Unified diff
Weekly update of contrib modules