You are here

protected function WebformHelpManager::initHelp in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformHelpManager.php \Drupal\webform\WebformHelpManager::initHelp()

Initialize help.

Return value

array An associative array containing help.

1 call to WebformHelpManager::initHelp()
WebformHelpManager::__construct in src/WebformHelpManager.php
Constructs a WebformHelpManager object.

File

src/WebformHelpManager.php, line 1537

Class

WebformHelpManager
Webform help manager.

Namespace

Drupal\webform

Code

protected function initHelp() {
  $help = [];

  /**************************************************************************/

  // Notifications.

  /**************************************************************************/
  if ($this->currentUser
    ->hasPermission('administer webform')) {
    $notifications = $this
      ->getNotifications();
    foreach ($notifications as $type => $messages) {
      foreach ($messages as $id => $message) {
        $message_id = 'webform_help_notification__' . $id;
        $help['webform_help_notification__' . $id] = [
          'group' => 'notifications',
          'content' => $message,
          'message_id' => $message_id,
          'message_type' => $type,
          'message_close' => TRUE,
          'message_storage' => WebformMessage::STORAGE_CUSTOM,
          'routes' => [
            // @see /admin/structure/webform
            'entity.webform.collection',
          ],
        ];
      }
    }
  }

  /**************************************************************************/

  // Promotions.
  // Disable promotions via Webform admin settings.
  // (/admin/structure/webform/config/advanced).

  /**************************************************************************/

  // Promotions: Webform.
  $t_args = [
    ':href_involved' => 'https://www.drupal.org/getting-involved',
    ':href_opencollective' => 'https://opencollective.com/webform',
    ':href_support' => 'https://www.jrockowitz.com',
  ];
  $help['promotion_webform'] = [
    'group' => 'promotions',
    'title' => $this
      ->t('Promotions: Drupal Association'),
    'content' => $this
      ->t('If you enjoy and value Drupal and the Webform module consider <a href=":href_involved">getting involved in the Drupal community</a>, <a href=":href_opencollective">contributing funds to the Webform module\'s Open Collective</a>, and <a href=":href_support">hiring professional support</a>.', $t_args),
    'message_type' => 'webform',
    'message_close' => TRUE,
    'message_storage' => WebformMessage::STORAGE_STATE,
    'attached' => [
      'library' => [
        'webform/webform.promotions',
      ],
    ],
    'access' => $this->currentUser
      ->hasPermission('administer webform') && !$this->configFactory
      ->get('webform.settings')
      ->get('ui.promotions_disabled'),
    'reset_version' => TRUE,
    'routes' => [
      // @see /admin/structure/webform
      'entity.webform.collection',
    ],
  ];

  /**************************************************************************/

  // Installation.

  /**************************************************************************/

  // Installation.
  $t_args = [
    ':about_href' => 'https://www.drupal.org/docs/8/modules/webform',
    ':addons_href' => Url::fromRoute('webform.addons')
      ->toString(),
    ':submodules_href' => Url::fromRoute('system.modules_list', [], [
      'fragment' => 'edit-modules-webform',
    ])
      ->toString(),
    ':libraries_href' => Url::fromRoute('webform.config.libraries')
      ->toString(),
  ];
  $help['installation'] = [
    'group' => 'installation',
    'title' => $this
      ->t('Installation'),
    'content' => '<strong>' . $this
      ->t('Congratulations!') . '</strong> ' . $this
      ->t('You have successfully installed the Webform module.') . ' ' . $this
      ->t('Learn more about the <a href=":about_href">Webform module and Drupal</a>', $t_args) . '</br>' . $this
      ->t('Please make sure to install additional <a href=":libraries_href">third-party libraries</a>, <a href=":submodules_href">sub-modules</a> and optional <a href=":addons_href">add-ons</a>.', $t_args),
    'video_id' => 'installation',
    'message_type' => 'webform',
    'message_close' => TRUE,
    'message_storage' => WebformMessage::STORAGE_STATE,
    'access' => $this->currentUser
      ->hasPermission('administer webform'),
    'attached' => [
      'library' => [
        'webform/webform.promotions',
      ],
    ],
    'routes' => [
      // @see /admin/modules
      'system.modules_list',
    ],
  ];

  /**************************************************************************/

  // Forms.

  /**************************************************************************/

  // Webforms.
  $help['webforms_manage'] = [
    'group' => 'forms',
    'title' => $this
      ->t('Forms'),
    'content' => $this
      ->t('The <strong>Forms</strong> management page lists all available webforms, which can be filtered by the following: title, description, elements, category and status.'),
    'video_id' => 'forms',
    'routes' => [
      // @see /admin/structure/webform
      'entity.webform.collection',
    ],
  ];

  /**************************************************************************/

  // Addons.

  /**************************************************************************/

  // Addons.
  $help['addons'] = [
    'group' => 'addons',
    'title' => $this
      ->t('Add-ons'),
    'content' => $this
      ->t('The <strong>Add-ons</strong> page lists Drupal modules and projects that extend and provide additional functionality to the Webform module and Drupal\'s Form API.  If you would like a module or project to be included in the below list, please submit a request to the <a href=":href">Webform module\'s issue queue</a>.', [
      ':href' => 'https://www.drupal.org/node/add/project-issue/webform',
    ]),
    'video_id' => 'addons',
    'routes' => [
      // @see /admin/structure/webform/addons
      'webform.addons',
    ],
  ];

  /**************************************************************************/

  // Help.

  /**************************************************************************/
  $help['help'] = [
    'group' => 'help',
    'title' => $this
      ->t('Help'),
    'content' => $this
      ->t('Visit the Webform <a href="https://www.drupal.org/node/2856146">documentation pages</a> for an <a href="https://www.drupal.org/node/2834423">introduction</a>, <a href="https://www.drupal.org/node/2837024">features overview</a>, <a href="https://www.drupal.org/node/2932764">articles</a>, <a href="https://www.drupal.org/node/2860989">recipes</a>, and more...'),
    'routes' => [
      // @see /admin/structure/webform/help
      'webform.help',
    ],
  ];

  /**************************************************************************/

  // Configuration.

  /**************************************************************************/

  // Configuration: Forms.
  $help['config_forms'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Forms'),
    'content' => $this
      ->t('The <strong>Forms configuration</strong> page allows administrators to manage form settings, behaviors, labels, messages and CSS classes.'),
    'video_id' => 'configuration',
    'routes' => [
      // @see /admin/structure/webform/config/forms
      'webform.config',
    ],
  ];

  // Configuration: Elements.
  $help['config_elements'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Elements'),
    'content' => $this
      ->t('The <strong>Elements configuration</strong> page allows administrators to enable/disable element types and manage element specific settings, properties, behaviors and formatting.'),
    'video_id' => 'configuration',
    'routes' => [
      // @see /admin/structure/webform/config/element
      'webform.config.elements',
    ],
  ];

  // Configuration: Options.
  $help['config_options'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Options'),
    'content' => $this
      ->t('The <strong>Options configuration</strong> page lists reusable predefined options/values available for select menus, radio buttons, checkboxes and Likert elements.'),
    'video_id' => 'configuration',
    'routes' => [
      // @see /admin/structure/webform/options
      'entity.webform_options.collection',
    ],
  ];

  // Configuration: Submissions.
  $help['config_submissions'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Submissions'),
    'content' => $this
      ->t('The <strong>Submissions configuration</strong> page allows administrators to manage submissions settings, behaviors and messages.'),
    'video_id' => 'configuration',
    'routes' => [
      // @see /admin/structure/webform/config/submissions
      'webform.config.submissions',
    ],
  ];

  // Configuration: Handlers.
  $help['config_handlers'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Handlers'),
    'content' => $this
      ->t('The <strong>Handlers configuration</strong> page allows administrators to enable/disable handlers and configure default email settings and messages.') . ' ' . $this
      ->t('<strong>Handlers</strong> are used to route submitted data to external applications and send notifications & confirmations.'),
    'video_id' => 'configuration',
    'routes' => [
      // @see /admin/structure/webform/config/handlers
      'webform.config.handlers',
    ],
  ];

  // Configuration: Variants.
  $help['config_variants'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Variants'),
    'content' => $this
      ->t('The <strong>Variants configuration</strong> page allows administrators to enable/disable variants.') . ' ' . $this
      ->t('<strong>Variants</strong> are used for A/B testing, segmentation, and personalization.'),
    'video_id' => 'configuration',
    'routes' => [
      // @see /admin/structure/webform/config/variants
      'webform.config.variants',
    ],
  ];

  // Configuration: Exporters.
  $help['config_exporters'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Exporters'),
    'content' => $this
      ->t('The <strong>Exporters configuration</strong> page allows administrators to enable/disable exporters and configure default export settings.') . ' ' . $this
      ->t('<strong>Exporters</strong> are used to export results into a downloadable format that can be used by MS Excel, Google Sheets and other spreadsheet applications.'),
    'video_id' => 'configuration',
    'routes' => [
      // @see /admin/structure/webform/config/exporters
      'webform.config.exporters',
    ],
  ];

  // Configuration: Libraries.
  $help['config_libraries'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Libraries'),
    'content' => $this
      ->t('The <strong>Libraries configuration</strong> page allows administrators to enable/disable libraries and define global custom CSS/JavaScript used by all webforms.'),
    'video_id' => 'configuration',
    'routes' => [
      // @see /admin/structure/webform/config/libraries
      'webform.config.libraries',
    ],
  ];

  // Configuration: Libraries.
  $t_args = [
    '@webform-libraries-composer' => 'webform-libraries-composer',
    '@webform-libraries-download' => 'webform-libraries-download',
    '@webform-composer-update' => 'webform-composer-update',
  ];
  $drush_version = class_exists('\\Drush\\Drush') ? \Drush\Drush::getMajorVersion() : 8;
  if ($drush_version >= 9) {
    foreach ($t_args as $command_name => $command) {
      $t_args[$command_name] = str_replace('-', ':', $command);
    }
  }
  $t_args += [
    ':href_5x' => 'https://git.drupalcode.org/sandbox/jrockowitz-2941983/-/raw/8.x-5.x/libraries.zip',
    ':href_6x' => 'https://git.drupalcode.org/sandbox/jrockowitz-2941983/-/raw/6.x/libraries.zip',
  ];
  $help['config_libraries_help'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Libraries: Help'),
    'content' => '<p>' . $this
      ->t('The Webform module utilizes third-party Open Source libraries to enhance webform elements and to provide additional functionality.') . ' ' . $this
      ->t("It is recommended that these libraries are installed in your Drupal installation's /libraries or /web/libraries directory.") . ' ' . $this
      ->t('If these libraries are not installed, they will be automatically loaded from a CDN.') . ' ' . $this
      ->t('All libraries are optional and can be excluded via the admin settings form.') . '</p>' . '<p>' . $this
      ->t('There are several ways to download the needed third-party libraries.') . '</p>' . '<p><strong>' . $this
      ->t('Recommended') . '</strong></p>' . '<ul>' . '<li>' . $this
      ->t('Use the <a href="https://github.com/wikimedia/composer-merge-plugin">Composer Merge plugin</a> to include the Webform module\'s <a href="https://cgit.drupalcode.org/webform/tree/composer.libraries.json">composer.libraries.json</a> or generate a custom file using <code>drush @webform-libraries-composer &gt; DRUPAL_ROOT/composer.libraries.json</code>.', $t_args) . '<br/><strong>' . $this
      ->t('<a href="https://www.drupal.org/node/3003140">Learn more &raquo;</a>') . '</strong>' . '</li>' . '</ul>' . '<p><strong>' . $this
      ->t('Alternatives') . '</strong></p>' . '<ul>' . '<li>' . $this
      ->t('Generate a composer.json file using <code>drush @webform-libraries-composer</code>.', $t_args) . '</li>' . '<li>' . $this
      ->t('Execute <code>drush @webform-libraries-download</code>, to download third-party libraries required by the Webform module. (OSX/Linux)', $t_args) . '</li>' . '<li>' . $this
      ->t("Execute <code>drush @webform-composer-update</code>, to update your Drupal installation's composer.json to include the Webform module's selected libraries as repositories.", $t_args) . '</li>' . '<li>' . $this
      ->t('Download and extract a zipped archive containing all webform libraries (<a href=":href_5x">8.x-5.x</a> and <a href=":href_6x">6.x</a>) and extract the directories and files to /libraries or /web/libraries', $t_args) . '</li>' . '</ul>',
    'message_type' => 'info',
    'message_close' => TRUE,
    'message_storage' => WebformMessage::STORAGE_SESSION,
    'routes' => [
      // @see /admin/structure/webform/config/libraries
      'webform.config.libraries',
    ],
  ];

  // Configuration: Advanced.
  $help['config_advanced'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Advanced'),
    'content' => $this
      ->t('The <strong>Advanced configuration</strong> page allows an administrator to enable/disable UI behaviors, manage requirements and define data used for testing webforms.'),
    'video_id' => 'configuration',
    'routes' => [
      // @see /admin/structure/webform/config/advanced
      'webform.config.advanced',
    ],
  ];

  // Configuration: Translate.
  $help['config_translation'] = [
    'group' => 'configuration',
    'title' => $this
      ->t('Configuration: Translate'),
    'content' => $this
      ->t('The <strong>Translate configuration</strong> page allows webform messages and labels to be translated into multiple languages.'),
    'video_id' => 'translations',
    'routes' => [
      // /admin/structure/webform/config/translate
      'config_translation.item.overview.webform.config',
    ],
  ];

  /**************************************************************************/

  // Plugins.

  /**************************************************************************/

  // Plugins: Elements.
  $help['plugins_elements'] = [
    'group' => 'plugins',
    'title' => $this
      ->t('Plugins: Elements'),
    'content' => $this
      ->t('The <strong>Element plugins</strong> overview page lists all available webform element plugins.') . ' ' . $this
      ->t('<strong>Webform Element</strong> plugins are used to enhance existing render/form elements. Webform element plugins provide default properties, data normalization, custom validation, element configuration form and customizable display formats.'),
    'video_id' => 'plugins',
    'routes' => [
      // @see /admin/reports/webform-plugins/elements
      'webform.reports_plugins.elements',
    ],
  ];

  // Plugins: Handlers.
  $help['plugins_handlers'] = [
    'group' => 'plugins',
    'title' => $this
      ->t('Plugins: Emails/Handlers'),
    'content' => $this
      ->t('The <strong>Handler plugins</strong> overview page lists all available webform handler plugins.') . ' ' . $this
      ->t('<strong>Handlers</strong> are used to route submitted data to external applications and send notifications & confirmations.'),
    'video_id' => 'plugins',
    'routes' => [
      // @see /admin/reports/webform-plugins/handlers
      'webform.reports_plugins.handlers',
    ],
  ];

  // Plugins: Variants.
  $help['plugins_variants'] = [
    'group' => 'plugins',
    'title' => $this
      ->t('Plugins: Variants'),
    'content' => $this
      ->t('The <strong>Variant plugins</strong> overview page lists all available webform variant plugins.') . ' ' . $this
      ->t('<strong>Variants</strong> are used for A/B testing, segmentation, and personalization.'),
    'video_id' => 'plugins',
    'routes' => [
      // @see /admin/reports/webform-plugins/variants
      'webform.reports_plugins.variants',
    ],
  ];

  // Plugins: Exporters.
  $help['plugins_exporters'] = [
    'group' => 'plugins',
    'title' => $this
      ->t('Plugins: Exporters'),
    'content' => $this
      ->t('The <strong>Exporter plugins</strong> overview page lists all available results exporter plugins.') . ' ' . $this
      ->t('<strong>Exporters</strong> are used to export results into a downloadable format that can be used by MS Excel, Google Sheets and other spreadsheet applications.'),
    'video_id' => 'plugins',
    'routes' => [
      // @see /admin/reports/webform-plugins/exporters
      'webform.reports_plugins.exporters',
    ],
  ];

  /**************************************************************************/

  // Webform.

  /**************************************************************************/

  // Webform: Source.
  $help['webform_source'] = [
    'group' => 'forms',
    'title' => $this
      ->t('Webform: Source'),
    'content' => $this
      ->t("The (View) <strong>Source</strong> page allows developers to edit a webform's render array using YAML markup.") . ' ' . $this
      ->t("Developers can use the (View) <strong>Source</strong> page to alter a webform's labels quickly, cut-n-paste multiple elements, reorder elements, as well as  add custom properties and markup to elements."),
    'video_id' => 'forms',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/source
      'entity.webform.source_form',
    ],
  ];

  // Webform: Test.
  $help['webform_test'] = [
    'group' => 'forms',
    'title' => $this
      ->t('Webform: Test'),
    'content' => $this
      ->t("The <strong>Test</strong> form allows a webform to be tested using a customizable test dataset.") . ' ' . $this
      ->t('Multiple test submissions can be created using the Devel generate module.'),
    'video_id' => 'forms',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/test
      'entity.webform.test_form',
      // @see /node/{node}/webform/test
      'entity.node.webform.test_form',
    ],
  ];

  // Webform: API.
  $help['webform_api'] = [
    'group' => 'forms',
    'title' => $this
      ->t('Webform: API'),
    'content' => $this
      ->t("The <strong>API</strong> form allows developers to test a webform's API."),
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/api
      'entity.webform.api_form',
      // @see /node/{node}/webform/api
      'entity.node.webform.api_form',
    ],
  ];

  // Webform: Translations.
  $help['webform_translate'] = [
    'group' => 'translations',
    'title' => $this
      ->t('Webform: Translate'),
    'content' => $this
      ->t("The <strong>Translate</strong> page allows a webform's configuration and elements to be translated into multiple languages."),
    'video_id' => 'translations',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/translate
      'entity.webform.config_translation_overview',
    ],
  ];

  /**************************************************************************/

  // Elements.

  /**************************************************************************/

  // Elements.
  $help['elements'] = [
    'group' => 'elements',
    'title' => $this
      ->t('Elements'),
    'content' => $this
      ->t('The <strong>Elements</strong>  page allows users to add, update, duplicate and delete elements and wizard pages.'),
    'video_id' => 'elements',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}
      'entity.webform.edit_form',
    ],
  ];

  /**************************************************************************/

  // Handlers.

  /**************************************************************************/

  // Handlers.
  $help['handlers'] = [
    'group' => 'handlers',
    'title' => $this
      ->t('Handlers'),
    'content' => $this
      ->t('The <strong>Emails/Handlers</strong> page allows additional actions and behaviors to be processed when a webform or submission is created, updated, or deleted.') . ' ' . $this
      ->t('<strong>Handlers</strong> are used to route submitted data to external applications and send notifications & confirmations.'),
    'video_id' => 'handlers',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/handlers
      'entity.webform.handlers',
    ],
  ];

  /**************************************************************************/

  // Variants.

  /**************************************************************************/

  // Variants.
  $help['variants'] = [
    'group' => 'variants',
    'title' => $this
      ->t('Variants'),
    'content' => $this
      ->t('The <strong>Variants</strong> page allows variations of a webform to be created and managed for A/B testing, segmentation, and personalization.'),
    'video_id' => 'variants',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/variants
      'entity.webform.variants',
    ],
  ];

  /**************************************************************************/

  // Settings.

  /**************************************************************************/

  // Settings.
  $help['settings'] = [
    'group' => 'settings',
    'title' => $this
      ->t('Settings: General'),
    'content' => $this
      ->t("The <strong>General</strong> settings page allows a webform's administrative information, paths, behaviors and third-party settings to be customized."),
    'video_id' => 'settings',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/settings
      'entity.webform.settings',
    ],
  ];

  // Settings: Form.
  $help['settings_form'] = [
    'group' => 'settings',
    'title' => $this
      ->t('Settings: Form'),
    'content' => $this
      ->t("The <strong>Form</strong> settings page allows a webform's status, attributes, behaviors, labels, messages, wizard settings and preview to be customized."),
    'video_id' => 'settings',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/settings/form
      'entity.webform.settings_form',
    ],
  ];

  // Settings: Submissions.
  $help['settings_submissions'] = [
    'group' => 'settings',
    'title' => $this
      ->t('Settings: Submissions'),
    'content' => $this
      ->t("The <strong>Submissions</strong> settings page allows a submission's labels, behaviors, limits and draft settings to be customized."),
    'video_id' => 'settings',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/settings/submissions
      'entity.webform.settings_submissions',
    ],
  ];

  // Settings: Confirmation.
  $help['settings_confirmation'] = [
    'group' => 'settings',
    'title' => $this
      ->t('Settings: Confirmation'),
    'content' => $this
      ->t("The <strong>Confirmation</strong> settings page allows the submission confirmation type, message and URL to be customized."),
    'video_id' => 'settings',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/settings/confirmation
      'entity.webform.settings_confirmation',
    ],
  ];

  // Settings: Assets.
  $help['settings_assets'] = [
    'group' => 'settings',
    'title' => $this
      ->t('Settings: Assets'),
    'content' => $this
      ->t("The <strong>CSS/JS</strong> settings page allows site builders to attach custom CSS and JavaScript to a webform."),
    'video_id' => 'settings',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/settings/assets
      'entity.webform.settings_assets',
    ],
  ];

  // Settings: Access.
  $help['settings_access'] = [
    'group' => 'settings',
    'title' => $this
      ->t('Settings: Access'),
    'content' => $this
      ->t('The <strong>Access</strong> settings page allows an administrator to determine who can administer a webform and/or create, update, delete and purge webform submissions.'),
    'video_id' => 'settings',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/access
      'entity.webform.settings_access',
    ],
  ];

  /**************************************************************************/

  // Submissions/Results.

  /**************************************************************************/

  // Submissions.
  $help['submissions'] = [
    'group' => 'submissions',
    'title' => $this
      ->t('Submissions'),
    'content' => $this
      ->t('The <strong>Submissions</strong> page lists all incoming submissions for all webforms.'),
    'routes' => [
      // @see /admin/structure/webform/submissions/manage
      'entity.webform_submission.collection',
    ],
  ];

  // Results.
  $help['results'] = [
    'group' => 'submissions',
    'title' => $this
      ->t('Results: Submissions'),
    'content' => $this
      ->t("The <strong>Submissions</strong> page displays a customizable overview of a webform's submissions.") . ' ' . $this
      ->t("Submissions can be reviewed, updated, flagged and/or annotated."),
    'video_id' => 'submissions',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/results/submissions
      'entity.webform.results_submissions',
    ],
  ];

  // Results: Download.
  $help['results_download'] = [
    'group' => 'submissions',
    'title' => $this
      ->t('Results: Download'),
    'content' => $this
      ->t("The <strong>Download</strong> page allows a webform's submissions to be exported into a customizable CSV (Comma Separated Values) file and other common data formats."),
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/results/download
      'entity.webform.results_export',
    ],
  ];

  /**************************************************************************/

  // Submission.

  /**************************************************************************/
  $help['submission'] = [
    'group' => 'submission',
    'title' => $this
      ->t('Submission: View'),
    'content' => $this
      ->t("The <strong>View</strong> page displays a submission's general information and data."),
    'video_id' => 'submission',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/submission/{webform_submission}
      'entity.webform_submission.canonical',
      // @see /node/{node}/webform/submission/{webform_submission}
      'entity.node.webform_submission.canonical',
    ],
  ];
  $help['submission_table'] = [
    'group' => 'submission',
    'title' => $this
      ->t('Submission: Table'),
    'content' => $this
      ->t("The <strong>Table</strong> page displays a submission's general information and data using tabular layout."),
    'video_id' => 'submission',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/submission/{webform_submission}/table
      'entity.webform_submission.table',
      // @see /node/{node}/webform/submission/{webform_submission}/table
      'entity.node.webform_submission.table',
    ],
  ];
  $help['submission_text'] = [
    'group' => 'submission',
    'title' => $this
      ->t('Submission: Plain text'),
    'content' => $this
      ->t("The <strong>Plain text</strong> page displays a submission's general information and data as plain text."),
    'video_id' => 'submission',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/submission/{webform_submission}/text
      'entity.webform_submission.text',
      // @see /node/{node}/webform/submission/{webform_submission}/text
      'entity.node.webform_submission.text',
    ],
  ];
  $help['submission_yaml'] = [
    'group' => 'submission',
    'title' => $this
      ->t('Submission: Data (YAML)'),
    'content' => $this
      ->t("The <strong>Data (YAML)</strong> page displays a submission's raw data as YAML."),
    'video_id' => 'submission',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/submission/{webform_submission}/yaml
      'entity.webform_submission.yaml',
      // @see /node/{node}/webform/submission/{webform_submission}/yaml
      'entity.node.webform_submission.yaml',
    ],
  ];
  $help['submission_edit'] = [
    'group' => 'submission',
    'title' => $this
      ->t('Submission: Edit'),
    'content' => $this
      ->t("The <strong>Edit</strong> form allows the administrator to update a submission."),
    'video_id' => 'submission',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/submission/{webform_submission}/edit
      'entity.webform_submission.edit_form',
      // @see /node/{node}/webform/submission/{webform_submission}/edit
      'entity.node.webform_submission.edit_form',
    ],
  ];
  $help['submission_edit_all'] = [
    'group' => 'submission',
    'title' => $this
      ->t('Submission: Edit All'),
    'content' => $this
      ->t("The <strong>Edit all</strong> form allows administrator to update all values for submission create from a multi-step form."),
    'video_id' => 'submission',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/submission/{webform_submission}/edit_all
      'entity.webform_submission.edit_all',
      // @see /node/{node}/webform/submission/{webform_submission}/edit_all
      'entity.node.webform_submission.edit_all',
    ],
  ];
  $help['submission_resend'] = [
    'group' => 'submission',
    'title' => $this
      ->t('Submission: Resend'),
    'content' => $this
      ->t("The <strong>Resend</strong> form allows administrator to preview and resend emails and messages."),
    'video_id' => 'submission',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/submission/{webform_submission}/resend
      'entity.webform_submission.resend_form',
      // @see /node/{node}/webform/submission/{webform_submission}/resend
      'entity.node.webform_submission.resend_form',
    ],
  ];
  $help['submission_notes'] = [
    'group' => 'submission',
    'title' => $this
      ->t('Submission: Notes'),
    'content' => $this
      ->t("The <strong>Notes</strong> form allows administrator to flag and annotate a submission."),
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/submission/{webform_submission}/notes
      'entity.webform_submission.notes_form',
      // @see /node/{node}/webform/submission/{webform_submission}/notes
      'entity.node.webform_submission.notes_form',
    ],
  ];

  /**************************************************************************/

  // Export.

  /**************************************************************************/

  // Export: Config.
  $config_import_href = $this->moduleHandler
    ->moduleExists('config') && $this->currentUser
    ->hasPermission('import configuration') ? Url::fromRoute('config.import_single', [], [
    'query' => [
      'config_type' => 'webform',
    ],
  ])
    ->toString() : 'https://www.drupal.org/docs/8/configuration-management';
  $help['webform_config_export'] = [
    'group' => 'development',
    'title' => $this
      ->t('Devel: Export'),
    'content' => $this
      ->t("The <strong>Config Export</strong> form allows developers to quickly export a single webform's YAML configuration file.") . ' ' . $this
      ->t('A single webform\'s YAML configuration file can easily be <a href=":href">imported</a> into another Drupal instance.', [
      ':href' => $config_import_href,
    ]) . ' ' . $this
      ->t('If you run into any issues with a webform, you can also attach the below configuration (without any personal information) to a new ticket in the Webform module\'s <a href=":href">issue queue</a>.', [
      ':href' => 'https://www.drupal.org/project/issues/webform',
    ]),
    'video_id' => 'development',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/export
      'entity.webform.export_form',
    ],
  ];

  /**************************************************************************/

  // Modules.

  /**************************************************************************/

  // Webform Entity Print (PDF).
  $help['webform_entity_print'] = [
    'group' => 'webform_entity_print',
    'title' => $this
      ->t('Webform Entity Print (PDF)'),
    'content' => $this
      ->t('Provides <a href=":href">Entity Print</a> (PDF) integration and allows site builders to download, export, and email PDF copies of webform submissions.', [
      ':href' => 'https://www.drupal.org/project/entity_print',
    ]),
    'video_id' => 'print',
  ];

  // Webform Node.
  $help['webform_node'] = [
    'group' => 'webform_nodes',
    'title' => $this
      ->t('Webform Node'),
    'content' => $this
      ->t("A <strong>Webform Node</strong> allows webforms to be fully integrated into a website as nodes."),
    'video_id' => 'webform_nodes',
    'paths' => [
      '/node/add/webform',
    ],
  ];
  $help['webform_node_reference'] = [
    'group' => 'webform_nodes',
    'title' => $this
      ->t('Webform Node: References'),
    'content' => $this
      ->t("The <strong>Reference</strong> pages displays an overview of a webform's references and allows you to quickly create new references (a.k.a Webform nodes)."),
    'video_id' => 'webform_nodes',
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}/references
      'entity.webform.references',
    ],
  ];
  $help['webform_node_results'] = [
    'group' => 'webform_nodes',
    'title' => $this
      ->t('Webform Node: Results: Submissions'),
    'content' => $this
      ->t("The <strong>Submissions</strong> page displays a customizable overview of a webform node's submissions.") . ' ' . $this
      ->t("Submissions can be reviewed, updated, flagged and annotated."),
    'video_id' => 'webform_nodes',
    'routes' => [
      // @see /node/{node}/webform/results/submissions
      'entity.node.webform.results_submissions',
    ],
  ];
  $help['webform_node_results_download'] = [
    'group' => 'webform_nodes',
    'title' => $this
      ->t('Webform Node: Results: Download'),
    'content' => $this
      ->t("The <strong>Download</strong> page allows a webform node's submissions to be exported into a customizable CSV (Comma Separated Values) file and other common data formats."),
    'routes' => [
      // @see /node/{node}/webform/results/download
      'entity.node.webform.results_export',
    ],
  ];

  // Webform Block.
  $help['webform_block'] = [
    'group' => 'webform_blocks',
    'title' => $this
      ->t('Webform Block'),
    'content' => $this
      ->t("A <strong>Webform Block</strong> allows a webform to be placed anywhere on a website."),
    'video_id' => 'webform_blocks',
    'paths' => [
      '/admin/structure/block/add/webform_block/*',
    ],
  ];

  // Webform Accessibility.
  $help['webform_accessibility'] = [
    'group' => 'webform_accessibility',
    'title' => $this
      ->t('Webform Node'),
    'content' => $this
      ->t("The Webform module aims to be accessible to all users."),
    'video_id' => 'accessibility',
    'paths' => [
      '/admin/structure/webform/manage/example_accessibility_*',
    ],
    'message_type' => 'info',
    'message_close' => TRUE,
    'message_storage' => WebformMessage::STORAGE_USER,
    'access' => $this->currentUser
      ->hasPermission('administer webform'),
    'weight' => -10,
  ];

  /**************************************************************************/

  // Messages.

  /**************************************************************************/

  // Webform: Elements -- Warning.
  $help['message_webform_ui'] = [
    'group' => 'messages',
    'title' => $this
      ->t('Message: Webform UI Disabled'),
    'content' => $this
      ->t('Please enable the <strong>Webform UI</strong> module if you would like to add easily add and manage elements using a drag-n-drop user interface.'),
    'message_type' => 'warning',
    'message_close' => TRUE,
    'message_storage' => WebformMessage::STORAGE_STATE,
    'access' => $this->currentUser
      ->hasPermission('administer webform') && $this->currentUser
      ->hasPermission('administer modules') && !$this->moduleHandler
      ->moduleExists('webform_ui') && !$this->moduleHandler
      ->moduleExists('webform_editorial'),
    'routes' => [
      // @see /admin/structure/webform/manage/{webform}
      'entity.webform.edit_form',
    ],
  ];

  // Let other modules provide any extra help.
  $help += $this->moduleHandler
    ->invokeAll('webform_help_info');
  $this->moduleHandler
    ->alter('webform_help_info', $help);

  /**************************************************************************/

  // Initialize help.
  foreach ($help as $id => &$help_info) {
    $help_info += [
      'id' => $id,
      'reset_version' => FALSE,
    ];
  }

  // Reset storage state if the Webform module version has changed.
  if ($this
    ->isUpdated()) {
    foreach ($help as $id => $help_info) {
      if (!empty($help_info['reset_version'])) {
        WebformMessage::resetClosed(WebformMessage::STORAGE_STATE, 'webform.help.' . $id);
      }
    }
    $this->state
      ->set('webform.version', $this
      ->getVersion());
  }
  return $help;
}