You are here

function disqus_help in Disqus 8

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

Implements hook_help().

File

./disqus.module, line 19
The Disqus Drupal module.

Code

function disqus_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.disqus':
      $output = '<p>' . t('Uses the <a href=":disqus">Disqus</a> comment system to enhance comments.', [
        ':disqus' => Url::fromUri('http://disqus.com/')
          ->toString(),
      ]) . '</p>';
      $output .= '<h3>' . t('Installation') . '</h3>';
      $output .= '<ol><li>' . t('Register your site information at <a href=":disqus">Disqus</a>.', [
        ':disqus' => Url::fromUri('http://disqus.com/')
          ->toString(),
      ]) . '</li>';
      $output .= '<li>' . t('In the <a href=":configuration">Disqus configuration</a>, set the domain to what you registered with Disqus.', [
        ':configuration' => Url::fromRoute('disqus.settings')
          ->toString(),
      ]) . '</li>';
      $output .= '<li>' . t('Disqus comments can be enabled for any <a href=":entity-help">entity sub-type</a> (for example, a <a href=":content-type">content type</a>). On the Manage fields page for each entity sub-type, you can enable disqus by adding a Disqus comments field.', [
        ':entity-help' => Url::fromRoute('help.page', [
          'name' => 'entity',
        ])
          ->toString(),
        ':content-type' => Url::fromRoute('entity.node_type.collection')
          ->toString(),
      ]) . '</li>';
      $output .= '<li>' . t('Alternatively disqus comments can be used on <a href=":blocks">Blocks</a>. You will first need to configure the disqus comment field for any entity sub-type.', [
        ':blocks' => Url::fromRoute('block.admin_display')
          ->toString(),
      ]) . '</li>';
      $output .= '<li>' . t('Visit the <a href=":permissions">permissions</a>, and set which users you would like to have the ability to view Disqus threads (recommended for role).', [
        ':permissions' => Url::fromRoute('user.admin_permissions', [], [
          'fragment' => 'module-disqus',
        ])
          ->toString(),
      ]) . '</li></ol>';
      return $output;
    case 'disqus.settings':
      return '<p>' . t('The following provides the general configuration options for the <a href=":disqus">Disqus</a> comment web service.', [
        ':disqus' => Url::fromUri('http://disqus.com')
          ->toString(),
      ]) . '</p>';
  }
}