annotate core/modules/datetime_range/datetime_range.module @ 2:5311817fb629

Theme updates
author Chris Cannam
date Tue, 10 Jul 2018 13:19:18 +0000
parents c75dbcec494b
children a9cd425dd02b
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /**
Chris@0 4 * @file
Chris@0 5 * Field hooks to implement a datetime field that stores a start and end date.
Chris@0 6 */
Chris@0 7
Chris@0 8 use Drupal\Core\Routing\RouteMatchInterface;
Chris@0 9
Chris@0 10 /**
Chris@0 11 * Implements hook_help().
Chris@0 12 */
Chris@0 13 function datetime_range_help($route_name, RouteMatchInterface $route_match) {
Chris@0 14 switch ($route_name) {
Chris@0 15 case 'help.page.datetime_range':
Chris@0 16 $output = '';
Chris@0 17 $output .= '<h3>' . t('About') . '</h3>';
Chris@0 18 $output .= '<p>' . t('The Datetime Range module provides a Date field that stores start dates and times, as well as end dates and times. See the <a href=":field">Field module help</a> and the <a href=":field_ui">Field UI module help</a> pages for general information on fields and how to create and manage them. For more information, see the <a href=":datetime_do">online documentation for the Datetime Range module</a>.', [':field' => \Drupal::url('help.page', ['name' => 'field']), ':field_ui' => (\Drupal::moduleHandler()->moduleExists('field_ui')) ? \Drupal::url('help.page', ['name' => 'field_ui']) : '#', ':datetime_do' => 'https://www.drupal.org/documentation/modules/datetime_range']) . '</p>';
Chris@0 19 $output .= '<h3>' . t('Uses') . '</h3>';
Chris@0 20 $output .= '<dl>';
Chris@0 21 $output .= '<dt>' . t('Managing and displaying date fields') . '</dt>';
Chris@0 22 $output .= '<dd>' . t('The <em>settings</em> and the <em>display</em> of the Date 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>';
Chris@0 23 $output .= '<dt>' . t('Displaying dates') . '</dt>';
Chris@0 24 $output .= '<dd>' . t('Dates can be displayed using the <em>Plain</em> or the <em>Default</em> formatter. The <em>Plain</em> formatter displays the date in the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> format. If you choose the <em>Default</em> formatter, you can choose a format from a predefined list that can be managed on the <a href=":date_format_list">Date and time formats</a> page.', [':date_format_list' => \Drupal::url('entity.date_format.collection')]) . '</dd>';
Chris@0 25 $output .= '</dl>';
Chris@0 26 return $output;
Chris@0 27 }
Chris@0 28 }