function bigmenu_alias_autocomplete in Big Menu 6
Autocomplete callback to find page aliases
Returns a json array with suggestions based on an entered string
Matches from the beginning only Removes http etc if you left it in. Only aliases that also match a menu link item path are returned. The key used is the mlid, not the alias id or the path.
1 string reference to 'bigmenu_alias_autocomplete'
- bigmenu_menu in ./bigmenu.module 
- Declare admin links and AJAX callbacks
File
- ./bigmenu.admin.inc, line 251 
- Administrative page callbacks for bigmenu module.
Code
function bigmenu_alias_autocomplete() {
  // The URL callback may have any number of slashes in it, which will have been split out.
  $args = func_get_args();
  $string = join('/', $args);
  // if it was an URL, one of the slashes got squashed - fixit
  $string = preg_replace('|http:/(\\w)|', 'http://$1', $string);
  if (valid_url($string)) {
    $url_parts = parse_url($string);
    $string = ltrim($url_parts['path'], '/');
  }
  $sql = "\n    SELECT u.src, u.dst, ml.mlid FROM {url_alias} u\n    JOIN menu_links ml ON ml.link_path = u.src\n    WHERE LOWER(u.dst) LIKE LOWER('%s%%')\n  ";
  $result = db_query_range($sql, $string, 0, 10);
  $matches = array();
  while ($alias = db_fetch_object($result)) {
    $id = check_plain($alias->dst) . " [mlid:{$alias->mlid}]";
    $matches[$id] = check_plain($alias->dst);
  }
  print drupal_to_js($matches);
  exit;
}