function _search_by_page_status_details in Search by Page 6
Same name and namespace in other branches
- 8 search_by_page.module \_search_by_page_status_details()
- 7 search_by_page.module \_search_by_page_status_details()
Generates a detailed status listing for the Search status page.
Return value
Renderable array of search status.
1 call to _search_by_page_status_details()
- search_by_page_search in ./
search_by_page.module - Implementation of hook_search().
File
- ./
search_by_page.module, line 1756 - Main module file for Drupal module Search by Page.
Code
function _search_by_page_status_details() {
_search_by_page_rebuild_all_paths();
// Query to find number of un-indexed items by environment and module.
$dbr = db_query('SELECT COUNT(*) as nonindexed, p.environment, p.from_module FROM {sbp_path} p WHERE p.last_index_time = 0 GROUP BY p.environment, p.from_module');
// Make this into a table.
$stuff = array();
$module_list = array();
while ($item = db_fetch_object($dbr)) {
if ($item->nonindexed) {
$stuff[$item->environment][$item->from_module] = $item->nonindexed;
$module_list[$item->from_module] = 1;
}
}
if (!count($stuff)) {
return array(
'#value' => '<p>' . t('Search by Page is fully indexed.') . '</p>',
);
}
$module_list = array_keys($module_list);
sort($module_list);
array_unshift($module_list, t('Core'));
$rows = array();
foreach ($stuff as $envid => $lst) {
$row = array();
$row[] = search_by_page_setting_get('environment_name', $envid, t('new'));
foreach ($module_list as $module) {
$row[] = isset($lst[$module]) ? $lst[$module] : '';
}
$rows[] = $row;
}
$core = node_search('status');
if (!empty($core['remaining'])) {
$corerow = array(
t('Core content search'),
$core['remaining'],
);
for ($i = count($corerow); $i < count($row); $i++) {
$corerow[] = '';
}
$rows[] = $corerow;
}
// Re-purpose module list as table header and make this into a table.
array_unshift($module_list, t('Environment'));
return array(
'#value' => theme('table', $module_list, $rows, array(), t('Count of un-indexed items by environment and module')),
);
}