You are here

public function TaxonomyTermInlineEntityFormController::tableFields in Inline Entity Form 7

Overrides EntityInlineEntityFormController::tableFields().

We can't use the parent class method because the taxonomy term metadata wrapper doesn't have a property that matches the entity bundle key. @todo: Remove this method once http://drupal.org/node/1662558 is fixed.

Overrides EntityInlineEntityFormController::tableFields

File

includes/taxonomy_term.inline_entity_form.inc, line 28
Defines the inline entity form controller for Taxonomy terms.

Class

TaxonomyTermInlineEntityFormController
@file Defines the inline entity form controller for Taxonomy terms.

Code

public function tableFields($bundles) {
  $fields = array();
  $info = entity_get_info($this->entityType);
  $metadata = entity_get_property_info($this->entityType);
  $label_key = $info['entity keys']['label'];
  $fields[$label_key] = array(
    'type' => 'property',
    'label' => $metadata ? $metadata['properties'][$label_key]['label'] : t('Label'),
    'weight' => 1,
  );

  // Add the vocabulary type.
  $fields['vocabulary'] = array(
    'type' => 'property',
    'label' => t('Vocabulary'),
    'weight' => 2,
  );
  return $fields;
}