public static function PathBreadcrumbsUIAutocomplete::processAutocomplete in Path Breadcrumbs 7.3
1 call to PathBreadcrumbsUIAutocomplete::processAutocomplete()
- path_breadcrumbs_ui_tokens_ajax_autocomplete in path_breadcrumbs_ui/
path_breadcrumbs_ui.pages.inc - AJAX callback for tokens autocomplete.
File
- path_breadcrumbs_ui/
includes/ path_breadcrumbs_ui.autocomplete.inc, line 12 - Path breadcrumbs UI autocomplete.
Class
- PathBreadcrumbsUIAutocomplete
- @file Path breadcrumbs UI autocomplete.
Code
public static function processAutocomplete($string, $context_keywords, $raw_keywords = array()) {
// Remove selector from search string.
if (drupal_substr($string, 0, 1) == '%') {
$string = drupal_substr($string, 1);
}
// Apply site information to contexts.
self::$context_keywords = $context_keywords + array(
'site' => 'site',
);
// Remove the last part as it might be unfinished.
$parts = explode(':', $string);
$last_part = array_pop($parts);
$selector = implode(':', $parts);
// Wrap entity in metadata wrapper.
$wrapper = PathBreadcrumbsUIAutocomplete::applyDataSelector($selector, self::$context_keywords);
$result = array();
if ($selector && $wrapper) {
$result = PathBreadcrumbsUIAutocomplete::matchDataSelector($wrapper, $selector . ':', 0);
}
elseif (!$selector) {
$result = PathBreadcrumbsUIAutocomplete::matchDataSelector(PathBreadcrumbsUIAutocomplete::applyCurrentVariables(self::$context_keywords), '', 0);
// Add custom keywords in first autocomplete level.
$result += $raw_keywords;
}
return PathBreadcrumbsUIAutocomplete::processResultData($result, $last_part, $string);
}