function demo_autocomplete in Demonstration site (Sandbox / Snapshot) 6
Same name and namespace in other branches
- 5 demo.admin.inc \demo_autocomplete()
Retrieve a pipe delimited string of autocomplete suggestions for existing snapshots.
1 string reference to 'demo_autocomplete'
- demo_menu in ./
demo.module - Implements hook_menu().
File
- ./
demo.admin.inc, line 599 - Demonstration Site administrative pages
Code
function demo_autocomplete($string = '') {
$matches = array();
if ($string && ($fileconfig = demo_get_fileconfig())) {
$string = preg_quote($string);
$files = file_scan_directory($fileconfig['dumppath'], $string . '.*\\.info$');
foreach ($files as $file) {
$matches[$file->name] = check_plain($file->name);
}
}
drupal_json($matches);
}