/[drupal]/contributions/modules/bitcache/bitcache.token.inc
ViewVC logotype

Contents of /contributions/modules/bitcache/bitcache.token.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Wed Jul 1 04:09:48 2009 UTC (4 months, 4 weeks ago) by arto
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
Changelog:
- #433708: Implemented support for tokenized file system repository paths.
- Added an optional repository parameter to the Services API method 'bitcache.put'.
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 }

  ViewVC Help
Powered by ViewVC 1.1.2