-
Notifications
You must be signed in to change notification settings - Fork 0
/
html_to_pdf.module
53 lines (47 loc) · 1.04 KB
/
html_to_pdf.module
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
<?php
/**
* @file
* Contains html_to_pdf.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function html_to_pdf_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the html_to_pdf module.
case 'help.page.html_to_pdf':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Html to PDF module.') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*
* Set standart values for html_to_pdf template.
*/
function html_to_pdf_theme(): array {
return [
'html_to_pdf' => [
'variables' => [
'content' => NULL,
'links' => NULL,
],
],
];
}
/**
* Implements hook_local_tasks_alter().
*
* Simply sets target attribute for local task link.
*
* @param $local_tasks
*
* @return string
*/
function html_to_pdf_local_tasks_alter(&$local_tasks): string {
return $local_tasks['html_to_pdf.pdf_tab']['options']['attributes']['target'] = '_blank';
}