function views_data_export_plugin_style_export::options_form in Views data export 7.3
Same name and namespace in other branches
- 6.3 plugins/views_data_export_plugin_style_export.inc \views_data_export_plugin_style_export::options_form()
- 6 plugins/views_data_export_plugin_style_export.inc \views_data_export_plugin_style_export::options_form()
- 6.2 plugins/views_data_export_plugin_style_export.inc \views_data_export_plugin_style_export::options_form()
- 7.4 plugins/views_data_export_plugin_style_export.inc \views_data_export_plugin_style_export::options_form()
- 7 plugins/views_data_export_plugin_style_export.inc \views_data_export_plugin_style_export::options_form()
Options form mini callback.
Parameters
$form: Form array to add additional fields to.
$form_state: State of the form.
Return value
None.
Overrides views_plugin_style::options_form
2 calls to views_data_export_plugin_style_export::options_form()
- views_data_export_plugin_style_export_csv::options_form in plugins/
views_data_export_plugin_style_export_csv.inc - Options form mini callback.
- views_data_export_plugin_style_export_xml::options_form in plugins/
views_data_export_plugin_style_export_xml.inc - Options form mini callback.
2 methods override views_data_export_plugin_style_export::options_form()
- views_data_export_plugin_style_export_csv::options_form in plugins/
views_data_export_plugin_style_export_csv.inc - Options form mini callback.
- views_data_export_plugin_style_export_xml::options_form in plugins/
views_data_export_plugin_style_export_xml.inc - Options form mini callback.
File
- plugins/
views_data_export_plugin_style_export.inc, line 52 - Plugin include file for export style plugin.
Class
- views_data_export_plugin_style_export
- Generalized style plugin for export plugins.
Code
function options_form(&$form, &$form_state) {
$form['attach_text'] = array(
'#type' => 'textfield',
'#title' => t('Attach text'),
'#default_value' => $this->options['attach_text'],
'#description' => t('This text is used in building the feed link. By default it is the "alt" text for the feed image.'),
);
$form['provide_file'] = array(
'#type' => 'checkbox',
'#title' => t('Provide as file'),
'#default_value' => $this->options['provide_file'],
'#description' => t('By deselecting this, the xml file will be provided as a feed instead of a file for download.'),
);
$form['filename'] = array(
'#type' => 'textfield',
'#title' => t('Filename'),
'#default_value' => $this->options['filename'],
'#description' => t('The filename that will be suggested to the browser for downloading purposes. You may include replacement patterns from the list below.'),
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-provide-file' => array(
TRUE,
),
),
);
// General token replacement.
$output = t('<p>The following substitution patterns are available for this display. Use the pattern shown on the left to display the value indicated on the right.</p>');
$items = array(
'%view == ' . t('View name'),
'%display == ' . t('Display name'),
);
$output .= theme('item_list', array(
'items' => $items,
));
// Get a list of the available arguments for token replacement.
$options = array();
$count = 0;
// This lets us prepare the key as we want it printed.
foreach ($this->view->display_handler
->get_handlers('argument') as $arg => $handler) {
$options[t('Arguments')]['%' . ++$count . '-title'] = t('@argument title', array(
'@argument' => $handler
->ui_name(),
));
$options[t('Arguments')]['%' . $count . '-value'] = t('@argument value', array(
'@argument' => $handler
->ui_name(),
));
}
// Append the list with exposed filters stuff.
$options[t('Exposed filters')]['%exposed'] = t('effective exposed filters, like <em>filter1_foo-filter2_bar</em>');
// ...and datestamp.
$time = REQUEST_TIME;
$parts = array(
'full' => 'Y-m-d\\TH-i-s',
'yy' => 'y',
'yyyy' => 'Y',
'mm' => 'm',
'mmm' => 'M',
'dd' => 'd',
'ddd' => 'D',
'hh' => 'H',
'ii' => 'i',
'ss' => 's',
);
foreach ($parts as $part => $format) {
$options[t('Timestamp')]['%timestamp-' . $part] = format_date($time, 'custom', $format);
}
// We have some options, so make a list.
if (!empty($options)) {
foreach (array_keys($options) as $type) {
if (!empty($options[$type])) {
$items = array();
foreach ($options[$type] as $key => $value) {
$items[] = $key . ' == ' . $value;
}
$output .= theme('item_list', array(
'items' => $items,
'title' => $type,
));
}
}
}
$form['help'] = array(
'#type' => 'fieldset',
'#title' => t('Replacement patterns'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#value' => $output,
'#dependency' => array(
'edit-style-options-provide-file' => array(
1,
),
),
);
$form['parent_sort'] = array(
'#type' => 'checkbox',
'#title' => t('Parent sort'),
'#default_value' => $this->options['parent_sort'],
'#description' => t('Try to apply any additional sorting from the attached display like table sorting to the exported feed.'),
);
}