social_event_enrolments_export.module in Open Social 8.7
Same filename and directory in other branches
- 8.9 modules/social_features/social_event/modules/social_event_enrolments_export/social_event_enrolments_export.module
- 8.5 modules/social_features/social_event/modules/social_event_enrolments_export/social_event_enrolments_export.module
- 8.6 modules/social_features/social_event/modules/social_event_enrolments_export/social_event_enrolments_export.module
- 8.8 modules/social_features/social_event/modules/social_event_enrolments_export/social_event_enrolments_export.module
- 10.3.x modules/social_features/social_event/modules/social_event_enrolments_export/social_event_enrolments_export.module
- 10.0.x modules/social_features/social_event/modules/social_event_enrolments_export/social_event_enrolments_export.module
- 10.1.x modules/social_features/social_event/modules/social_event_enrolments_export/social_event_enrolments_export.module
- 10.2.x modules/social_features/social_event/modules/social_event_enrolments_export/social_event_enrolments_export.module
The Social Event Enrolments Export module.
File
modules/social_features/social_event/modules/social_event_enrolments_export/social_event_enrolments_export.moduleView source
<?php
/**
* @file
* The Social Event Enrolments Export module.
*/
/**
* Implements hook_file_download().
*/
function social_event_enrolments_export_file_download($uri) {
$scheme = \Drupal::service('file_system')
->uriScheme($uri);
$target = file_uri_target($uri);
$access = \Drupal::currentUser()
->hasPermission('administer users');
if ($scheme === 'private' && preg_match('/^csv\\/export-enrollments-([a-f0-9]{12})\\.csv$/i', $target) && $access) {
return [
'Content-disposition' => 'attachment; filename="' . basename($target) . '"',
];
}
}
/**
* Implements hook_social_event_action_ACTION_ID_finish().
*/
function social_event_enrolments_export_social_event_managers_action_social_event_enrolments_export_enrollments_action_finish($success) {
if ($success) {
return [
'singular' => '1 selected enrollee has been exported successfully',
'plural' => '@count selected enrollees have been exported successfully',
];
}
return [
'singular' => '1 selected enrollee has not been exported successfully',
'plural' => '@count selected enrollees have not been exported successfully',
];
}
Functions
Name | Description |
---|---|
social_event_enrolments_export_file_download | Implements hook_file_download(). |
social_event_enrolments_export_social_event_managers_action_social_event_enrolments_export_enrollments_action_finish | Implements hook_social_event_action_ACTION_ID_finish(). |