function smart_date_help in Smart Date 3.4.x
Same name and namespace in other branches
- 8.2 smart_date.module \smart_date_help()
- 8 smart_date.module \smart_date_help()
- 3.x smart_date.module \smart_date_help()
- 3.0.x smart_date.module \smart_date_help()
- 3.1.x smart_date.module \smart_date_help()
- 3.2.x smart_date.module \smart_date_help()
- 3.3.x smart_date.module \smart_date_help()
Implements hook_help().
File
- ./
smart_date.module, line 17 - Field hooks for a field that stores a start and end date as timestamps.
Code
function smart_date_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.smart_date':
if (\Drupal::moduleHandler()
->moduleExists('field_ui')) {
$field_ui_link = Url::fromRoute('help.page', [
'name' => 'field_ui',
])
->toString();
}
else {
$field_ui_link = '#';
}
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Smart Date 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 Smart Date module</a>.', [
':field' => Url::fromRoute('help.page', [
'name' => 'field',
])
->toString(),
':field_ui' => $field_ui_link,
':datetime_do' => 'https://www.drupal.org/docs/contributed-modules/smart-date',
]) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Managing and displaying date fields') . '</dt>';
$output .= '<dd>' . t('The <em>settings</em> and the <em>display</em> of the Smart 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' => $field_ui_link,
]) . '</dd>';
$output .= '<dt>' . t('Displaying dates') . '</dt>';
$output .= '<dd>' . t('Smart 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 configure the format at a granular level by altering the display options to meet your needs.') . '</dd>';
$output .= '</dl>';
return $output;
}
}