-
Notifications
You must be signed in to change notification settings - Fork 1
/
cm_crew_connect.module
207 lines (188 loc) · 6.08 KB
/
cm_crew_connect.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
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
87
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?php
/**
* @file
* Implements the CM Crew Connect Module
*/
/**
* Implements hook_menu()
*/
function cm_crew_connect_menu() {
$items = array();
$items['admin/config/cm_crew_connect'] =
array(
'title' => 'Crew Connect',
'description' => t('Crew Connect Configuration'),
'page callback' => 'cm_crew_connect_settings_home',
'access arguments' => array('administer crew connect'),
'type' => MENU_NORMAL_ITEM,
);
$items['admin/config/cm_crew_connect/settings'] =
array(
'title' => 'Crew Connect Configuration',
'description' =>
t('Set Position/Crew Type Mapping & CiviCRM EventType/Template IDs'),
'page callback' => 'drupal_get_form',
'page arguments' => array('cm_crew_connect_settings_form'),
'access arguments' => array('administer crew connect'),
);
$items['user/%/cm_crew_connect'] =
array(
'title' => 'Crew Connect',
'description' => 'Crew Connect',
'access arguments' => array('use crew connect'),
'page callback' => 'cm_crew_connect_page',
'page arguments' => array(1),
'type' => MENU_LOCAL_TASK,
);
$items['crew-connect/requests-search'] =
array(
'title' => 'Crew Connect Search',
'description' => 'Crew Connect Search',
'access arguments' => array('use crew connect'),
'page callback' => 'cm_crew_connect_search_page',
'page arguments' => array(1),
'type' => MENU_CALLBACK,
);
$items['admin/crew_connect/positions'] =
array(
'title' => 'Get Available Positions for Opportunity Type',
'access callback' => TRUE,
'delivery callback' => 'drupal_json_output',
'page callback' => 'cm_crew_connect_positions_for_opp_type_json',
'type' => MENU_CALLBACK,
);
return $items;
}
/**
* Implements hook_init().
*
* Loads all the include files
*/
function cm_crew_connect_init() {
drupal_add_css(drupal_get_path('module', 'cm_crew_connect') .
'/cm_crew_connect.css');
module_load_include('inc', 'cm_crew_connect', 'includes/computed_field');
module_load_include('inc', 'cm_crew_connect', 'includes/civicrm');
module_load_include('inc', 'cm_crew_connect', 'includes/form_alter');
module_load_include('inc', 'cm_crew_connect', 'includes/misc');
module_load_include('inc', 'cm_crew_connect', 'includes/page');
module_load_include('inc', 'cm_crew_connect', 'includes/phpfields');
module_load_include('inc', 'cm_crew_connect', 'includes/postsave');
module_load_include('inc', 'cm_crew_connect', 'includes/presave');
module_load_include('inc', 'cm_crew_connect', 'includes/settings_form');
module_load_include('inc', 'cm_crew_connect', 'includes/rules_defaults');
}
function cm_crew_connect_permission() {
return
array(
'administer crew connect' =>
array(
'title' => t('Administer Crew Connect'),
),
'use crew connect' =>
array(
'title' => t('Crew Connect Tab On User Page'),
),
);
}
/**
* Implements hook_views_api
*/
function cm_crew_connect_views_api() {
return array(
'api' => 3,
'path' =>
drupal_get_path('module',
'cm_crew_connect').'/includes'
);
}
/**
* Implements hook_views_data_alter().
*/
function cm_crew_connect_views_data_alter(&$data) {
// Signup to Crew field.
$data['node']['signup_to_crew'] = array(
'title' => t('Sign up to Crew Link'),
'help' => t('Used in crew_connect_search to produce signup link.'),
'field' => array(
'handler' => 'cm_crew_connect_handler_signup_to_crew',
),
);
// Crew Details field.
$data['node']['crew_details'] = array(
'title' => t('Crew Details Link'),
'help' => t('Used in crew_connect_search to produce crew details link.'),
'field' => array(
'handler' => 'cm_crew_connect_handler_crew_details',
),
);
// Add Request field.
$data['node']['add_request'] = array(
'title' => t('Add Request Link'),
'help' => t('Used in crew_connect_project_alerts to produce add request link.'),
'field' => array(
'handler' => 'cm_crew_connect_handler_add_request',
),
);
// Delete Request field.
$data['node']['delete_request'] = array(
'title' => t('Delete Request Link'),
'help' => t('Used in admin display of crew_connect_search to produce delete request link.'),
'field' => array(
'handler' => 'cm_crew_connect_handler_delete_request',
),
);
// Cancel Request field.
$data['node']['cancel_request'] = array(
'title' => t('Cancel Request Link'),
'help' => t('Used in Future Crew Requests display of crew_connect_crew_requests to produce cancel request link.'),
'field' => array(
'handler' => 'cm_crew_connect_handler_cancel_request',
),
);
// Edit Request field.
$data['node']['edit_request'] = array(
'title' => t('Edit Request Link'),
'help' => t('Used in Future Crew Requests display of crew_connect_crew_requests to produce edit request link.'),
'field' => array(
'handler' => 'cm_crew_connect_handler_edit_request',
),
);
// Applicant Name field.
$data['node']['applicant_name'] = array(
'title' => t('Applicant Name'),
'help' => t('Used in Future Crew Requests display of crew_connect_crew_requests to produce Applicant Name field.'),
'field' => array(
'handler' => 'cm_crew_connect_handler_applicant_name',
),
);
// Header link.
$data['views']['header_search_link'] = array(
'title' => t('Crew Connect header search link'),
'help' => t("Global header used in the Page display of crew_connect_search."),
'area' => array(
'handler' => 'cm_crew_connect_handler_header_search_link',
),
);
// Footer messages.
$data['views']['footer_messages'] = array(
'title' => t('Crew Connect footer messages'),
'help' => t("Global footer used in the Admin Search display of crew_connect_search."),
'area' => array(
'handler' => 'cm_crew_connect_handler_footer_messages',
),
);
}
/**
* Implements hook_views_plugins().
*/
function cm_crew_connect_views_plugins() {
return array(
'argument default' => array(
'crew_node' => array(
'title' => t('Crew Node'),
'handler' => 'cm_crew_connect_argument_crew_node',
),
),
);
}