You are here

function _content_get_formatter in Content Construction Kit (CCK) 6.3

Same name and namespace in other branches
  1. 6.2 content.module \_content_get_formatter()

Return the formatter description corresponding to a formatter name, defaulting to 'default' if none is found.

4 calls to _content_get_formatter()
content_field in ./content.module
Implementation of hook_field(). Handles common field housekeeping.
content_format in ./content.module
Format a field item for display.
content_handler_field::render in includes/views/handlers/content_handler_field.inc
content_handler_field_multiple::render in includes/views/handlers/content_handler_field_multiple.inc

File

./content.module, line 1443
Allows administrators to associate custom fields to content types.

Code

function _content_get_formatter($formatter_name, $field_type) {
  $field_types = _content_field_types();
  $formatters = $field_types[$field_type]['formatters'];
  if (!isset($formatters[$formatter_name]) && $formatter_name != 'hidden') {

    // This might happen when the selected formatter has been renamed in the
    // module, or if the module has been disabled since then.
    $formatter_name = 'default';
  }
  return isset($formatters[$formatter_name]) ? $formatters[$formatter_name] : FALSE;
}