function tripal_views_handler_filter_file_upload::exposed_form
2.x tripal_views_handler_filter_file_upload.inc | tripal_views_handler_filter_file_upload::exposed_form(&$form, &$form_state) |
3.x tripal_views_handler_filter_file_upload.inc | tripal_views_handler_filter_file_upload::exposed_form(&$form, &$form_state) |
1.x tripal_views_handler_filter_file_upload.inc | tripal_views_handler_filter_file_upload::exposed_form(&$form, &$form_state) |
Render our chunk of the exposed filter form when selecting
You can override this if it doesn't do what you expect.
Overrides views_handler_filter::exposed_form
File
- tripal_views/
views/ handlers/ tripal_views_handler_filter_file_upload.inc, line 35 - Contains tripal_views_handler_filter_file_upload filter handler
Class
- tripal_views_handler_filter_file_upload
- This Handler provides a file upload field by extending the views_handler_filter object.
Code
function exposed_form(&$form, &$form_state) {
// don't do anything if the form isn't exposed.
if (empty($this->options['exposed'])) {
return;
}
// rebuild the form elements
$value = $this->options['expose']['identifier'];
$this->value_form($form, $form_state);
$form[$value] = $form['value'];
unset($form[$value]['#title']);
// since this is an exposed form we want to enable file uploads by
// setting the 'enctype' attribute and the method to POST
$form['#attributes']['enctype'] = 'multipart/form-data';
$form['#method'] = 'POST';
$this->exposed_translate($form[$value], 'value');
if ($value != 'value') {
unset($form['value']);
}
}