| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
//////////////////////////////////////////////////////////////////////////////
|
| 5 |
// Token API hooks
|
| 6 |
|
| 7 |
/**
|
| 8 |
* Implementation of hook_token_list().
|
| 9 |
*/
|
| 10 |
function bitcache_token_list($type = 'all') {
|
| 11 |
$tokens = array();
|
| 12 |
$tokens['global']['file-directory-path'] = t('The file system path for the current Drupal website.');
|
| 13 |
$tokens['global']['file-directory-temp'] = t('The temporary directory for the current Drupal website.');
|
| 14 |
$tokens['global']['site-host'] = t('The HTTP host name of the current Drupal website.');
|
| 15 |
return $tokens;
|
| 16 |
}
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Implementation of hook_token_values().
|
| 20 |
*/
|
| 21 |
function bitcache_token_values($type, $object = NULL) {
|
| 22 |
$values = array();
|
| 23 |
switch ($type) {
|
| 24 |
case 'global':
|
| 25 |
$values['file-directory-path'] = file_directory_path();
|
| 26 |
$values['file-directory-temp'] = file_directory_temp();
|
| 27 |
$values['site-host'] = $_SERVER['HTTP_HOST'];
|
| 28 |
break;
|
| 29 |
}
|
| 30 |
return $values;
|
| 31 |
}
|