Revision e8074ec5
Added by Patrick Plitzner over 6 years ago
modules/cdm_dataportal/cdm_csv_export/cdm_csv_export.module | ||
---|---|---|
73 | 73 |
return $block; |
74 | 74 |
} |
75 | 75 |
|
76 |
function taxon_selection_update($form, &$form_state) {
|
|
77 |
unset($form_state['input']['taxon_select'], $form_state['values']['taxon_select']);
|
|
78 |
$tree = $form_state['input']['taxonNode'];
|
|
79 |
$form['taxon_select']['#autocomplete_path'] = 'cdm_dataportal/taxon/autosuggest/'.$tree.'///'; |
|
80 |
$form['taxon_select']['#value'] = ''; |
|
81 |
return form_builder($form['#id'], $form['taxon_select'], $form_state);
|
|
76 |
function update_classification_selected($form, &$form_state) {
|
|
77 |
unset($form_state['input']['csv_export_taxon_select'], $form_state['values']['csv_export_taxon_select']);
|
|
78 |
$tree = $form_state['input']['classificationUuid'];
|
|
79 |
$form['csv_export_taxon_select']['#autocomplete_path'] = 'cdm_dataportal/taxon/autosuggest/'.$tree.'///';
|
|
80 |
$form['csv_export_taxon_select']['#value'] = '';
|
|
81 |
return form_builder($form['#id'], $form['csv_export_taxon_select'], $form_state);
|
|
82 | 82 |
} |
83 | 83 |
|
84 | 84 |
/** |
... | ... | |
90 | 90 |
*/ |
91 | 91 |
function cdm_csv_export_my_form($form_state) { |
92 | 92 |
$tree = variable_get(CDM_TAXONOMICTREE_UUID, FALSE); |
93 |
$form['combobox'] = array(
|
|
93 |
$form['csv_export_classification_select'] = array(
|
|
94 | 94 |
'#type' => 'select', |
95 | 95 |
'#title' => t('Classification').':', |
96 | 96 |
'#default_value' => $tree, |
97 | 97 |
'#options' => cdm_get_taxontrees_as_options(FALSE, TRUE), |
98 | 98 |
'#attributes' => array( |
99 |
'name' => 'taxonNode',
|
|
99 |
'name' => 'classificationUuid',
|
|
100 | 100 |
'onchange' => 'return validateForm()' |
101 | 101 |
), |
102 | 102 |
'#ajax' => array( |
103 |
'callback' => 'taxon_selection_update',
|
|
103 |
'callback' => 'update_classification_selected',
|
|
104 | 104 |
'wrapper' => 'taxon-selection', |
105 | 105 |
'progress' => array( |
106 | 106 |
'message' => '', |
... | ... | |
108 | 108 |
), |
109 | 109 |
) |
110 | 110 |
); |
111 |
$form['taxon_select'] = array( |
|
111 |
$form['csv_export_taxon_select'] = array(
|
|
112 | 112 |
'#title' => t('Taxon'), |
113 | 113 |
'#type' => 'textfield', |
114 | 114 |
'#prefix' => '<div id="taxon-selection">', |
115 |
'#suffix' => '</div>' |
|
115 |
'#suffix' => '</div>', |
|
116 |
'#attributes' => array( |
|
117 |
'onchange' => 'return validateForm()' |
|
118 |
), |
|
116 | 119 |
); |
117 | 120 |
if(variable_get('cdm_dataportal_taxon_auto_suggest')){ |
118 |
$form['taxon_select']['#autocomplete_path'] = 'cdm_dataportal/taxon/autosuggest////'; |
|
121 |
$form['csv_export_taxon_select']['#autocomplete_path'] = 'cdm_dataportal/taxon/autosuggest////';
|
|
119 | 122 |
} |
123 |
$form['taxonUuidStore'] = array( |
|
124 |
'#type' => 'hidden', |
|
125 |
'#value' => '', |
|
126 |
'#name' => taxonUuid, |
|
127 |
'#attributes' => array( |
|
128 |
'id' => 'taxonUuid', |
|
129 |
) |
|
130 |
); |
|
120 | 131 |
|
121 | 132 |
$form['redListField'] = array( |
122 | 133 |
'#type' => 'fieldset', |
Also available in: Unified diff
#5890 Pass classification uuid and taxon uuid to csv export