function search_api_page_block_info in Search API Pages 7
Implements hook_block_info().
File
- ./
search_api_page.module, line 146 - Generate search pages using Search API indexes.
Code
function search_api_page_block_info() {
$blocks = array();
foreach (search_api_page_load_multiple(FALSE, array(
'enabled' => TRUE,
)) as $page) {
$blocks[$page->machine_name] = array(
'info' => t('Search block: !name', array(
'!name' => $page->name,
)),
'cache' => DRUPAL_CACHE_PER_ROLE | DRUPAL_CACHE_PER_PAGE,
);
}
return $blocks;
}