-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathos2web_agman_esdh.module
100 lines (93 loc) · 3.49 KB
/
os2web_agman_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
<?php
/**
* @file
* This module implements AGMAN ESDH backend for use in os2web
*/
define('MM_IMPORT_DIR', 'public://agman');
define('MM_DEFAULT_APPROVED', '11');
define('MM_DEFAULT_BANNED_CHAR', '');
define('MM_DEFAULT_BANNED_REGEX', '/&#x.*;/');
/**
* Implements hook_ctools_plugin_directory().
*
* Register as provider of esdh plugins
*/
function os2web_agman_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_agman_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 Agenda Management referater og dagsordener.',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['meetings']['os2web_agman_esdh_mm_path'] = array(
'#type' => 'textfield',
'#title' => 'Sti til AGMAN publish folder.',
'#description' => 'Dette er stien hvor ESDH publisere .XML filer til.',
'#default_value' => variable_get('os2web_agman_esdh_mm_path', MM_IMPORT_DIR),
);
$form['meetings']['os2web_agman_esdh_approved_committees'] = array(
'#type' => 'textfield',
'#title' => 'Godkendte Udvalg',
'#maxlength' => 2000,
'#description' => 'Komma sepereret liste over udvalgs-id der er godkendt til publisering.',
'#default_value' => variable_get('os2web_agman_esdh_approved_committees', MM_DEFAULT_APPROVED),
);
$form['meetings']['os2web_agman_esdh_banned_activate_regex'] = array(
'#type' => 'checkbox',
'#title' => 'Aktiver regex',
'#description' => t('This decides whether the regulax expression or CSV list will be used to trim out the unneeded content from XMLs.'),
'#default_value' => variable_get('os2web_agman_esdh_banned_activate_regex', FALSE),
);
$form['meetings']['os2web_agman_esdh_banned_special_char'] = array(
'#type' => 'textfield',
'#title' => 'Ikke standard XML tegn der skal fjernes ved import (CSV)',
'#maxlength' => 200,
'#description' => 'Komma sepereret liste over ikke standard tegn der skal fjernes ved import.',
'#default_value' => variable_get('os2web_agman_esdh_banned_special_char', MM_DEFAULT_BANNED_CHAR),
'#states' => array(
'invisible' => array(
':input[name="os2web_agman_esdh_banned_activate_regex"]' => array('checked' => TRUE),
),
),
);
$form['meetings']['os2web_agman_esdh_banned_special_regex'] = array(
'#type' => 'textfield',
'#title' => 'Ikke standard XML tegn der skal fjernes ved import (regex)',
'#maxlength' => 200,
'#description' => 'Regular expression over ikke standard tegn der skal fjernes ved import.',
'#default_value' => variable_get('os3web_agman_esdh_banned_special_regex', MM_DEFAULT_BANNED_REGEX),
'#states' => array(
'invisible' => array(
':input[name="os2web_agman_esdh_banned_activate_regex"]' => array('checked' => FALSE),
),
),
);
}
/**
* Implements hook_os2web_help().
*/
function os2web_agman_esdh_os2web_help($sections) {
// TODO. Write some actual help.
}
/**
* Implements hook_help().
*/
function os2web_agman_esdh_help($path, $arg) {
switch ($path) {
case 'admin/help#os2web_agman_esdh':
// TODO.
return t('Se the OS2web documentation under "help" for details. If you don not have that please activate the OS2web Help module');
}
}