Revision ab2258a1
Added by Lorna Morris over 12 years ago
7.x/modules/dwca_export/dwca_export.module | ||
---|---|---|
17 | 17 |
//'file' => 'dwca_export.admin.inc' |
18 | 18 |
); |
19 | 19 |
|
20 |
|
|
20 | 21 |
$items['dwca_export'] = array( |
21 | 22 |
'page callback' => 'dwca_export_deliver_archive', |
22 | 23 |
'access arguments' => array('access content'), |
... | ... | |
54 | 55 |
.'</p>' |
55 | 56 |
); |
56 | 57 |
|
58 |
$form['views'] = dwca_export_select_view_form(); |
|
59 |
|
|
60 |
$form['#submit'][] = 'dwca_export_config_form_submit'; |
|
57 | 61 |
return system_settings_form($form); |
62 |
|
|
63 |
} |
|
64 |
|
|
65 |
|
|
66 |
function dwca_export_select_view_form() { |
|
67 |
|
|
68 |
$views = array( |
|
69 |
'#type' => 'fieldset', |
|
70 |
'#title' => t('Select views'), |
|
71 |
//'#tree' => TRUE, |
|
72 |
); |
|
73 |
|
|
74 |
$default_value = _dwca_export_archive_descriptor_file_map(); |
|
75 |
|
|
76 |
$views['classification_view'] = array( |
|
77 |
'#type' => 'textfield', |
|
78 |
'#title' => t('classification:'), |
|
79 |
'#default_value' => $default_value['classification.txt']['view_name'], |
|
80 |
'#size' => 60, |
|
81 |
'#maxlength' => 64, |
|
82 |
'#description' => t('specify view for classification.txt'), |
|
83 |
); |
|
84 |
|
|
85 |
$views['specimen_view'] = array( |
|
86 |
'#type' => 'textfield', |
|
87 |
'#title' => t('specimen:'), |
|
88 |
'#default_value' => variable_get('specimen.txt', 'dwca_export_specimen'), |
|
89 |
'#size' => 60, |
|
90 |
'#maxlength' => 64, |
|
91 |
'#description' => t('specify view for specimen.txt'), |
|
92 |
); |
|
93 |
|
|
94 |
$views['reference_view'] = array( |
|
95 |
'#type' => 'textfield', |
|
96 |
'#title' => t('reference:'), |
|
97 |
'#size' => 60, |
|
98 |
'#maxlength' => 64, |
|
99 |
'#description' => t('specify view for reference.txt'), |
|
100 |
); |
|
101 |
|
|
102 |
$views['description_view'] = array( |
|
103 |
'#type' => 'textfield', |
|
104 |
'#title' => t('description:'), |
|
105 |
'#size' => 60, |
|
106 |
'#maxlength' => 64, |
|
107 |
'#description' => t('specify view for description.txt'), |
|
108 |
); |
|
109 |
|
|
110 |
$views['distribution_view'] = array( |
|
111 |
'#type' => 'textfield', |
|
112 |
'#title' => t('distribution:'), |
|
113 |
'#size' => 60, |
|
114 |
'#maxlength' => 64, |
|
115 |
'#description' => t('specify view for distribution.txt'), |
|
116 |
); |
|
117 |
|
|
118 |
$views['image_view'] = array( |
|
119 |
'#type' => 'textfield', |
|
120 |
'#title' => t('image:'), |
|
121 |
'#size' => 60, |
|
122 |
'#maxlength' => 64, |
|
123 |
'#description' => t('specify view for image.txt'), |
|
124 |
); |
|
125 |
|
|
126 |
//variable_get('classification.txt', 'test'), |
|
127 |
//$views['submit'] = array('#type' => 'submit', '#value' => t('Save selected')); |
|
128 |
|
|
129 |
return $views; |
|
130 |
} |
|
131 |
|
|
132 |
function dwca_export_config_form_submit($form, &$form_state) { |
|
133 |
|
|
134 |
// db_query("INSERT INTO {table} (classification_view) VALUES ('%s')", $form_state['values']['classification_view']); |
|
135 |
//variable_set($name, $value) |
|
136 |
drupal_set_message(t('Your config form has been saved.')); |
|
137 |
|
|
138 |
//throw new Exception(t('Could not create zip_archive %tmp_archive_file_name', array('%tmp_archive_file_name' => $tmp_archive_file_name))); |
|
58 | 139 |
} |
59 | 140 |
|
60 | 141 |
|
... | ... | |
110 | 191 |
return $file_map; |
111 | 192 |
} |
112 | 193 |
|
194 |
|
|
113 | 195 |
/** |
114 | 196 |
* Walks all view export paths defined in the $views_map. |
115 | 197 |
* Each file is downloaded to the tmp folder and a zip file |
Also available in: Unified diff
Added form for selecting views.