|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * @file |
| 4 | + * This module implements SBSYS ESDH backend for use in os2web |
| 5 | + */ |
| 6 | + |
| 7 | +define('MM_IMPORT_DIR', 'public://agman'); |
| 8 | +define('MM_DEFAULT_APPROVED', '11'); |
| 9 | +define('MM_DEFAULT_BANNED_CHAR', ''); |
| 10 | +define('MM_DEFAULT_BANNED_REGEX', '/&#x.*;/'); |
| 11 | + |
| 12 | +/** |
| 13 | + * Implements hook_ctools_plugin_directory(). |
| 14 | + * |
| 15 | + * Register as provider of esdh plugins |
| 16 | + */ |
| 17 | +function os2web_agman_esdh_ctools_plugin_directory($module, $plugin) { |
| 18 | + if ($module == 'os2web_esdh_provider') { |
| 19 | + return "plugins/$plugin"; |
| 20 | + } |
| 21 | +} |
| 22 | + |
| 23 | +/** |
| 24 | + * Implements hook_form_alter(). |
| 25 | + * |
| 26 | + * Add configuration to the settings form. |
| 27 | + */ |
| 28 | +function os2web_agman_esdh_form_os2web_settings_settings_form_alter(&$form, &$form_state) { |
| 29 | + // MM configuration. |
| 30 | + $form['meetings'] = array( |
| 31 | + '#type' => 'fieldset', |
| 32 | + '#title' => 'Referat import', |
| 33 | + '#description' => 'Indstillinger der vedrører importen af SBsys referater og dagsordener.', |
| 34 | + '#collapsible' => TRUE, |
| 35 | + '#collapsed' => FALSE, |
| 36 | + ); |
| 37 | + $form['meetings']['os2web_agman_esdh_mm_path'] = array( |
| 38 | + '#type' => 'textfield', |
| 39 | + '#title' => 'Sti til AGMAN publish folder.', |
| 40 | + '#description' => 'Dette er stien hvor ESDH publisere .XML filer til.', |
| 41 | + '#default_value' => variable_get('os2web_agman_esdh_mm_path', MM_IMPORT_DIR), |
| 42 | + ); |
| 43 | + $form['meetings']['os2web_agman_esdh_approved_committees'] = array( |
| 44 | + '#type' => 'textfield', |
| 45 | + '#title' => 'Godkendte Udvalg', |
| 46 | + '#maxlength' => 2000, |
| 47 | + '#description' => 'Komma sepereret liste over udvalgs-id der er godkendt til publisering.', |
| 48 | + '#default_value' => variable_get('os2web_agman_esdh_approved_committees', MM_DEFAULT_APPROVED), |
| 49 | + ); |
| 50 | + $form['meetings']['os2web_agman_esdh_banned_activate_regex'] = array( |
| 51 | + '#type' => 'checkbox', |
| 52 | + '#title' => 'Aktiver regex', |
| 53 | + '#description' => t('This decides whether the regulax expression or CSV list will be used to trim out the unneeded content from XMLs.'), |
| 54 | + '#default_value' => variable_get('os2web_agman_esdh_banned_activate_regex', FALSE), |
| 55 | + ); |
| 56 | + |
| 57 | + $form['meetings']['os2web_agman_esdh_banned_special_char'] = array( |
| 58 | + '#type' => 'textfield', |
| 59 | + '#title' => 'Ikke standard XML tegn der skal fjernes ved import (CSV)', |
| 60 | + '#maxlength' => 200, |
| 61 | + '#description' => 'Komma sepereret liste over ikke standard tegn der skal fjernes ved import.', |
| 62 | + '#default_value' => variable_get('os2web_agman_esdh_banned_special_char', MM_DEFAULT_BANNED_CHAR), |
| 63 | + '#states' => array( |
| 64 | + 'invisible' => array( |
| 65 | + ':input[name="os2web_agman_esdh_banned_activate_regex"]' => array('checked' => TRUE), |
| 66 | + ), |
| 67 | + ), |
| 68 | + ); |
| 69 | + |
| 70 | + $form['meetings']['os2web_agman_esdh_banned_special_regex'] = array( |
| 71 | + '#type' => 'textfield', |
| 72 | + '#title' => 'Ikke standard XML tegn der skal fjernes ved import (regex)', |
| 73 | + '#maxlength' => 200, |
| 74 | + '#description' => 'Regular expression over ikke standard tegn der skal fjernes ved import.', |
| 75 | + '#default_value' => variable_get('os2web_agman_esdh_banned_special_regex', MM_DEFAULT_BANNED_REGEX), |
| 76 | + '#states' => array( |
| 77 | + 'invisible' => array( |
| 78 | + ':input[name="os2web_agman_esdh_banned_activate_regex"]' => array('checked' => FALSE), |
| 79 | + ), |
| 80 | + ), |
| 81 | + ); |
| 82 | +} |
| 83 | + |
| 84 | +/** |
| 85 | + * Implements hook_os2web_help(). |
| 86 | + */ |
| 87 | +function os2web_agman_esdh_os2web_help($sections) { |
| 88 | + // TODO. Write some actual help. |
| 89 | +} |
| 90 | + |
| 91 | +/** |
| 92 | + * Implements hook_help(). |
| 93 | + */ |
| 94 | +function os2web_agman_esdh_help($path, $arg) { |
| 95 | + switch ($path) { |
| 96 | + case 'admin/help#os2web_agman_esdh': |
| 97 | + // TODO. |
| 98 | + return t('Se the OS2web documentation under "help" for details. If you don not have that please activate the OS2web Help module'); |
| 99 | + } |
| 100 | +} |
0 commit comments