comparison core/modules/ban/ban.module @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
3 /** 3 /**
4 * @file 4 * @file
5 * Allows to ban individual IP addresses. 5 * Allows to ban individual IP addresses.
6 */ 6 */
7 7
8 use Drupal\Core\Url;
8 use Drupal\Core\Routing\RouteMatchInterface; 9 use Drupal\Core\Routing\RouteMatchInterface;
9 10
10 /** 11 /**
11 * Implements hook_help(). 12 * Implements hook_help().
12 */ 13 */
17 $output .= '<h3>' . t('About') . '</h3>'; 18 $output .= '<h3>' . t('About') . '</h3>';
18 $output .= '<p>' . t('The Ban module allows administrators to ban visits to their site from individual IP addresses. For more information, see the <a href=":url">online documentation for the Ban module</a>.', [':url' => 'https://www.drupal.org/documentation/modules/ban']) . '</p>'; 19 $output .= '<p>' . t('The Ban module allows administrators to ban visits to their site from individual IP addresses. For more information, see the <a href=":url">online documentation for the Ban module</a>.', [':url' => 'https://www.drupal.org/documentation/modules/ban']) . '</p>';
19 $output .= '<h3>' . t('Uses') . '</h3>'; 20 $output .= '<h3>' . t('Uses') . '</h3>';
20 $output .= '<dl>'; 21 $output .= '<dl>';
21 $output .= '<dt>' . t('Banning IP addresses') . '</dt>'; 22 $output .= '<dt>' . t('Banning IP addresses') . '</dt>';
22 $output .= '<dd>' . t('Administrators can enter IP addresses to ban on the <a href=":bans">IP address bans</a> page.', [':bans' => \Drupal::url('ban.admin_page')]) . '</dd>'; 23 $output .= '<dd>' . t('Administrators can enter IP addresses to ban on the <a href=":bans">IP address bans</a> page.', [':bans' => Url::fromRoute('ban.admin_page')->toString()]) . '</dd>';
23 $output .= '</dl>'; 24 $output .= '</dl>';
24 return $output; 25 return $output;
25 26
26 case 'ban.admin_page': 27 case 'ban.admin_page':
27 return '<p>' . t('IP addresses listed here are banned from your site. Banned addresses are completely forbidden from accessing the site and instead see a brief message explaining the situation.') . '</p>'; 28 return '<p>' . t('IP addresses listed here are banned from your site. Banned addresses are completely forbidden from accessing the site and instead see a brief message explaining the situation.') . '</p>';