countdown.module in Countdown 8
Same filename and directory in other branches
Count to, or from, a specified date and display the output in a block.
File
countdown.moduleView source
<?php
/**
* @file
* Count to, or from, a specified date and display the output in a block.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help() for countdown_help().
*/
function countdown_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.countdown':
$path_validator = \Drupal::pathValidator();
$output = '';
$output .= '<h3>' . t('"Don\'t forget to configure the event name and date in admin/structure/block". Please follow below mentioned steps') . '</h3>';
$output .= '<ul>';
$output .= '<li>' . t('Click on "Place block" button.') . '</li>';
$output .= '<li>' . t('Search "Countdown block" using filter text box.') . '</li>';
$output .= '<li>' . t('Click on "Place block" button again and configure the event details.') . '</li>';
$output .= '</ul>';
return $output;
}
}
/**
* Implements hook_theme() for countdown_theme().
*/
function countdown_theme($existing, $type, $theme, $path) {
return [
'countdown' => [
'variables' => [
'accuracy' => NULL,
'countdown_url' => NULL,
'countdown_event_name' => NULL,
'days_left' => NULL,
'hrs_left' => NULL,
'min_left' => NULL,
'secs_left' => NULL,
],
],
];
}
Functions
Name | Description |
---|---|
countdown_help | Implements hook_help() for countdown_help(). |
countdown_theme | Implements hook_theme() for countdown_theme(). |