You are here

function range_field_info in Range 6

Same name and namespace in other branches
  1. 7 range.module \range_field_info()

Implementation of hook_field_info().

Here we indicate that the content module will use its default handling for the view of these fields.

Callbacks can be omitted if default handing is used. They're included here just so this module can be used as an example for custom modules that might do things differently.

File

./range.module, line 49
Defines numeric fields within a range of possible values and displays them colored accordingly..

Code

function range_field_info() {
  return array(
    'range_integer' => array(
      'label' => t('Range: Integer'),
      'description' => t('Store a number in the database as an integer.'),
      'callbacks' => array(
        'tables' => CONTENT_CALLBACK_DEFAULT,
        'arguments' => CONTENT_CALLBACK_DEFAULT,
      ),
    ),
    'range_decimal' => array(
      'label' => t('Range: Decimal'),
      'description' => t('Store a number in the database in a fixed decimal format.'),
      'callbacks' => array(
        'tables' => CONTENT_CALLBACK_DEFAULT,
        'arguments' => CONTENT_CALLBACK_DEFAULT,
      ),
    ),
    'range_float' => array(
      'label' => t('Range: Float'),
      'description' => t('Store a number in the database in a floating point format.'),
      'callbacks' => array(
        'tables' => CONTENT_CALLBACK_DEFAULT,
        'arguments' => CONTENT_CALLBACK_DEFAULT,
      ),
    ),
  );
}