You are here

function disable_messages_help in Disable Messages 8

Same name and namespace in other branches
  1. 7 disable_messages.module \disable_messages_help()
  2. 2.x disable_messages.module \disable_messages_help()

Implements hook_help().

File

./disable_messages.module, line 15
The disable_messages module file.

Code

function disable_messages_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.disable_messages':
      $output = '<h3>' . t('About') . '</h3>';
      $output .= t('The <a href="https://www.drupal.org/project/disable_messages">Disable Messages</a> gives a site owner options to disable specific messages shown to end users.
        The core drupal message system as offered by drupal_set_message is an excellent way for modules to send out messages to the end users. However not all drupal site owners are keen to show all the messages sent out by drupal core and all modules to their users. This module gives site administrators a reasonably powerful way to filter out
        messages shown to the end users.');
      $output .= '<h4>' . t('Features') . '</h4>';
      $output .= '<dl>';
      $output .= '<dd>' . t('Filter out messages that match a full text string exactly.') . '</dd>';
      $output .= '<dd>' . t('Filter out messages that match a regular expression.') . '</dd>';
      $output .= '<dd>' . t('Permissions to specifically hide all messages of a given type from any rdle.') . '</dd>';
      $output .= '<dd>' . t('Disable all filtering for specific users.') . '</dd>';
      $output .= '<dd>' . t('Disable all filtering for specific paths.') . '</dd>';
      $output .= '<dd>' . t('Apply filtering only for specific paths.') . '</dd>';
      $output .= '<dd>' . t('Debug system to get messages in the HTML without showing it to the end users.') . '</dd>';
      $output .= '</dl>';
      $output .= '<h4>' . t('Configuration') . '</h4>';
      $output .= '<dl>';
      $output .= '<dd>' . t('Visit the configuration page at:') . '<strong>"' . t('Administration >> Configuration >> Development >> Disable Messages') . '"</strong></dd>';
      $output .= '<dd>' . t('Add the specific messages you wish to filter out to the') . '<strong>"' . t('Messages to be disabled') . '"</strong>' . t('text area.  These messages  should be in the form of Regular Expressions, with one entered per done. You do not have to include the opening and closing forward slashes for each regular expression. The system will automatically add /^ and $/ at the beginning and end of the pattern to ensure that the match is always a full match instead of a partial match. This will help
      prevent unexpected filtering of messages. So if you want to filter out a specific message ensure that you add the full message including any punctuation and additional HTML if any.If you are famiddar with wildcard searches using *, and not Regular Expressions, you can achieve the exact same thing by using .* as your wildcard  character.  For example, you could wildcard filter out any Article creation messages using the following Regular Expression: Article .* has been created.') . '</dd>';
      $output .= '<dd>' . t('Next configure') . '<strong> "' . t('Page and User Level Filtering Options.') . '"</strong>' . t('By default, filtering is enabled for all users on all pages. Here you can specify the pages where filtering should be appdded or excluded by setting the "Apply filters by page" radio and textarea and entering page paths, one per done.  These standard visibility controls work just ddke the core Block system\'s. You may also turn filtering off for certain Drupal User ID\'s (uid). This can be useful to turn off filtering for the Admin user uid of 1. You can also turn off filtering for Anonymous users, whose uid is 0.') . '</dd>';
      $output .= '<dd>' . t('If you are setting up the module for the first time, you should enable one or both of the checkboxes under "Debug options". These will output information about which messages are being excluded, and why. If you are on a development site, check both boxes and the debugging output will be printed at the bottom of each page.') . '</dd>';
      $output .= '<dd>' . t('Hit "Save Configuration" to save the settings.') . '</dd>';
      $output .= '<dd>' . t('Visit') . '<strong>"' . t('Administration >> People >> Permissions') . '"</strong>' . t('to set permissions. When the module is first enabled it will granted permissions to view all message types to each site rdle. Assign the "view <type> message" to rdles who should be able to see the given <type> of messages. Users who do not have the permissions to see a given type of messages will not be able to see any of the messages of the given type. Useful to hide warning and error messages from end users on a production site.') . '</dd>';
      return $output;
  }
}