You are here

function statistics_help in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/statistics/statistics.module \statistics_help()

Implements hook_help().

File

core/modules/statistics/statistics.module, line 17
Logs and displays content statistics for a site.

Code

function statistics_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.statistics':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Statistics module shows you how often content is viewed. This is useful in determining which pages of your site are most popular. For more information, see the <a href=":statistics_do">online documentation for the Statistics module</a>.', array(
        ':statistics_do' => 'https://www.drupal.org/documentation/modules/statistics/',
      )) . '</p>';
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Displaying popular content') . '</dt>';
      $output .= '<dd>' . t('The module includes a <em>Popular content</em> block that displays the most viewed pages today and for all time, and the last content viewed. To use the block, enable <em>Count content views</em> on the <a href=":statistics-settings">Statistics page</a>, and then you can enable and configure the block on the <a href=":blocks">Block layout page</a>.', array(
        ':statistics-settings' => \Drupal::url('statistics.settings'),
        ':blocks' => \Drupal::moduleHandler()
          ->moduleExists('block') ? \Drupal::url('block.admin_display') : '#',
      )) . '</dd>';
      $output .= '<dt>' . t('Page view counter') . '</dt>';
      $output .= '<dd>' . t('The Statistics module includes a counter for each page that increases whenever the page is viewed. To use the counter, enable <em>Count content views</em> on the <a href=":statistics-settings">Statistics page</a>, and set the necessary <a href=":permissions">permissions</a> (<em>View content hits</em>) so that the counter is visible to the users.', array(
        ':statistics-settings' => \Drupal::url('statistics.settings'),
        ':permissions' => \Drupal::url('user.admin_permissions', array(), array(
          'fragment' => 'module-statistics',
        )),
      )) . '</dd>';
      $output .= '</dl>';
      return $output;
    case 'statistics.settings':
      return '<p>' . t('Settings for the statistical information that Drupal will keep about the site.') . '</p>';
  }
}