You are here

function _multifield_table_get_title in Multifield table 7

Helps find the title of the field, as it could be in several places.

2 calls to _multifield_table_get_title()
theme_multifield_table_multiple_value_field in theme/theme.inc
Print a single row of multiple fields.
theme_multifield_table_multiple_value_fields in theme/theme.inc
Replacement for theme_field_multiple_value_form().

File

theme/theme.inc, line 213
Theme functions for the Mutifield Table module.

Code

function _multifield_table_get_title($field) {
  $title = '';
  if (isset($field['#language']) && isset($field[$field['#language']])) {
    $language = $field['#language'];
    if (isset($field[$language]['#title'])) {
      $title = $field[$language]['#title'];
    }
    elseif (isset($field[$language][0]['#title'])) {
      $title = $field[$language][0]['#title'];
    }
    elseif (isset($field[$language][0])) {
      foreach (element_children($field[$language][0]) as $child) {
        if (isset($field[$language][0][$child]['#title'])) {
          $title = $field[$language][0][$child]['#title'];
          break;
        }
      }
    }
  }
  elseif (isset($field['#title'])) {
    $title = empty($field['#is_weight']) ? $field['#title'] : t('Order');
  }
  elseif (isset($field['#value'])) {
    $title = $field['#value'];
  }
  return $title;
}