1 views_handler_field_file_uri.inc | views_handler_field_file_uri::options_form(&$form, &$form_state) |
Provide link to file option
Overrides views_handler_field_file::options_form
File
- core/
modules/ file/ views/ views_handler_field_file_uri.inc, line 18 - Definition of views_handler_field_file_uri.
Class
- views_handler_field_file_uri
- Field handler to add rendering file paths as file URLs instead of as internal file URIs.
Code
function options_form(&$form, &$form_state) {
$form['file_download_path'] = array(
'#title' => t('Use full URL instead of file storage URI'),
'#description' => t('An internal file path is usually <code>public://example.png</code>. Enabling this option will display the URL instead, such as <code>http://example.com/files/example.png</code>.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['file_download_path']),
);
$form['image_style'] = array(
'#type' => 'select',
'#options' => image_style_options(TRUE, PASS_THROUGH),
'#default_value' => $this->options['image_style'],
'#title' => t('Apply image style to URL'),
'#description' => t('Select an available image style and the URL will be modified.'),
'#states' => array(
'visible' => array(
'[name="options[file_download_path]"]' => array('checked' => TRUE),
),
),
);
parent::options_form($form, $form_state);
}