You are here

function lingotek_get_menu_link_field_content in Lingotek Translation 7.7

Builds an array that masquerades as field_content for Menu Links for upload

1 call to lingotek_get_menu_link_field_content()
lingotek_xml_fields in ./lingotek.util.inc

File

./lingotek.util.inc, line 3071
Utility functions.

Code

function lingotek_get_menu_link_field_content($field_name, $entity) {
  $field_content = array();
  $field_array = array();
  $field_language = $entity->language;
  if ($field_name == 'title') {
    $field_array = array(
      'value' => $entity->link_title,
    );
  }
  elseif ($field_name == 'description') {
    if (isset($entity->options['attributes']['title'])) {
      $field_array = array(
        'value' => $entity->options['attributes']['title'],
      );
    }
  }
  $field_content[$field_language][] = $field_array;
  return $field_content;
}