You are here

function notifications_node_autocomplete_type in Notifications 7

Same name and namespace in other branches
  1. 6.4 includes/node.inc \notifications_node_autocomplete_type()
  2. 6 notifications.node.inc \notifications_node_autocomplete_type()
  3. 6.2 notifications.node.inc \notifications_node_autocomplete_type()
  4. 6.3 notifications.node.inc \notifications_node_autocomplete_type()

Menu callback; Retrieve a pipe delimited string of autocomplete suggestions for existing nodes

Parameters

$node_types: Comma separated node types to query

1 string reference to 'notifications_node_autocomplete_type'
notifications_menu in ./notifications.module
Implementation of hook_menu().

File

includes/node.inc, line 93
Notifications node API for use by plug-in modules providing node related features

Code

function notifications_node_autocomplete_type($node_types, $string = '') {
  $matches = array();
  $types = split(',', $node_types);
  foreach (_notifications_node_references($string, 'contains', $types) 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);
}