function epub_list_books_autocomplete in Epub 6
Implementation of hook_autocomplete().
1 string reference to 'epub_list_books_autocomplete'
- epub_menu in ./
epub.module - Implementation of hook_menu().
File
- ./
epub.module, line 325 - Provide ePub content type and enable the creation of ePub files from book contents.
Code
function epub_list_books_autocomplete($arg) {
$matches = array();
$result = db_query_range(db_rewrite_sql("SELECT n.title FROM {node} AS n\n INNER JOIN {book} AS b ON b.nid = n.nid\n WHERE b.nid = b.bid AND n.title LIKE '%%%s%%'"), $arg, 0, 10);
while ($row = db_fetch_object($result)) {
$matches[$row->title] = check_plain($row->title);
}
print drupal_to_js($matches);
}