-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschedule_builder.module
More file actions
68 lines (61 loc) · 2.04 KB
/
schedule_builder.module
File metadata and controls
68 lines (61 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* @file
* Schedule Builder module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function schedule_builder_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.schedule_builder':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Schedule Builder module allows sitebuilders to place a block on pages containing event listings. The module attaches JavaScript that extracts event data from the page HTML, allows users to select events via checkboxes, and download selected events as ICS calendar files.') . '</p>';
$output .= '<h3>' . t('Usage') . '</h3>';
$output .= '<p>' . t('Place the Schedule Builder block on a page containing event listings. Configure the block settings to map CSS selectors to standard iCal event properties (title/summary, start/end times, description, location, and link). The module will automatically attach checkboxes to event items and enable ICS download functionality.') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function schedule_builder_theme($existing, $type, $theme, $path) {
return [
'schedule_builder_block' => [
'variables' => [
'block_id' => NULL,
'download_button_label' => NULL,
'download_button_extra_classes' => NULL,
'enable_selection_filter' => FALSE,
'enable_select_actions' => FALSE,
'filter_extra_classes' => NULL,
'select_all_button_extra_classes' => NULL,
'deselect_all_button_extra_classes' => NULL,
],
'template' => 'schedule-builder-block',
],
];
}
/**
* Implements hook_library_info_build().
*/
function schedule_builder_library_info_build() {
$libraries = [];
$libraries['schedule-builder'] = [
'css' => [
'theme' => [
'css/schedule-builder.css' => [],
],
],
'js' => [
'js/schedule-builder.js' => [],
],
'dependencies' => [
'core/drupal',
],
];
return $libraries;
}