Projet

Général

Profil

Paste
Télécharger (795 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / token / tests / token_test.module @ f9d4b898

1
<?php
2

    
3
/**
4
 * @file
5
 * Helper module for token tests.
6
 */
7

    
8
/**
9
 * Implements hook_exit().
10
 */
11
function token_test_exit() {
12
  if ($debug = variable_get('token_page_tokens', array())) {
13
    $debug += array('tokens' => array(), 'data' => array(), 'options' => array());
14
    foreach (array_keys($debug['tokens']) as $token) {
15
      $debug['values'][$token] = token_replace($token, $debug['data'], $debug['options']);
16
    }
17
    variable_set('token_page_tokens', $debug);
18
  }
19
}
20

    
21
/**
22
 * Implements hook_date_format_types().
23
 *
24
 * @todo Remove when http://drupal.org/node/1173706 is fixed.
25
 */
26
function token_test_date_format_types() {
27
  $info['token_test'] = t('Token test date format');
28

    
29
  // Explicitly set the variable here as well.
30
  variable_set('date_format_token_test', 'Y');
31

    
32
  return $info;
33
}