-
Notifications
You must be signed in to change notification settings - Fork 7
/
os2web_acadre_esdh.module
142 lines (133 loc) · 5.25 KB
/
os2web_acadre_esdh.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
<?php
/**
* @file
* This module implements Acadre ESDH backend for use in os2web
*/
include_once('os2web_acadre_esdh.features.inc');
define('ACADRE_MM_IMPORT_DIR', 'public://acadre');
define('ACADRE_MM_DEFAULT_APPROVED', '62,59,64,53,54,56,57,63,58,51,55,61,68,69,42');
/**
* Implements hook_ctools_plugin_directory().
*
* Register as provider of esdh plugins
*/
function os2web_acadre_esdh_ctools_plugin_directory($module, $plugin) {
if ($module == 'os2web_esdh_provider') {
return "plugins/$plugin";
}
}
/**
* Implements hook_form_alter().
*
* Add configuration to the settings form.
*/
function os2web_acadre_esdh_form_os2web_settings_settings_form_alter(&$form, &$form_state) {
// MM configuration.
$form['meetings'] = array(
'#type' => 'fieldset',
'#title' => 'Referat import',
'#description' => 'Indstillinger der vedrører importen af Acadre referater og dagsordener.',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['meetings']['os2web_meetings_path'] = array(
'#type' => 'textfield',
'#title' => 'Sti til acadre publish folder.',
'#description' => 'Dette er stien hvor Acadre publisere .XML filer til.',
'#default_value' => variable_get('os2web_meetings_path', ACADRE_MM_IMPORT_DIR),
);
$form['meetings']['os2web_meetings_approved_committee'] = array(
'#type' => 'textfield',
'#title' => 'Godkendte Udvalg',
'#maxlength' => 200,
'#description' => 'Komma sepereret liste over udvalgs-id der er godkendt til publisering.',
'#default_value' => variable_get('os2web_meetings_approved_committee', ACADRE_MM_DEFAULT_APPROVED),
);
// CM Configuration.
$form['os2web_pws_config_group'] = array(
'#type' => 'fieldset',
'#title' => t('PWS Endpoint configuration'),
);
$form['os2web_pws_config_group']['os2web_pws_url'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('os2web_pws_url'),
'#title' => t('PWS URL for V4'),
'#description' => t('URL to the PWS webservice endpoint.'),
);
$form['os2web_pws_config_group']['os2web_pws_url_v6'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('os2web_pws_url_v6'),
'#title' => t('PWS URL for V6'),
'#description' => t('URL to the PWSv6 webservice endpoint.'),
);
$form['os2web_pws_config_group']['os2web_pws_url_search'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('os2web_pws_url_search'),
'#title' => t('PWS URL for Search service'),
'#description' => t('URL to the webservice endpoint that runs the search service.'),
);
$form['os2web_pws_config_group']['os2web_pws_user'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('os2web_pws_user'),
'#title' => t('PWS login user'),
'#description' => t('PWS HTTP authentification user.'),
);
$form['os2web_pws_config_group']['os2web_pws_password'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('os2web_pws_password'),
'#title' => t('PWS password'),
'#description' => t('PWS HTTP authentification password.'),
);
// Proxy setups
$form['os2web_pws_proxy_group'] = array(
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => !variable_get('os2web_pws_proxy'),
'#title' => t('Proxy configuration'),
'#weight' => 10,
);
$form['os2web_pws_proxy_group']['os2web_pws_proxy'] = array(
'#type' => 'checkbox',
'#default_value' => variable_get('os2web_pws_proxy'),
'#title' => t('Use proxy?'),
);
$form['os2web_pws_proxy_group']['os2web_pws_proxy_host'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('os2web_pws_proxy_host'),
'#title' => t('Proxy hostname or IP'),
);
$form['os2web_pws_proxy_group']['os2web_pws_proxy_port'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('os2web_pws_proxy_port'),
'#title' => t('Proxy port number.'),
);
$form['os2web_pws_adlib_group'] = array(
'#type' => 'fieldset',
'#title' => t('Adlib Endpoint configuration'),
);
$form['os2web_pws_adlib_group']['os2web_adlib_url'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('os2web_adlib_url', 'http://706CAR01/ExponentWSA/ExponentWSA.asmx?wsdl'),
'#title' => t('URL for Adlib service endpoint'),
'#description' => t('URL to the webservice endpoint that runs the Adlib service.'),
);
}
/**
* Implements hook_os2web_help().
*/
function os2web_acadre_esdh_os2web_help($sections) {
// Content types.
$sections['configuration'] = t('<p>Configure PWS and resume import in the <a href="@url" target="_blank">OS2web Configuration</a><br /><i>This requires some insight in the server setup and the data recieved.</i><br />Setup the required endpoints, path to the published XML files from acadre and the authentication user/pass for accessing the PWS endpoints.</p>', array('@url' => url('admin/config/os2web/settings')));
$sections['configuration'] .= t('<p><a href="@url" target="_blank">See the advanced documentation for acadre</a></p>', array('@url' => url('admin/help/os2web_acadre_esdh')));
return $sections;
}
/**
* Implements hook_help().
*/
//function os2web_acadre_esdh_help($path, $arg) {
// switch ($path) {
// case 'admin/help#os2web_acadre_esdh':
// TODO.
// return t('Missing documentation.');
// }
//}