You are here

function interval_field_formatter_info in Interval Field 7

Implements hook_field_formatter_info().

We need to tell Drupal that we have two different types of formatters for this field. One will change the text color, and the other will change the background color.

See also

interval_field_formatter_view()

File

./interval.module, line 103
Defines an interval field @copyright Copyright(c) 2011 Rowlands Group @license GPL v2+ http://www.fsf.org/licensing/licenses/gpl.html @author Lee Rowlands leerowlands at rowlandsgroup dot com

Code

function interval_field_formatter_info() {
  return array(
    // This formatter just displays the interval and period wrapped in a div.
    'interval_default' => array(
      'label' => t('Plain'),
      'field types' => array(
        'interval',
      ),
    ),
    // Same as default formatter but without the wrapper div.
    'interval_raw' => array(
      'label' => t('Raw'),
      'field types' => array(
        'interval',
      ),
    ),
    'interval_php' => array(
      'label' => t('PHP date/time'),
      'field types' => array(
        'interval',
      ),
      'description' => t('A valid PHP date/time string.'),
    ),
  );
}