You are here

function i18n_node_autocomplete in Internationalization 7

Same name and namespace in other branches
  1. 6 i18n.pages.inc \i18n_node_autocomplete()

Node title autocomplete callback

1 string reference to 'i18n_node_autocomplete'
i18n_node_menu in i18n_node/i18n_node.module
Implements hook_menu().

File

i18n_node/i18n_node.pages.inc, line 236
User page callbacks for the translation module.

Code

function i18n_node_autocomplete($type, $language, $string = '') {
  $params = array(
    'type' => $type,
    'language' => $language,
    'tnid' => 0,
  );
  $matches = array();
  foreach (_i18n_node_references($string, 'contains', $params) as $id => $row) {

    // Add a class wrapper for a few required CSS overrides.
    $matches[$row['title'] . " [nid:{$id}]"] = '<div class="reference-autocomplete">' . $row['rendered'] . '</div>';
  }
  drupal_json_output($matches);
}