comparison core/modules/telephone/telephone.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 * Defines a simple telephone number field type. 5 * Defines a simple telephone number field type.
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 */
13 function telephone_help($route_name, RouteMatchInterface $route_match) { 14 function telephone_help($route_name, RouteMatchInterface $route_match) {
14 switch ($route_name) { 15 switch ($route_name) {
15 case 'help.page.telephone': 16 case 'help.page.telephone':
16 $output = ''; 17 $output = '';
17 $output .= '<h3>' . t('About') . '</h3>'; 18 $output .= '<h3>' . t('About') . '</h3>';
18 $output .= '<p>' . t('The Telephone module allows you to create fields that contain telephone numbers. See the <a href=":field">Field module help</a> and the <a href=":field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href=":telephone_documentation">online documentation for the Telephone module</a>.', [':field' => \Drupal::url('help.page', ['name' => 'field']), ':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? \Drupal::url('help.page', ['name' => 'field_ui']) : '#', ':telephone_documentation' => 'https://www.drupal.org/documentation/modules/telephone']) . '</p>'; 19 $output .= '<p>' . t('The Telephone module allows you to create fields that contain telephone numbers. See the <a href=":field">Field module help</a> and the <a href=":field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href=":telephone_documentation">online documentation for the Telephone module</a>.', [':field' => Url::fromRoute('help.page', ['name' => 'field'])->toString(), ':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? Url::fromRoute('help.page', ['name' => 'field_ui'])->toString() : '#', ':telephone_documentation' => 'https://www.drupal.org/documentation/modules/telephone']) . '</p>';
19 $output .= '<h3>' . t('Uses') . '</h3>'; 20 $output .= '<h3>' . t('Uses') . '</h3>';
20 $output .= '<dl>'; 21 $output .= '<dl>';
21 $output .= '<dt>' . t('Managing and displaying telephone fields') . '</dt>'; 22 $output .= '<dt>' . t('Managing and displaying telephone fields') . '</dt>';
22 $output .= '<dd>' . t('The <em>settings</em> and the <em>display</em> of the telephone field can be configured separately. See the <a href=":field_ui">Field UI help</a> for more information on how to manage fields and their display.', [':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? \Drupal::url('help.page', ['name' => 'field_ui']) : '#']) . '</dd>'; 23 $output .= '<dd>' . t('The <em>settings</em> and the <em>display</em> of the telephone field can be configured separately. See the <a href=":field_ui">Field UI help</a> for more information on how to manage fields and their display.', [':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? Url::fromRoute('help.page', ['name' => 'field_ui'])->toString() : '#']) . '</dd>';
23 $output .= '<dt>' . t('Displaying telephone numbers as links') . '</dt>'; 24 $output .= '<dt>' . t('Displaying telephone numbers as links') . '</dt>';
24 $output .= '<dd>' . t('Telephone numbers can be displayed as links with the scheme name <em>tel:</em> by choosing the <em>Telephone</em> display format on the <em>Manage display</em> page. Any spaces will be stripped out of the link text. This semantic markup improves the user experience on mobile and assistive technology devices.') . '</dd>'; 25 $output .= '<dd>' . t('Telephone numbers can be displayed as links with the scheme name <em>tel:</em> by choosing the <em>Telephone</em> display format on the <em>Manage display</em> page. Any spaces will be stripped out of the link text. This semantic markup improves the user experience on mobile and assistive technology devices.') . '</dd>';
25 $output .= '</dl>'; 26 $output .= '</dl>';
26 return $output; 27 return $output;
27 } 28 }