You are here

function masquerade_help in Masquerade 8.2

Same name and namespace in other branches
  1. 5 masquerade.module \masquerade_help()
  2. 6 masquerade.module \masquerade_help()
  3. 7 masquerade.module \masquerade_help()

Implements hook_help().

File

./masquerade.module, line 17
Allows privileged users to masquerade as another user.

Code

function masquerade_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.masquerade':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Masquerade module allows users to temporarily switch to another user account. It records the original user account, so users can easily switch back.') . '</p>';
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Granting masquerade access') . '</dt>';
      $output .= '<dd>' . t('Users may only masquerade as another user if they have the <a href=":permission_link">Masquerade as any user</a> permission or if they have all the <a href=":permission_link">Masquerade as ROLE</a> permissions for all the target account\'s roles.', [
        ':permission_link' => Url::fromRoute('user.admin_permissions', [], [
          'fragment' => 'module-masquerade',
        ])
          ->toString(),
      ]) . '</dd>';
      $output .= '<dt>' . t('Masquerading as another user') . '</dt>';
      $output .= '<dd>' . t('There are multiple ways to masquerade as another user:');
      $output .= '<ul>';
      $output .= '<li>' . t('On the <a href=":admin-people-url">administrative user listing</a>, choose the <em>Masquerade</em> operation of a certain user account.', [
        ':admin-people-url' => Url::fromRoute('entity.user.collection')
          ->toString(),
      ]) . '</li>';
      $output .= '<li>' . t('Masquerade can be used directly from menus provided by the %toolbar module.', [
        '%toolbar' => t('Toolbar'),
      ]) . '</li>';
      $output .= '</ul>';
      $output .= '</dd>';
      $output .= '<dt>' . t('Switching back') . '</dt>';
      $output .= '<dd>' . t('To stop masquerading as another user, click the <em>Unmasquerade</em> link in the user account links menu.') . '</dd>';
      $output .= '</dl>';
      return $output;
  }
}