function fuzzysearch_admin in Fuzzy Search 6
Build the administration settings panel.
1 string reference to 'fuzzysearch_admin'
- fuzzysearch_menu in ./
fuzzysearch.module - Implementation of hook_menu().
File
- ./
fuzzysearch.admin.inc, line 11 - Admin settings and related functions
Code
function fuzzysearch_admin() {
$total = db_result(db_query("SELECT COUNT(*) FROM {node}"));
$remaining = db_result(db_query("SELECT COUNT(*) FROM {fuzzysearch_index_queue}"));
$count = format_plural($remaining, 'There is 1 item left to index.', 'There are @count items left to index.');
$percentage = (int) min(100, 100 * ($total - $remaining) / max(1, $total)) . '%';
$status = '<p><strong>' . t('%percentage of the site has been indexed.', array(
'%percentage' => $percentage,
)) . ' ' . $count . '</strong></p>';
$output .= $status;
$output .= drupal_get_form('fuzzysearch_admin_form');
$output .= drupal_get_form('fuzzysearch_scoring');
return $output;
}