You are here

function languagefield_field_formatter_view in Custom Language field 7

Implements hook_field_formatter_view().

Parameters

$items is set in hook_field_prepare_view():

File

./languagefield.module, line 262
Provides a list of languages from ISO 639 standard. All variables of a $language-object can be found here: http://api.drupal.org/api/drupal/developer--globals.php/global/language

Code

function languagefield_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $settings = $display['settings'];
  $element = array();
  switch ($display['type']) {
    case 'language_default':

      //      $settings['format'] = isset($settings['format']) ? $settings['format'] : array('name' =>  'name');
      break;
  }
  foreach ($items as $delta => $item) {
    $markup = _languagefield_theme_option($item, $settings);
    $element[$delta]['#markup'] = $markup;
  }
  return $element;
}