You are here

function _feeds_excel_token_values__excel_file in Feeds Excel 7

Helper function for rendering token values for excel file tokens.

Parameters

object $object: the exce file object to build the token value for.

string $token_name: the specific token name, like passed to hook_tokens() as $tokens key.

string $original_token: the original complete token, containing type and name, like passed to hook_tokens() as $tokens value.

Return value

string rendered token value for the given token or nothing if token name is not defined.

1 string reference to '_feeds_excel_token_values__excel_file'
feeds_excel_tokens in ./feeds_excel.module
Implements hook_tokens().

File

./feeds_excel.module, line 296

Code

function _feeds_excel_token_values__excel_file($object, $token_name, $original_token, $sanitize) {
  switch ($token_name) {
    case 'path':
      return $sanitize ? check_url($object->filepath) : $object->filepath;
    case 'url':
      return url($object->filepath, array(
        'absolute' => TRUE,
      ));
  }
}