function ckeditor_link_ckeditor_link_taxonomy_autocomplete

cis7 ckeditor_link.taxonomy.inc ckeditor_link_ckeditor_link_taxonomy_autocomplete($string, $limit)
cle7 ckeditor_link.taxonomy.inc ckeditor_link_ckeditor_link_taxonomy_autocomplete($string, $limit)
elmsmedia7 ckeditor_link.taxonomy.inc ckeditor_link_ckeditor_link_taxonomy_autocomplete($string, $limit)
icor7 ckeditor_link.taxonomy.inc ckeditor_link_ckeditor_link_taxonomy_autocomplete($string, $limit)
meedjum_blog7 ckeditor_link.taxonomy.inc ckeditor_link_ckeditor_link_taxonomy_autocomplete($string, $limit)
mooc7 ckeditor_link.taxonomy.inc ckeditor_link_ckeditor_link_taxonomy_autocomplete($string, $limit)

Implementation of hook_ckeditor_link_TYPE_autocomplete().

File

sites/all/modules/ulmus/ckeditor_link/includes/ckeditor_link.taxonomy.inc, line 11
Written by Henri MEDOT <henri.medot[AT]absyx[DOT]fr> http://www.absyx.fr

Code

function ckeditor_link_ckeditor_link_taxonomy_autocomplete($string, $limit) {
  $matches = array();

  $vocabularies = array_keys(array_filter(variable_get('ckeditor_link_autocomplete_vocabularies', array())));
  if (count($vocabularies)) {
    $query = db_select('taxonomy_term_data', 't')->fields('t', array('tid', 'name'))->condition('t.name', '%' . db_like($string) . '%', 'LIKE')->orderBy('t.name')->range(0, $limit)->addTag('term_access');
    if (!in_array('- any -', $vocabularies)) {
      $query->condition('t.vid', $vocabularies, 'IN');
    }
    $result = $query->execute();
    foreach ($result as $term) {
      $matches['taxonomy/term/' . $term->tid] = $term->name;
    }
  }

  return $matches;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.