You are here

function poll_help in Poll 8

Implements hook_help().

File

./poll.module, line 25
Collects votes on different topics in the form of multiple choice questions.

Code

function poll_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.poll':
      $output = '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The Poll module can be used to create simple surveys or questionnaires that display cumulative results. A poll is a good way to receive feedback from site users and community members. For more information, see the online handbook entry for the <a href=":poll">Poll module</a>.', array(
        ':poll' => 'https://www.drupal.org/docs/8/modules/poll',
      )) . '</p>';
      $output .= '<h3>' . t('Uses') . '</h3>';
      $output .= '<dl>';
      $output .= '<dt>' . t('Creating a poll') . '</dt>';
      $output .= '<dd>' . t('Users can create a poll by clicking on <a href=":add-poll">Add a poll</a> on the <a href=":polls">Polls</a> page, and entering the question being posed, the answer choices, and beginning vote counts for each choice. The status (closed or active) and duration (length of time the poll remains active for new votes) can also be specified.', array(
        ':add-poll' => Url::fromRoute('poll.poll_add')
          ->toString(),
        ':polls' => Url::fromRoute('poll.poll_list')
          ->toString(),
      )) . '</dd>';
      $output .= '<dt>' . t('Viewing polls') . '</dt>';
      $output .= '<dd>' . t('You can visit the <a href=":polls">Polls</a> page to view all current polls, or alternately enable the <em>Most recent poll</em> block on the <a href=":blocks">Blocks administration page</a>. To vote in or view the results of a specific poll, you can click on the poll itself.', array(
        ':polls' => Url::fromRoute('poll.poll_list')
          ->toString(),
        ':blocks' => Url::fromRoute('block.admin_display')
          ->toString(),
      )) . '</dd>';
      $output .= '</dl>';
      return $output;
  }
}