function search_files_attachments_dashboard in Search Files 7.2
Same name and namespace in other branches
- 6.2 search_files_attachments.module \search_files_attachments_dashboard()
Generates the search_files_directories dashboard page.
1 string reference to 'search_files_attachments_dashboard'
- search_files_attachments_menu in ./
search_files_attachments.module - Implements hook_menu().
File
- ./
search_files_attachments.module, line 253 - Used to index files in attachments
Code
function search_files_attachments_dashboard() {
$lastindex = variable_get('search_files_attachments_last_index', 0);
$items = array();
if ($lastindex == 0) {
$items[] = t('Last Index = %index', array(
'%index' => t('never'),
));
}
else {
$items[] = t('Last Index = %index', array(
'%index' => format_date($lastindex, $type = 'medium'),
));
}
$count = db_query("SELECT COUNT(*) FROM {search_dataset} WHERE type = 'search_files_att'")
->fetchField();
$items[] = t("Files indexed = %count", array(
'%count' => $count,
));
$count = db_query("SELECT COUNT(*) FROM {search_dataset} WHERE (type = 'search_files_att' AND reindex > 0)")
->fetchField();
$items[] = t("Files indexed and scheduled for reindexing = %count", array(
'%count' => $count,
));
$items[] = l(t('Update index'), 'admin/config/search/search_files/attachments/update_index');
return array(
'#theme' => 'item_list',
'#items' => $items,
);
}