You are here

function search_by_page_permission in Search by Page 7

Same name and namespace in other branches
  1. 8 search_by_page.module \search_by_page_permission()

Implements hook_permission().

1 call to search_by_page_permission()
SearchByPageEnvironmentTest::setUp in tests/search_by_page.test
Sets up a Drupal site for running functional and integration tests.

File

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

Code

function search_by_page_permission() {
  $perms = array();
  $perms['administer search by page'] = array(
    'title' => t('Administer Search by Page'),
  );
  $envs = search_by_page_list_environments();
  foreach ($envs as $envid) {
    $name = search_by_page_setting_get('environment_name', $envid, t('new'));
    $hrname = $name;
    if (module_exists('i18n_string')) {
      $hrname = i18n_string_translate('search_by_page:environment:name' . $envid, $name);
    }
    $perms['search page environment ' . $name] = array(
      'title' => t('Search environment @name in Search by Page', array(
        '@name' => $hrname,
      )),
    );
  }
  return $perms;
}