You are here

function biblio_ipni_autocomplete_publication in Biblio Autocomplete 6

Same name and namespace in other branches
  1. 7 plugins/biblio_ipni/biblio_ipni.module \biblio_ipni_autocomplete_publication()

Gets a list of potential publication matches for the autocomplete

Parameters

$string: Text string to try and match

Return value

$return_matches An array of autocomplete results for use in biblio_autocomple_json(). Format: array( 'key' => 'value to put in biblio field', 'description' => 'can be the same as key or contain extra information to help use decide', 'provider' => 'source of the autocmplete information', )

1 string reference to 'biblio_ipni_autocomplete_publication'
biblio_ipni_biblio_autocomplete_info in plugins/biblio_ipni/biblio_ipni.module
Implements hook_biblio_autocomplete_info().

File

plugins/biblio_ipni/biblio_ipni.module, line 47
Provides autocompletion of Biblio fields from IPNI.

Code

function biblio_ipni_autocomplete_publication($string) {
  $ipni_matches = biblio_ipni_get_publication_data($string);
  $return_matches = array();
  foreach ($ipni_matches as $result) {
    $return_matches[] = array(
      'key' => $result[3],
      'description' => $result[3],
      'provider' => 'IPNI',
    );
  }
  return $return_matches;
}