Skip to content
Snippets Groups Projects
fillpdf.module 1.10 KiB
<?php

/**
 * @file
 * Allows mappings of PDFs to site content.
 */

use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;

/**
 * Implements hook_help().
 */
function fillpdf_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.fillpdf':
      $content = t('See the <a href=":documentation">documentation on drupal.org</a> for a full description of and guide to this module.', [
        ':documentation' => Url::fromUri('https://www.drupal.org/docs/contributed-modules/fillpdf')
          ->toString(),
      ]);
      return $content;

    case 'fillpdf.forms_admin':
      if (\Drupal::moduleHandler()->moduleExists('help')) {
        return t('See the <a href=":link">documentation</a> for an explanation on downloading these forms to PDF',
          [
            ':link' => Url::fromUri('https://www.drupal.org/docs/contributed-modules/fillpdf')
              ->toString(),
          ]);
      }
      else {
        return t('Activate the help module if you need an explanation on downloading these forms to PDF.');
      }
      break;
  }

  return '';
}