function download_count_export_form in Download Count 6.2
Same name and namespace in other branches
- 7.3 includes/download_count.export.inc \download_count_export_form()
Download_count export form.
1 string reference to 'download_count_export_form'
- download_count_menu in ./
download_count.module - Implementation of hook_menu().
File
- includes/
download_count.export.inc, line 11 - Page callback file for the download_count module export feature.
Code
function download_count_export_form($form_state, $dc_entry = array()) {
drupal_add_js(drupal_get_path('module', 'download_count') . '/download_count.js');
if ($dc_entry == 'all') {
drupal_set_title(t('Download Count Export CSV - All Files'));
}
else {
drupal_set_title(t('Download Count Export CSV - %filename', array(
'%filename' => $dc_entry['filename'],
)));
}
$form['download_count_export_note'] = array(
'#type' => 'markup',
'#value' => t('The following data will be exported:') . '<ul>' . '<li>' . t('Download count id') . '<li>' . t('File id') . '<li>' . t('File name') . '<li>' . t('File size') . '<li>' . t('Node id ') . '<li>' . t('Downloading user id') . '<li>' . t('Downloading username') . '<li>' . t('Downloading user ip address') . '<li>' . t('HTTP referrer') . '<li>' . t('Date - time (YYYY-MM-DD HH:MM:SS)') . '</ul>',
);
$form['download_count_export_range'] = array(
'#type' => 'radios',
'#title' => t('Export Range'),
'#options' => array(
t('export all data'),
t('export data for a specified date range'),
),
'#default_value' => variable_get('download_count_export_range', 0),
);
$form['download_count_export_date_range_from'] = array(
'#type' => 'date',
'#title' => t('Export Range From Date'),
'#description' => t('This field will be ignored if the Export Range \'export all data\' option is selected above.'),
);
$form['download_count_export_date_range_to'] = array(
'#type' => 'date',
'#title' => t('Export Range To Date'),
'#description' => t('This field will be ignored if the Export Range \'export all data\' option is selected above.'),
);
$form['download_count_file_info'] = array(
'#type' => 'value',
'#value' => $dc_entry,
);
$form['download_count_export_submit'] = array(
'#type' => 'submit',
'#value' => t('Export'),
);
$form['download_count_export_cancel'] = array(
'#value' => '<a href="javascript:history.back(-1)">' . t('Cancel') . '</a>',
);
$form['#redirect'] = TRUE;
return $form;
}