You are here

function i18n_node_autocomplete in Internationalization 6

Same name and namespace in other branches
  1. 7 i18n_node/i18n_node.pages.inc \i18n_node_autocomplete()

Node title autocomplete callback

1 string reference to 'i18n_node_autocomplete'
i18n_menu in ./i18n.module
Implementation of hook_menu().

File

./i18n.pages.inc, line 157
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($matches);
}