1 views_handler_field_file.inc | views_handler_field_file::options_form(&$form, &$form_state) |
Provide link to file option
Overrides views_handler_field::options_form
File
- core/
modules/ file/ views/ views_handler_field_file.inc, line 34 - Definition of views_handler_field_file.
Class
- views_handler_field_file
- Field handler to provide simple renderer that allows linking to a file.
Code
function options_form(&$form, &$form_state) {
$form['link_to_file'] = array(
'#title' => t('Link this field to the file'),
'#description' => t("Enable to override this field's links."),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['link_to_file']),
);
$form['link_to_file_options'] = array(
'#title' => t('Link type'),
'#type' => 'radios',
'#options' => array(
'download' => 'Download link',
'page' => t('Link to the file page'),
),
'#default_value' => !empty($this->options['link_to_file_options']) ? $this->options['link_to_file_options'] : 'download',
'#states' => array(
'visible' => array(
':input[name="options[link_to_file]"]' => array('checked' => TRUE),
),
),
);
parent::options_form($form, $form_state);
}