You are here

function environment_indicator_help in Environment Indicator 8.3

Same name and namespace in other branches
  1. 8.2 environment_indicator.module \environment_indicator_help()
  2. 6 environment_indicator.module \environment_indicator_help()
  3. 7.2 environment_indicator.module \environment_indicator_help()
  4. 7 environment_indicator.module \environment_indicator_help()
  5. 4.x environment_indicator.module \environment_indicator_help()

Implements hook_help().

File

./environment_indicator.module, line 16
Module implementation file.

Code

function environment_indicator_help($route_name, RouteMatchInterface $route_match) {
  $permissions_url = Url::fromRoute('user.admin_permissions', [], [
    'fragment' => 'module-environment_indicator',
  ])
    ->toString();
  $settings_url = Url::fromRoute('environment_indicator.settings')
    ->toString();
  switch ($route_name) {
    case 'environment_indicator.settings':
      $output = '<p>' . t('The Environment Indicator adds a coloured strip to the site informing you which environment you are currently in (Development, Staging, Production, etc.)') . '</p>';
      $output .= '<p>' . t('The Environment Indicator\'s visibility depends upon the permissions of the viewer. The <a href=":permissions">access environment indicator</a> permission must be enabled for a user role in order for users of that role to see the indicator.', [
        ':permissions' => $permissions_url,
      ]) . '</p>';
      $output .= '<p>' . t('The recommended way to add information about your release is to set the \'environment_indicator.current_release\' state. Use your git hooks to set the state using drush: <code>drush sset environment_indicator.current_release v1.2.44</code>') . '</p>';
      return $output;
    case 'entity.environment_indicator.collection':
      $output = '<p>' . t('The environment indicator switcher allows you to create a menu to switch between your environments easily.') . '</p>';
      $output .= '<p>' . t('You will need to declare all the environments you want to switch. It is advisable that you set your environments in the switcher with the same colors that you use in every environment\'s settings.php.') . '</p>';
      return $output;
    case 'help.page.environment_indicator':
      $output = '<p>' . t('The Environment Indicator adds a coloured strip to the site informing you which environment you are currently in (Development, Staging, Production, etc.') . '</p>';
      $output .= '<p>' . t('The Environment Indicator <a href=":settings">settings page</a> allows you to modify some elements of the indicator\'s behavior and appearance. Since the appearance of the indicator is dependent on your site theme, substantial customisations require modifications to your site\'s theme and CSS files.', [
        ':settings' => $settings_url,
      ]) . '</p>';
      $output .= '<p>' . t('The Environment Indicator\'s visibility depends upon the permissions of the viewer. The <a href=":permissions">access environment indicator</a> permission must be enabled for a user role in order for users of that role to see the indicator.', [
        ':permissions' => $permissions_url,
      ]) . '</p>';
      $output .= '<p>' . t('Modify the "environment_indicator.indicator" configuration object to control how the environment indicator is presented:') . '</p>';
      $output .= '<dl>';
      $output .= '<dt><em>$config[\'environment_indicator.indicator\'][\'bg_color\']</em></dt><dd>' . t('A valid CSS color for the background of the indicator.') . '<br/>$config[\'environment_indicator.indicator\'][\'bg_color\'];<br /></dd></dt>';
      $output .= '<dt><em>$config[\'environment_indicator.indicator\'][\'fg_color\']</em></dt><dd>' . t('A valid CSS color for the text of the indicator.') . '<br/>$config[\'environment_indicator.indicator\'][\'fg_color\'] = \'#555533\';<br /></dd></dt>';
      $output .= '<dt><em>$config[\'environment_indicator.indicator\'][\'name\']</em></dt><dd>' . t('The text that will be displayed on the indicator.') . '<br/>$config[\'environment_indicator.indicator\'][\'name\'] = \'Staging\';<br /></dd></dt>';
      $output .= '</dl>';
      $output .= '<p>' . t('The recommended way to add information about your release is to set the \'environment_indicator.current_release\' state. Use your git hooks to set the state using drush: <code>drush sset environment_indicator.current_release v1.2.44</code>') . '</p>';
      return $output;
  }
  return NULL;
}