1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Implementaion of the views hooks.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Implements hook_views_data().
|
10
|
*/
|
11
|
function views_pdf_views_data() {
|
12
|
$data['pdf']['table']['group'] = t('PDF');
|
13
|
$data['pdf']['table']['join'] = array(
|
14
|
'#global' => array(),
|
15
|
);
|
16
|
|
17
|
$data['pdf']['page_break'] = array(
|
18
|
'title' => t('Page Break'),
|
19
|
'help' => t('Insert in the PDF view a new page.'),
|
20
|
'field' => array(
|
21
|
'handler' => 'views_pdf_handler_page_break',
|
22
|
'click sortable' => FALSE,
|
23
|
'notafield' => TRUE,
|
24
|
),
|
25
|
);
|
26
|
|
27
|
$data['pdf']['page_number'] = array(
|
28
|
'title' => t('Page Number'),
|
29
|
'help' => t('Contains the page number of the current page.'),
|
30
|
'field' => array(
|
31
|
'handler' => 'views_pdf_handler_page_number',
|
32
|
'click sortable' => FALSE,
|
33
|
'notafield' => TRUE,
|
34
|
),
|
35
|
);
|
36
|
|
37
|
return $data;
|
38
|
}
|
39
|
|
40
|
|
41
|
/**
|
42
|
* Implements hook_views_plugins().
|
43
|
*/
|
44
|
function views_pdf_views_plugins() {
|
45
|
$path = drupal_get_path('module', 'views_pdf');
|
46
|
$theme_path = $path . '/theme';
|
47
|
return array(
|
48
|
'module' => 'views_pdf',
|
49
|
'display' => array(
|
50
|
'pdf' => array(
|
51
|
'title' => t('PDF Page'),
|
52
|
'help' => t('Outputs the view as a PDF file.'),
|
53
|
'handler' => 'views_pdf_plugin_display',
|
54
|
'uses hook menu' => TRUE,
|
55
|
'use ajax' => FALSE,
|
56
|
'use pager' => FALSE,
|
57
|
'use_more' => FALSE,
|
58
|
'accept attachments' => FALSE,
|
59
|
'admin' => t('PDF Page'),
|
60
|
),
|
61
|
),
|
62
|
'style' => array(
|
63
|
'pdf_table' => array(
|
64
|
'title' => t('PDF Table'),
|
65
|
'help' => t('Display the view as a table.'),
|
66
|
'handler' => 'views_pdf_plugin_style_table',
|
67
|
'parent' => 'default',
|
68
|
'uses row plugin' => FALSE,
|
69
|
'uses fields' => TRUE,
|
70
|
'uses options' => TRUE,
|
71
|
'type' => 'pdf',
|
72
|
),
|
73
|
'pdf_unformatted' => array(
|
74
|
'title' => t('PDF unformatted'),
|
75
|
'help' => t('Display the view in a unformatted way.'),
|
76
|
'handler' => 'views_pdf_plugin_style_unformatted',
|
77
|
'parent' => 'default',
|
78
|
'uses row plugin' => TRUE,
|
79
|
'uses fields' => TRUE,
|
80
|
'uses options' => TRUE,
|
81
|
'type' => 'pdf',
|
82
|
),
|
83
|
),
|
84
|
'row' => array(
|
85
|
'pdf_fields' => array(
|
86
|
'title' => t('PDF Fields'),
|
87
|
'help' => t('Displays the fields with an optional template.'),
|
88
|
'handler' => 'views_pdf_plugin_row_fields',
|
89
|
'uses fields' => TRUE,
|
90
|
'uses options' => TRUE,
|
91
|
'type' => 'pdf',
|
92
|
'help topic' => 'style-row-fields',
|
93
|
),
|
94
|
),
|
95
|
|
96
|
|
97
|
);
|
98
|
}
|