You are here

function search_by_page_block_info in Search by Page 8

Same name and namespace in other branches
  1. 7 search_by_page.module \search_by_page_block_info()

Implements hook_block_info().

File

./search_by_page.module, line 852
Main module file for Drupal module Search by Page.

Code

function search_by_page_block_info() {
  $ret = [];

  // Create one block per environment
  $envs = search_by_page_list_environments();
  foreach ($envs as $envid) {
    $envname = search_by_page_setting_get('environment_name', $envid, t('new'));
    if (\Drupal::moduleHandler()
      ->moduleExists('i18n_string')) {
      $envname = i18n_string_translate('search_by_page:environment:name' . $envid, $envname);
    }
    $ret[$envid] = [
      'info' => t('Search by page @environment', [
        '@environment' => $envname,
      ]),
      'cache' => DRUPAL_NO_CACHE,
    ];
  }
  return $ret;
}