function disable_messages_help in Disable Messages 2.x
Same name and namespace in other branches
- 8 disable_messages.module \disable_messages_help()
- 7 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 messaging system is an excellent
way for modules to send out messages to the end users. However not
all messages sent out by drupal core and all modules need to be shown
to the end users. This module gives site administrators a reasonably
powerful way to filter out messages shown to the end users using
regular expressions.');
$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 role.') . '</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>"Messages to be disabled"</strong> text area.
These messages should be in the form of Regular
Expressions, with one entered per line. 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
familiar 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>"Page Level Filtering Options."</strong>
By default, filtering is enabled for all users on all pages. Here
you can specify the pages where filtering should be added or
excluded by setting the "Apply filters by page" radio
and entering page paths, one per line. These standard visibility
controls work just like the core Block system\'s.') . '</dd>';
$output .= '<dd>' . t('You may also configure <strong>"User Level Filtering Options."</strong>
to turn filtering off for certain Drupal User ID\'s (uid). This can be
useful to turn off filtering for any specific admin users. You can
also turn off filtering for Anonymous users, whose uid is 0.
You can also filter message types entirely by roles and setting
the appropriate permissoins for the relevant roles to view the
different types of messages. You will have to explicitly enable
this option to allow filtering by types by permissions') . '</dd>';
$output .= '<dd>' . t('If you are setting up the module for the first time, you should
enable one 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>Administration » People » Permissions"</strong>
to set permissions. When the module is first enabled it will
not give any permission to any roles to view any types of messages.
Assign the "view <type> message" to roles who should
be able to see the given <type> of messages. Users who do not have
the permission 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;
}
}