You are here

formatted_number.token.inc in Formatted Number 7

Same filename and directory in other branches
  1. 6 includes/formatted_number.token.inc

Integration of Formatted Number CCK field with token module.

File

includes/formatted_number.token.inc
View source
<?php

/**
 * @file
 * Integration of Formatted Number CCK field with token module.
 */

/**
 * Implementation of hook_token_list().
 */
function formatted_number_token_list($type = 'all') {
  if ($type == 'field' || $type == 'all') {
    return array(
      'formatted number' => array(
        'raw' => t('Raw number value'),
        'formatted' => t('Formatted number value'),
      ),
    );
  }
}

/**
 * Implementation of hook_token_values().
 */
function formatted_number_token_values($type, $items = NULL) {
  if ($type == 'field') {
    return array(
      'raw' => isset($items[0]['value']) ? $items[0]['value'] : '',
      'formatted' => isset($items[0]['view']) ? $items[0]['view'] : '',
    );
  }
}

Functions

Namesort descending Description
formatted_number_token_list Implementation of hook_token_list().
formatted_number_token_values Implementation of hook_token_values().