Newer
Older
<?php
/**
* Implements hook_views_data().
*/
function print_mail_views_data() {
// The 'group' index will be used as a prefix in the UI for any of this
// table's fields, sort criteria, etc. so it's easy to tell where they came
// from.
$data['print_mail_node_conf']['table']['group'] = t('Printer-friendly version');
$data['print_mail_page_counter']['table']['group'] = t('Printer-friendly version');
// This table references the {node} table. The declaration below creates an
// 'implicit' relationship to the node table, so that when 'node' is the base
// table, the fields are automatically available.
$data['print_mail_node_conf']['table']['join']['node'] = array(
// 'left_field' is the primary key in the referenced table.
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'nid',
);
$data['print_mail_page_counter']['table']['join']['node'] = array(
// 'left_field' is the primary key in the referenced table.
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'path',
'handler' => 'print_join_page_counter',
);
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
$data['print_mail_node_conf']['link'] = array(
'title' => t('Email: Show link'),
'help' => t('Whether to show the send by email link.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['print_mail_node_conf']['comments'] = array(
'title' => t('Email: Show link in individual comments'),
'help' => t('Whether to show the send by email link in individual comments.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['print_mail_node_conf']['url_list'] = array(
'title' => t('Email: Show Printer-friendly URLs list'),
'help' => t('Whether to show the URL list.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
$data['print_mail_page_counter']['totalcount'] = array(
'title' => t('Email: Number of page accesses'),
'help' => t('Counter of accesses to the send by email form for this node.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
);
$data['print_mail_page_counter']['timestamp'] = array(
'title' => t('Email: Last access'),
'help' => t("The date of the last access to the node's send by email form."),
'field' => array(
'handler' => 'views_handler_field_date',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
);
$data['print_mail_page_counter']['sentcount'] = array(
'title' => t('Email: Number of sent emails'),
'help' => t('Counter of emails sent for this node.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
);
$data['print_mail_page_counter']['sent_timestamp'] = array(
'title' => t('Email: Last email sent'),
'help' => t('The date when the node was last sent by email.'),
'field' => array(
'handler' => 'views_handler_field_date',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
);
return $data;
}